@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); }
@Override public EncounterTransaction.Order mapOrder(Order order) { EncounterTransaction.Order emrOrder = new EncounterTransaction.Order(); emrOrder.setUuid(order.getUuid()); emrOrder.setConcept(conceptMapper.map(order.getConcept())); emrOrder.setOrderType(order.getOrderType().getName()); emrOrder.setInstructions(order.getInstructions()); emrOrder.setDateCreated(order.getDateCreated()); emrOrder.setDateChanged(order.getDateChanged()); emrOrder.setDateStopped(order.getDateStopped()); emrOrder.setOrderNumber(order.getOrderNumber()); emrOrder.setCommentToFulfiller(order.getCommentToFulfiller()); emrOrder.setAction(order.getAction().name()); org.openmrs.Order previousOrder = order.getPreviousOrder(); if (previousOrder != null && StringUtils.isNotBlank(previousOrder.getUuid())) { emrOrder.setPreviousOrderUuid(previousOrder.getUuid()); } return emrOrder; }