/** * Save a ProcedureVo */ public PatientProcedureChecklistVo savePatienProcedureChecklist(PatientProcedureChecklistVo procedureChecklist) throws StaleObjectException { if (!procedureChecklist.isValidated()) throw new DomainRuntimeException("Procedure Checklist has not been validated"); DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer("from PatientProcedureChecklist p "); if(procedureChecklist.getID_PatientProcedureChecklist() == null) hql.append(" where (p.clinicalContact.id = " + procedureChecklist.getClinicalContact().getID_ClinicalContact() + ")"); else hql.append(" where (p.clinicalContact.id = " + procedureChecklist.getClinicalContact().getID_ClinicalContact() + ") and p.id <> " + procedureChecklist.getID_PatientProcedureChecklist()); List list = (factory.find(hql.toString())); if(list.size() > 0) throw new DomainRuntimeException("A record exists for this clinical contact, the screen will be refreshed"); PatientProcedureChecklist domChecklist = PatientProcedureChecklistVoAssembler.extractPatientProcedureChecklist(factory, procedureChecklist); factory.save(domChecklist); return PatientProcedureChecklistVoAssembler.create(domChecklist); }
public PatientProcedureChecklistVo getPatientProcedureChecklistVo(ClinicalContactRefVo clinicalContact) { if(clinicalContact == null) throw new DomainRuntimeException("Invalid Search criteria. ClinicalContact must be supplied."); DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer("from PatientProcedureChecklist p "); hql.append(" where (p.clinicalContact.id = " + clinicalContact.getID_ClinicalContact() + ")"); PatientProcedureChecklistVoCollection collPatientProcedureChecklist = PatientProcedureChecklistVoAssembler.createPatientProcedureChecklistVoCollectionFromPatientProcedureChecklist((factory.find(hql.toString()))); if(collPatientProcedureChecklist==null || collPatientProcedureChecklist.size()==0) return null; return collPatientProcedureChecklist.get(0); }
public Boolean checkForProcedureChecklist(ClinicalContactRefVo refClinicalContact) { if(refClinicalContact == null) throw new DomainRuntimeException("Invalid Search criteria. ClinicalContact must be supplied."); DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer("from PatientProcedureChecklist p "); hql.append(" where (p.clinicalContact.id = " + refClinicalContact.getID_ClinicalContact() + ")"); PatientProcedureChecklistVoCollection collPatientProcedureChecklist = PatientProcedureChecklistVoAssembler.createPatientProcedureChecklistVoCollectionFromPatientProcedureChecklist((factory.find(hql.toString()))); if(collPatientProcedureChecklist.size()==0) return Boolean.FALSE; return Boolean.TRUE; }