/** * saves Patient Handling */ public AssessmentHeaderInfo savePatientHandling(PatientHandling patientHandling, AssessmentHeaderInfo assessment, AssessmentComponent component) throws StaleObjectException { // Ensure the value object has been validated if (!patientHandling.isValidated()) throw new DomainRuntimeException("Patient Handling has not been validated"); DomainFactory factory = getDomainFactory(); PatientMovementHandlingScreening domHandle = PatientHandlingAssembler.extractPatientMovementHandlingScreening(factory, patientHandling); factory.save(domHandle); /* if (assessment != null) { AssessmentMobility comp = (AssessmentMobility) component; comp.setPatientHandling(PatientHandlingAssembler.create(domHandle)); if (comp.validate() != null) throw new DomainRuntimeException("Mobility Component has not been validated"); return (saveMobilityComponent(assessment, comp)); }*/ return null; }
/** * saves Patient Movement */ public AssessmentHeaderInfo savePatientMovement(PatientMovement patientMovement, AssessmentHeaderInfo assessment, AssessmentComponent component) throws StaleObjectException { // Ensure the Patient Movement has been validated if (!patientMovement.isValidated()) throw new DomainRuntimeException("Patient Movement has not been validated"); DomainFactory factory = getDomainFactory(); PatientMovementHandling domMovement = PatientMovementAssembler.extractPatientMovementHandling(factory, patientMovement); factory.save(domMovement); /*if (assessment != null) { AssessmentMobility comp = (AssessmentMobility) component; comp.setPatientMovement(PatientMovementAssembler.create(domMovement)); if (comp.validate() != null) throw new DomainRuntimeException("Mobility Component has not been validated"); return (saveMobilityComponent(assessment, comp)); }*/ return null; }
private void open() { prepareControls(); // If there is an assessment in the global context, we want to call the get component domain method // Otherwise, it is a new assessment component AssessmentHeaderInfo voAssmntHeader = form.getGlobalContext().Nursing.getAssessmentHeaderInfo(); form.getLocalContext().setAssmnt(voAssmntHeader); if (voAssmntHeader != null && voAssmntHeader.getID_AssessmentIsNotNull()) { AssessmentBladder voAssessBladder = (AssessmentBladder)domain.getComponent(voAssmntHeader,AssessmentComponentType.BLADDER); form.getLocalContext().setAssessBladder(voAssessBladder); populateInstanceControl(voAssessBladder); } else { //check if there is a relevant component getLastAssessmentComponent(); } checkRequireAssistance(); }
private void open() { prepareControls(); // If there is an assessment in the global context, we want to call the get component domain method // Otherwise, it is a new assessment component AssessmentHeaderInfo voAssessHeader = form.getGlobalContext().Nursing.getAssessmentHeaderInfo(); form.getLocalContext().setAssmnt(voAssessHeader); if (voAssessHeader != null && voAssessHeader.getID_AssessmentIsNotNull()) { AssessmentBowels voAssessBowel = (AssessmentBowels)domain.getComponent(voAssessHeader,AssessmentComponentType.BOWELS); form.getLocalContext().setAssessBowels(voAssessBowel); populateInstanceControl(voAssessBowel); } else { //check if there is a relevant component getLastAssessmentComponent(); } }
private void open() { form.gridGrooming().setFocus(); form.setMode(FormMode.EDIT); form.getLocalContext().setyesNoColl(ims.core.vo.lookups.LookupHelper.getYesNoUnknown(domain.getLookupService())); form.bSave().setEnabled(true); form.gridCarePlan().setReadOnly(false); form.checkBoxCopy().setEnabled(false); // If there is an assessment in the global context, we want to call the get component domain method // Otherwise, it is a new assessment component AssessmentHeaderInfo voAssHeaderInfo = form.getGlobalContext().Nursing.getAssessmentHeaderInfo(); form.getLocalContext().setassmnt(voAssHeaderInfo); if (voAssHeaderInfo != null && voAssHeaderInfo.getID_AssessmentIsNotNull()) { //AssessmentDressingAndGrooming assessDG = (AssessmentDressingAndGrooming)domain.getComponent(assmnt.getCurrentComponent(), AssessmentComponentType.DRESSING); AssessmentDressingAndGrooming voAssessDressAndGroom = (AssessmentDressingAndGrooming)domain.getComponent(voAssHeaderInfo,AssessmentComponentType.DRESSING); form.getLocalContext().setassmntDG(voAssessDressAndGroom); populateInstanceControl(voAssessDressAndGroom); } else { // check if there is a relevant component getLastAssessmentComponent(); } }
private void open() { form.setMode(FormMode.EDIT); form.container1().gridCarePlan().setReadOnly(false); form.container1().bSave().setEnabled(true); form.checkBoxCopy().setEnabled(false); // If there is an assessment in the global context, we want to call the get component domain method // Otherwise, it is a new assessment component AssessmentHeaderInfo assmnt = form.getGlobalContext().Nursing.getAssessmentHeaderInfo(); form.getLocalContext().setassmnt(assmnt); if (assmnt != null && assmnt.getID_AssessmentIsNotNull()) { //AssessmentPersonalHygiene assessPH = (AssessmentPersonalHygiene)domain.getComponent(assmnt.getCurrentComponent(), AssessmentComponentType.PERSONAL_HYGIENE); AssessmentPersonalHygiene voAssessPH = (AssessmentPersonalHygiene)domain.getComponent(assmnt, AssessmentComponentType.PERSONAL_HYGIENE); form.getLocalContext().setassessPH(voAssessPH); populateInstanceControl(voAssessPH); } else { // check if there is a relevant component getLastAssessmentComponent(); } }
private void open() { form.container1().gridEmotional().setFocus(); form.setMode(FormMode.EDIT); form.container1().bSave().setEnabled(true); form.container1().gridCarePlan().setReadOnly(false); form.checkBoxCopy().setEnabled(false); // If there is an assessment in the global context, we want to call the get component domain method // Otherwise, it is a new assessment component AssessmentHeaderInfo voAssmntHeader = form.getGlobalContext().Nursing.getAssessmentHeaderInfo(); form.getLocalContext().setAssmnt(voAssmntHeader); if (voAssmntHeader != null && voAssmntHeader.getID_AssessmentIsNotNull()) { //AssessmentEmotionalState assessEM = (AssessmentEmotionalState)domain.getComponent(assmnt.getCurrentComponent(), AssessmentComponentType.EMOTIONAL_STATE); AssessmentEmotionalState voAssessEM = (AssessmentEmotionalState)domain.getComponent(voAssmntHeader,AssessmentComponentType.EMOTIONAL_STATE); form.getLocalContext().setAssessEmotionalState(voAssessEM); populateInstanceControl(voAssessEM); } else { // check if there is a relevant component getLastAssessmentComponent(); } }
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException { // If there is an assessment in the global context, we want to call the get component // domain method // Otherwise, it is a new assessment component AssessmentHeaderInfo assmnt = form.getGlobalContext().Nursing.getAssessmentHeaderInfo(); form.getLocalContext().setAssessment(assmnt); if (assmnt != null && assmnt.getCurrentComponent() != null) { NurAssessmentEatingVo voEat = (NurAssessmentEatingVo)domain.getComponent(assmnt.getCurrentComponent()); if (voEat == null) return; if (voEat != null) form.getLocalContext().setAssessEating(voEat); this.populateScreenFromData(voEat); if (assmnt.getAssessmentType().equals(AssessmentType.INITIAL)) { if (voEat.getNutritionalRiskAssessmentIsNotNull()) { if ( (voEat.getIsCompleteIsNotNull() ) && (voEat.getIsComplete().booleanValue() == false) ) form.chkSectionComplete().setEnabled(true); } else form.chkSectionComplete().setEnabled(false); } } // if(formName.equals(form.getForms().Nursing.NutritionalRiskAssessmentDialog)) // { // if(form.getGlobalContext().Nursing.getAssessmentScore() != null) // form.intNutritionalRisk().setValue(new Integer(form.getGlobalContext().Nursing.getAssessmentScore().intValue())); // } }
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException { // If there is an assessment in the global context, we want to call the // get component domain method // Otherwise, it is a new assessment component AssessmentHeaderInfo assmnt = form.getGlobalContext().Nursing.getAssessmentHeaderInfo(); form.getLocalContext().setAssessment(assmnt); if (assmnt != null && assmnt.getCurrentComponent() != null && assmnt.getCurrentComponent().getID_AssessmentComponentIsNotNull()) { NurAssessmentSkinVo voSkin = (NurAssessmentSkinVo) domain.getComponent(assmnt.getCurrentComponent()); if (voSkin == null) return; form.getLocalContext().setAssessmentSkin(voSkin); if (voSkin.getBradenScaleIsNotNull()) form.getGlobalContext().COE.setBradenScaleRecord(voSkin.getBradenScale()); litePopulateScreenFromData(voSkin);// this.populateScreenFromData(voSkin); if (assmnt.getAssessmentType().equals(AssessmentType.INITIAL)) { if (voSkin.getBradenScaleIsNotNull() && voSkin.getSkinAssessmentIsNotNull()) { if (!Boolean.TRUE.equals(voSkin.getIsComplete())) form.chkSectionComplete().setEnabled(true); } else form.chkSectionComplete().setEnabled(false); } } setBradenTooltip(); }
public AssessmentHeaderInfo getAssessmentHeaderInfoByCareContext(CareContextRefVo voCareContextRef) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" "); String query = "from AdmissionAssessment t "; ArrayList<String> markers = new ArrayList<String>(); ArrayList<Integer> values = new ArrayList<Integer>(); String andStr = " "; if (voCareContextRef != null) { hql.append(andStr + " t.careContext.id = :care"); markers.add("care"); values.add(voCareContextRef.getID_CareContext()); andStr = " and "; hql.append(andStr + " t.isRIE is null"); } if (markers.size() > 0) query += " where "; query += hql.toString(); List headerInfoList = factory.find(query, markers, values); if (headerInfoList != null && headerInfoList.size() > 0) { AssessmentHeaderInfo voAssmnt = AssessmentHeaderInfoAssembler.create((AdmissionAssessment) headerInfoList.get(0)); return voAssmnt; } else return null; }
/** * save the PainAssessment Record * @throws UniqueKeyViolationException * @throws DomainInterfaceException * **/ public AssessmentHeaderInfo saveRecord(ims.nursing.vo.PainAssessment painAssessment, AssessmentHeaderInfo assessment, AssessmentComponent component) throws StaleObjectException, UniqueKeyViolationException, DomainInterfaceException { if(painAssessment != null && !painAssessment.isValidated()) throw new DomainRuntimeException("The PainAssessment has not been validated"); if (assessment != null && component != null) { if(!assessment.isValidated()) throw new DomainRuntimeException("The AssessmentHeaderInfo has not been validated"); if(!component.isValidated()) throw new DomainRuntimeException("The AssessmentComponent has not been validated"); return (savePainAssessmentComponent(assessment, component, painAssessment.getClinicalContact())); } else { DomainFactory factory = getDomainFactory(); ims.nursing.assessmenttools.domain.objects.PainAssessment domPainAssess = PainAssessmentAssembler.extractPainAssessment(factory, painAssessment); try { factory.save(domPainAssess); ims.nursing.vo.PainAssessment voPain = PainAssessmentAssembler.create(domPainAssess); return null; } catch (DomainException e) { throw new DomainRuntimeException("DomainException occurred saving Skin Assessment.\r\n" + e.getMessage(), e); } } }
public MnaEnhancedVo saveAll(MnaEnhancedVo mnaEnhancedRecordVo, CareContextShortVo careContext) throws DomainInterfaceException,StaleObjectException, UniqueKeyViolationException { // Ensure the Value Object was validated if (!mnaEnhancedRecordVo.isValidated()) throw new DomainRuntimeException("This MnaEnhanced VO has not been validated"); VitalSignsVo vs = null; if(mnaEnhancedRecordVo.getVsRecord() != null){ vs = insertMetricsRecord(mnaEnhancedRecordVo.getVsRecord()); if(vs!=null) mnaEnhancedRecordVo.getMnaRecord().setMetrics(vs.getMetrics()); } mnaEnhancedRecordVo.getMnaRecord().validate(); MiniNutritionalAssessment mna = saveRecord(mnaEnhancedRecordVo.getMnaRecord()); AssessmentHeaderInfo headerInfo = null; if(mnaEnhancedRecordVo.getVsRecord() != null) insertMetricsRecord(mnaEnhancedRecordVo.getVsRecord()); if(mnaEnhancedRecordVo.getAedRecord() != null) { mnaEnhancedRecordVo.getAedRecord().setMiniNutritionalAssessment(mna); mnaEnhancedRecordVo.getAedRecord().validate(); headerInfo = saveEatingAssessmentComponent(mnaEnhancedRecordVo.getAshRecord(), mnaEnhancedRecordVo.getAedRecord(), careContext); } mnaEnhancedRecordVo.setMnaRecord(mna); mnaEnhancedRecordVo.setAshRecord(headerInfo); return mnaEnhancedRecordVo; }
public AssessmentHeaderInfo saveRecord(NutritionalRiskAssessmentVo nutritionalRiskRecord, AssessmentHeaderInfo assessment, AssessmentComponent component, VitalSignsVo vitalSign) throws StaleObjectException { // Ensure the Value Object was validated if (!nutritionalRiskRecord.isValidated()) throw new DomainRuntimeException("This Nutritional Risk Assessment has not been validated"); DomainFactory factory = getDomainFactory(); NutritionalRiskAssessment domAssessment = NutritionalRiskAssessmentVoAssembler.extractNutritionalRiskAssessment(factory, nutritionalRiskRecord); factory.save(domAssessment); if(vitalSign != null) saveVitalSign(vitalSign); if (assessment != null) { if(component != null && component instanceof NurAssessmentEatingVo) { NutritionalRiskAssessmentVo nutritionalRisk = NutritionalRiskAssessmentVoAssembler.create(domAssessment); nutritionalRisk.validate(); ((NurAssessmentEatingVo)component).setNutritionalRiskAssessment(nutritionalRisk); component.validate(); } assessment.validate(); return saveEatingComponent(assessment, component, null); } return null; // It otherwise expects assessment header }
/** * This method is called when the patient movement/handling form is called * from the Assessment Mobility Component form. It will save the mobility * component by calling the implementation from * AssessmentComponentImpl.java, with the patienthandling and * patientmovement details set. * @throws UniqueKeyViolationException * @throws DomainInterfaceException */ public ims.nursing.vo.AssessmentHeaderInfo saveMobilityComponent(ims.nursing.vo.AssessmentHeaderInfo assessment, ims.nursing.vo.AssessmentComponent component) throws ims.domain.exceptions.StaleObjectException, UniqueKeyViolationException, DomainInterfaceException // private ims.nursing.vo.AssessmentHeaderInfo saveMobilityComponent(ims.nursing.vo.AssessmentHeaderInfo assessment, ims.nursing.vo.AssessmentComponent component) throws ims.domain.exceptions.StaleObjectException, UniqueKeyViolationException { // AssessSkin componentImpl = (AssessSkin)getDomainImpl(AssessmentComponentImpl.class); // AssessMobility componentImpl = (AssessMobility) getDomainImpl(AssessmentComponentImpl.class); // AssessMobility componentImpl = (AssessMobility) getDomainImpl(AssessmentComponentImpl.class); // ims.nursing.vo.AssessmentHeaderInfo header = componentImpl.saveComponent(assessment, component); // header.setCurrentComponent(componentImpl.getComponent(header.getCurrentComponent())); /// return header; return null; }
public void completeComponent(ims.nursing.vo.AssessmentComponent component, AssessmentHeaderInfo assessment) throws StaleObjectException { DomainFactory factory = getDomainFactory(); // Update the VO with the completed information AssessmentComponent comp = (AssessmentComponent) factory.getDomainObject(AssessmentComponent.class, component.getID_AssessmentComponent()); comp.setIsComplete(new Boolean(true)); try { factory.save(comp); // We need to know whether to complete the actual assessment itself // too at this stage, call the // method in AssessmentComponentImpl to check whether it is required // We need to specify one component explicitly as // AssessmentComponent is not a class in it's own right AdmissionAssessment assmnt = AssessmentHeaderInfoAssembler.extractAdmissionAssessment(factory, assessment); if (assmnt.isAssessmentCompleted()) { assmnt.setDateTimeComplete(new java.util.Date()); assmnt.setHCPComplete(HcpAssembler.extractHcp(factory, (ims.core.vo.Hcp) getHcpUser())); assmnt.setAssessmentStatus(factory.getLookupInstance(AssessmentStatus.TYPE_ID, AssessmentStatus.COMPLETE.getID())); factory.save(assmnt); } } catch (DomainException e) { throw new DomainRuntimeException("DomainException occurred completing assessment component.\r\n" + e.getMessage(), e); } }
/** * Save the record */ public AssessmentHeaderInfo saveRecord(ims.nursing.vo.BradenScale bradenScale, AssessmentHeaderInfo assessment, AssessmentComponent component) throws StaleObjectException { // Ensure the Value Object was validated if (!bradenScale.isValidated()) throw new DomainRuntimeException("This Braden Assessment has not been validated"); DomainFactory factory = getDomainFactory(); BradenScale domAssessment = BradenScaleAssembler.extractBradenScale(factory, bradenScale); factory.save(domAssessment); if (assessment != null) { ims.nursing.vo.BradenScale braden = BradenScaleAssembler.create(domAssessment); braden.validate(); if(component != null && component instanceof AssessmentSkin) ((AssessmentSkin)component).setBradenScale(braden); if(component != null && component instanceof NurAssessmentSkinVo) ((NurAssessmentSkinVo)component).setBradenScale(braden); component.validate(); assessment.validate(); assessment.setCurrentComponent(component); return saveAssessmentComponent(assessment, component); } return null; // It otherwise expects assessment header }
/** * save record */ public AssessmentHeaderInfo saveRecord(SkinAssessment skinAssessment, AssessmentHeaderInfo assessment, AssessmentComponent component) throws StaleObjectException { if(!skinAssessment.isValidated()) throw new DomainRuntimeException("This Skin Assessment has not been validated"); DomainFactory factory = getDomainFactory(); ims.nursing.assessmenttools.domain.objects.SkinAssessment domSkinAssess = SkinAssessmentAssembler.extractSkinAssessment(factory, skinAssessment); try { if(domSkinAssess == null) throw new DomainException("No Skin Assessment"); if (assessment != null) { String[] arrErrors = component.validate(); if(arrErrors != null) throw new DomainRuntimeException("Validation Errors"); return (saveAssessmentComponent(assessment, component)); } else { factory.save(domSkinAssess); SkinAssessment voSkin = SkinAssessmentAssembler.create(domSkinAssess); return null; } } catch (DomainException e) { throw new DomainRuntimeException("DomainException occurred saving Skin Assessment.\r\n" + e.getMessage(), e); } }
private void open() throws FormOpenException { form.container1().ansCommDifficulty().setFocus(); form.setMode(FormMode.EDIT); form.container1().bSave().setEnabled(true); form.container1().gridCarePlan().setReadOnly(false); form.chkCopyPrev().setEnabled(false); // If there is an assessment in the global context, we want to call the get component domain method // Otherwise, it is a new assessment component AssessmentHeaderInfo assmnt = form.getGlobalContext().Nursing.getAssessmentHeaderInfo(); form.getLocalContext().setassmnt(assmnt); if (assmnt != null && assmnt.getID_AssessmentIsNotNull()) { AssessmentCommunication assessComm = (AssessmentCommunication)domain.getComponent(assmnt,AssessmentComponentType.COMMUNICATION); form.getLocalContext().setcommunication(assessComm); populateInstanceControl(assessComm); } else { // check if there is a relevant component getLastAssessmentComponent(); } try { onAnsHearingImpValueChanged(); onAnsVisImpairValueChanged(); } catch (PresentationLogicException e) { throw new FormOpenException(e.getMessage(),e); } }
private void open() { form.setMode(FormMode.EDIT); form.bSave().setEnabled(true); form.gridCarePlan().setReadOnly(false); form.getLocalContext().setYesNoColl(ims.core.vo.lookups.LookupHelper.getYesNoUnknown(domain.getLookupService())); form.checkBoxCopy().setEnabled(false); // If there is an assessment in the global context, we want to call the get component domain method // Otherwise, it is a new assessment component AssessmentHeaderInfo voAssmntHeader = form.getGlobalContext().Nursing.getAssessmentHeaderInfo(); form.getLocalContext().setAssmnt(voAssmntHeader); if (voAssmntHeader != null && voAssmntHeader.getID_AssessmentIsNotNull()) { //AssessmentSpirituality assessSP = (AssessmentSpirituality)domain.getComponent(assmnt.getCurrentComponent(), AssessmentComponentType.SPIRITUALITY); AssessmentSpirituality voAssessSP = (AssessmentSpirituality)domain.getComponent(voAssmntHeader,AssessmentComponentType.SPIRITUALITY); form.getLocalContext().setAssessSpirituality(voAssessSP); populateInstanceControl(voAssessSP); } else { if (form.getGlobalContext().Core.getPatientShort().getReligion() != null) form.textBoxReligion().setValue(form.getGlobalContext().Core.getPatientShort().getReligion().getText()); // check if there is a relevant component getLastAssessmentComponent(); } beliefOrFaith(); }
protected void onFormOpen() { form.cmbLivingArrng().setFocus(); form.setMode(FormMode.EDIT); form.bSave().setEnabled(true); form.chkCopyPrev().setEnabled(false); HomeFacilitiesCollection hfColl = LookupHelper.getHomeFacilities(domain.getLookupService()); form.gHomeFacilities().getRows().clear(); GenForm.gHomeFacilitiesRow row; for (int i=0; i< hfColl.size(); i++) { HomeFacilities comp = hfColl.get(i); row = form.gHomeFacilities().getRows().newRow(); row.setcolService(comp); } // If there is an assessment in the global context, we want to call the get component // domain method // Otherwise, it is a new assessment component AssessmentHeaderInfo assmnt = form.getGlobalContext().Nursing.getAssessmentHeaderInfo(); form.getLocalContext().setassmnt(assmnt); if (assmnt != null && assmnt.getID_AssessmentIsNotNull()) { AssessmentAccommodation assessAccom = (AssessmentAccommodation)domain.getComponent(form.getLocalContext().getassmnt(),AssessmentComponentType.ACCOMMODATION); if (assessAccom != null) populateFormInfo(assessAccom); } else { // check if there is a relevant component getLastAssessmentComponent(); } }
public AssessmentHeaderInfo getAssessment(CareContextRefVo careContextVo) { if (careContextVo == null || careContextVo.getID_CareContext()==null) throw new DomainRuntimeException("Invalid CareContextRefVo provided"); String hql = "select aa from AdmissionAssessment as aa where (aa.careContext.id = :id and aa.isRIE is null )"; List<?> list = getDomainFactory().find(hql,"id",careContextVo.getID_CareContext()); if (list == null || list.size() == 0 ) return null; return AssessmentHeaderInfoAssembler.create((AdmissionAssessment) list.get(0)); }