use of org.hl7.fhir.r4.model.Practitioner in project openmrs-module-fhir2 by openmrs.
the class PractitionerTranslatorUserImplTest method shouldTranslateUserGenderToFhirPractitionerGender.
@Test
public void shouldTranslateUserGenderToFhirPractitionerGender() {
Person person = new Person();
person.setGender(GENDER);
user.setPerson(person);
when(genderTranslator.toFhirResource(GENDER)).thenReturn(Enumerations.AdministrativeGender.MALE);
Practitioner practitioner = practitionerTranslatorUser.toFhirResource(user);
assertThat(practitioner, notNullValue());
assertThat(practitioner.getGender(), notNullValue());
assertThat(practitioner.getGender(), equalTo(Enumerations.AdministrativeGender.MALE));
}
use of org.hl7.fhir.r4.model.Practitioner in project openmrs-module-fhir2 by openmrs.
the class PractitionerTranslatorUserImplTest method shouldTranslateOpenMrsUserToFhirPractitioner.
@Test
public void shouldTranslateOpenMrsUserToFhirPractitioner() {
Practitioner practitioner = practitionerTranslatorUser.toFhirResource(user);
assertThat(practitioner, notNullValue());
}
use of org.hl7.fhir.r4.model.Practitioner in project openmrs-module-fhir2 by openmrs.
the class PractitionerTranslatorUserImplTest method shouldTranslateUserUuidToFhirPractitionerId.
@Test
public void shouldTranslateUserUuidToFhirPractitionerId() {
Practitioner practitioner = practitionerTranslatorUser.toFhirResource(user);
assertThat(practitioner, notNullValue());
assertThat(practitioner.getId(), notNullValue());
assertThat(practitioner.getId(), equalTo(USER_UUID));
}
use of org.hl7.fhir.r4.model.Practitioner in project openmrs-module-fhir2 by openmrs.
the class PractitionerReferenceTranslatorUserImplTest method toOpenmrsType_shouldConvertReferenceToUser.
@Test
public void toOpenmrsType_shouldConvertReferenceToUser() {
Reference creatorReference = new Reference().setReference(FhirConstants.PRACTITIONER + "/" + USER_UUID).setType(FhirConstants.PRACTITIONER);
User user = new User();
user.setUuid(USER_UUID);
Practitioner practitioner = new Practitioner();
practitioner.setId(PRACTITIONER_UUID);
when(userDao.get(USER_UUID)).thenReturn(user);
User result = practitionerReferenceTranslatorUser.toOpenmrsType(creatorReference);
assertThat(result, Matchers.notNullValue());
assertThat(result.getUuid(), Matchers.equalTo(USER_UUID));
}
use of org.hl7.fhir.r4.model.Practitioner in project openmrs-module-fhir2 by openmrs.
the class PractitionerTranslatorProviderImplTest method setUp.
@Before
public void setUp() {
practitionerTranslator = new PractitionerTranslatorProviderImpl();
practitionerTranslator.setAddressTranslator(addressTranslator);
practitionerTranslator.setGenderTranslator(genderTranslator);
practitionerTranslator.setNameTranslator(nameTranslator);
practitionerTranslator.setTelecomTranslator(telecomTranslator);
practitionerTranslator.setFhirPractitionerDao(fhirPractitionerDao);
practitionerTranslator.setGlobalPropertyService(globalPropertyService);
practitionerTranslator.setProvenanceTranslator(provenanceTranslator);
practitionerTranslator.setBirthDateTranslator(birthDateTranslator);
Person person = new Person();
person.setGender(GENDER);
provider = new Provider();
provider.setUuid(PROVIDER_UUID);
provider.setPerson(person);
practitioner = new Practitioner();
practitioner.setId(PRACTITIONER_UUID);
Identifier identifier = new Identifier();
identifier.setValue(PRACTITIONER_IDENTIFIER);
practitioner.addIdentifier();
}
Aggregations