protected void onBSaveClick() throws ims.framework.exceptions.PresentationLogicException { loadCarePlanFromScreen(); CarePlan cp = form.getLocalContext().getCarePlan(); if (cp == null) return; String[] arrErrors = cp.validate(); if (arrErrors != null) { engine.showErrors("Validation Errors", arrErrors); return; } try { cp = domain.saveCarePlan(cp); } catch (StaleObjectException e) { engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); open(); return; } if (form.getLocalContext().getLastFormName() != null && form.getLocalContext().getLastFormName().equals(form.getForms().Nursing.CarePlanReview)) { engine.open(form.getForms().Nursing.CarePlanReview); } form.bEval().setVisible(true); form.bUpdate().setEnabled(true); form.bPrint().setEnabled(true); open(); }
protected void onBtnSaveClick() throws PresentationLogicException { loadCarePlanFromScreen(); CarePlan cp = form.getLocalContext().getCarePlan(); String[] arrErrors = cp.validate(); if(arrErrors == null) { try { cp = domain.saveCarePlan(cp); } catch (StaleObjectException e) { form.getGlobalContext().Core.setYesNoDialogMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); engine.open(form.getForms().Core.OkDialog, "Data Warning"); return; } } else { if (arrErrors != null) { engine.showErrors("Validation Errors", arrErrors); return; } } engine.close(DialogResult.OK); }
private void addThisRowsCarePlanInterventionAndOtherInterventionstoo(DynamicGridRow row) { // Check to see if the CarePlan is already in collection for (int i = 0 ; i < form.getLocalContext().getCarePlansToSave().size() ; i++) { if (form.getLocalContext().getCarePlansToSave().get(i).getID_CarePlan().equals(((CarePlan)row.getValue()).getID_CarePlan())) return; } CarePlan voRowCarePlan = ((CarePlan)row.getValue()); //Look thru grid find rows for suppplied CarePlan - voRowCarePlan for (int iRow = 0 ; iRow < form.dyngrdInterventions().getRows().size() ; iRow++) { if (((CarePlan)form.dyngrdInterventions().getRows().get(iRow).getValue()).getID_CarePlan().equals(voRowCarePlan.getID_CarePlan())) { CarePlanInterventions voRowIntervention = (CarePlanInterventions)form.dyngrdInterventions().getRows().get(iRow).getIdentifier(); // see if associated Intervention - Row is ticked DynamicGridCell cellComp = form.dyngrdInterventions().getRows().get(iRow).getCells().get(getColumn(COLCOMPLETED)); if (cellComp != null && cellComp.getType() == DynamicCellType.BOOL && (! cellComp.isReadOnly()) && ((Boolean) cellComp.getValue()) ) { //look for matching intervention in CarePlan - and set Stpooed INfo for( int iInter = 0 ; iInter < voRowCarePlan.getInterventions().size() ; iInter++) { if (voRowCarePlan.getInterventions().get(iInter).getID_CarePlanIntervention().equals(voRowIntervention.getID_CarePlanIntervention())) { voRowCarePlan.getInterventions().get(iInter).setStopBy((HcpLiteVo)domain.getHcpLiteUser()); voRowCarePlan.getInterventions().get(iInter).setStopDate(new Date()); //WDEV-12155 voRowCarePlan.getInterventions().get(iInter).setActive(false); } } } } } form.getLocalContext().getCarePlansToSave().add(voRowCarePlan); }
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; }
public CarePlan saveCarePlan(CarePlan carePlan) throws StaleObjectException { CarePlanDetails impl = (CarePlanDetails) getDomainImpl(CarePlanDetailsImpl.class); return impl.saveCarePlan(carePlan); }