@Override protected void onCmbCarePlanStatusValueChanged() throws PresentationLogicException { if (form.cmbCarePlanStatus().getValue() == null) { return; } if (form.cmbCarePlanStatus().getValue().equals(ims.nursing.vo.lookups.CarePlanStatus.ACTIVE)) { form.dateNextEvaluation().setRequired(true); } else { form.dateNextEvaluation().setRequired(false); } }
protected void onFormOpen() throws ims.framework.exceptions.FormOpenException { //WDEV-13535 set default status defaultcbFilterLookupValue(); boolean isCcoSpecific = ConfigFlag.GEN.CARE_PLAN_FUNCTIONALITY_TYPE.getValue().equals("CCO"); if(!isCcoSpecific) form.cbFilter().removeRow(ims.nursing.vo.lookups.CarePlanStatus.ALL_ADMISSIONS); listCarePlans(); //wdev-13495 if(engine.isRIEMode()) form.gridCarePlans().setSelectable(false); else form.gridCarePlans().setSelectable(true); updateControlsState();//WDEV-14924 }
private CarePlanStatus createNewCarePlanStatus() { CarePlanStatus carePlanStatus = new CarePlanStatus(); carePlanStatus.setStatus(ims.nursing.vo.lookups.CarePlanStatus.ACTIVE); carePlanStatus.setDateTime(new DateTime()); Object hcpUser = domain.getHcpLiteUser(); if (hcpUser != null) { carePlanStatus.setHCP((HcpLiteVo) hcpUser); } return carePlanStatus; }
private void updateControlState() { boolean isCcoSpecific = ConfigFlag.GEN.CARE_PLAN_FUNCTIONALITY_TYPE.getValue().equals("CCO"); boolean isEditMode = FormMode.EDIT.equals(form.getMode()); //WDEV-15252 form.lnkReturnToCarePlanWorklist().setVisible(!isEditMode && engine.getPreviousNonDialogFormName().equals(form.getForms().Nursing.CarePlanWorklist)); if (isEditMode) { form.cbFilter().setEnabled(isCcoSpecific); } else { ims.nursing.vo.lookups.CarePlanStatus cStatus = form.getLocalContext().getCarePlanIsNotNull() && form.getLocalContext().getCarePlan().getCurrentCarePlanStatusIsNotNull() ? form.getLocalContext().getCarePlan().getCurrentCarePlanStatus().getStatus():null; //wdev-13495 form.btnReactivate().setVisible(isCcoSpecific && (ims.nursing.vo.lookups.CarePlanStatus.DISCONTINUED.equals(cStatus)||ims.nursing.vo.lookups.CarePlanStatus.COMPLETE.equals(cStatus))); } form.bNoteCorrection().setEnabled(!isEditMode && form.gridNotes().getValue()!= null && form.gridNotes().getValue().getActiveIsNotNull() && form.gridNotes().getValue().getActive()); form.lnkClinicalNote().setEnabled(!isEditMode); form.chkActive().setEnabled(!isEditMode); updateContextMenuActionsState(); if(!isEditMode && form.getLocalContext().getCarePlanIsNotNull() && form.getGlobalContext().Core.getCurrentCareContextIsNotNull() && !form.getLocalContext().getCarePlan().getCareContext().equals(form.getGlobalContext().Core.getCurrentCareContext())) //WDEV-14521 { showOnlyCreateDuplicateAndClose(); } else form.btnCreateDuplicate().setVisible(false); }
private void doReactivate() { CarePlanStatus status = new CarePlanStatus(); status.setDateTime(new DateTime()); status.setHCP((HcpLiteVo) domain.getHcpLiteUser()); status.setStatus(ims.nursing.vo.lookups.CarePlanStatus.ACTIVE); form.getLocalContext().getCarePlan().setCurrentCarePlanStatus(status); form.getLocalContext().getCarePlan().getCarePlanStatus().add(status); }
/** * Method to list the careplans for the current episode * it will list either all or active. * */ private void listCarePlans() { CarePlanOverviewCollection coll = null; CarePlanOverviewCollection collOtherCarePlans = null; CarePlanStatus statusFilter = new CarePlanStatus(); if(form.cbFilter().getValue()!=null) statusFilter.setStatus(form.cbFilter().getValue()); else{ engine.showMessage("Please select a Filter."); return; } try { if(form.cbFilter().getValue().equals(ims.nursing.vo.lookups.CarePlanStatus.ALL)){ coll = domain.listCarePlans(form.getGlobalContext().Core.getCurrentCareContext(), null, false); } else if(form.cbFilter().getValue().equals(ims.nursing.vo.lookups.CarePlanStatus.ALL_ADMISSIONS)){ boolean isCcoSpecific = ConfigFlag.GEN.CARE_PLAN_FUNCTIONALITY_TYPE.getValue().equals("CCO"); if(isCcoSpecific){ collOtherCarePlans = domain.listCarePlans(form.getGlobalContext().Core.getCurrentCareContext(), null, true); coll = domain.listCarePlans(form.getGlobalContext().Core.getCurrentCareContext(), null, false); } } else coll = domain.listCarePlans(form.getGlobalContext().Core.getCurrentCareContext(), statusFilter, false); } catch (DomainInterfaceException e) { throw new DomainRuntimeException("DomainInterfaceException occurred listing careplans.\r\n" + e.getMessage(), e); } form.gridCarePlans().getRows().clear(); populateCarePlansGrid(coll, false); form.gridCarePlans().sort(4, SortOrder.ASCENDING); populateCarePlansGrid(collOtherCarePlans, true); }
private String fillToolTip(CarePlanStatusCollection voCarePlanStatusCollection) { StringBuffer tooltip = new StringBuffer(); tooltip.append("<p align=\"center\"><font color=\"#FF0000\"><b>CARE PLAN STATUS</b></font> </p>"); final String newLine = "<br>"; CarePlanStatus voCarePlanStatus; if(voCarePlanStatusCollection != null) { voCarePlanStatusCollection.sort(SortOrder.ASCENDING); for(int i=0; i<voCarePlanStatusCollection.size(); i++) { voCarePlanStatus = voCarePlanStatusCollection.get(i); if(voCarePlanStatus.getDateTimeIsNotNull()) { tooltip.append("<b>" + "Date/Time: " + "</b>" + voCarePlanStatus.getDateTime().toString(DateTimeFormat.STANDARD) + "</b>"); } if(voCarePlanStatus.getHCPIsNotNull()) { tooltip.append(newLine); tooltip.append("<b>" + "HCP: " + "</b>" + voCarePlanStatus.getHCP().getMos().getName().toString()); } else { tooltip.append(newLine); tooltip.append("<b>" + "HCP: " + "</b>"); } if(voCarePlanStatus.getStatusIsNotNull()) { tooltip.append(newLine); tooltip.append("<b>" + "Status: " + "</b>" + voCarePlanStatus.getStatus().toString()); } tooltip.append(newLine); tooltip.append(newLine); } } return tooltip.toString(); }
protected void onFormOpen() throws ims.framework.exceptions.FormOpenException { //WDEV-13535 set default status defaultcbFilterLookupValue(); boolean isCcoSpecific = ConfigFlag.GEN.CARE_PLAN_FUNCTIONALITY_TYPE.getValue().equals("CCO"); if(!isCcoSpecific) form.cbFilter().removeRow(ims.nursing.vo.lookups.CarePlanStatus.ALL_ADMISSIONS); //WDEV-19389 --- start if (!(form.getGlobalContext().Core.getCurrentCareContextIsNotNull() && form.getGlobalContext().Nursing.getCarePlanOverviewSearchCriteriaIsNotNull() && form.getGlobalContext().Nursing.getCarePlanOverviewSearchCriteria().getCareContextIsNotNull() && form.getGlobalContext().Core.getCurrentCareContext().equals(form.getGlobalContext().Nursing.getCarePlanOverviewSearchCriteria().getCareContext()))) form.getGlobalContext().Nursing.setCarePlanOverviewSearchCriteria(null); if(form.getGlobalContext().Nursing.getCarePlanOverviewSearchCriteriaIsNotNull()) { setSearchCriteria(form.getGlobalContext().Nursing.getCarePlanOverviewSearchCriteria()); } //WDEV-19389 --- end listCarePlans(); //wdev-13495 if(engine.isRIEMode()) form.gridCarePlans().setSelectable(false); else form.gridCarePlans().setSelectable(true); updateControlsState();//WDEV-14924 }
boolean validateUserInput() { if(form.dDate().getValue() == null) { engine.showMessage("Please enter the Date."); return false; } //wdev-14915 if( ims.configuration.gen.ConfigFlag.DOM.CAREPLAN_NEXT_EVALUTION_DATE_VALIDATION.getValue() != 0 ) { Date dateT = new Date(); dateT.addDay(ims.configuration.gen.ConfigFlag.DOM.CAREPLAN_NEXT_EVALUTION_DATE_VALIDATION.getValue()); if( form.dateNextEvaluation().getValue() != null && form.dateNextEvaluation().getValue().isGreaterThan(dateT)) { engine.showMessage("Next Evaluation Date exceeds " +ims.configuration.gen.ConfigFlag.DOM.CAREPLAN_NEXT_EVALUTION_DATE_VALIDATION.getValue()+" day policy!" ); //WDEV-15275 return false; } } //--------------- if(form.tTime().getValue() == null) { engine.showMessage("Please enter the Time."); return false; } if (form.cmbCarePlanStatus().getValue() == null ) { engine.showMessage("Please enter the Care Plan Status."); return false; } if (form.cmbCarePlanStatus().getValue().equals(ims.nursing.vo.lookups.CarePlanStatus.ACTIVE) && form.dateNextEvaluation().getValue() == null) { engine.showMessage("Please enter the Next Evaluation Date."); return false; } if(form.dateNextEvaluation().getValue() != null) { Date today = new Date(); if(form.dateNextEvaluation().getValue().isLessThan(today)) { engine.showMessage("The Next Evaluation Date cannot be in the past."); return false; } } if (form.textEvaluationNotes().getValue() == null && ! ConfigFlag.GEN.CARE_PLAN_FUNCTIONALITY_TYPE.getValue().toString().equals("CCO"))//wdev-13781 { engine.showMessage("Please enter an Evaluation Note."); return false; } if(form.qmbConfirmedBy().getVisible()) { if(form.qmbConfirmedBy().getValue() == null) { Hcp voHcp = (Hcp) domain.getHcpUser(); if(voHcp != null) { if(HcpDisType.NURSING.equals(voHcp.getHcpType())) //WDEV-17953 { NurseVo voNurse = (NurseVo) voHcp; if (voNurse.getNurseTypeIsNotNull()) if(voNurse.getNurseType().equals(HcpDisType.STUDENTNURSE)) { engine.showMessage("'Confirmed by' is a mandatory field as you are logged in as a student nurse"); return false; } } } } } return true; }
private CarePlan createDuplicateCarePlan() { CarePlan cpDuplicate = new CarePlan(); CarePlan cp = form.getLocalContext().getCarePlan(); cpDuplicate.setCareContext(form.getGlobalContext().Core.getCurrentCareContext()); cpDuplicate.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact()); cpDuplicate.setTitle(cp.getTitle()); cpDuplicate.setObjective(cp.getObjective()); cpDuplicate.setNextEvaluationDate(new Date()); CarePlanInterventionsCollection collCarePlanInterventions = new CarePlanInterventionsCollection(); if(cp.getInterventions()!=null) for(int i=0; i<cp.getInterventions().size(); i++){ CarePlanInterventions action = cp.getInterventions().get(i); CarePlanInterventions carePlanIntervention = new CarePlanInterventions(); carePlanIntervention.setDescription(action.getDescription()); carePlanIntervention.setActive(true); carePlanIntervention.setStartDate(action.getStartDate()); carePlanIntervention.setStartBy(action.getStartBy()); carePlanIntervention.setOrder(action.getOrder()); carePlanIntervention.setInterventionType(action.getInterventionType()); carePlanIntervention.setFrequency(action.getFrequency()); collCarePlanInterventions.add(carePlanIntervention); } cpDuplicate.setInterventions(collCarePlanInterventions); //Care Plan Status CarePlanStatus status = new CarePlanStatus(); status.setDateTime(new DateTime()); Object Object = domain.getHcpLiteUser(); HcpLiteVo hcpLiteVo = Object != null ? (HcpLiteVo) Object : null; status.setHCP(hcpLiteVo); status.setStatus(ims.nursing.vo.lookups.CarePlanStatus.ACTIVE); cpDuplicate.setCurrentCarePlanStatus(status); CarePlanStatusCollection voColl = new CarePlanStatusCollection(); voColl.add(status); cpDuplicate.setCarePlanStatus(voColl); return cpDuplicate; }
private void populateCarePlansGrid(CarePlanOverviewCollection coll, boolean bOtherCarePlans) { if (coll != null) { GenForm.gridCarePlansRow row; for (int i=0; i<coll.size(); i++) { CarePlanOverview overview = coll.get(i); row = form.gridCarePlans().getRows().newRow(); row.setValue(overview); row.setcolCarePlanTitle(overview.getTitle()); if(overview!=null && overview.getCarePlanStatusIsNotNull()) { for(int x=0; x<overview.getCarePlanStatus().size(); x++) { overview.getCarePlanStatus().sort(SortOrder.ASCENDING); if(overview.getCarePlanStatus().get(x).getStatus().equals(ims.nursing.vo.lookups.CarePlanStatus.ACTIVE)) { if(overview.getCarePlanStatus().get(x).getDateTime().getDate() != null) row.setcolInitiatedOn(overview.getCarePlanStatus().get(x).getDateTime().getDate()); if(overview.getCarePlanStatus().get(x).getHCP() != null) { if(overview.getCarePlanStatus().get(x).getHCP().getName() != null) row.setcolInitiateBy(overview.getCarePlanStatus().get(x).getHCP().getName().toShortForm()); } break; //you could have a number of actives, i.e.active,then suspended,then active, you want //the first active, so ASCENDING - get first active - need break. } } } if (overview.getCurrentCarePlanStatus()!=null && overview.getCurrentCarePlanStatus().getStatus().equals(ims.nursing.vo.lookups.CarePlanStatus.ACTIVE) && !bOtherCarePlans) { if (overview.getNextEvaluationDate() != null) row.setcolNextEvaluation(overview.getNextEvaluationDate()); // If the careplan evaluation is due today, we want to set the row green if (overview.getNextEvaluationDate() != null && overview.getNextEvaluationDate().equals(new ims.framework.utils.Date())) row.setBackColor(Color.Orange); // If the careplan is overdue, we want to set the row red if (overview.getNextEvaluationDate() != null && overview.getNextEvaluationDate().isLessThan(new ims.framework.utils.Date())) row.setBackColor(Color.LightCoral); } if(bOtherCarePlans){ if (overview.getNextEvaluationDate() != null) row.setcolNextEvaluation(overview.getNextEvaluationDate()); row.setBackColor(Color.LightSlateGray); } if(overview.getCurrentCarePlanStatus()!=null) row.setcolStatus(overview.getCurrentCarePlanStatus().getStatus().getText()); row.setTooltipForcolStatus(fillToolTip(overview.getCarePlanStatus())); } } }
protected void onImbRefreshClick() throws PresentationLogicException { // We need to call the InpatientEpisode list for the ward selected form.grdCarePlans().getRows().clear(); if (form.cmbPatient().getValue() != null) { CarePlanStatus statusFilter = new CarePlanStatus(); statusFilter.setStatus(ims.nursing.vo.lookups.CarePlanStatus.ACTIVE); CarePlanOverviewCollection epColl = domain.listCarePlansForReview(form.cmbPatient().getValue(), statusFilter); CarePlanOverview voCpr; GenForm.grdCarePlansRow row; if (epColl != null) { for (int i = 0; i < epColl.size(); i++) { voCpr = epColl.get(i); row = form.grdCarePlans().getRows().newRow(); row.setcolCarePlan(voCpr.getTitle()); if (voCpr.getNextEvaluationDate() != null) row.setcolEvaluationDate(voCpr.getNextEvaluationDate().toString()); if (voCpr.getLastReviewedDate() != null) row.setColDateReview(voCpr.getLastReviewedDate().toString()); if (voCpr.getLastReviewedBy() != null) row.setColBy(voCpr.getLastReviewedBy().getName().toString()); // If the careplan evaluation is due today, set the row // Orange if (voCpr.getNextEvaluationDate() != null && voCpr.getNextEvaluationDate().equals(new ims.framework.utils.Date())) row.setBackColor(Color.Orange); // If the careplan is overdue, set the row red if (voCpr.getNextEvaluationDate() != null && voCpr.getNextEvaluationDate().isLessThan(new ims.framework.utils.Date())) row.setBackColor(Color.LightCoral); row.setValue(voCpr); } } } form.btnConfirm().setEnabled(false); form.btnReviewHistory().setEnabled(false); }
/** * Lists all careplans for the given Episode with the filter of 0 = Active, 1 = All */ public CarePlanOverviewCollection listCarePlans(CareContextRefVo voCurrentCareContext, CarePlanStatus currentStatus, Boolean bCarePlansFromOtherContexts) throws DomainInterfaceException { if(voCurrentCareContext == null && voCurrentCareContext.getID_CareContextIsNotNull()) throw new CodingRuntimeException("Current Care Context not available."); DomainFactory factory = getDomainFactory(); String hqlQuery = " from CarePlan cp "; StringBuffer condStr = new StringBuffer(); ArrayList<String> markerNames = new ArrayList<String>(); ArrayList<Integer> markerValues = new ArrayList<Integer>(); CarePlanOverviewCollection voColl = null; condStr.append(" where "); if(voCurrentCareContext != null) { if(!bCarePlansFromOtherContexts) condStr.append(" cp.careContext.id = :rcc"); else{ condStr.append(" cp.careContext.episodeOfCare.careSpell.patient.id = :patientId and cp.careContext.id != :rcc"); markerNames.add("patientId"); markerValues.add(getPatientId(voCurrentCareContext)); } markerNames.add("rcc"); markerValues.add(voCurrentCareContext.getID_CareContext()); } if(currentStatus != null) { if(currentStatus.getStatus() != null) { if(currentStatus != null) condStr.append(" and "); condStr.append(" cp.currentCarePlanStatus.status.id = :status"); markerNames.add("status"); markerValues.add(new Integer(currentStatus.getStatus().getId())); } } hqlQuery += condStr.toString(); List careplans = factory.find(hqlQuery,markerNames,markerValues); if(careplans != null) voColl = (CarePlanOverviewAssembler.createCarePlanOverviewCollectionFromCarePlan(careplans)); if(voColl != null) voColl.sort(SortOrder.ASCENDING); return voColl; }
public CopyCarePlanVoCollection listCarePlans(CareContextRefVo voCurrentCareContext, CarePlanStatus currentStatus, Boolean bCarePlansFromOtherContexts) { if (voCurrentCareContext == null || voCurrentCareContext.getID_CareContext()==null) throw new CodingRuntimeException("Current Care Context not available."); DomainFactory factory = getDomainFactory(); String hqlQuery = " from CarePlan cp "; StringBuffer condStr = new StringBuffer(); ArrayList<String> markerNames = new ArrayList<String>(); ArrayList<Integer> markerValues = new ArrayList<Integer>(); CopyCarePlanVoCollection voColl = null; condStr.append(" where "); if (voCurrentCareContext != null) { if (!bCarePlansFromOtherContexts) { condStr.append(" cp.careContext.id = :rcc"); markerNames.add("rcc"); markerValues.add(voCurrentCareContext.getID_CareContext()); } else { condStr.append(" cp.careContext.episodeOfCare.careSpell.patient.id = :patientId"); markerNames.add("patientId"); markerValues.add(getPatientId(voCurrentCareContext)); } } if (currentStatus != null) { if (currentStatus.getStatus() != null) { condStr.append(" and cp.currentCarePlanStatus.status.id = :status"); markerNames.add("status"); markerValues.add(new Integer(currentStatus.getStatus().getId())); } } hqlQuery += condStr.toString(); List<?> careplans = factory.find(hqlQuery, markerNames, markerValues); if (careplans != null) voColl = (CopyCarePlanVoAssembler.createCopyCarePlanVoCollectionFromCarePlan(careplans)); if (voColl != null) voColl.sort(SortOrder.ASCENDING); return voColl; }
public CarePlanOverviewCollection listCarePlansForReview(CareContextShortVo careContextShortVo, CarePlanStatus activeFilter) { DomainFactory factory = getDomainFactory(); String hqlQuery = " from CarePlan cp "; StringBuffer condStr = new StringBuffer(); ArrayList<String> markerNames = new ArrayList<String>(); ArrayList<Integer> markerValues = new ArrayList<Integer>(); CarePlanOverviewCollection voColl = null; condStr.append(" where "); if(careContextShortVo != null) { condStr.append(" cp.careContext.id = :careContext"); markerNames.add("careContext"); markerValues.add(careContextShortVo.getID_CareContext()); } if(activeFilter != null) { if(activeFilter.getStatus() != null) { if(activeFilter != null) condStr.append(" and "); condStr.append(" cp.currentCarePlanStatus.status.id = :status"); markerNames.add("status"); markerValues.add(new Integer(activeFilter.getStatus().getId())); } } hqlQuery += condStr.toString(); List careplans = factory.find(hqlQuery,markerNames,markerValues); if(careplans != null) voColl = (CarePlanOverviewAssembler.createCarePlanOverviewCollectionFromCarePlan(careplans)); if(voColl != null) voColl.sort(SortOrder.ASCENDING); return voColl; }
/** * Method to list the careplans for the current episode * it will list either all or active. * */ private void listCarePlans() { CarePlanOverviewCollection coll = null; CarePlanOverviewCollection collOtherCarePlans = null; CarePlanStatus statusFilter = new CarePlanStatus(); if(form.cbFilter().getValue()!=null) statusFilter.setStatus(form.cbFilter().getValue()); else{ engine.showMessage("Please select a Filter."); form.getGlobalContext().Nursing.setCarePlanOverviewSearchCriteria(null);//WDEV-19389 return; } try { if(form.cbFilter().getValue().equals(ims.nursing.vo.lookups.CarePlanStatus.ALL)){ coll = domain.listCarePlans(form.getGlobalContext().Core.getCurrentCareContext(), null, false); } else if(form.cbFilter().getValue().equals(ims.nursing.vo.lookups.CarePlanStatus.ALL_ADMISSIONS)){ boolean isCcoSpecific = ConfigFlag.GEN.CARE_PLAN_FUNCTIONALITY_TYPE.getValue().equals("CCO"); if(isCcoSpecific){ collOtherCarePlans = domain.listCarePlans(form.getGlobalContext().Core.getCurrentCareContext(), null, true); coll = domain.listCarePlans(form.getGlobalContext().Core.getCurrentCareContext(), null, false); } } else coll = domain.listCarePlans(form.getGlobalContext().Core.getCurrentCareContext(), statusFilter, false); } catch (DomainInterfaceException e) { throw new DomainRuntimeException("DomainInterfaceException occurred listing careplans.\r\n" + e.getMessage(), e); } form.gridCarePlans().getRows().clear(); populateCarePlansGrid(coll, false); form.gridCarePlans().sort(4, SortOrder.ASCENDING); populateCarePlansGrid(collOtherCarePlans, true); form.getGlobalContext().Nursing.setCarePlanOverviewSearchCriteria(getSearchCriteria());//WDEV-19389 }