use of org.hl7.fhir.r4.model.Location in project openmrs-module-fhir2 by openmrs.
the class BaseReferenceHandlingTranslatorTest method shouldAddLocationReference.
@Test
public void shouldAddLocationReference() {
Reference reference = referenceHandlingTranslator.createLocationReference(location);
assertThat(reference, notNullValue());
assertThat(reference.getReference(), equalTo(LOCATION_URI));
assertThat(reference.getType(), equalTo(FhirConstants.LOCATION));
assertThat(reference.getDisplay(), equalTo(TEST_LOCATION_NAME));
}
use of org.hl7.fhir.r4.model.Location in project openmrs-module-fhir2 by openmrs.
the class EncounterLocationTranslatorImplTest method setUp.
@Before
public void setUp() {
encounterLocationTranslator = new EncounterLocationTranslatorImpl();
encounterLocationTranslator.setLocationDao(locationDao);
location = new Location();
location.setUuid(LOCATION_UUID);
location.setName(TEST_LOCATION_NAME);
encounterLocationComponent = new Encounter.EncounterLocationComponent();
Reference reference = new Reference(LOCATION_URI);
encounterLocationComponent.setLocation(reference);
}
use of org.hl7.fhir.r4.model.Location in project openmrs-module-fhir2 by openmrs.
the class EncounterTranslatorImplTest method toFhirResource_shouldTranslateToEncounterClassFhirType.
@Test
public void toFhirResource_shouldTranslateToEncounterClassFhirType() {
when(encounterClassMap.getFhirClass(LOCATION_UUID)).thenReturn(TEST_FHIR_CLASS);
omrsEncounter.setLocation(location);
Encounter result = encounterTranslator.toFhirResource(omrsEncounter);
assertThat(result, notNullValue());
assertThat(result.getClass_(), notNullValue());
assertThat(result.getClass_().getSystem(), is(FhirConstants.ENCOUNTER_CLASS_VALUE_SET_URI));
assertThat(result.getClass_().getCode(), is(TEST_FHIR_CLASS));
}
use of org.hl7.fhir.r4.model.Location in project openmrs-module-fhir2 by openmrs.
the class LocationAddressTranslatorImplTest method shouldTranslateAddressPostalCodeToLocationPostalCode.
@Test
public void shouldTranslateAddressPostalCodeToLocationPostalCode() {
org.hl7.fhir.r4.model.Address address = new Address();
address.setPostalCode(POSTAL_CODE);
omrsLocation = translator.toOpenmrsType(new Location(), address);
assertThat(omrsLocation, notNullValue());
assertThat(omrsLocation.getPostalCode(), notNullValue());
assertThat(omrsLocation.getPostalCode(), equalTo(POSTAL_CODE));
}
use of org.hl7.fhir.r4.model.Location in project openmrs-module-fhir2 by openmrs.
the class LocationAddressTranslatorImplTest method shouldTranslateAddressCountryToLocationCountry.
@Test
public void shouldTranslateAddressCountryToLocationCountry() {
org.hl7.fhir.r4.model.Address address = new Address();
address.setCountry(COUNTRY);
omrsLocation = translator.toOpenmrsType(new Location(), address);
assertThat(omrsLocation, notNullValue());
assertThat(omrsLocation.getCountry(), notNullValue());
assertThat(omrsLocation.getCountry(), equalTo(COUNTRY));
}
Aggregations