public boolean save() throws PresentationLogicException { MUSTVo voMust = populateInstanceData(); String[] arrErrors = voMust.validate(validateUIRules()); if(arrErrors != null) { engine.showErrors(arrErrors); return false; } try { form.getLocalContext().setSelectedRecord(domain.saveMUST(voMust)); } catch (StaleObjectException e) { engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); open(); return false; } return true; }
public void newInstance() throws PresentationLogicException { if (allowNew()) { clearInstanceControls(); form.ctnMust().customControlAuth().initializeComponent(); enableAuthoringControls(true); form.ctnMust().customControlAuth().setIsRequiredPropertyToControls(true); // initalise the screen for a new record form.getLocalContext().setSelectedRecord(new MUSTVo()); getLastHeightWeight(); form.ctnMust().setCollapsed(false); //set the form mode form.setMode(FormMode.EDIT); } }
private void populateMustRecord() { CareContextRefVo careContextRefVo = form.getGlobalContext().Core.getCurrentCareContext(); MUSTVo mustVo = domain.getLastComplementedMustRecord(careContextRefVo); if(mustVo != null) { addNewAssessmentRow(mustVo, "MUST", mustVo.getAuthoringInformationIsNotNull()?mustVo.getAuthoringInformation().getAuthoringDateTime():null); } }
private void populateListControl(MUSTVoCollection voMUSTColl) { clear(); if(voMUSTColl == null) return; for(int i=0; i<voMUSTColl.size(); i++) { MUSTVo voMUST = voMUSTColl.get(i); GenForm.grdDetailsRow row = form.grdDetails().getRows().newRow(); if(voMUST.getAuthoringInformationIsNotNull()) row.setColDateTime(voMUST.getAuthoringInformation().getAuthoringDateTime().toString()+" - "+ voMUST.getAuthoringInformation().getAuthoringHcp().toString()); if(voMUST.getBMIScoreIsNotNull()) row.setColStep1(voMUST.getBMIScore().toString()); if(voMUST.getUWLScoreIsNotNull()) row.setColStep2(voMUST.getUWLScore().toString()); if(voMUST.getADEScoreIsNotNull()) row.setColStep3(voMUST.getADEScore().toString()); if(voMUST.getORMScoreIsNotNull()) row.setColTotal(voMUST.getORMScore().toString()); if(voMUST.getManagementIsNotNull()) row.setColManagement(voMUST.getManagement().toString()); row.setColAction(voMUST.getActionTaken()); row.setTooltipForColAction(voMUST.getActionTakenIsNotNull()? voMUST.getActionTaken():""); row.setValue(voMUST); if(voMUST.getManagement().equals(MUSTManagement.HIGHRISK)) row.setTextColor(Color.Red); } }
private void viewAssessmentRecord() { Object value = form.grdSummary().getValue(); if (value instanceof BradenScale) { engine.open(form.getForms().Nursing.BradenScaleVIEW); } if (value instanceof MUSTVo) { engine.open(form.getForms().Nursing.MUST); } if (value instanceof PatientAssessmentListVo) { PatientAssessmentListVo voPatAsssess = (PatientAssessmentListVo) value; UserDefinedAssessmentType userDefinedAssessmentType = null; if (voPatAsssess.getAssessmentDataIsNotNull() && voPatAsssess.getAssessmentData().getGraphicIsNotNull()) userDefinedAssessmentType = voPatAsssess.getAssessmentData().getGraphic().getAssessmentType(); if (userDefinedAssessmentType != null) { if (userDefinedAssessmentType.equals(UserDefinedAssessmentType.PAINASSESSMENT)) engine.open(form.getForms().Assessment.PatientGraphicStagesPain); else if (userDefinedAssessmentType.equals(UserDefinedAssessmentType.SKINASSESSMENT)) engine.open(form.getForms().Assessment.PatientGraphicStages); } } if(value instanceof RepositioningPlanVo) { engine.open(form.getForms().Nursing.RepositioningPlan); } }
public MUSTVo getLastComplementedMustRecord(CareContextRefVo voCareContextRef) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer("from MUST m "); ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; if (voCareContextRef != null) { hql.append(" where "); hql.append(andStr + " m.careContext.id = :id_CareContext"); markers.add("id_CareContext"); values.add(voCareContextRef.getID_CareContext()); andStr = " and "; } hql.append(" order by m.authoringInformation.authoringDateTime desc "); List list = factory.find(hql.toString(), markers, values); //Get only the first record (to optimise the work of the assembler) if(list != null && list.size() > 1) { Object firstItem = list.get(0); list.removeAll(list); list.add(firstItem); } MUSTVoCollection collMUSTVo = MUSTVoAssembler.createMUSTVoCollectionFromMUST(list); if (collMUSTVo != null && collMUSTVo.size() > 0) return collMUSTVo.get(0); return null; }
public MUSTVo saveMUST(MUSTVo voMUST) throws StaleObjectException { if(!voMUST.isValidated()) throw new DomainRuntimeException("This MUST has not been validated"); DomainFactory factory = getDomainFactory(); MUST doMUST = MUSTVoAssembler.extractMUST(factory, voMUST); factory.save(doMUST); return MUSTVoAssembler.create(doMUST); }
public VSMetrics getLastMUSTMetrics(CareContextRefVo voCareContext) { if (voCareContext == null) return null; MUSTVo voMust = getLastComplementedMustRecord(voCareContext); if (voMust != null) return voMust.getMetrics(); else return null; }
private void populateInstanceControl(MUSTVo voMUST) { VitalSignsVo voVital = voMUST.getVitalSign(); VSMetrics voMetrics = voMUST.getMetrics(); if(voVital != null && voVital.getMetricsIsNotNull()) { form.ctnMust().decWeight().setValue(voVital.getMetrics().getWeightValue()); form.ctnMust().decHeight().setValue(voVital.getMetrics().getHeightValue()); if(ConfigFlag.UI.HW_MEASURED_ESTIMATED_FUNCTIONALITY.getValue())//WDEV-15193 { form.ctnMust().GroupH().setValue(voVital.getMetrics().getHeightEstimatedMeasuredIsNotNull() && voVital.getMetrics().getHeightEstimatedMeasured() ? GroupHEnumeration.rdoHM : GroupHEnumeration.rdoHE); form.ctnMust().GroupW().setValue(voVital.getMetrics().getWeightEstimatedMeasuredIsNotNull() && voVital.getMetrics().getWeightEstimatedMeasured() ? GroupWEnumeration.rdoWM : GroupWEnumeration.rdoWE); } } else if(voMetrics != null) { form.ctnMust().decWeight().setValue(voMetrics.getWeightValue()); form.ctnMust().decHeight().setValue(voMetrics.getHeightValue()); if(ConfigFlag.UI.HW_MEASURED_ESTIMATED_FUNCTIONALITY.getValue())//WDEV-15193 { form.ctnMust().GroupH().setValue(voMetrics.getHeightEstimatedMeasuredIsNotNull() && voMetrics.getHeightEstimatedMeasured() ? GroupHEnumeration.rdoHM : GroupHEnumeration.rdoHE); form.ctnMust().GroupW().setValue(voMetrics.getWeightEstimatedMeasuredIsNotNull() && voMetrics.getWeightEstimatedMeasured() ? GroupWEnumeration.rdoWM : GroupWEnumeration.rdoWE); } } form.ctnMust().decPreviousWeight().setValue(voMUST.getPreviousHealthyWeight()); form.ctnMust().chkAcutelyIll().setValue(voMUST.getAcutelyIll().booleanValue()); form.ctnMust().chkAcutelyIll().setValue(voMUST.getAcutelyIll().booleanValue()); form.ctnMust().intStep1().setValue(voMUST.getBMIScore()); form.ctnMust().intStep2().setValue(voMUST.getUWLScore()); form.ctnMust().intStep3().setValue(voMUST.getADEScore()); form.ctnMust().intStepTotal().setValue(voMUST.getORMScore()); form.ctnMust().cmbManagement().setValue(voMUST.getManagement()); form.ctnMust().txtAction().setValue(voMUST.getActionTaken()); form.ctnMust().txtWeightLossReason().setValue(voMUST.getWeightLossReason()); form.ctnMust().customControlAuth().setValue(voMUST.getAuthoringInformation()); calculateUWL(); calculateBMI(); form.ctnMust().setCollapsed(false); }
public MUSTVo getLastComplementedMustRecord(CareContextRefVo careContextRefVo) { DailyPatientProgress impl = (DailyPatientProgress) getDomainImpl(DailyPatientProgressImpl.class); return impl.getLastComplementedMustRecord(careContextRefVo); }
public MUSTVo getLastComplementedMustRecord(CareContextRefVo careContextRefVo) { MUST mustDommainImpl = (MUST) getDomainImpl(MUSTImpl.class); return mustDommainImpl.getLastComplementedMustRecord(careContextRefVo); }