private void populateGridResults(CarePlanWorklistVoCollection listCarePlans) { form.grdResult().getRows().clear(); if (listCarePlans == null || listCarePlans.size() == 0) return; for (int i = 0; i < listCarePlans.size(); i++) { CarePlanWorklistVo record = listCarePlans.get(i); if (record == null) continue; addCarePlanWorklistRow(record); } }
private void addCarePlanWorklistRow(CarePlanWorklistVo record) { if (record == null) return; // WDEV-15063 if (record.getPatient() == null || record.getCarePlan() == null) { return; } grdResultRow row = form.grdResult().getRows().newRow(); PatientIdCollection identifiers = record.getPatient().getIdentifiers(); for (int i = 0; i < identifiers.size(); i++) { if (identifiers.get(i).getType().equals(PatIdType.HOSPNUM)) row.setcolHospitalNo(identifiers.get(i).getValue().toString()); } row.setcolName(record.getPatient().getName().toString()); row.setTooltipForcolName(record.getPatient().getName().toString()); row.setcolDOB(record.getPatient().getDob()); if (record.getPatient().getWard() != null) { row.setcolWard(record.getPatient().getWard().getName()); row.setTooltipForcolWard(record.getPatient().getWard().getName()); } row.setcolCarePlan(record.getCarePlan().getTitle()); row.setTooltipForcolCarePlan(record.getCarePlan().getTitle()); row.setcolNextEvaluetionDate(record.getCarePlan().getNextEvaluationDate().toString()); if (record.getCarePlan().getConfirmedBy() != null) { row.setcolHCP(record.getCarePlan().getConfirmedBy().getName().toString()); row.setTooltipForcolHCP(record.getCarePlan().getConfirmedBy().getName().toString()); } row.setcolStatus(record.getCarePlan().getCurrentCarePlanStatus().getStatus().toString()); if (record.getCarePlan().getNextEvaluationDate().isLessThan(new Date())) { row.setBackColor(ims.configuration.gen.ConfigFlag.UI.CAREPLAN_WORKLIST_OVERDUE_COLOUR.getValue()); } else if (record.getCarePlan().getNextEvaluationDate().isGreaterOrEqualThan(new Date()) && record.getCarePlan().getNextEvaluationDate().isLessOrEqualThan((new Date()).addDay(ims.configuration.gen.ConfigFlag.DOM.CAREPLAN_WORKLIST_TO_BE_REVIEWED_RANGE.getValue()))) { row.setBackColor(ims.configuration.gen.ConfigFlag.UI.CAREPLAN_WORKLIST_DUE_COLOUR.getValue()); } row.setValue(record); }