private void populateListControl(MUSTVoCollection voMUSTColl) { clear(); if(voMUSTColl == null) return; for(int i=0; i<voMUSTColl.size(); i++) { MUSTVo voMUST = voMUSTColl.get(i); GenForm.grdDetailsRow row = form.grdDetails().getRows().newRow(); if(voMUST.getAuthoringInformationIsNotNull()) row.setColDateTime(voMUST.getAuthoringInformation().getAuthoringDateTime().toString()+" - "+ voMUST.getAuthoringInformation().getAuthoringHcp().toString()); if(voMUST.getBMIScoreIsNotNull()) row.setColStep1(voMUST.getBMIScore().toString()); if(voMUST.getUWLScoreIsNotNull()) row.setColStep2(voMUST.getUWLScore().toString()); if(voMUST.getADEScoreIsNotNull()) row.setColStep3(voMUST.getADEScore().toString()); if(voMUST.getORMScoreIsNotNull()) row.setColTotal(voMUST.getORMScore().toString()); if(voMUST.getManagementIsNotNull()) row.setColManagement(voMUST.getManagement().toString()); row.setColAction(voMUST.getActionTaken()); row.setTooltipForColAction(voMUST.getActionTakenIsNotNull()? voMUST.getActionTaken():""); row.setValue(voMUST); if(voMUST.getManagement().equals(MUSTManagement.HIGHRISK)) row.setTextColor(Color.Red); } }
public MUSTVoCollection listMUSTByCareContext(CareContextRefVo voCareContextRef) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" "); String query = "from MUST m "; ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; if (voCareContextRef != null) { hql.append(andStr + " m.careContext.id = :id_CareContext"); markers.add("id_CareContext"); values.add(voCareContextRef.getID_CareContext()); andStr = " and "; } if (markers.size() > 0) query += " where "; query += hql.toString(); List must = factory.find(query, markers, values); MUSTVoCollection collMUSTVo = MUSTVoAssembler.createMUSTVoCollectionFromMUST(must); if(collMUSTVo != null) return collMUSTVo.sort(); return null; }
public MUSTVo getLastComplementedMustRecord(CareContextRefVo voCareContextRef) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer("from MUST m "); ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; if (voCareContextRef != null) { hql.append(" where "); hql.append(andStr + " m.careContext.id = :id_CareContext"); markers.add("id_CareContext"); values.add(voCareContextRef.getID_CareContext()); andStr = " and "; } hql.append(" order by m.authoringInformation.authoringDateTime desc "); List list = factory.find(hql.toString(), markers, values); //Get only the first record (to optimise the work of the assembler) if(list != null && list.size() > 1) { Object firstItem = list.get(0); list.removeAll(list); list.add(firstItem); } MUSTVoCollection collMUSTVo = MUSTVoAssembler.createMUSTVoCollectionFromMUST(list); if (collMUSTVo != null && collMUSTVo.size() > 0) return collMUSTVo.get(0); return null; }