private PainAssessmentReview getReviewVOfromFindingVO(PainAssessmentFindings pafVO) { PainAssessmentReview painAssVo = getReviewRecord(pafVO); if(painAssVo.getID_PainAssessmentReview() == null) painAssVo.setID_PainAssessmentReview(pafVO.getID_PainAssessmentFindings()); painAssVo.setDepth(pafVO.getDepth()); painAssVo.setOnset(pafVO.getOnset()); painAssVo.setProgression(pafVO.getProgression()); painAssVo.setRecordingDateTime(new DateTime(form.dteRecording().getValue(), form.timRecording().getValue())); painAssVo.setAssessmentDateTime(new DateTime(form.dteAssessment().getValue(), form.timAssessment().getValue())); MemberOfStaffShortVo memStaffShortVo = (MemberOfStaffShortVo)domain.getMosUser(); if(memStaffShortVo != null && memStaffShortVo.getHcp() != null) painAssVo.setRecordingHCP(memStaffShortVo.getHcp()); painAssVo.setSeverity(pafVO.getSeverity()); painAssVo.setSiteDetails(pafVO.getSiteDetails()); painAssVo.setType(pafVO.getType()); return painAssVo; }
private void populateFindingData() { PainAssessmentFindings painAssFindingVO = form.getGlobalContext().COE.PainBodyChart.getAssessmentFinding(); if(painAssFindingVO != null) { populateControlsFromVO(painAssFindingVO, null); } }
private void populateReviewData() { PainAssessmentFindings painAssFindingVO = form.getGlobalContext().COE.PainBodyChart.getAssessmentFinding(); PainAssessmentReview painAssReviewVO = form.getGlobalContext().COE.PainBodyChart.getPainAssReviewVO(); if(painAssFindingVO != null && painAssReviewVO != null) { populateControlsFromVO(painAssFindingVO, painAssReviewVO); } }
private PainAssessmentReview getReviewRecord(PainAssessmentFindings findingVo) { if(findingVo.getPainAssessmentReviewIsNotNull()) { for(int i=0; i<findingVo.getPainAssessmentReview().size(); i++) { if(findingVo.getPainAssessmentReview().get(i).getID_PainAssessmentReviewIsNotNull() && findingVo.getPainAssessmentReview().get(i).getID_PainAssessmentReview().intValue() == findingVo.getID_PainAssessmentFindings().intValue()) return findingVo.getPainAssessmentReview().get(i); } } return new PainAssessmentReview(); }
private boolean reviewEdited(PainAssessmentFindings findingVo) { if(findingVo.getPainAssessmentReviewIsNotNull()) { //Only when having one review - (e.g. when the review was created from the finding) if(findingVo.getPainAssessmentReview().size() == 1 && findingVo.getPainAssessmentReview().get(0).getID_PainAssessmentReviewIsNotNull() && findingVo.getPainAssessmentReview().get(0).getID_PainAssessmentReview().intValue() == findingVo.getID_PainAssessmentFindings().intValue()) return true; } return false; }
private boolean getPainDetails(PainAssessmentFindings painDetailsVO, PainAssessmentReview painReviewDetailsVO) { if(painDetailsVO == null) return false; if(painReviewDetailsVO == null) { if(!checkAssessmentDate()) return false; PainAssessment painAssVO = form.getGlobalContext().COE.PainBodyChart.getPainAssessmentVO(); if(painAssVO != null) painAssVO.setAssessmentDateTime(new DateTime(form.dteAssessmentDate().getValue(), form.timAssessmentTime().getValue())); form.getGlobalContext().COE.PainBodyChart.setPainAssessmentVO(painAssVO); painDetailsVO.setSiteDetails(form.txtBoxSiteDetails().getValue()); painDetailsVO.setType(form.cmbType().getValue()); painDetailsVO.setSeverity(form.getLocalContext().getSeverity()); painDetailsVO.setOnset(form.cmbOnset().getValue()); painDetailsVO.setProgression(form.cmbProgression().getValue()); painDetailsVO.setDepth(form.cmbDepth().getValue()); painDetailsVO.setIsDiscontinuedAssess(new Boolean(form.chkDiscontinueAssessment().getValue())); //Set the Findings value back to the context form.getGlobalContext().COE.PainBodyChart.setAssessmentFinding(painDetailsVO); } else { if(!checkAssessmentDate()) return false; painReviewDetailsVO.setRecordingDateTime(new DateTime(form.dteRecordingDate().getValue(), form.timRecordingTime().getValue())); painReviewDetailsVO.setAssessmentDateTime(new DateTime(form.dteAssessmentDate().getValue(), form.timAssessmentTime().getValue())); painReviewDetailsVO.setSiteDetails(form.txtBoxSiteDetails().getValue()); painReviewDetailsVO.setType(form.cmbType().getValue()); painReviewDetailsVO.setSeverity(form.getLocalContext().getSeverity()); painReviewDetailsVO.setOnset(form.cmbOnset().getValue()); painReviewDetailsVO.setProgression(form.cmbProgression().getValue()); painReviewDetailsVO.setDepth(form.cmbDepth().getValue()); MemberOfStaffShortVo memStaffShortVo = (MemberOfStaffShortVo)domain.getMosUser(); if(memStaffShortVo != null && memStaffShortVo.getHcp() != null) painReviewDetailsVO.setRecordingHCP(memStaffShortVo.getHcp()); painDetailsVO.setIsDiscontinuedAssess(new Boolean(form.chkDiscontinueAssessment().getValue())); //Set the Findings value back to the context form.getGlobalContext().COE.PainBodyChart.setAssessmentFinding(painDetailsVO); //Set the Review value back to the context form.getGlobalContext().COE.PainBodyChart.setPainAssReviewVO(painReviewDetailsVO); } return true; }
private void copyLastAssessment() { PainAssessment voPainAssessment = form.getGlobalContext().COE.PainBodyChart.getPainAssessmentVO(); PainAssessment newPainAssessment = new PainAssessment(); if (newPainAssessment.getClinicalContact() == null) newPainAssessment.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact()); if (newPainAssessment.getCareContext() == null) newPainAssessment.setCareContext(form.getGlobalContext().Core.getCurrentCareContext()); if (voPainAssessment.getSiteDetailsIsNotNull()) { PainAssessmentFindingsCollection voCollFindings = new PainAssessmentFindingsCollection(); for (int i = 0; i < voPainAssessment.getSiteDetails().size(); i++) { if (voPainAssessment.getSiteDetails().get(i).getIsDiscontinuedAssessIsNotNull() && !voPainAssessment.getSiteDetails().get(i).getIsDiscontinuedAssess().booleanValue()) { PainAssessmentFindings voFinding = voPainAssessment.getSiteDetails().get(i); //force copy of finding voFinding.setID_PainAssessmentFindings(null); if (voFinding.getPainAssessmentReviewIsNotNull()) { //force copy of reviews for(int j = 0; j < voFinding.getPainAssessmentReview().size(); j++) voFinding.getPainAssessmentReview().get(j).setID_PainAssessmentReview(null); } voCollFindings.add(voFinding); } } newPainAssessment.setSiteDetails(voCollFindings); } else newPainAssessment.setSiteDetails(null); form.getGlobalContext().COE.PainBodyChart.setPainAssessmentVO(newPainAssessment); }