Search in sources :

Example 26 with Address

use of org.hl7.fhir.dstu2016may.model.Address 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));
}
Also used : Address(org.hl7.fhir.r4.model.Address) Address(org.hl7.fhir.r4.model.Address) Location(org.openmrs.Location) Test(org.junit.Test)

Example 27 with Address

use of org.hl7.fhir.dstu2016may.model.Address 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));
}
Also used : Address(org.hl7.fhir.r4.model.Address) Address(org.hl7.fhir.r4.model.Address) Location(org.openmrs.Location) Test(org.junit.Test)

Example 28 with Address

use of org.hl7.fhir.dstu2016may.model.Address in project openmrs-module-fhir2 by openmrs.

the class LocationAddressTranslatorImplTest method shouldTranslateLocationProvinceToAddressProvince.

@Test
public void shouldTranslateLocationProvinceToAddressProvince() {
    omrsLocation.setStateProvince(STATE_PROVINCE);
    org.hl7.fhir.r4.model.Address address = translator.toFhirResource(omrsLocation);
    assertThat(address, notNullValue());
    assertThat(address.getState(), notNullValue());
    assertThat(address.getState(), equalTo(STATE_PROVINCE));
}
Also used : Address(org.hl7.fhir.r4.model.Address) Test(org.junit.Test)

Example 29 with Address

use of org.hl7.fhir.dstu2016may.model.Address in project openmrs-module-fhir2 by openmrs.

the class LocationAddressTranslatorImplTest method shouldTranslateLocationCountryToAddressCountry.

@Test
public void shouldTranslateLocationCountryToAddressCountry() {
    omrsLocation.setCountry(COUNTRY);
    org.hl7.fhir.r4.model.Address address = translator.toFhirResource(omrsLocation);
    assertThat(address, notNullValue());
    assertThat(address.getCountry(), notNullValue());
    assertThat(address.getCountry(), equalTo(COUNTRY));
}
Also used : Address(org.hl7.fhir.r4.model.Address) Test(org.junit.Test)

Example 30 with Address

use of org.hl7.fhir.dstu2016may.model.Address in project openmrs-module-fhir2 by openmrs.

the class LocationAddressTranslatorImplTest method shouldTranslateAddressStateToLocationState.

@Test
public void shouldTranslateAddressStateToLocationState() {
    org.hl7.fhir.r4.model.Address address = new Address();
    address.setState(STATE_PROVINCE);
    omrsLocation = translator.toOpenmrsType(new Location(), address);
    assertThat(omrsLocation, notNullValue());
    assertThat(omrsLocation.getStateProvince(), notNullValue());
    assertThat(omrsLocation.getStateProvince(), equalTo(STATE_PROVINCE));
}
Also used : Address(org.hl7.fhir.r4.model.Address) Address(org.hl7.fhir.r4.model.Address) Location(org.openmrs.Location) Test(org.junit.Test)

Aggregations

Address (org.hl7.fhir.r4.model.Address)75 Test (org.junit.Test)47 Patient (org.hl7.fhir.r4.model.Patient)30 Test (org.junit.jupiter.api.Test)30 PersonAddress (org.openmrs.PersonAddress)27 HumanName (org.hl7.fhir.r4.model.HumanName)24 Identifier (org.hl7.fhir.r4.model.Identifier)23 ArrayList (java.util.ArrayList)22 Address (org.hl7.fhir.dstu3.model.Address)22 Path (javax.ws.rs.Path)20 Produces (javax.ws.rs.Produces)20 NotImplementedException (org.apache.commons.lang3.NotImplementedException)19 ContactPoint (org.hl7.fhir.r4.model.ContactPoint)19 Location (org.hl7.fhir.r4.model.Location)13 Organization (org.hl7.fhir.r4.model.Organization)13 InputStream (java.io.InputStream)12 IdType (org.hl7.fhir.dstu3.model.IdType)12 Patient (org.hl7.fhir.dstu3.model.Patient)12 Complex (org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)12 BaseModuleContextSensitiveTest (org.openmrs.test.BaseModuleContextSensitiveTest)12