private void populateScreen() { DateTime now = new DateTime(new Date(), new Time()); //Prepopulate Controls---------------------------------------------------- if(domain.getMosUser() != null) form.txtBoxHCP().setValue(((MemberOfStaffShortVo)domain.getMosUser()).toString()); form.dteAssessment().setValue(new Date()); form.timAssessment().setValue(new Time()); form.dteRecording().setValue(new Date()); form.timRecording().setValue(new Time()); //------------------------------------------------------------------------- //Save previous PainAssessment form.getLocalContext().setPreviousPainAssessment(form.getGlobalContext().COE.PainBodyChart.getPainAssessmentVO()); PainAssessment painAssessmentVO = new PainAssessment(); painAssessmentVO.setAssessmentDateTime(now); painAssessmentVO.setDateTimeInitiated(now); Object hcpLite = domain.getHcpLiteUser(); painAssessmentVO.setHcpInitiated(hcpLite != null ? ((HcpLiteVo)hcpLite) : null); painAssessmentVO.setSiteDetails(new PainAssessmentFindingsCollection()); DrawingImageVersionVo versionNoVo = new DrawingImageVersionVo(); versionNoVo.setImageName(getCurrentImageName()); if(getCurrentVersionNumber() != null) versionNoVo.setVersionNumber(getCurrentVersionNumber()); painAssessmentVO.setImageVersion(versionNoVo); //Copy the previous Active(Not Discontinued) Findings copyPreviousFindings(painAssessmentVO); //Add a new VO form.getGlobalContext().COE.PainBodyChart.setPainAssessmentVO(painAssessmentVO); }
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); }