public InvestigationsVoCollection listInvestigation(CareContextRefVo voCareContextRef) { if (voCareContextRef == null) throw new CodingRuntimeException("Care Context was not supplied. Mandatory argument"); DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" "); String query = "from Investigations t "; ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; hql.append(andStr + " t.careContext.id like :rcc"); markers.add("rcc"); values.add(voCareContextRef.getID_CareContext()); andStr = " and "; if (markers.size() > 0) query += " where "; query += hql.toString(); List investList = factory.find(query, markers, values); return InvestigationsVoAssembler.createInvestigationsVoCollectionFromInvestigations(investList); }
private void populateScreenFromData() { InvestigationsVoCollection voColl = new InvestigationsVoCollection(); form.grdInvestigations().getRows().clear(); clearScreen(); voColl = domain.listInvestigation((CareContextRefVo) form.recbrOPDInvestigations().getValue()); if (voColl == null || voColl.size() <= 0) return; GenForm.grdInvestigationsRow row = null; for(int i=0;i<voColl.size();i++) { InvestigationsVo voInvestigation = voColl.get(i); row = form.grdInvestigations().getRows().newRow(); row.setValue(voColl.get(i)); if(voInvestigation.getInvestigation() != null) row.setColInvestigation(voInvestigation.getInvestigation().toString()); if(voInvestigation.getDateComplete() != null) row.setColDateComplete(voInvestigation.getDateComplete()); if(voInvestigation.getDateResult() != null) row.setColDateResult(voInvestigation.getDateResult()); if(voInvestigation.getResultDetails() != null) row.setColResult(voInvestigation.getResultDetails().toString()); } }
public InvestigationsVoCollection listInvestigationsByCareContext(CareContextLiteVo voCareContext) { return listInvestigation(voCareContext); }