/** * 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; }
/** * saveClinicalAdmission */ public ims.nursing.vo.ClinicalAdmissionVo saveClinicalAdmission(ims.nursing.vo.ClinicalAdmissionVo clinAdmVo) throws ims.domain.exceptions.DomainInterfaceException, ims.domain.exceptions.StaleObjectException,ims.domain.exceptions.UniqueKeyViolationException { if(clinAdmVo == null) throw new CodingRuntimeException("ClinicalAdmissionVo is null"); if(!clinAdmVo.isValidated()) throw new CodingRuntimeException("ClinicalAdmissionVo Value Object has not been validated"); DomainFactory factory = getDomainFactory(); ClinicalAdmission doCA = ClinicalAdmissionVoAssembler.extractClinicalAdmission(factory, clinAdmVo); factory.save(doCA); return ClinicalAdmissionVoAssembler.create(doCA); }
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; }
public ClinicalAdmissionVo getClinicalAdmissionById(ClinicalAdmissionRefVo clinicalAdmissionId) { if (clinicalAdmissionId == null || clinicalAdmissionId.getID_ClinicalAdmission()== null) { throw new CodingRuntimeException("Cannot get ClinicalAdmissionRefVo on null Id "); } DomainFactory factory = getDomainFactory(); ClinicalAdmission domainClinicalAdmission = (ClinicalAdmission) factory.getDomainObject(ClinicalAdmission.class, clinicalAdmissionId.getID_ClinicalAdmission()); return ClinicalAdmissionVoAssembler.create(domainClinicalAdmission); }