use of org.openmrs.module.fhir2.model.FhirTask in project openmrs-module-fhir2 by openmrs.
the class FhirTaskTranslatorImplTest method toFhirResource_shouldSetBusinessIdentifier.
// Task.Identifier
@Test
public void toFhirResource_shouldSetBusinessIdentifier() {
// https://www.hl7.org/fhir/resource.html#identifiers
FhirTask task = new FhirTask();
Task result = taskTranslator.toFhirResource(task);
assertThat(result, notNullValue());
assertThat(result.getIdentifier(), hasSize(1));
Identifier identifier = result.getIdentifier().iterator().next();
assertThat(identifier.getValue(), equalTo(task.getUuid()));
assertThat(identifier.getSystem(), equalTo(FhirConstants.OPENMRS_FHIR_EXT_TASK_IDENTIFIER));
}
use of org.openmrs.module.fhir2.model.FhirTask in project openmrs-module-fhir2 by openmrs.
the class FhirTaskTranslatorImplTest method toOpenmrsType_shouldTranslateStatus.
@Test
public void toOpenmrsType_shouldTranslateStatus() {
Task task = new Task();
task.setStatus(FHIR_TASK_STATUS);
FhirTask result = taskTranslator.toOpenmrsType(task);
assertThat(result, notNullValue());
assertThat(result.getStatus(), equalTo(OPENMRS_TASK_STATUS));
}
use of org.openmrs.module.fhir2.model.FhirTask in project openmrs-module-fhir2 by openmrs.
the class FhirTaskTranslatorImplTest method toOpenmrsType_shouldTranslateFor.
@Test
public void toOpenmrsType_shouldTranslateFor() {
Task task = new Task();
shouldTranslateReferenceToOpenmrs(task, FhirConstants.PATIENT, PATIENT_UUID, task::setFor, FhirTask::getForReference);
}
use of org.openmrs.module.fhir2.model.FhirTask in project openmrs-module-fhir2 by openmrs.
the class FhirTaskTranslatorImplTest method toOpenmrsType_shouldUpdateBasedOn.
@Test
public void toOpenmrsType_shouldUpdateBasedOn() {
Task task = new Task();
shouldUpdateReferenceListInOpenmrs(task, FhirConstants.SERVICE_REQUEST, SERVICE_REQUEST_UUID, task::setBasedOn, FhirTask::getBasedOnReferences);
}
use of org.openmrs.module.fhir2.model.FhirTask in project openmrs-module-fhir2 by openmrs.
the class FhirTaskTranslatorImplTest method toOpenmrsType_shouldUpdateEncounter.
@Test
public void toOpenmrsType_shouldUpdateEncounter() {
Task task = new Task();
shouldUpdateReferenceInOpenmrs(task, FhirConstants.ENCOUNTER, ENCOUNTER_UUID, task::setEncounter, FhirTask::getEncounterReference);
}
Aggregations