public ims.core.vo.CareSpellVoCollection listCareSpellsByPatient(ims.core.patient.vo.PatientRefVo patientRefVo, Date careContextDate) { if(patientRefVo == null || patientRefVo.getID_Patient() == null) throw new CodingRuntimeException("Patient not provided"); DomainFactory factory = getDomainFactory(); List<?> careSpells = null; if(careContextDate != null) careSpells = factory.find("select careSpell from CareSpell as careSpell left join careSpell.episodes as epis left join epis.careContexts as cc where (cc.startDateTime >= :ccStartDate and careSpell.patient.id = :idPatient)", new String[] {"ccStartDate","idPatient"}, new Object[] { careContextDate.getDate(), patientRefVo.getID_Patient()}); else careSpells = factory.find("from CareSpell as careSpell where careSpell.patient.id = :idPatient", new String[] {"idPatient"}, new Object[] { patientRefVo.getID_Patient()}); if (careSpells != null && careSpells.size() > 0) return CareSpellVoAssembler.createCareSpellVoCollectionFromCareSpell(careSpells).sort(SortOrder.DESCENDING); return null; }
private Integer getPatientId(CareContextRefVo voCurrentCareContext) { DomainFactory factory = getDomainFactory(); CareContext doCareContext = (CareContext)factory.getDomainObject(CareContext.class, voCurrentCareContext.getID_CareContext()); CareContextVo voCareContext = CareContextVoAssembler.create(doCareContext); CareSpell doCareSpell = (CareSpell)factory.getDomainObject(CareSpell.class, voCareContext.getEpisodeOfCare().getCareSpell().getID_CareSpell()); CareSpellVo voCareSpell = CareSpellVoAssembler.create(doCareSpell); return voCareSpell.getPatient().getID_Patient(); }
private Integer getPatientId(CareContextRefVo voCurrentCareContext) { DomainFactory factory = getDomainFactory(); CareContext doCareContext = (CareContext) factory.getDomainObject(CareContext.class, voCurrentCareContext.getID_CareContext()); CareContextVo voCareContext = CareContextVoAssembler.create(doCareContext); CareSpell doCareSpell = (CareSpell) factory.getDomainObject(CareSpell.class, voCareContext.getEpisodeOfCare().getCareSpell().getID_CareSpell()); CareSpellVo voCareSpell = CareSpellVoAssembler.create(doCareSpell); return voCareSpell.getPatient().getID_Patient(); }
public CareSpellVoCollection listCareSpellsByPatient(PatientRefVo patientRefVo) { if(patientRefVo == null || patientRefVo.getID_Patient() == null) throw new CodingRuntimeException("Patient not provided"); DomainFactory factory = getDomainFactory(); List careSpells = factory.find("from CareSpell careSpell where careSpell.patient.id = :idPatient", new String[] {"idPatient"}, new Object[] {patientRefVo.getID_Patient()}); if (careSpells != null && careSpells.size() > 0) return CareSpellVoAssembler.createCareSpellVoCollectionFromCareSpell(careSpells).sort(SortOrder.DESCENDING); return null; }
public CareSpellVo saveCareSpell(CareSpellVo voCareSpell) throws StaleObjectException { if (voCareSpell == null || !voCareSpell.isValidated()) throw new CodingRuntimeException("Care Spell is null or has not been validated"); DomainFactory factory = getDomainFactory(); CareSpell doCareSpell = CareSpellVoAssembler.extractCareSpell(factory, voCareSpell); //WDEV-10231 - add any new cc status record to the history maintainCareContextStatusHistory(doCareSpell); factory.save(doCareSpell); return CareSpellVoAssembler.create(doCareSpell); }
public CareSpellVo getCareSpellByEpisodeOfCare(Integer id) { if(id == null) throw new CodingRuntimeException("Patient not provided"); DomainFactory factory = getDomainFactory(); String hsql = "select cs from EpisodeOfCare as eoc left join eoc.careSpell as cs"; hsql += " where eoc.id = :id"; List careSpell = factory.find(hsql, new String[] {"id"}, new Object[] {id.intValue()}); return CareSpellVoAssembler.createCareSpellVoCollectionFromCareSpell(careSpell).get(0); }
public CareSpellVo saveCareSpell(CareSpellVo voCareSpell) throws StaleObjectException { if (voCareSpell == null || !voCareSpell.isValidated()) throw new CodingRuntimeException("Care Spell is null or has not been validated"); DomainFactory factory = getDomainFactory(); CareSpell doCareSpell = CareSpellVoAssembler.extractCareSpell(factory, voCareSpell); factory.save(doCareSpell); return CareSpellVoAssembler.create(doCareSpell); }
public CareSpellVoCollection listCareSpellsByPatient(PatientRefVo patientRefVo) { if (patientRefVo == null || patientRefVo.getID_Patient() == null) throw new CodingRuntimeException("Patient not provided"); DomainFactory factory = getDomainFactory(); List careSpells = factory.find("from CareSpell careSpell where careSpell.patient.id = :idPatient", new String[] { "idPatient" }, new Object[] { patientRefVo.getID_Patient() }); if (careSpells != null && careSpells.size() > 0) return CareSpellVoAssembler.createCareSpellVoCollectionFromCareSpell(careSpells).sort(SortOrder.DESCENDING); return null; }
public CareSpellVo getCareSpellById(CareSpellRefVo careSpellRef) { if (careSpellRef == null) return null; DomainFactory factory = getDomainFactory(); return CareSpellVoAssembler.create((CareSpell) factory.getDomainObject(CareSpell.class, careSpellRef.getID_CareSpell())); }
public CareSpellVo getCareSpellById(CareSpellRefVo careSpellRef) { if(careSpellRef == null) return null; DomainFactory factory = getDomainFactory(); return CareSpellVoAssembler.create((CareSpell)factory.getDomainObject(CareSpell.class, careSpellRef.getID_CareSpell())); }