private CareSetting getCareSetting(FormEntrySession session, HttpServletRequest submission) { Integer careSettingId = Integer.valueOf((String) careSettingWidget.getValue(session.getContext(), submission)); CareSetting careSetting = Context.getOrderService().getCareSetting(careSettingId); return careSetting; }
orderTag.dosingType = (Class<? extends DosingInstructions>)Context.loadClass((String) dosingTypeWidget.getValue(session.getContext(), submission)); } catch (ClassNotFoundException e) { throw new APIException(e); String doseUnitsValue = (String) doseUnitsWidget.getValue(session.getContext(), submission); if (doseUnitsValue != null) { orderTag.doseUnits = Context.getConceptService().getConcept(Integer.valueOf(doseUnitsValue)); String quantityUnitsValue = (String) quantityUnitsWidget.getValue(session.getContext(), submission); if (quantityUnitsValue != null) { orderTag.quantityUnits = Context.getConceptService().getConcept(Integer.valueOf(quantityUnitsValue)); String durationUnitsValue = (String) durationUnitsWidget.getValue(session.getContext(), submission); if (durationUnitsValue != null) { orderTag.durationUnits = Context.getConceptService().getConcept(Integer.valueOf(durationUnitsValue)); String careSettingValue = (String) careSettingWidget.getValue(session.getContext(), submission); if (careSettingValue != null) { orderTag.careSettingId = Integer.valueOf(Integer.valueOf(careSettingValue)); String routeValue = (String) routeWidget.getValue(session.getContext(), submission); if (routeValue != null) { orderTag.route = Context.getConceptService().getConcept(Integer.valueOf(routeValue));
@Override public void handleSubmission(FormEntrySession session, HttpServletRequest submission) { Date date = null; Concept exitReasonConcept = null; Concept causeOfDeathConcept = null; String otherReason = null; if (dateWidget != null) { date = dateWidget.getValue(session.getContext(), submission); } if (reasonForExitWidget != null) { Object value = reasonForExitWidget.getValue(session.getContext(), submission); exitReasonConcept = (Concept) HtmlFormEntryUtil.convertToType(value.toString().trim(), Concept.class); } if (causeOfDeathWidget != null) { Object value = causeOfDeathWidget.getValue(session.getContext(), submission); causeOfDeathConcept = (Concept) HtmlFormEntryUtil.convertToType(value.toString().trim(), Concept.class); } if (otherReasonWidget != null) { otherReason = otherReasonWidget.getValue(session.getContext(), submission); } // only if user submits both date and reason we allow to exit from care, and this is done // to make sure a user is able to submit a form with <exitfromcare> tag, without filling that // section, however if it is filled initially, user can't resubmit after changing the date and // reason fields to null back if (date != null && exitReasonConcept != null) { session.getSubmissionActions().exitFromCare(date, exitReasonConcept, causeOfDeathConcept, otherReason); } }
String discReason = (String) discontinuedReasonWidget.getValue(context, submission); Date endDate = discontinuedDateWidget.getValue(context, submission); if (endDate == null && !StringUtils.isEmpty(discReason))
String discReason = (String) discontinuedReasonWidget.getValue(context, submission); Date endDate = discontinuedDateWidget.getValue(context, submission); if (endDate == null && !StringUtils.isEmpty(discReason))
orderTag.discontinuedReasonStr = (String) discontinuedReasonWidget.getValue(session.getContext(), submission); orderTag.frequency = (String) frequencyWidget.getValue(session.getContext(), submission); if (frequencyWeekWidget != null) { orderTag.frequency += "/d " + frequencyWeekWidget.getValue(session.getContext(), submission) + "d/w"; orderTag.frequency = (String) frequencyWidget.getValue(session.getContext(), submission); if (frequencyWeekWidget != null) { orderTag.frequency += "/d " + frequencyWeekWidget.getValue(session.getContext(), submission) + "d/w";
if (exitDate == null) { if (reasonForExitWidget != null && HtmlFormEntryUtil.convertToType(reasonForExitWidget.getValue(context, submission).toString().trim(), Concept.class) != null) { ret.add(new FormSubmissionError(context.getFieldName(dateErrorWidget), Context.getMessageSourceService() .getMessage("htmlformentry.error.required"))); Object value = reasonForExitWidget.getValue(context, submission); exitReasonAnswerConcept = (Concept) HtmlFormEntryUtil.convertToType(value.toString().trim(), Concept.class); if (obsList != null && obsList.size() == 0) { HtmlFormEntryUtil.convertToType(causeOfDeathWidget.getValue(context, submission).toString().trim(), Concept.class) == null) { ret.add(new FormSubmissionError(context.getFieldName(causeOfDeathErrorWidget), Context.getMessageSourceService() .getMessage("htmlformentry.error.required"))); HtmlFormEntryUtil.convertToType(causeOfDeathWidget.getValue(context, submission).toString().trim(), Concept.class) != null) { ret.add(new FormSubmissionError(context.getFieldName(causeOfDeathErrorWidget), Context.getMessageSourceService() .getMessage("htmlformentry.error.cannotEnterAValue"))); Object value = causeOfDeathWidget.getValue(context, submission); causeOfDeathAnswerConcept = (Concept) HtmlFormEntryUtil.convertToType(value.toString().trim(), Concept.class); String valueString = otherReasonWidget.getValue(context, submission); } else if (exitReasonAnswerConcept != null && exitReasonAnswerConcept.getConceptId().equals(patientDiedConcept.getConceptId())) { if (causeOfDeathWidget == null || HtmlFormEntryUtil.convertToType(causeOfDeathWidget.getValue(context, submission).toString().trim(), Concept.class) == null) { ret.add(new FormSubmissionError(context.getFieldName(causeOfDeathErrorWidget), Context.getMessageSourceService() .getMessage("htmlformentry.error.required"))); HtmlFormEntryUtil.convertToType(causeOfDeathWidget.getValue(context, submission).toString().trim(), Concept.class) != null) {
@Override public void handleSubmission(FormEntrySession session, HttpServletRequest submission) { String regCode = null; if (regWidget.getValue(session.getContext(), submission) != null) regCode = ((String) regWidget.getValue(session.getContext(), submission)); Date startDate = startDateWidget.getValue(session.getContext(), submission); Date discontinuedDate = null; if (discontinuedDateWidget != null){ discontinuedDate = discontinuedDateWidget.getValue(session.getContext(), submission); } String discontinuedReasonStr = null; if (discontinuedReasonWidget != null){ discontinuedReasonStr = (String) discontinuedReasonWidget.getValue(session.getContext(), submission); } if (!StringUtils.isEmpty(regCode)){ if (session.getContext().getMode() == Mode.ENTER || (session.getContext().getMode() == Mode.EDIT && regDrugOrders == null)) { enterStandardRegimen(session, submission, regCode, startDate, discontinuedDate, discontinuedReasonStr); } else if (session.getContext().getMode() == Mode.EDIT) { editStandardRegimen(session, submission, regCode, startDate, discontinuedDate, discontinuedReasonStr); } } else if (regDrugOrders != null){ //void all existing orders in standard regimen -- this is if you un-select an existing standardRegimen //these are already part of the encounter, so will be updated when encounter is saved. voidDrugOrders(regDrugOrders, session); } }
String value = (String) genderWidget.getValue(context, request); patient.setGender(value);