use of org.hl7.fhir.r4b.model.ContactPoint in project openmrs-module-fhir2 by openmrs.
the class TelecomTranslatorImplTest method shouldUpdatePersonAttributeValue.
@Test
public void shouldUpdatePersonAttributeValue() {
PersonAttribute personAttribute = new PersonAttribute();
personAttribute.setValue(PERSON_ATTRIBUTE_VALUE);
ContactPoint contactPoint = new ContactPoint();
contactPoint.setValue(NEW_PERSON_ATTRIBUTE_VALUE);
PersonAttribute result = (PersonAttribute) telecomTranslator.toOpenmrsType(personAttribute, contactPoint);
assertThat(result, notNullValue());
assertThat(result.getValue(), notNullValue());
assertThat(result.getValue(), equalTo(NEW_PERSON_ATTRIBUTE_VALUE));
}
use of org.hl7.fhir.r4b.model.ContactPoint in project openmrs-module-fhir2 by openmrs.
the class TelecomTranslatorImplTest method shouldTranslateProviderAttributeValueToFhirContactPointValue.
@Test
public void shouldTranslateProviderAttributeValueToFhirContactPointValue() {
ProviderAttribute providerAttribute = new ProviderAttribute();
providerAttribute.setValue(PROVIDER_ATTRIBUTE_VALUE);
ContactPoint contactPoint = telecomTranslator.toFhirResource(providerAttribute);
assertThat(contactPoint, notNullValue());
assertThat(contactPoint.getValue(), equalTo(PROVIDER_ATTRIBUTE_VALUE));
}
use of org.hl7.fhir.r4b.model.ContactPoint in project openmrs-module-fhir2 by openmrs.
the class TelecomTranslatorImplTest method shouldTranslateFhirContactPointIdToPersonAttributeUuid.
@Test
public void shouldTranslateFhirContactPointIdToPersonAttributeUuid() {
ContactPoint contactPoint = new ContactPoint();
contactPoint.setId(CONTACT_POINT_ID);
PersonAttribute result = (PersonAttribute) telecomTranslator.toOpenmrsType(new PersonAttribute(), contactPoint);
assertThat(result, notNullValue());
assertThat(result.getUuid(), equalTo(CONTACT_POINT_ID));
}
use of org.hl7.fhir.r4b.model.ContactPoint in project openmrs-module-fhir2 by openmrs.
the class TelecomTranslatorImplTest method shouldTranslateWithCorrectPersonAttributeTypeForContactDetails.
@Test
public void shouldTranslateWithCorrectPersonAttributeTypeForContactDetails() {
ContactPoint contactPoint = new ContactPoint();
contactPoint.setId(CONTACT_POINT_ID);
contactPoint.setValue(CONTACT_POINT_VALUE);
PersonAttributeType attributeType = new PersonAttributeType();
attributeType.setName(ATTRIBUTE_TYPE_NAME);
attributeType.setUuid(PERSON_ATTRIBUTE_TYPE_UUID);
when(globalPropertyService.getGlobalProperty(FhirConstants.PERSON_CONTACT_POINT_ATTRIBUTE_TYPE)).thenReturn(PERSON_ATTRIBUTE_TYPE_UUID);
when(personService.getPersonAttributeTypeByUuid(PERSON_ATTRIBUTE_TYPE_UUID)).thenReturn(attributeType);
PersonAttribute result = (PersonAttribute) telecomTranslator.toOpenmrsType(new PersonAttribute(), contactPoint);
assertThat(result, notNullValue());
assertThat(result.getAttributeType().getUuid(), equalTo(PERSON_ATTRIBUTE_TYPE_UUID));
}
use of org.hl7.fhir.r4b.model.ContactPoint in project openmrs-module-fhir2 by openmrs.
the class TelecomTranslatorImplTest method shouldTranslateFhirContactPointIdToProviderAttributeUuid.
@Test
public void shouldTranslateFhirContactPointIdToProviderAttributeUuid() {
ContactPoint contactPoint = new ContactPoint();
contactPoint.setId(CONTACT_POINT_ID);
ProviderAttribute result = (ProviderAttribute) telecomTranslator.toOpenmrsType(new ProviderAttribute(), contactPoint);
assertThat(result, notNullValue());
assertThat(result.getUuid(), equalTo(CONTACT_POINT_ID));
}
Aggregations