private SkinAssessmentFindingsCollection copySkinAssessmentFindings(SkinAssessmentFindingsCollection skinAssessmentFindings) { if (skinAssessmentFindings == null) return null; for (int i = 0; i < skinAssessmentFindings.size(); i++) { SkinAssessmentFindings skinAssessmentFinding = skinAssessmentFindings.get(i); if (skinAssessmentFinding == null) continue; skinAssessmentFinding.clearIDAndVersion(); skinAssessmentFinding.setSkinAssessmentReview(copySkinAssessmentReview(skinAssessmentFinding.getSkinAssessmentReview())); } return skinAssessmentFindings; }
private void populateControls() { //Prepopulate Controls if(domain.getMosUser() != null) form.textBoxHCP().setValue(((MemberOfStaffShortVo)domain.getMosUser()).toString()); form.dateAssess().setValue(new Date()); form.timeAssess().setValue(new Time()); form.chkSkinIntact().setValue(false); //Save the previous Assessment form.getLocalContext().setPreviousSkinAssessment(form.getGlobalContext().COE.SkinBodyChart.getSkinAssessmentVO()); SkinAssessment skinAssVO = new SkinAssessment(); DrawingImageVersionVo drawingVO = new DrawingImageVersionVo(); //Set the Current Image Name & Version No drawingVO.setImageName(getCurrentImageName()); if(getCurrentVersionNumber() != null) drawingVO.setVersionNumber(getCurrentVersionNumber()); skinAssVO.setImageVersion(drawingVO); skinAssVO.setSkinAssessmentFindings(new SkinAssessmentFindingsCollection()); //Copy the previous Findings getPreviousFindings(skinAssVO); //Set back to the context the SkinAssVO form.getGlobalContext().COE.SkinBodyChart.setSkinAssessmentVO(skinAssVO); form.bNew().setEnabled(false); form.setMode(FormMode.EDIT); }
private void copyLastAssessment() { SkinAssessment voSkinAssessment = form.getGlobalContext().COE.SkinBodyChart.getSkinAssessmentVO(); SkinAssessment newSkinAssessment = new SkinAssessment(); if (newSkinAssessment.getClinicalContact() == null) newSkinAssessment.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact()); if (newSkinAssessment.getCareContext() == null) newSkinAssessment.setCareContext(form.getGlobalContext().Core.getCurrentCareContext()); if (voSkinAssessment.getSkinAssessmentFindingsIsNotNull()) { SkinAssessmentFindingsCollection voCollFindings = new SkinAssessmentFindingsCollection(); for (int i = 0; i < voSkinAssessment.getSkinAssessmentFindings().size(); i++) { if (voSkinAssessment.getSkinAssessmentFindings().get(i).getIsDiscontinuedAssessIsNotNull() && !voSkinAssessment.getSkinAssessmentFindings().get(i).getIsDiscontinuedAssess().booleanValue()) { SkinAssessmentFindings voFinding = voSkinAssessment.getSkinAssessmentFindings().get(i); //force copy of finding voFinding.setID_SkinAssessmentFindings(null); if (voFinding.getSkinAssessmentReviewIsNotNull()) { //force copy of reviews for(int j = 0; j < voFinding.getSkinAssessmentReview().size(); j++) voFinding.getSkinAssessmentReview().get(j).setID_SkinAssessmentReview(null); } voCollFindings.add(voFinding); } } newSkinAssessment.setSkinAssessmentFindings(voCollFindings); } else newSkinAssessment.setSkinAssessmentFindings(null); form.getGlobalContext().COE.SkinBodyChart.setSkinAssessmentVO(newSkinAssessment); }