/** * @see DosingInstructions#setDosingInstructions(DrugOrder) */ @Override public void setDosingInstructions(DrugOrder order) { order.setDosingType(this.getClass()); order.setDose(this.dose); order.setDoseUnits(this.doseUnits); order.setRoute(this.route); order.setFrequency(this.frequency); order.setDuration(this.duration); order.setDurationUnits(this.durationUnits); order.setAsNeeded(this.asNeeded); order.setAsNeededCondition(this.asNeededCondition); order.setDosingInstructions(this.administrationInstructions); }
/** * @see DrugOrderValidator#validate(Object, org.springframework.validation.Errors) */ @Test public void validate_shouldFailValidationIfFrequencyIsNullForSimpleDosingInstructionsDosingType() { DrugOrder order = new DrugOrder(); order.setDosingType(SimpleDosingInstructions.class); order.setFrequency(null); Errors errors = new BindException(order, "order"); new DrugOrderValidator().validate(order, errors); Assert.assertTrue(errors.hasFieldErrors("frequency")); }
private DrugOrder createValidDrugOrder() { DrugOrder drugOrder = new DrugOrder(); drugOrder.setDose(10.0); drugOrder.setDoseUnits(createConceptWithName("ml")); drugOrder.setRoute(createConceptWithName("IV")); OrderFrequency frequency = new OrderFrequency(); frequency.setConcept(createConceptWithName("Twice a day")); drugOrder.setFrequency(frequency); return drugOrder; }
order.setQuantity(20.0); order.setQuantityUnits(conceptService.getConcept(51)); order.setFrequency(orderService.getOrderFrequency(3000)); order.setRoute(conceptService.getConcept(22)); order.setNumRefills(10);
/** * @see org.openmrs.Order#copyHelper(Order) */ protected DrugOrder copyHelper(DrugOrder target) { super.copyHelper(target); target.setDose(getDose()); target.setDoseUnits(getDoseUnits()); target.setFrequency(getFrequency()); target.setAsNeeded(getAsNeeded()); target.setAsNeededCondition(getAsNeededCondition()); target.setQuantity(getQuantity()); target.setQuantityUnits(getQuantityUnits()); target.setDrug(getDrug()); target.setDosingType(getDosingType()); target.setDosingInstructions(getDosingInstructions()); target.setDuration(getDuration()); target.setDurationUnits(getDurationUnits()); target.setNumRefills(getNumRefills()); target.setRoute(getRoute()); target.setBrandName(getBrandName()); target.setDispenseAsWritten(getDispenseAsWritten()); target.setDrugNonCoded(getDrugNonCoded()); return target; }
/** * @see Order#cloneForRevisionHelper(Order) */ protected DrugOrder cloneForRevisionHelper(DrugOrder target) { super.cloneForRevisionHelper(target); target.setDose(getDose()); target.setDoseUnits(getDoseUnits()); target.setFrequency(getFrequency()); target.setAsNeeded(getAsNeeded()); target.setAsNeededCondition(getAsNeededCondition()); target.setQuantity(getQuantity()); target.setQuantityUnits(getQuantityUnits()); target.setDrug(getDrug()); target.setDosingType(getDosingType()); target.setDosingInstructions(getDosingInstructions()); target.setDuration(getDuration()); target.setDurationUnits(getDurationUnits()); target.setRoute(getRoute()); target.setNumRefills(getNumRefills()); target.setBrandName(getBrandName()); target.setDispenseAsWritten(getDispenseAsWritten()); target.setDrugNonCoded(getDrugNonCoded()); return target; }
order.setDoseUnits(duplicateOrder.getDoseUnits()); order.setRoute(duplicateOrder.getRoute()); order.setFrequency(duplicateOrder.getFrequency()); order.setQuantity(duplicateOrder.getQuantity()); order.setQuantityUnits(duplicateOrder.getQuantityUnits());
order.setOrderType(orderService.getOrderType(1)); order.setQuantityUnits(conceptService.getConcept(51)); order.setFrequency(orderService.getOrderFrequency(1)); order.setRoute(conceptService.getConcept(22)); order.setDuration(10); order2.setOrderType(orderService.getOrderType(1)); order2.setQuantityUnits(conceptService.getConcept(51)); order2.setFrequency(orderService.getOrderFrequency(1)); order2.setRoute(conceptService.getConcept(22)); order2.setDuration(20);
order.setDoseUnits(orderToDiscontinue.getDoseUnits()); order.setRoute(orderToDiscontinue.getRoute()); order.setFrequency(orderToDiscontinue.getFrequency()); order.setQuantity(orderToDiscontinue.getQuantity()); order.setQuantityUnits(orderToDiscontinue.getQuantityUnits());
order.setDose(500.0); order.setDoseUnits(conceptService.getConcept(50)); order.setFrequency(orderService.getOrderFrequency(1)); order.setRoute(conceptService.getConcept(22)); order.setNumRefills(10);
order.setDose(500.0); order.setDoseUnits(conceptService.getConcept(50)); order.setFrequency(orderService.getOrderFrequency(1)); order.setRoute(conceptService.getConcept(22)); order.setNumRefills(10);
protected void editOrder(FormEntrySession session, OrderTag orderTag) { existingOrder.setDrug(orderTag.drug); existingOrder.setDose(orderTag.dose); existingOrder.setFrequency(orderTag.frequency); existingOrder.setStartDate(orderTag.startDate); if (orderTag.orderDuration != null) existingOrder.setAutoExpireDate(calculateAutoExpireDate(orderTag.startDate, orderTag.orderDuration)); if (orderTag.discontinuedDate != null){ existingOrder.setDiscontinuedDate(orderTag.discontinuedDate); existingOrder.setDiscontinued(true); } if (!StringUtils.isEmpty(orderTag.discontinuedReasonStr)) existingOrder.setDiscontinuedReason(HtmlFormEntryUtil.getConcept(orderTag.discontinuedReasonStr)); existingOrder.setConcept(orderTag.drug.getConcept()); if (!StringUtils.isEmpty(orderTag.instructions)) existingOrder.setInstructions((String) orderTag.instructions); log.debug("modifying drug order, drugId is " + orderTag.drugId + " and startDate is " + orderTag.startDate); existingOrder = setDiscontinueDateFromAutoExpire(existingOrder); session.getSubmissionActions().getCurrentEncounter().setDateChanged(new Date()); }
drugOrder.setDoseUnits(duplicateOrder.getDoseUnits()); drugOrder.setRoute(duplicateOrder.getRoute()); drugOrder.setFrequency(duplicateOrder.getFrequency()); drugOrder.setQuantity(duplicateOrder.getQuantity()); drugOrder.setQuantityUnits(duplicateOrder.getQuantityUnits());
@Test public void saveOrder_shouldSetAutoExpireDateOfDrugOrderIfAutoExpireDateIsNotSet() throws ParseException { executeDataSet("org/openmrs/api/include/OrderServiceTest-drugOrderAutoExpireDate.xml"); Drug drug = conceptService.getDrug(3000); DrugOrder drugOrder = new DrugOrder(); Encounter encounter = encounterService.getEncounter(3); drugOrder.setEncounter(encounter); drugOrder.setPatient(patientService.getPatient(7)); drugOrder.setCareSetting(orderService.getCareSetting(1)); drugOrder.setOrderer(Context.getProviderService().getProvider(1)); drugOrder.setDrug(drug); drugOrder.setDosingType(SimpleDosingInstructions.class); drugOrder.setDose(300.0); drugOrder.setDoseUnits(conceptService.getConcept(50)); drugOrder.setQuantity(20.0); drugOrder.setQuantityUnits(conceptService.getConcept(51)); drugOrder.setFrequency(orderService.getOrderFrequency(3)); drugOrder.setRoute(conceptService.getConcept(22)); drugOrder.setNumRefills(0); drugOrder.setOrderType(null); drugOrder.setDateActivated(TestUtil.createDateTime("2014-08-03")); drugOrder.setDuration(20);// 20 days drugOrder.setDurationUnits(conceptService.getConcept(1001)); Order savedOrder = orderService.saveOrder(drugOrder, null); Order loadedOrder = orderService.getOrder(savedOrder.getId()); Assert.assertEquals(TestUtil.createDateTime("2014-08-22 23:59:59"), loadedOrder.getAutoExpireDate()); }
drugOrder.setQuantity(20.0); drugOrder.setQuantityUnits(conceptService.getConcept(51)); drugOrder.setFrequency(orderService.getOrderFrequency(3)); drugOrder.setRoute(conceptService.getConcept(22)); drugOrder.setNumRefills(10);
drugOrder.setPatient(session.getPatient()); drugOrder.setDose(orderTag.dose); drugOrder.setFrequency(orderTag.frequency); drugOrder.setStartDate(orderTag.startDate);
throw new RuntimeException("Your standard regimen xml file constains a drugId that can't be found, for regimen " + rs.getCodeName() + ", DrugComponent.id = " + ds.getDrugId()); dor.setDrug(Context.getConceptService().getDrugByNameOrId(ds.getDrugId())); dor.setFrequency(ds.getFrequency()); dor.setUnits(ds.getUnits()); dor.setInstructions(ds.getInstructions());
dor.setFrequency(frequency); dor.setInstructions(ds.getInstructions()); dor.setDose(Double.valueOf(ds.getDose()));
revisedOrder.setCareSetting(Context.getOrderService().getCareSetting(orderTag.careSettingId)); OrderFrequency orderFrequency = Context.getOrderService().getOrderFrequency(Integer.valueOf(orderTag.frequency)); revisedOrder.setFrequency(orderFrequency); revisedOrder.setDateActivated(orderTag.startDate); revisedOrder.setNumRefills(orderTag.numRefills);
drugOrder.setCareSetting(Context.getOrderService().getCareSetting(orderTag.careSettingId)); OrderFrequency orderFrequency = Context.getOrderService().getOrderFrequency(Integer.valueOf(orderTag.frequency)); drugOrder.setFrequency(orderFrequency); drugOrder.setDateActivated(orderTag.startDate); drugOrder.setNumRefills(orderTag.numRefills);