public ClinicVo getClinicByTaxonomyCode(TaxonomyType type,String taxCode) { DomainFactory factory = getDomainFactory(); String hql="select clinic from Clinic as clinic left join clinic.codeMappings as codeMappings " + "where (codeMappings.taxonomyCode = :code and codeMappings.taxonomyName =:name )"; List clinics=factory.find(hql, new String []{"code", "name"},new Object []{taxCode, getDomLookup(type)}); if (clinics.size()!=0) { Clinic clinic=(Clinic)clinics.get(0); return ClinicVoAssembler.create(clinic); } else { return null; } }
public ClinicVo saveClinic(ClinicVo voClinic) throws StaleObjectException, UniqueKeyViolationException { if(voClinic == null) throw new CodingRuntimeException("This Clinic Value Object is null"); if(!voClinic.isValidated()) throw new DomainRuntimeException("This Clinic Value Object has not been validated"); DomainFactory factory = getDomainFactory(); Clinic domClinic = ClinicVoAssembler.extractClinic(factory,voClinic); domClinic.setUpperNames(); try { factory.save(domClinic); } catch (UnqViolationUncheckedException e) { throw new UniqueKeyViolationException("This Clinic Code already exists. ", e); } return ClinicVoAssembler.create(domClinic); }
public ClinicVo getClinicByPASCode(String clinicCode) { ArrayList names = new ArrayList(); ArrayList values = new ArrayList(); String prepend = " where "; DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer("from Clinic clin join clin.codeMappings map where map.taxonomyCode = :clinicCode and map.taxonomyName = :type"); names.add("clinicCode"); values.add(clinicCode); names.add("type"); values.add(getDomLookup(TaxonomyType.PAS)); List clinics = factory.find(hql.toString(), names, values, 1000); if (clinics != null && clinics.size() > 0) return ClinicVoAssembler.create((Clinic) clinics.get(0)); return null; }
public String getCCOClinicName(String strClinicCode) { DomainFactory factory = getDomainFactory(); StringBuffer hql2 = new StringBuffer(); hql2.append("select clin from Clinic clin left join clin.codeMappings as tax left join tax.taxonomyName as taxTyp where taxTyp = :taxonomyType and tax.taxonomyCode = '" + strClinicCode + "'"); ClinicVoCollection voClinics = ClinicVoAssembler.createClinicVoCollectionFromClinic(factory.find(hql2.toString(),new String[]{"taxonomyType"},new Object[]{getDomLookup(TaxonomyType.PAS)})); if (voClinics != null && voClinics.size() > 0) return voClinics.get(0).getClinicName(); else return null; }
public ClinicVoCollection listClinics() { DomainFactory factory = getDomainFactory(); return ClinicVoAssembler.createClinicVoCollectionFromClinic(factory.listDomainObjects(Clinic.class)); }
public ClinicVo saveClinic(ClinicVo clinic) throws StaleObjectException { DomainFactory factory = getDomainFactory(); Clinic domClinic = ClinicVoAssembler.extractClinic(factory, clinic); // wdev-3603 set uppernames if null //wdev-14268 , set uppernames at every save domClinic.setUpperNames(); factory.save(domClinic); //WDEV-10574 REMOTE_LOC_CACHE.clear(); return ClinicVoAssembler.create(domClinic); }
public ClinicVo getClinic(Integer clinicCode) { DomainFactory factory = getDomainFactory(); return ClinicVoAssembler.create((Clinic) factory.getDomainObject(Clinic.class, clinicCode.intValue())); }
public ClinicVo getClinic(ClinicRefVo clinicRef) { return ClinicVoAssembler.create((Clinic)this.getDomainFactory().getDomainObject(clinicRef)); }
public ClinicVoCollection listClinicsByNameCodeLocation(LocationRefVo voLocRef, LocationRefVo outpatientDepartment, String strClinicName, String strClinicCode, Boolean bActiveOnly) { if(voLocRef == null && strClinicName == null && strClinicCode == null) throw new CodingRuntimeException("No parameters set for listClinicsByNameCodeLocation method"); ArrayList names = new ArrayList(); ArrayList values = new ArrayList(); String prepend = " where "; DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer("from Clinic clin left join clin.codeMappings as codeMappings "); if (voLocRef != null) { hql.append(prepend + " clin.clinicLocation.id = :idLocation "); names.add("idLocation"); values.add(voLocRef.getID_Location()); prepend = " and "; } //WDEV-11914 - start here if (outpatientDepartment != null && outpatientDepartment.getID_LocationIsNotNull()) { hql.append(prepend + " clin.outpatientDept.id = :idOutpatientDept "); names.add("idOutpatientDept"); values.add(outpatientDepartment.getID_Location()); prepend = " and "; } //WDEV-11914 - ends here //upperName max 20 if(strClinicName != null && strClinicName.length()>19) strClinicName = strClinicName.substring(0,20); if (strClinicName != null && strClinicName.length() > 0) { hql.append(prepend + " clin.upperName like :ClinicName"); names.add("ClinicName"); values.add(strClinicName.toUpperCase() + "%"); prepend = " and "; } if (strClinicCode != null && strClinicCode.length() > 0) { hql.append(prepend + " codeMappings.taxonomyCode like :taxonomyCode"); names.add("taxonomyCode"); values.add(strClinicCode + "%"); prepend = " and "; } if (bActiveOnly != null && bActiveOnly) { hql.append(prepend + " clin.isActive like :Active"); names.add("Active"); values.add(Boolean.TRUE); } hql.append(" order by clin.upperName asc"); //WDEV-15426 List clinics = factory.find(hql.toString(), names, values, 1000); return ClinicVoAssembler.createClinicVoCollectionFromClinic(clinics); }