public ClinicalContactShortVoCollection listClinicalContact(CareContextRefVo careContext) { if(careContext == null || !careContext.getID_CareContextIsNotNull()) { throw new CodingRuntimeException("Supplied Care Context is null or doesn't have an id."); } String hql = "from ClinicalContact as c where c.careContext.id = :cc order by c.startDateTime desc ";//WDEV-12385 List<?> list = getDomainFactory().find(hql, "cc", careContext.getID_CareContext()); if (list == null || list.size() == 0) return null; return ClinicalContactShortVoAssembler.createClinicalContactShortVoCollectionFromClinicalContact(list); }
public ClinicalContactShortVoCollection listClinicalContactsByCareContext(CareContextRefVo refCareContext) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" "); String query = "from ClinicalContact cc "; ArrayList<String> markers = new ArrayList<String>(); ArrayList<Integer> values = new ArrayList<Integer>(); String andStr = " "; if (refCareContext != null) { hql.append(andStr + " cc.careContext.id = :id_CareContext"); markers.add("id_CareContext"); values.add(refCareContext.getID_CareContext()); andStr = " and "; } if (markers.size() > 0) query += " where "; query += hql.toString(); List contacts = factory.find(query, markers, values); return ClinicalContactShortVoAssembler.createClinicalContactShortVoCollectionFromClinicalContact(contacts); }
public ClinicalContactShortVoCollection listClinicalContactsByCareContext(CareContextRefVo refCareContext) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" "); String query = "from ClinicalContact cc "; ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; if (refCareContext != null) { hql.append(andStr + " cc.careContext.id = :id_CareContext"); markers.add("id_CareContext"); values.add(refCareContext.getID_CareContext()); andStr = " and "; } if (markers.size() > 0) query += " where "; query += hql.toString(); List contacts = factory.find(query, markers, values); return ClinicalContactShortVoAssembler.createClinicalContactShortVoCollectionFromClinicalContact(contacts); }
public ClinicalContactShortVo getClinicalContactShort(ClinicalContactRefVo clinicacalContactRefVo) { if (clinicacalContactRefVo == null) return null; ClinicalContact doClinicalContact = (ClinicalContact) getDomainFactory().getDomainObject(ClinicalContact.class, clinicacalContactRefVo.getID_ClinicalContact()); return ClinicalContactShortVoAssembler.create(doClinicalContact); }
public ClinicalContactShortVo getClinicalContact(ClinicalContactRefVo clinicalContactRef) { if (clinicalContactRef == null || !clinicalContactRef.getID_ClinicalContactIsNotNull()) return null; return ClinicalContactShortVoAssembler.create((ClinicalContact) getDomainFactory().getDomainObject(ClinicalContact.class, clinicalContactRef.getID_ClinicalContact())); }
public ClinicalContactShortVoCollection listClinicalContacts(CareContextRefVo careContext) { DomainFactory factory = getDomainFactory(); CareContext cc = (CareContext) factory.getDomainObject(CareContext.class, careContext.getID_CareContext()); return ClinicalContactShortVoAssembler.createClinicalContactShortVoCollectionFromClinicalContact( cc.getClinicalContacts()).sort(); }
public ClinicalContactShortVo saveClinicalContact(ClinicalContactShortVo clinicalContact) throws StaleObjectException { if (clinicalContact == null || !clinicalContact.isValidated()) throw new CodingRuntimeException("ClinicalContact is null or has not been validated"); DomainFactory factory = getDomainFactory(); ClinicalContact doClinicalContact = ClinicalContactShortVoAssembler.extractClinicalContact(factory, clinicalContact); // WDEV-10231 - add any new status record to history if (doClinicalContact != null && doClinicalContact.getCurrentStatus().getId() == null) doClinicalContact.getStatusHistory().add(doClinicalContact.getCurrentStatus()); factory.save(doClinicalContact); return ClinicalContactShortVoAssembler.create(doClinicalContact); }
public ClinicalContactShortVo getClinicalContact(ClinicalContactRefVo clinicalContactRefVo) { if (clinicalContactRefVo == null) return null; DomainFactory factory = getDomainFactory(); ClinicalContact doClinContact = (ClinicalContact)factory.getDomainObject(ClinicalContact.class, clinicalContactRefVo.getID_ClinicalContact()); return ClinicalContactShortVoAssembler.create(doClinContact); }
/** * Function used to retrieve Clinical Contact (ShortVo) record */ public ClinicalContactShortVo getClinicalContact(ClinicalContactRefVo clinicalContact) { if (clinicalContact == null || !clinicalContact.getID_ClinicalContactIsNotNull()) return null; return ClinicalContactShortVoAssembler.create((ClinicalContact) getDomainFactory().getDomainObject(ClinicalContact.class, clinicalContact.getID_ClinicalContact())); }
public ClinicalContactShortVo saveClinicalContact(ClinicalContactShortVo clinicalContact) throws StaleObjectException { if (clinicalContact == null || !clinicalContact.isValidated()) throw new CodingRuntimeException("ClinicalContact is null or has not been validated"); DomainFactory factory=getDomainFactory(); ClinicalContact doClinicalContact = ClinicalContactShortVoAssembler.extractClinicalContact(factory, clinicalContact); //WDEV-10231 - add any new status record to history if(doClinicalContact != null && doClinicalContact.getCurrentStatus().getId() == null) doClinicalContact.getStatusHistory().add(doClinicalContact.getCurrentStatus()); factory.save(doClinicalContact); return ClinicalContactShortVoAssembler.create(doClinicalContact); }
public ClinicalContactShortVo saveClinicalContact(ClinicalContactShortVo clinicalContactVo) throws StaleObjectException { if(clinicalContactVo != null && clinicalContactVo.isValidated() == false) throw new DomainRuntimeException("clinicalContactVo has not been validated"); DomainFactory factory = getDomainFactory(); ClinicalContact doClinContact; doClinContact = ClinicalContactShortVoAssembler.extractClinicalContact(factory, clinicalContactVo); factory.save(doClinContact); return ClinicalContactShortVoAssembler.create(doClinContact); }