Search in sources :

Example 21 with Address

use of com.adobe.target.delivery.v1.model.Address in project openmrs-module-fhir2 by openmrs.

the class LocationFhirResourceProviderTest method initLocation.

@Before
public void initLocation() {
    Address address = new Address();
    address.setCity(CITY);
    address.setCountry(COUNTRY);
    address.setState(STATE);
    address.setPostalCode(POSTAL_CODE);
    location = new org.hl7.fhir.r4.model.Location();
    location.setId(LOCATION_UUID);
    location.setName(LOCATION_NAME);
    location.setAddress(address);
    location.getMeta().addTag(new Coding(FhirConstants.OPENMRS_FHIR_EXT_LOCATION_TAG, LOGIN_LOCATION_TAG_NAME, LOGIN_LOCATION_TAG_DESCRIPTION));
    setProvenanceResources(location);
}
Also used : Address(org.hl7.fhir.r4.model.Address) Coding(org.hl7.fhir.r4.model.Coding) Before(org.junit.Before)

Example 22 with Address

use of com.adobe.target.delivery.v1.model.Address in project openmrs-module-fhir2 by openmrs.

the class PersonAddressTranslatorImplTest method shouldConvertFhirPostalCodeToPostalCode.

@Test
public void shouldConvertFhirPostalCodeToPostalCode() {
    Address address = new Address();
    address.setPostalCode(POSTAL_CODE);
    assertThat(addressTranslator.toOpenmrsType(address).getPostalCode(), equalTo(POSTAL_CODE));
}
Also used : Address(org.hl7.fhir.r4.model.Address) PersonAddress(org.openmrs.PersonAddress) Test(org.junit.Test)

Example 23 with Address

use of com.adobe.target.delivery.v1.model.Address in project openmrs-module-fhir2 by openmrs.

the class PersonAddressTranslatorImplTest method shouldConvertPersonAddressToAddress.

@Test
public void shouldConvertPersonAddressToAddress() {
    PersonAddress address = new PersonAddress();
    address.setUuid(PERSON_ADDRESS_UUID);
    Address result = addressTranslator.toFhirResource(address);
    assertThat(result, notNullValue());
    assertThat(result.getId(), equalTo(PERSON_ADDRESS_UUID));
}
Also used : PersonAddress(org.openmrs.PersonAddress) Address(org.hl7.fhir.r4.model.Address) PersonAddress(org.openmrs.PersonAddress) Test(org.junit.Test)

Example 24 with Address

use of com.adobe.target.delivery.v1.model.Address in project openmrs-module-fhir2 by openmrs.

the class PersonAddressTranslatorImplTest method shouldConvertOldAddressToNotPreferred.

@Test
public void shouldConvertOldAddressToNotPreferred() {
    Address address = new Address();
    address.setUse(Address.AddressUse.OLD);
    assertThat(addressTranslator.toOpenmrsType(address).getPreferred(), is(false));
}
Also used : Address(org.hl7.fhir.r4.model.Address) PersonAddress(org.openmrs.PersonAddress) Test(org.junit.Test)

Example 25 with Address

use of com.adobe.target.delivery.v1.model.Address in project openmrs-module-fhir2 by openmrs.

the class PersonAddressTranslatorImplTest method shouldConvertCityToCityVillage.

@Test
public void shouldConvertCityToCityVillage() {
    Address address = new Address();
    address.setCity(CITY);
    assertThat(addressTranslator.toOpenmrsType(address).getCityVillage(), equalTo(CITY));
}
Also used : Address(org.hl7.fhir.r4.model.Address) PersonAddress(org.openmrs.PersonAddress) Test(org.junit.Test)

Aggregations

Address (org.hl7.fhir.r4.model.Address)75 Test (org.junit.Test)35 Address (org.hl7.fhir.dstu3.model.Address)22 PersonAddress (org.openmrs.PersonAddress)21 HumanName (org.hl7.fhir.r4.model.HumanName)20 Patient (org.hl7.fhir.r4.model.Patient)18 ArrayList (java.util.ArrayList)17 Identifier (org.hl7.fhir.r4.model.Identifier)17 ContactPoint (org.hl7.fhir.r4.model.ContactPoint)16 Test (org.junit.jupiter.api.Test)13 Organization (org.hl7.fhir.r4.model.Organization)12 Address (com.amazonaws.services.ec2.model.Address)7 HumanName (org.hl7.fhir.dstu3.model.HumanName)7 PatientCommunicationComponent (org.hl7.fhir.r4.model.Patient.PatientCommunicationComponent)7 ByteArrayOutputStream (java.io.ByteArrayOutputStream)6 DescribeAddressesResult (com.amazonaws.services.ec2.model.DescribeAddressesResult)5 HashSet (java.util.HashSet)5 Coding (org.hl7.fhir.r4.model.Coding)5 StringType (org.hl7.fhir.r4.model.StringType)5 Before (org.junit.Before)5