use of org.openmrs.module.fhir2.api.translators.ConceptTranslator in project openmrs-module-fhir2 by openmrs.
the class DiagnosticReportTranslatorImplTest method setup.
@Before
public void setup() {
translator = new DiagnosticReportTranslatorImpl();
translator.setObservationReferenceTranslator(observationReferenceTranslator);
translator.setConceptTranslator(conceptTranslator);
translator.setEncounterReferenceTranslator(encounterReferenceTranslator);
translator.setPatientReferenceTranslator(patientReferenceTranslator);
// OpenMRS setup
fhirDiagnosticReport = new FhirDiagnosticReport();
Obs childObs = new Obs();
childObs.setUuid(CHILD_UUID);
fhirDiagnosticReport.setUuid(PARENT_UUID);
fhirDiagnosticReport.getResults().add(childObs);
// FHIR setup
Reference obsReference = new Reference().setType("Observation").setReference("Observation/" + CHILD_UUID);
diagnosticReport = new DiagnosticReport();
diagnosticReport.setId(PARENT_UUID);
diagnosticReport.addResult(obsReference);
// Mocks for DiagnosticReport.result
when(observationReferenceTranslator.toFhirResource(childObs)).thenReturn(obsReference);
when(observationReferenceTranslator.toOpenmrsType(obsReference)).thenReturn(childObs);
}
Aggregations