/** * get clinical admission */ public ims.nursing.vo.ClinicalAdmissionVo getClinicalAdmission(ims.core.admin.vo.CareContextRefVo careContextRefvo) { if(careContextRefvo == null) throw new CodingRuntimeException("careContextRefVo Filter not provided for list call. "); if(careContextRefvo != null) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" from ClinicalAdmission ca where "); String andStr = " "; ArrayList<String> markers = new ArrayList<String>(); ArrayList<Serializable> values = new ArrayList<Serializable>(); hql.append(andStr + " ca.careContext.id = :careContextId"); markers.add("careContextId"); values.add(careContextRefvo.getID_CareContext()); andStr = " and "; List list = factory.find(hql.toString(), markers,values); if(list != null && list.size() > 0) { ClinicalAdmissionVoCollection voColl = ClinicalAdmissionVoAssembler.createClinicalAdmissionVoCollectionFromClinicalAdmission(list); if(voColl != null && voColl.size() > 0) return voColl.get(0); } } return null; }
public ClinicalAdmissionVo getPreviousClinicalAdmission(Integer patientId) { if(patientId == null) return null; if(patientId != null) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" select c1_1 from ClinicalAdmission as c1_1 left join c1_1.careContext as c2_1 left join c2_1.episodeOfCare as e1_1 left join e1_1.careSpell as c3_1 left join c3_1.patient as p1_1 where(c3_1.patient.id = :PID) order by c1_1.authoringInformation.authoringDateTime desc "); ArrayList<String> markers = new ArrayList<String>(); ArrayList<Serializable> values = new ArrayList<Serializable>(); markers.add("PID"); values.add(patientId); //List list = factory.find(hql.toString(), markers,values,1); List list = factory.find(hql.toString(), markers,values); if(list != null && list.size() > 0) { ClinicalAdmissionVoCollection voColl = ClinicalAdmissionVoAssembler.createClinicalAdmissionVoCollectionFromClinicalAdmission(list); if(voColl != null && voColl.size() > 0) return voColl.get(0); } } return null; }