public ClinicianNoteDefaultTextConfigVo getDefaultClinicianNote(ClinicalProblemRefVo clinicalProblemRef) { if(clinicalProblemRef == null || clinicalProblemRef.getID_ClinicalProblem() == null) throw new CodingRuntimeException("Cannot get default clinician note for a null Presenting Problem Id."); DomainFactory factory = getDomainFactory(); String query = "select cn from ClinicianNoteDefaultTextConfig as cn left join cn.problem as p where p.id = :ProblemId and cn.status.id = :ActiveStatus "; List<?> defaultClinicianNoteList = factory.find(query, new String[] {"ProblemId", "ActiveStatus"}, new Object[] {clinicalProblemRef.getID_ClinicalProblem(), PreActiveActiveInactiveStatus.ACTIVE.getID()}); if(defaultClinicianNoteList == null || defaultClinicianNoteList.size() == 0) return null; return ClinicianNoteDefaultTextConfigVoAssembler.create((ClinicianNoteDefaultTextConfig) defaultClinicianNoteList.get(0)); }
public ClinicianNoteDefaultTextConfigVo saveClinicianNote(ClinicianNoteDefaultTextConfigVo clinicianNoteToSave) throws StaleObjectException { if (clinicianNoteToSave == null) throw new CodingRuntimeException("Cannot save null ClinicianNote"); if (!clinicianNoteToSave.isValidated()) throw new DomainRuntimeException("ClinicianNoteVo Not Validated."); DomainFactory factory = getDomainFactory(); ClinicianNoteDefaultTextConfig domainClinicianNote = ClinicianNoteDefaultTextConfigVoAssembler.extractClinicianNoteDefaultTextConfig(factory, clinicianNoteToSave); factory.save(domainClinicianNote); return ClinicianNoteDefaultTextConfigVoAssembler.create(domainClinicianNote); }
public ClinicianNoteDefaultTextConfigVoCollection listClinicianNotes(ClinicalProblemVo presentingProblem, LookupInstVo status) { DomainFactory factory = getDomainFactory(); String hql = " select cn from ClinicianNoteDefaultTextConfig as cn "; StringBuffer condStr = new StringBuffer(); String andStr = " "; ArrayList<String> markers = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); if (presentingProblem != null) { condStr.append(andStr + " where cn.problem.id = :cName"); markers.add("cName"); values.add(presentingProblem.getID_ClinicalProblem()); andStr = " and "; } else andStr = " where "; if (status != null) { condStr.append(andStr + " cn.status.id = :cStatus"); markers.add("cStatus"); values.add(status.getID()); } condStr.append(" order by UPPER(cn.problem.pCName) asc"); hql += condStr.toString(); return ClinicianNoteDefaultTextConfigVoAssembler.createClinicianNoteDefaultTextConfigVoCollectionFromClinicianNoteDefaultTextConfig(factory.find(hql, markers, values)); }
public ClinicianNoteDefaultTextConfigVo getClinicianNote(ClinicianNoteDefaultTextConfigRefVo clinicianNote) { if (clinicianNote == null || clinicianNote.getID_ClinicianNoteDefaultTextConfig() == null) { throw new CodingRuntimeException("Cannot get ClinicianNoteDefaultTextConfigVo on null Id "); } DomainFactory factory = getDomainFactory(); ClinicianNoteDefaultTextConfig domainClinicianNote = (ClinicianNoteDefaultTextConfig) factory.getDomainObject(ClinicianNoteDefaultTextConfig.class, clinicianNote.getID_ClinicianNoteDefaultTextConfig()); return ClinicianNoteDefaultTextConfigVoAssembler.create(domainClinicianNote); }
public ims.emergency.vo.ClinicianNoteDefaultTextConfigVo getDefaultTriageNote(ims.clinical.configuration.vo.ClinicalProblemRefVo problem) { if(problem == null || problem.getID_ClinicalProblem() == null) throw new CodingRuntimeException("Cannot get default medic note for a null Presenting Problem Id."); DomainFactory factory = getDomainFactory(); String query = "select cn from ClinicianNoteDefaultTextConfig as cn left join cn.problem as p where p.id = :ProblemId and cn.status.id = :ActiveStatus "; List<?> defaultMedicNoteList = factory.find(query, new String[] {"ProblemId", "ActiveStatus"}, new Object[] {problem.getID_ClinicalProblem(), PreActiveActiveInactiveStatus.ACTIVE.getID()}); if(defaultMedicNoteList == null || defaultMedicNoteList.size() == 0) return null; return ClinicianNoteDefaultTextConfigVoAssembler.create( (ClinicianNoteDefaultTextConfig) defaultMedicNoteList.get(0)); }