public ClinicalDIAssociationVoCollection saveClinicalDiAssociation(ClinicalDIAssociationVoCollection list) throws StaleObjectException { if(list == null) throw new RuntimeException("Cannot save null ClinicalDIAssociationVoCollection"); if(!list.isValidated()) throw new CodingRuntimeException("ClinicalDIAssociationVoCollection has not been validated."); DomainFactory factory = getDomainFactory(); ClinicalDIAssociationVoCollection result = new ClinicalDIAssociationVoCollection(); for(int x = 0; x < list.size(); x++) { if(list.get(x) != null) { factory.save(ClinicalDIAssociationVoAssembler.extractClinicalcdiassociations(factory, list.get(x))); } } return result; }
private ClinicalDIAssociationVoCollection listAssociation(ValueObject filter) { if (filter == null) throw new DomainRuntimeException("filter not provided"); String hql = "from Clinicalcdiassociations assoc where "; ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); if (filter instanceof PatientDiagnosisRefVo) { hql += "assoc.primDiagnosis.id = :diagId"; markers.add("diagId"); values.add(((PatientDiagnosisRefVo) filter).getID_PatientDiagnosis()); } else if (filter instanceof PatientProcedureRefVo) { hql += "assoc.primProcedure.id = :procId"; markers.add("procId"); values.add(((PatientProcedureRefVo) filter).getID_PatientProcedure()); } else if (filter instanceof PatientProblemRefVo) { hql += "assoc.primProblem.id = :problemId"; markers.add("problemId"); values.add(((PatientProblemRefVo) filter).getID_PatientProblem()); } hql += " and assoc.isActive = 1";// WDEV-12407 DomainFactory factory = getDomainFactory(); List associations = factory.find(hql, markers, values); if (associations != null) return ClinicalDIAssociationVoAssembler.createClinicalDIAssociationVoCollectionFromClinicalcdiassociations(associations); return null; }
private ClinicalDIAssociationVoCollection listAssociation(ValueObject filter) { if(filter == null) throw new DomainRuntimeException("filter not provided"); String hql = "from Clinicalcdiassociations assoc where "; ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); if(filter instanceof PatientDiagnosisRefVo) { hql += "assoc.primDiagnosis.id = :diagId"; markers.add("diagId"); values.add(((PatientDiagnosisRefVo)filter).getID_PatientDiagnosis()); } else if(filter instanceof PatientProcedureRefVo) { hql += "assoc.primProcedure.id = :procId"; markers.add("procId"); values.add(((PatientProcedureRefVo)filter).getID_PatientProcedure()); } else if(filter instanceof PatientProblemRefVo) { hql += "assoc.primProblem.id = :problemId"; markers.add("problemId"); values.add(((PatientProblemRefVo)filter).getID_PatientProblem()); } hql += " and assoc.isActive = 1";//WDEV-12407 DomainFactory factory = getDomainFactory(); List associations = factory.find(hql, markers, values); if(associations != null) return ClinicalDIAssociationVoAssembler.createClinicalDIAssociationVoCollectionFromClinicalcdiassociations(associations); return null; }