public PatientProblemVoCollection listPatientProblemsByCareContext(CareContextRefVo careContext) { if(careContext == null || careContext.getID_CareContext() == null) throw new CodingRuntimeException("No Care context Supplied"); DomainFactory factory = getDomainFactory(); List problems = factory.find("from PatientProblem p where p.careContext.id = :careContextId order by p.specialty.text, p.problem.pCName", new String[]{"careContextId"},new Object[]{careContext.getID_CareContext()}); return PatientProblemVoAssembler.createPatientProblemVoCollectionFromPatientProblem(problems); }
/** * listByClinicalContact */ public ims.core.vo.PatientProblemVoCollection listByClinicalContact(ims.core.admin.vo.ClinicalContactRefVo clinicalcontact) { if(clinicalcontact == null) throw new DomainRuntimeException("Invalid clinical contact"); DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer("from PatientProblem p "); hql.append(" where p.isActive = TRUE and p.clinicalContact.id = " + clinicalcontact.getID_ClinicalContact()); return PatientProblemVoAssembler.createPatientProblemVoCollectionFromPatientProblem((factory.find(hql.toString()))); }
/** * Saves a patientProblem */ public ims.core.vo.PatientProblemVo save(ims.core.vo.PatientProblemVo voPatientProblem) throws ims.domain.exceptions.StaleObjectException { if (!voPatientProblem.isValidated()) throw new DomainRuntimeException("Patient problem has not been validated"); DomainFactory factory = getDomainFactory(); PatientProblem domProblem = PatientProblemVoAssembler.extractPatientProblem(factory, voPatientProblem); if(domProblem.getId() == null) domProblem.setIsActive(Boolean.TRUE); factory.save(domProblem); return PatientProblemVoAssembler.create(domProblem); }
/** * Get a patient Problem */ public PatientProblemVo get(PatientProblemRefVo patientProblem) { if(patientProblem == null) throw new DomainRuntimeException("Invalid patient problem record to get"); return PatientProblemVoAssembler.create((PatientProblem)getDomainFactory().getDomainObject(PatientProblem.class, patientProblem.getID_PatientProblem())); }
public PatientProblemVoCollection listByPatient(PatientRefVo patient) { if(patient == null || patient.getID_Patient() == null) throw new DomainRuntimeException("No Patient Supplied"); DomainFactory factory = getDomainFactory(); List problems = factory.find("from PatientProblem problem where problem.careContext.episodeOfCare.careSpell.patient.id = :patientId and problem.isActive = :active ", new String[]{"patientId","active"},new Object[]{patient.getID_Patient(), Boolean.TRUE}); if(problems != null) return PatientProblemVoAssembler.createPatientProblemVoCollectionFromPatientProblem(problems); return null; }
public PatientProblemVoCollection listProblemsByCareContext(CareContextRefVo careContextRefVo) { if(careContextRefVo == null) throw new DomainRuntimeException("Invalid Care Context Ref"); DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer("from PatientProblem p "); hql.append(" where p.isActive = TRUE and p.careContext.id = " + careContextRefVo.getID_CareContext()); return PatientProblemVoAssembler.createPatientProblemVoCollectionFromPatientProblem((factory.find(hql.toString()))); }
public PatientProblemVoCollection listProblemsByCareSpell(CareSpellRefVo careSpellRefVo) { if(careSpellRefVo == null) throw new DomainRuntimeException("Invalid Care Spell Ref"); DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer("from PatientProblem p "); hql.append(" where p.isActive = TRUE and p.careContext.episodeOfCare.careSpell.id = " + careSpellRefVo.getID_CareSpell()); return PatientProblemVoAssembler.createPatientProblemVoCollectionFromPatientProblem((factory.find(hql.toString()))); }
public PatientProblemVoCollection listProblemsByEpisodeOfCarePlusUnresolved(EpisodeOfCareRefVo episodeOfCareRefVo) { if(episodeOfCareRefVo == null) throw new DomainRuntimeException("Invalid Episode Context Ref"); DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer("from PatientProblem p "); hql.append(" where (p.careContext.episodeOfCare.id = " + episodeOfCareRefVo.getID_EpisodeOfCare() + ")"); hql.append(" or (p.isResolved = " + Boolean.FALSE + ")"); return PatientProblemVoAssembler.createPatientProblemVoCollectionFromPatientProblem((factory.find(hql.toString()))); }
public PatientProblemVoCollection listProblemsByEpisodeOfCare(EpisodeOfCareRefVo episodeOfCareRefVo) { List list = listPatientProblemnsRecordsByEpisodeOfCare(episodeOfCareRefVo); return PatientProblemVoAssembler.createPatientProblemVoCollectionFromPatientProblem(list); }