use of org.openmrs.module.emrapi.diagnosis.Diagnosis in project openmrs-module-coreapps by openmrs.
the class EncounterDiagnosesElementTest method testGenerateHtml.
@Test
public void testGenerateHtml() throws Exception {
EmrApiProperties emrApiProperties = mock(EmrApiProperties.class);
FormEntryContext context = mock(FormEntryContext.class);
when(context.getMode()).thenReturn(FormEntryContext.Mode.VIEW);
EncounterDiagnosesElement element = new EncounterDiagnosesElement() {
@Override
List<Diagnosis> getExistingDiagnoses(FormEntryContext context, DiagnosisMetadata diagnosisMetadata) {
return Arrays.asList(new Diagnosis(new CodedOrFreeTextAnswer("Some disease")));
}
};
element.setEmrApiProperties(emrApiProperties);
String html = element.generateHtml(context);
assertTrue(html.indexOf("Translated") >= 0);
}
Aggregations