public ProcedureVo getProcedureForActivity(ActivityRefVo activityRefVo) { DomainFactory factory = getDomainFactory(); if (activityRefVo.getID_ActivityIsNotNull()) { java.util.List procList = factory.find("from Procedure proc where proc.activity.id = :actid", new String[]{"actid"}, new Object[]{activityRefVo.getID_Activity()}); if (procList.size() > 1) throw new DomainRuntimeException("More then one Procedure is configured for this Activity."); else if (procList.size() == 1) { ProcedureVoCollection coll = ProcedureVoAssembler.createProcedureVoCollectionFromProcedure(procList); return coll.get(0); } else return null; } return null; }
public ProcedureVo getProcedureVo(ProcedureRefVo voProcedureVo) { DomainFactory factory = getDomainFactory(); Procedure doProc = (Procedure) factory.getDomainObject(Procedure.class, voProcedureVo.getID_Procedure()); return (ProcedureVoAssembler.create(doProc)); }
public ProcedureVoCollection listActiveFullProcedures(String filter) throws DomainInterfaceException { return ProcedureVoAssembler.createProcedureVoCollectionFromProcedure(listDomProcedures(filter,true)).sort(); }
/** * Given an IGenericItemInfo interface, returns an ICciFull interface, based on the given CciType * @param IGenericItemInfo * @param CciType * @return ICciFull * @author mmccarthy */ public ICciFull getCci(IGenericItemInfo cci, CciType cciType) { DomainFactory factory = getDomainFactory(); if (cci.getIGenericItemInfoID()!=null) { if (cciType.equals(CciType.ALLERGEN)) { return AllergenDetailsAssembler.create((Allergen)factory.getDomainObject(Allergen.class, cci.getIGenericItemInfoID())); } else if (cciType.equals(CciType.MEDICATION)) { return MedicationFullVoAssembler.create((Medication)factory.getDomainObject(Medication.class, cci.getIGenericItemInfoID()));//WDEV-11921 } else if (cciType.equals(CciType.DIAGNOSIS)) { return DiagnosisVoAssembler.create((Diagnosis)factory.getDomainObject(Diagnosis.class, cci.getIGenericItemInfoID())); } else if (cciType.equals(CciType.PROBLEM)) { return ProblemConfigVoAssembler.create((ClinicalProblem)factory.getDomainObject(ClinicalProblem.class, cci.getIGenericItemInfoID())); } else if (cciType.equals(CciType.PROCEDURE)) { return ProcedureVoAssembler.create((Procedure)factory.getDomainObject(Procedure.class, cci.getIGenericItemInfoID())); } else if (cciType.equals(CciType.CANCERIMAGE)) { return CancerImagingEventVoAssembler.create((CancerImagingEvent)factory.getDomainObject(CancerImagingEvent.class, cci.getIGenericItemInfoID())); } else if (cciType.equals(CciType.VACCINE)) { return VaccineVoAssembler.create((Vaccine) factory.getDomainObject(Vaccine.class, cci.getIGenericItemInfoID())); } else if(cciType.equals(CciType.PRESENTING_ISSUE)) { return PresentingComplaintVoAssembler.create((PresentingComplaint) factory.getDomainObject(PresentingComplaint.class, cci.getIGenericItemInfoID())); } else if(cciType.equals(CciType.TREATMENT_INTERVENTION)) //WDEV-17060 { return TreatmentInterventionVoAssembler.create((TreatmentIntervention) factory.getDomainObject(TreatmentIntervention.class, cci.getIGenericItemInfoID())); } else { throw new DomainRuntimeException("Unknown CCI type in 'getCci' = " + cciType.toString()); } } else return null; }
public ProcedureVo getProcedureWithTaxonomyMappings(ProcedureRefVo procRefVo) { DomainFactory factory = getDomainFactory(); Procedure proc = (Procedure) factory.getDomainObject(Procedure.class, procRefVo.getID_Procedure()); return (ProcedureVoAssembler.create(proc)); }
public ProcedureVo getProcedureLOS(ProcedureRefVo procedureRefVo) { DomainFactory factory = getDomainFactory(); Procedure procBo = (Procedure) factory.getDomainObject(Procedure.class, procedureRefVo.getID_Procedure().intValue()); return ProcedureVoAssembler.create(procBo); }
public ProcedureVo saveProcedureVo(ProcedureVo voProcedureVo) throws StaleObjectException, UniqueKeyViolationException { if (!voProcedureVo.isValidated()) { throw new DomainRuntimeException("This ProcedureVo has not been validated"); } DomainFactory factory = getDomainFactory(); // We need to ensure that the taxonomy map is not duplicated - based on Taxonomy and map voProcedureVo.setProcedureName(voProcedureVo.getProcedureName().trim());//wdev-1336 Procedure domProcedure = ProcedureVoAssembler.extractProcedure(factory, voProcedureVo); domProcedure.setKeywords(Keywords.setupKeyWords(domProcedure.getKeywords(), domProcedure.getProcedureName())); try { factory.save(domProcedure); } catch(UnqViolationUncheckedException e) { //check which constraint was violated (name/taxononmy map) ///name Procedure proc = Procedure.getProcedureFromProcedureName(factory, voProcedureVo.getProcedureName()); if (proc != null && proc.getId() != null && !(proc.getId().equals(voProcedureVo.getID_Procedure()))) { throw new UniqueKeyViolationException("Procedure record called \"" + voProcedureVo.getProcedureName() + "\" already exists. Duplicates not allowed.", e); } //taxonomy map String dupMessage = Keywords.checkDuplicateTaxonomy(factory, domProcedure, voProcedureVo.getTaxonomyMap(), "getProcedureName"); if(dupMessage != null) throw new UniqueKeyViolationException(dupMessage); throw (e); } return ProcedureVoAssembler.create(domProcedure); }
public ProcedureVo getProcedureByName(String strName) { DomainFactory factory = getDomainFactory(); Procedure domProcedure = Procedure.getProcedureFromProcedureName(factory, strName); return ProcedureVoAssembler.create(domProcedure); }
public ProcedureVo saveProcedureVo(ProcedureVo voProcedureVo) throws StaleObjectException, UniqueKeyViolationException { if (!voProcedureVo.isValidated()) { throw new DomainRuntimeException("This ProcedureVo has not been validated"); } DomainFactory factory = getDomainFactory(); // We need to ensure that the taxonomy map is not duplicated - based on Taxonomy and map voProcedureVo.setProcedureName(voProcedureVo.getProcedureName().trim());//wdev-1336 Procedure domProcedure = ProcedureVoAssembler.extractProcedure(factory, voProcedureVo); domProcedure.setKeywords(Keywords.setupKeyWords(domProcedure.getKeywords(), domProcedure.getProcedureName())); try { factory.save(domProcedure); } catch(UnqViolationUncheckedException e) { //check which constraint was violated (name/taxononmy map) ///name Procedure proc = Procedure.getProcedureFromProcedureName(factory, voProcedureVo.getProcedureName()); if (proc != null && proc.getId() != null && !(proc.getId().equals(voProcedureVo.getID_Procedure()))) { throw new UniqueKeyViolationException("Procedure record called \"" + voProcedureVo.getProcedureName() + "\" already exists. Duplicates not allowed.", e); } //taxonomy map // String dupMessage = Keywords.checkDuplicateTaxonomy(factory, domProcedure, voProcedureVo.getTaxonomyMap(), "getProcedureName"); // if(dupMessage != null) // throw new UniqueKeyViolationException(dupMessage); throw (e); } return ProcedureVoAssembler.create(domProcedure); }