use of org.hl7.fhir.dstu2.model.Narrative in project openmrs-module-fhir2 by openmrs.
the class ConditionNarrativeTest method shouldGenerateConditionNarrative.
/**
* Check that the expected narrative is generated for some example Condition resource
*
* @throws IOException
*/
@Test
public void shouldGenerateConditionNarrative() throws IOException {
Condition given = parser.parseResource(Condition.class, getClass().getClassLoader().getResourceAsStream(EXAMPLE_RESOURCE_PATH));
Condition result = parser.parseResource(Condition.class, parser.encodeResourceToString(given));
assertThat(result, notNullValue());
assertThat(result.getText(), notNullValue());
assertThat(result.getText().getStatusAsString(), equalTo("generated"));
assertThat(result.getText().getDivAsString(), equalTo(readNarrativeFile(EXPECTED_NARRATIVE_PATH)));
}
use of org.hl7.fhir.dstu2.model.Narrative in project openmrs-module-fhir2 by openmrs.
the class MedicationNarrativeTest method shouldGenerateMedicationNarrative.
/**
* Check that the expected narrative is generated for some example Medication resource
*
* @throws IOException
*/
@Test
public void shouldGenerateMedicationNarrative() throws IOException {
Medication given = parser.parseResource(Medication.class, getClass().getClassLoader().getResourceAsStream(EXAMPLE_RESOURCE_PATH));
Medication result = parser.parseResource(Medication.class, parser.encodeResourceToString(given));
assertThat(result, notNullValue());
assertThat(result.getText(), notNullValue());
assertThat(result.getText().getStatusAsString(), equalTo("generated"));
assertThat(result.getText().getDivAsString(), equalTo(readNarrativeFile(EXPECTED_NARRATIVE_PATH)));
}
use of org.hl7.fhir.dstu2.model.Narrative in project openmrs-module-fhir2 by openmrs.
the class MedicationRequestNarrativeTest method shouldGenerateMedicationRequestNarrative.
/**
* Check that the expected narrative is generated for some example MedicationRequest resource
*
* @throws IOException
*/
@Test
public void shouldGenerateMedicationRequestNarrative() throws IOException {
MedicationRequest given = parser.parseResource(MedicationRequest.class, getClass().getClassLoader().getResourceAsStream(EXAMPLE_RESOURCE_PATH));
MedicationRequest result = parser.parseResource(MedicationRequest.class, parser.encodeResourceToString(given));
assertThat(result, notNullValue());
assertThat(result.getText(), notNullValue());
assertThat(result.getText().getStatusAsString(), equalTo("generated"));
assertThat(result.getText().getDivAsString(), equalTo(readNarrativeFile(EXPECTED_NARRATIVE_PATH)));
}
use of org.hl7.fhir.dstu2.model.Narrative in project openmrs-module-fhir2 by openmrs.
the class ObservationNarrativeTest method shouldGenerateObservationNarrative.
/**
* Check that the expected narrative is generated for some example Observation resource
*
* @throws IOException
*/
@Test
public void shouldGenerateObservationNarrative() throws IOException {
Observation given = parser.parseResource(Observation.class, getClass().getClassLoader().getResourceAsStream(EXAMPLE_RESOURCE_PATH));
Observation result = parser.parseResource(Observation.class, parser.encodeResourceToString(given));
assertThat(result, notNullValue());
assertThat(result.getText(), notNullValue());
assertThat(result.getText().getStatusAsString(), equalTo("generated"));
assertThat(result.getText().getDivAsString(), equalTo(readNarrativeFile(EXPECTED_NARRATIVE_PATH)));
}
use of org.hl7.fhir.dstu2.model.Narrative in project openmrs-module-fhir2 by openmrs.
the class PersonNarrativeTest method shouldGeneratePersonNarrative.
/**
* Check that the expected narrative is generated for some example Person resource
*
* @throws IOException
*/
@Test
public void shouldGeneratePersonNarrative() throws IOException {
Person given = parser.parseResource(Person.class, getClass().getClassLoader().getResourceAsStream(EXAMPLE_RESOURCE_PATH));
Person result = parser.parseResource(Person.class, parser.encodeResourceToString(given));
assertThat(result, notNullValue());
assertThat(result.getText(), notNullValue());
assertThat(result.getText().getStatusAsString(), equalTo("generated"));
assertThat(result.getText().getDivAsString(), equalTo(readNarrativeFile(EXPECTED_NARRATIVE_PATH)));
}
Aggregations