private void populateScreenFromData(WheelchairAssessmentVo voWheelchairAssessment) { form.getLocalContext().setWheelchairAssessmentVo(voWheelchairAssessment); if(voWheelchairAssessment.getAuthoringCPIsNotNull()){ form.qmbHCP().newRow(voWheelchairAssessment.getAuthoringCP(), voWheelchairAssessment.getAuthoringCP().getName().toString()); form.qmbHCP().setValue(voWheelchairAssessment.getAuthoringCP()); } if(voWheelchairAssessment.getAuthoringDateTimeIsNotNull()) form.dtimRecording().setValue(voWheelchairAssessment.getAuthoringDateTime()); form.cmbChairType().setValue(voWheelchairAssessment.getChairTypeIsNotNull() ? voWheelchairAssessment.getChairType() : null); cmbChairTypeValueChanged(); boolean lkupFound; GenForm.grdSurfaceRow rowSurface; form.grdSurface().getRows().clear(); if(voWheelchairAssessment.getSurfaceDistanceIsNotNull()) for (int i = 0; i< voWheelchairAssessment.getSurfaceDistance().size(); i++) { WheelchairSurfaceDistanceVo voSurfaceDistance = voWheelchairAssessment.getSurfaceDistance().get(i); rowSurface = form.grdSurface().getRows().newRow(); rowSurface.setColSurface(voSurfaceDistance.getSurface()); if(voSurfaceDistance.getDistanceIsNotNull()) rowSurface.setColDistance(voSurfaceDistance.getDistance()); } populateWheelchairAssessment(voWheelchairAssessment); GenForm.grdSkillsRow rowSkills; if(voWheelchairAssessment.getWheelchairSkillsAssessIsNotNull()) for (int i = 0; i< voWheelchairAssessment.getWheelchairSkillsAssess().size(); i++) { WheelchairSkillsAssessmentVo voWheelchairSkills = voWheelchairAssessment.getWheelchairSkillsAssess().get(i); lkupFound = false; for(int j=0; j<form.grdSkills().getRows().size(); j++){ rowSkills = form.grdSkills().getRows().get(j); if(rowSkills.getColWheelchairSkills().equals(voWheelchairSkills.getWheelchairSkill())){ if(voWheelchairSkills.getWheelchairSkillAssLevelIsNotNull()){ if(voWheelchairSkills.getWheelchairSkillAssLevel().equals(WheelchairSkillAssessedLevel.CONTINUOUSLYGOOD)) rowSkills.setColContgood(true); else if(voWheelchairSkills.getWheelchairSkillAssLevel().equals(WheelchairSkillAssessedLevel.FAIR)) rowSkills.setColFair(true); else if(voWheelchairSkills.getWheelchairSkillAssLevel().equals(WheelchairSkillAssessedLevel.POOR)) rowSkills.setColPoor(true); } lkupFound = true; } } if(!lkupFound){ rowSkills = form.grdSkills().getRows().newRow(); rowSkills.setColWheelchairSkills(voWheelchairSkills.getWheelchairSkill()); if(voWheelchairSkills.getWheelchairSkillAssLevelIsNotNull()){ if(voWheelchairSkills.getWheelchairSkillAssLevel().equals(WheelchairSkillAssessedLevel.CONTINUOUSLYGOOD)) rowSkills.setColContgood(true); else if(voWheelchairSkills.getWheelchairSkillAssLevel().equals(WheelchairSkillAssessedLevel.FAIR)) rowSkills.setColFair(true); else if(voWheelchairSkills.getWheelchairSkillAssLevel().equals(WheelchairSkillAssessedLevel.POOR)) rowSkills.setColPoor(true); } } } }
private WheelchairAssessmentVo populateDataFromScreem(WheelchairAssessmentVo voWheelchairAssessment) { if(voWheelchairAssessment.getClinicalContact()==null) voWheelchairAssessment.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact()); voWheelchairAssessment.setAuthoringCP(form.qmbHCP().getValue()); if(form.dtimRecording().getValue() == null || form.dtimRecording().getValue().getDate()==null){ engine.showMessage("Please enter Date and Time."); return null; } if(form.dtimRecording().getValue().getTime()==null){ engine.showMessage("Please enter Time."); return null; } voWheelchairAssessment.setAuthoringDateTime(form.dtimRecording().getValue()); voWheelchairAssessment.setChairType(form.cmbChairType().getValue()); WheelchairSurfaceDistanceVoCollection collSurfaceDistance = new WheelchairSurfaceDistanceVoCollection(); GenForm.grdSurfaceRow rowSurface = null; for (int i = 0; i< form.grdSurface().getRows().size(); i++) { rowSurface = form.grdSurface().getRows().get(i); WheelchairSurfaceDistanceVo voSurfaceDistance = new WheelchairSurfaceDistanceVo(); voSurfaceDistance.setSurface(rowSurface.getColSurface()); voSurfaceDistance.setDistance(rowSurface.getColDistance()); collSurfaceDistance.add(voSurfaceDistance); } voWheelchairAssessment.setSurfaceDistance(collSurfaceDistance); PowerchairSkillsAssessmentVoCollection collPowerchairSkillsAssess = new PowerchairSkillsAssessmentVoCollection(); GenForm.grdPowechairRow rowPowerchair = null; for (int i = 0; i< form.grdPowechair().getRows().size(); i++) { rowPowerchair = form.grdPowechair().getRows().get(i); PowerchairSkillsAssessmentVo voPowerchairSkills = new PowerchairSkillsAssessmentVo(); voPowerchairSkills.setPowerchairSkill(rowPowerchair.getColPowerchairskills()); if(rowPowerchair.getColIndependent()) voPowerchairSkills.setPowerchairSkillAssLevel(PowerchairSkillAssessedLevel.INDEPENDENT); else if(rowPowerchair.getColSupervision()) voPowerchairSkills.setPowerchairSkillAssLevel(PowerchairSkillAssessedLevel.SUPERVISION); else if(rowPowerchair.getColUnsafe()) voPowerchairSkills.setPowerchairSkillAssLevel(PowerchairSkillAssessedLevel.SAFE); collPowerchairSkillsAssess.add(voPowerchairSkills); } voWheelchairAssessment.setPowerchairSkillsAssess(collPowerchairSkillsAssess); WheelchairSkillsAssessmentVoCollection collWheelchairSkills = new WheelchairSkillsAssessmentVoCollection(); GenForm.grdSkillsRow rowSkills = null; for (int i = 0; i< form.grdSkills().getRows().size(); i++) { rowSkills = form.grdSkills().getRows().get(i); WheelchairSkillsAssessmentVo voWheelchairSkills = new WheelchairSkillsAssessmentVo(); voWheelchairSkills.setWheelchairSkill(rowSkills.getColWheelchairSkills()); if(rowSkills.getColContgood()) voWheelchairSkills.setWheelchairSkillAssLevel(WheelchairSkillAssessedLevel.CONTINUOUSLYGOOD); else if(rowSkills.getColPoor()) voWheelchairSkills.setWheelchairSkillAssLevel(WheelchairSkillAssessedLevel.POOR); else if(rowSkills.getColFair()) voWheelchairSkills.setWheelchairSkillAssLevel(WheelchairSkillAssessedLevel.FAIR); collWheelchairSkills.add(voWheelchairSkills); } voWheelchairAssessment.setWheelchairSkillsAssess(collWheelchairSkills); return voWheelchairAssessment; }