private EpisodeofCareShortVo updateEpisodeOfCareSpecialty(CatsReferralWizardVo catsReferralVo, ReferralLetterDetailsVo referralDetailsVo, DomainFactory factory) throws StaleObjectException { CareContextVo voCC = CareContextVoAssembler.create((CareContext) getDomainFactory().getDomainObject(CareContext.class, catsReferralVo.getCareContext().getID_CareContext())); ServiceVo voServ = ServiceVoAssembler.create((ims.core.clinical.domain.objects.Service) getDomainFactory().getDomainObject(ims.core.clinical.domain.objects.Service.class, referralDetailsVo.getService().getID_Service())); EpisodeOfCare doEOC = (EpisodeOfCare) factory.getDomainObject(EpisodeOfCare.class, voCC.getEpisodeOfCare().getID_EpisodeOfCare()); if (doEOC != null) { //WDEV-11535 - if referral service.specialty is null set it back to DAD Specialty spec = null; if(voServ.getSpecialty() == null) spec = Specialty.DAD; else spec = voServ.getSpecialty(); doEOC.setSpecialty(getDomLookup(spec)); factory.save(doEOC); return EpisodeofCareShortVoAssembler.create(doEOC); } return null; }
/** * Lists all Episode of Care records for the given patient */ public ims.core.vo.EpisodeofCareShortVoCollection listEpisodesForPatient(ims.core.patient.vo.PatientRefVo patient) { DomainFactory factory = getDomainFactory(); ArrayList<String> names = new ArrayList<String>(); ArrayList values = new ArrayList(); names.add("patient"); values.add(patient.getID_Patient()); List lst = factory.find("select epis from EpisodeOfCare epis join epis.careSpell cs left join epis.currentStatus as currentStatus where (cs.patient.id = :patient and (currentStatus is null or currentStatus.status.id <> -2218))", names, values); //WDEV-14326 if (lst != null && lst.size() > 0) return EpisodeofCareShortVoAssembler.createEpisodeofCareShortVoCollectionFromEpisodeOfCare(lst); return null; }
/** * WDEV-13261 * List EpisodeOfCare records for the given patient */ public EpisodeofCareShortVoCollection listEpisodesForPatient(PatientRefVo patient) { DomainFactory factory = getDomainFactory(); ArrayList<String> names = new ArrayList<String>(); ArrayList values = new ArrayList(); names.add("patient"); values.add(patient.getID_Patient()); List lst = factory.find("select epis from EpisodeOfCare epis join epis.careSpell cs left join epis.currentStatus as currentStatus where (cs.patient.id = :patient and (currentStatus is null or currentStatus.status.id <> -2218))", names, values); //WDEV-14326 if (lst != null && lst.size() > 0) return EpisodeofCareShortVoAssembler.createEpisodeofCareShortVoCollectionFromEpisodeOfCare(lst); return null; }
public ims.core.vo.EpisodeofCareShortVoCollection listEpisodeOfCare(ims.core.patient.vo.PatientRefVo patientRefvo) { DomainFactory factory = getDomainFactory(); String hql = "select eoc from EpisodeOfCare as eoc left join eoc.currentStatus as cs left join cs.status as st where eoc.careSpell.patient.id = " + patientRefvo.getID_Patient() + " and (cs is null or (cs is not null and st.id <> -2218 ))"; return EpisodeofCareShortVoAssembler.createEpisodeofCareShortVoCollectionFromEpisodeOfCare((factory.find(hql))).sort(); }
public ValueObjectRef getEpisodeOfCareForCareContext(ValueObjectRef refVo) { CareContext ctx = (CareContext)this.getDomainFactory().getDomainObject(CareContext.class, refVo.getBoId()); if (ctx == null) throw new DomainRuntimeException("Invalid CareContext refVo passed into getEpisodeOfCareForCareContext. "); EpisodeOfCare epis = (EpisodeOfCare)this.getDomainFactory().getDomainObject(EpisodeOfCare.class, ctx.getEpisodeOfCare().getId()); if (epis == null) throw new DomainRuntimeException("EpisodeOfCare not found for CareContext passed into getEpisodeOfCareForCareContext"); return EpisodeofCareShortVoAssembler.create(epis); }
public EpisodeofCareShortVoCollection listEpisodesOfCare(PatientRefVo patientId) { if (patientId == null || !patientId.getID_PatientIsNotNull()) { throw new CodingRuntimeException("Supplied patient is null or doesn't have an id."); } String hql = "select e1_1 from EpisodeOfCare as e1_1 left join e1_1.careSpell as c1_1 left join c1_1.patient as p1_1 where (p1_1.id = :Patient_id) order by e1_1.startDate desc ";//WDEV-12385 List<?> list = getDomainFactory().find(hql, "Patient_id", patientId.getID_Patient()); if (list == null || list.size() == 0) return null; return EpisodeofCareShortVoAssembler.createEpisodeofCareShortVoCollectionFromEpisodeOfCare(list); }
public ims.core.vo.EpisodeofCareShortVoCollection listEpisodesOfCare(ims.core.patient.vo.PatientRefVo patientId) { if (patientId == null || !patientId.getID_PatientIsNotNull()) { throw new CodingRuntimeException("Supplied patient is null or doesn't have an id."); } String hql = "select e1_1 from EpisodeOfCare as e1_1 left join e1_1.careSpell as c1_1 left join c1_1.patient as p1_1 where (p1_1.id = :Patient_id) order by e1_1.startDate desc "; List<?> list = getDomainFactory().find(hql, "Patient_id", patientId.getID_Patient()); if (list == null || list.size() == 0) return null; return EpisodeofCareShortVoAssembler.createEpisodeofCareShortVoCollectionFromEpisodeOfCare(list); }
public ims.core.vo.EpisodeofCareShortVoCollection listEpisodesOfCare(ims.core.patient.vo.PatientRefVo patientId) { if (patientId == null || !patientId.getID_PatientIsNotNull()) { throw new CodingRuntimeException("Supplied patient is null or doesn't have an id."); } String hql = "select e1_1 from EpisodeOfCare as e1_1 left join e1_1.careSpell as c1_1 left join c1_1.patient as p1_1 where (p1_1.id = :Patient_id) order by e1_1.startDate asc "; List<?> list = getDomainFactory().find(hql, "Patient_id", patientId.getID_Patient()); if (list == null || list.size() == 0) return null; return EpisodeofCareShortVoAssembler.createEpisodeofCareShortVoCollectionFromEpisodeOfCare(list); }
public EpisodeofCareShortVo getEpisodeOfCare(EpisodeOfCareRefVo episodeOfCareRef) { if(episodeOfCareRef == null || !episodeOfCareRef.getID_EpisodeOfCareIsNotNull()) return null; //WDEV-11721 return EpisodeofCareShortVoAssembler.create((EpisodeOfCare) getDomainFactory().getDomainObject(EpisodeOfCare.class, episodeOfCareRef.getID_EpisodeOfCare())); }
public EpisodeofCareShortVo getEpisodeOfCare(EpisodeOfCareRefVo episodeOfCare) { if(episodeOfCare == null || episodeOfCare.getID_EpisodeOfCare() == null) throw new CodingRuntimeException("Cannnot get EOC for a null Id."); return EpisodeofCareShortVoAssembler.create((EpisodeOfCare) getDomainFactory().getDomainObject(EpisodeOfCare.class, episodeOfCare.getID_EpisodeOfCare())); }
public ims.core.vo.EpisodeofCareShortVo getEpisodeOfCare(ims.core.admin.vo.EpisodeOfCareRefVo episodeOfCare) { if(episodeOfCare == null || episodeOfCare.getID_EpisodeOfCare() == null) throw new CodingRuntimeException("Cannnot get EOC for a null Id."); return EpisodeofCareShortVoAssembler.create((EpisodeOfCare) getDomainFactory().getDomainObject(EpisodeOfCare.class, episodeOfCare.getID_EpisodeOfCare())); }
public EpisodeofCareShortVo getEpisodeOfCare(EpisodeOfCareRefVo episodeRef) { if( episodeRef == null || episodeRef.getID_EpisodeOfCare() == null) throw new CodingRuntimeException("Cannot get Episode Of Care record for a null EpisodeOfCareRefVo"); return EpisodeofCareShortVoAssembler.create((EpisodeOfCare) getDomainFactory().getDomainObject(EpisodeOfCare.class, episodeRef.getID_EpisodeOfCare())); }
public EpisodeofCareShortVoCollection listEpisodeOfCaresByPatient(PatientRefVo patientVo) { if(patientVo == null) throw new DomainRuntimeException("Invalid Argument: Patient not provided"); DomainFactory factory = getDomainFactory(); return EpisodeofCareShortVoAssembler.createEpisodeofCareShortVoCollectionFromEpisodeOfCare( factory.find("from EpisodeOfCare epis where epis.careSpell.patient.id = :PID", new String[] {"PID"}, new Object[] {patientVo.getID_Patient()})).sort(); }
public String getSpecialtyForCareContext(CareContextRefVo careContext) { if(careContext == null || careContext.getID_CareContext() == null) throw new CodingRuntimeException("CareContext is null or id not provided for getSpecialtyForCareContext"); DomainFactory factory = getDomainFactory(); List dischargeDetails = factory.find("select eoc from EpisodeOfCare as eoc left join eoc.careContexts as cc where cc.id = :idCareContext", new String[]{"idCareContext"}, new Object[]{careContext.getID_CareContext()}); EpisodeofCareShortVoCollection eocVos = EpisodeofCareShortVoAssembler.createEpisodeofCareShortVoCollectionFromEpisodeOfCare(dischargeDetails); return eocVos != null && eocVos.size() > 0 ? ((eocVos.get(0) != null && eocVos.get(0).getSpecialtyIsNotNull()) ? eocVos.get(0).getSpecialty().toString() : "") : ""; }
public HcpRefVo getResponsibleHCPForCareContext(CareContextRefVo careContext) { if(careContext == null || careContext.getID_CareContext() == null) throw new CodingRuntimeException("CareContext is null or id not provided for getResponsibleHCPForCareContext"); DomainFactory factory = getDomainFactory(); List dischargeDetails = factory.find("select eoc from EpisodeOfCare as eoc left join eoc.careContexts as cc where cc.id = :idCareContext", new String[]{"idCareContext"}, new Object[]{careContext.getID_CareContext()}); EpisodeofCareShortVoCollection eocVos = EpisodeofCareShortVoAssembler.createEpisodeofCareShortVoCollectionFromEpisodeOfCare(dischargeDetails); return eocVos != null && eocVos.size() > 0 ? ((eocVos.get(0) != null && eocVos.get(0).getResponsibleHCPIsNotNull()) ? eocVos.get(0).getResponsibleHCP() : null) : null; }
public EpisodeofCareShortVo getEpisodeofCareShortVo(EpisodeOfCareRefVo episode) { if( episode == null ) return null; return EpisodeofCareShortVoAssembler.create((EpisodeOfCare)getDomainFactory().getDomainObject(EpisodeOfCare.class, episode.getID_EpisodeOfCare())); }
public EpisodeofCareShortVo getEpisodeOfCareShort(EpisodeOfCareRefVo episodeRef) { if (episodeRef == null) return null; DomainFactory factory = getDomainFactory(); return EpisodeofCareShortVoAssembler.create((EpisodeOfCare) factory.getDomainObject(EpisodeOfCare.class, episodeRef.getID_EpisodeOfCare())); }
/** * Function used to retrieve Episode Of Care (ShortVo) record */ public EpisodeofCareShortVo getEpisodeOfCare(EpisodeOfCareRefVo episodeOfCare) { if (episodeOfCare == null || !episodeOfCare.getID_EpisodeOfCareIsNotNull()) return null; return EpisodeofCareShortVoAssembler.create((EpisodeOfCare) getDomainFactory().getDomainObject(EpisodeOfCare.class, episodeOfCare.getID_EpisodeOfCare())); }
public EpisodeofCareShortVo getEpisodeOfCareShort(EpisodeOfCareRefVo episodeRef) { if(episodeRef == null) return null; DomainFactory factory = getDomainFactory(); return EpisodeofCareShortVoAssembler.create((EpisodeOfCare)factory.getDomainObject(EpisodeOfCare.class, episodeRef.getID_EpisodeOfCare())); }
public EpisodeofCareShortVo getEpisodeOfCare(EpisodeOfCareRefVo episodeRefVo) { if (episodeRefVo == null || episodeRefVo.getID_EpisodeOfCare() == null) { throw new CodingRuntimeException("Cannot get EpisodeOfCareRefVo on null Id "); } DomainFactory factory = getDomainFactory(); EpisodeOfCare domainEpisodeOfCare = (EpisodeOfCare) factory.getDomainObject(EpisodeOfCare.class, episodeRefVo.getID_EpisodeOfCare()); return EpisodeofCareShortVoAssembler.create(domainEpisodeOfCare); }