private void populateScreenWithTreatmentInfo() { MRSAAssessmentVo voMRSA = form.cmbScreeningRecords().getValue(); updateControlStatus(); if (voMRSA == null) return; MRSATreatmentVo voTreatment = voMRSA.getTreatment(); if (voTreatment == null) return; form.dteRescreen().setValue(voTreatment.getRescreenDate()); form.dteStart().setValue(voTreatment.getStartDate()); form.intTreatmentNumber().setValue(voTreatment.getTreatmentNumber()); if (voTreatment.getStartDate() != null) try { onDteStartValueChanged(); } catch (PresentationLogicException e) { } MRSATreatmentDetailsVoCollection voTreatmentDetailColl = new MRSATreatmentDetailsVoCollection(); if (voTreatment != null && voTreatment.getTreatmentDetails() != null) voTreatmentDetailColl = voTreatment.getTreatmentDetails(); for(int z =0; z<voTreatmentDetailColl.size(); z++) { MRSATreatmentDetailsVo voTreatmentDetail = voTreatmentDetailColl.get(z); int i=0; for(i=0; i<form.grdEdit().getRows().size(); i++) { GenForm.grdEditRow row = form.grdEdit().getRows().get(i); if(voTreatmentDetail.getTreatment()!= null && row.getColTreatment() != null) { if(row.getColTreatment().equals(voTreatmentDetail.getTreatment())) { setGridEditRowData(voTreatmentDetail, row); break; } } } if(i == form.grdEdit().getRows().size()) { grdEditRow newRow = form.grdEdit().getRows().newRow(); newRow.setColTreatment(voTreatmentDetail.getTreatment()); setGridEditRowData(voTreatmentDetail, newRow); } } }
/** * @param arrDates * @param voTreatmentDetail * @param row */ private void setGridEditRowData(MRSATreatmentDetailsVo voTreatmentDetail, GenForm.grdEditRow row) { Date[] arrDates = getDateArray(); String strTooltip; row.setValue(voTreatmentDetail); for(int t=0; t<voTreatmentDetail.getDailyTreatment().size(); t++) { MRSADailyTreatmentVo voDailyTreatment = voTreatmentDetail.getDailyTreatment().get(t); DateTime creationDateTime = voDailyTreatment.getTreatmentDateTime(); if (voDailyTreatment.getDay().toString().equals(arrDates[0].toString())) //equals(arrDates[0]) { row.setColDay1(true); strTooltip = prepareToolTip(voDailyTreatment, creationDateTime); row.setTooltipForColDay1(strTooltip); row.setColDay1_Value(voDailyTreatment); } if (voDailyTreatment.getDay().toString().equals(arrDates[1].toString())) { row.setColDay2(true); strTooltip = prepareToolTip(voDailyTreatment, creationDateTime); row.setTooltipForColDay2(strTooltip); row.setColDay2_Value(voDailyTreatment); } if (voDailyTreatment.getDay().toString().equals(arrDates[2].toString())) { row.setColDay3(true); strTooltip = prepareToolTip(voDailyTreatment, creationDateTime); row.setTooltipForColDay3(strTooltip); row.setColDay3_Value(voDailyTreatment); } if (voDailyTreatment.getDay().toString().equals(arrDates[3].toString())) { row.setColDay4(true); strTooltip = prepareToolTip(voDailyTreatment, creationDateTime); row.setTooltipForColDay4(strTooltip); row.setColDay4_Value(voDailyTreatment); } if (voDailyTreatment.getDay().toString().equals(arrDates[4].toString())) { row.setColDay5(true); strTooltip = prepareToolTip(voDailyTreatment, creationDateTime); row.setTooltipForColDay5(strTooltip); row.setColDay5_Value(voDailyTreatment); } } row.setColDay6("No Tx"); row.setColDay7("No Tx"); row.setColDay8("No Tx - Rescreen"); }