private EncounterTransaction.Order createOrder( String uuid, String conceptName, String action, Date dateStopped) { EncounterTransaction.Order order = new EncounterTransaction.Order(); EncounterTransaction.Concept concept = new EncounterTransaction.Concept(); concept.setName(conceptName); order.setConcept(concept); order.setAction(action); order.setDateStopped(dateStopped); order.setUuid(uuid); order.setOrderType(LabOrderResultsServiceImpl.LAB_ORDER_TYPE); return order; }
public String getValueAsString() { Object value = encounterTransactionObservation.getValue(); if (value != null) { if (value instanceof EncounterTransaction.Concept) { EncounterTransaction.Concept concept = (EncounterTransaction.Concept) value; return (concept.getShortName() == null ? concept.getName() : concept.getShortName()); } else if (value instanceof EncounterTransaction.Drug) { EncounterTransaction.Drug drug = (EncounterTransaction.Drug) value; return drug.getName(); } else if (value instanceof Boolean) { return (Boolean) value ? "Yes" : "No"; } return String.valueOf(value); } return ""; }
@Before public void setUp() throws Exception { MockitoAnnotations.initMocks(this); bahmniObservation1 = new BahmniObservation(); bahmniObservation2 = new BahmniObservation(); bahmniObservation3 = new BahmniObservation(); bahmniObservation4 = new BahmniObservation(); bahmniObservation5 = new BahmniObservation(); observationTemplateConcept = new ConceptBuilder().withUUID("otUUID").build(); EncounterTransaction.Concept conceptData = new EncounterTransaction.Concept(); conceptData.setName("Observation Template"); conceptData.setConceptClass("otClass"); conceptData.setDataType("N/A"); conceptData.setUuid("otUUID"); when(conceptMapper.map(observationTemplateConcept)).thenReturn(conceptData); observationTemplateMapper = new ObservationTemplateMapper(conceptMapper); }