private boolean currentEpisodeHaveCarePlans() { try { CarePlanOverviewCollection coll = domain.listCarePlans(form.getGlobalContext().Core.getCurrentCareContext(), null, false); if (coll==null || coll.size()==0) return false; return true; } catch (DomainInterfaceException e) { throw new DomainRuntimeException("DomainInterfaceException occurred listing careplans.\r\n" + e.getMessage(), e); } }
/** * 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 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 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 }