public MedicVo getMedic(HcpRefVo hcpId) { if(hcpId == null) throw new CodingRuntimeException("HCP id must not be null "); DomainFactory factory = getDomainFactory(); String hql = "from Medic as m1_1 where m1_1.id = :idHCP"; List list = factory.find(hql, new String[] {"idHCP"}, new Object[] {hcpId.getID_Hcp()}); if(list != null && list.size() > 0) { MedicVoCollection voColl = MedicVoAssembler.createMedicVoCollectionFromMedic(list); if(voColl != null && voColl.size() > 0) return voColl.get(0); } return null; }
public Specialty getSpecialtyForConsultant(Integer mosID) { StringBuffer hql = new StringBuffer("select medic from Medic as medic left join medic.mos as mos where mos.id= :mosID "); DomainFactory factory = getDomainFactory(); List<?> list = factory.find(hql.toString(), new String[] {"mosID"}, new Object[] {mosID}); if (list!=null && list.size()>0) { MedicVo tempMedic = (MedicVoAssembler.createMedicVoCollectionFromMedic(list)).get(0); return tempMedic.getSpecialty(); } return null; }
public MedicVoCollection listAllMedics() { MedicVoCollection voCollMedics = new MedicVoCollection(); List lstMedics = listActiveMedics(); if (lstMedics != null) { for (int i = 0; i < lstMedics.size(); i++) { Hcp hcp = (Hcp) lstMedics.get(i); if (Medic.class.isAssignableFrom(hcp.getClass())) voCollMedics.add(MedicVoAssembler.create((Medic) hcp)); } } return voCollMedics; }
public MemberOfStaffVo getMemberOfStaffByTaxonomyType(String extId, TaxonomyType taxonomyType) { MemberOfStaff domMos = getDomMosByTaxonomyType(extId, taxonomyType); if (domMos == null) return null; MemberOfStaffVo mosVo = MemberOfStaffVoAssembler.create(domMos); ims.core.vo.Hcp hcp = null; if (domMos.getHcp() instanceof Medic) { hcp = MedicVoAssembler.create((Medic)domMos.getHcp()); } else if (domMos.getHcp() instanceof Nurse) { hcp = NurseVoAssembler.create((Nurse)domMos.getHcp()); } else if (domMos.getHcp() instanceof Therapist) { hcp = TherapistVoAssembler.create((Therapist)domMos.getHcp()); } mosVo.setHcp(hcp); return mosVo; }
public MedicVoCollection listFullMedicsForMedicLites(MedicLiteVoCollection voCollLiteMedics) { DomainFactory factory = getDomainFactory(); StringBuffer hqlStart = new StringBuffer(); String hql; hqlStart.append("from Hcp hcp where hcp.id in ( "); for (int i = 0; i < voCollLiteMedics.size(); i++) hqlStart.append(voCollLiteMedics.get(i) + ","); if (hqlStart.toString().endsWith(",")) hql = hqlStart.toString().substring(0, hqlStart.length() - 1); else hql = hqlStart.toString(); hql += " )"; return MedicVoAssembler.createMedicVoCollectionFromMedic(factory.find(hql)); }
public Hcp getHCP(HcpRefVo hcpRefVo) { DomainFactory factory = getDomainFactory(); ims.core.resource.people.domain.objects.Hcp doHcp = (ims.core.resource.people.domain.objects.Hcp) factory.getDomainObject(ims.core.resource.people.domain.objects.Hcp.class, hcpRefVo.getID_Hcp()); if (Medic.class.isAssignableFrom(doHcp.getClass())) return MedicVoAssembler.create((Medic) doHcp); else if (doHcp instanceof Therapist) return TherapistVoAssembler.create((Therapist)doHcp); else if (doHcp instanceof Nurse) return NurseVoAssembler.create((Nurse) doHcp); return HcpAssembler.create(doHcp); }
private ICspTypeSpecifier getConsultant(Integer id) { if (id == null) throw new CodingRuntimeException("Invalid argiment:Medic Id is null."); DomainFactory factory = getDomainFactory(); Medic doMed = (Medic) factory.getDomainObject(Medic.class, id); MedicVo medic = MedicVoAssembler.create(doMed); return (ICspTypeSpecifier) medic; }
private IMos[] listByDiscipline(List hcps, String name, HcpDisType mosDiscipline) { List<IMos> hcpList = new ArrayList<IMos>(); if(hcps != null) { for(int i=0;i<hcps.size();i++) { Hcp hcp = (Hcp) hcps.get(i); if (Medic.class.isAssignableFrom(hcp.getClass())) hcpList.add(MedicVoAssembler.create((Medic)hcp)); else if (Therapist.class.isAssignableFrom(hcp.getClass())) hcpList.add(TherapistVoAssembler.create((Therapist)hcps.get(i))); else if (Nurse.class.isAssignableFrom(hcp.getClass())) hcpList.add(NurseVoAssembler.create((Nurse)hcps.get(i))); else hcpList.add(HcpAssembler.create((Hcp)hcps.get(i))); } } Collections.sort(hcpList, new HcpAdminComparator(SortOrder.ASCENDING)); IMos[] iMosArray = new IMos[hcpList.size()]; for(int i=0; i < hcpList.size(); i++) iMosArray[i] = hcpList.get(i); return iMosArray; }
public MedicVo getMedic(HcpRefVo hcp) { if (hcp == null || hcp.getID_Hcp() == null) return null; String query = "SELECT medic FROM Medic AS medic WHERE medic.id = :ID"; return MedicVoAssembler.create((Medic) getDomainFactory().findFirst(query, "ID", hcp.getID_Hcp())); }
private HcpCollection listHCPs(HcpFilter filter, String subClass) { List hcps = listHCPList(filter,subClass,-1); //WDEV-11656 //iterate through domainlist and use each subclasses respective assembler to convert and add to voCollHcps //Using arraylist so can sort it locally. Not sort won't work as collection is mixed type. ArrayList hcpList = new ArrayList(); if(hcps != null) { for(int i=0;i<hcps.size();i++) { Hcp hcp = (Hcp) hcps.get(i); if (Medic.class.isAssignableFrom(hcp.getClass())){ hcpList.add(MedicVoAssembler.create((Medic)hcp)); } else if (Therapist.class.isAssignableFrom(hcp.getClass())) hcpList.add(TherapistVoAssembler.create((Therapist)hcps.get(i))); else if (Nurse.class.isAssignableFrom(hcp.getClass())) hcpList.add(NurseVoAssembler.create((Nurse)hcps.get(i))); else hcpList.add(HcpAssembler.create((Hcp)hcps.get(i))); } } Collections.sort(hcpList, new HcpAdminComparator(SortOrder.ASCENDING)); HcpCollection voCollHcps = new HcpCollection(); for(int i=0; i < hcpList.size(); i++) { voCollHcps.add((ims.core.vo.Hcp)hcpList.get(i)); } return voCollHcps; }
/** * Creates a new HCP or updates if it already exists */ public ims.core.vo.Hcp saveHCP(ims.core.vo.Hcp hcp) throws StaleObjectException { if (!hcp.isValidated()) { throw new DomainRuntimeException("HCP VO has not been validated."); } DomainFactory factory = getDomainFactory(); hcp.getName().setUppers(); Hcp doHcp = null; if (hcp instanceof MedicVo) { doHcp = MedicVoAssembler.extractMedic(factory, (MedicVo)hcp); } else if (hcp instanceof TherapistVo) { doHcp = TherapistVoAssembler.extractTherapist(factory, (TherapistVo)hcp); } else if (hcp instanceof NurseVo) { doHcp = NurseVoAssembler.extractNurse(factory, (NurseVo)hcp); } else { doHcp = HcpAssembler.extractHcp(factory, hcp); } factory.save(doHcp); hcp.setID_Hcp(doHcp.getId()); return hcp; }
public ims.core.vo.Hcp getHcpByExternalCode(TaxonomyType taxType, String codeVal) { if (codeVal == null) return null; List hcpList = getDomHcpByExternalCode(taxType, codeVal); if (hcpList != null && hcpList.size() > 0) { Hcp hcp = (Hcp)hcpList.get(0); if (hcp instanceof Medic) { return MedicVoAssembler.create((Medic)hcp); } else if (hcp instanceof Therapist) { return TherapistVoAssembler.create((Therapist)hcp); } else if (hcp instanceof Nurse) { return NurseVoAssembler.create((Nurse)hcp); } else { return HcpAssembler.create((Hcp)hcpList.get(0)); } } return null; }
public ims.core.vo.Hcp getHcp(HcpFilter filter) { DomainFactory factory = getDomainFactory(); Hcp doHcp = (Hcp) factory.getDomainObject(Hcp.class, filter.getID_Hcp()); if (Medic.class.isAssignableFrom(doHcp.getClass())) return MedicVoAssembler.create((Medic) doHcp); else if (doHcp instanceof Therapist) return TherapistVoAssembler.create((Therapist)doHcp); else if (doHcp instanceof Nurse) return NurseVoAssembler.create((Nurse) doHcp); return HcpAssembler.create(doHcp); }
public ims.core.vo.Hcp saveHcp(ims.core.vo.Hcp hcp) throws ims.domain.exceptions.StaleObjectException { if (!hcp.isValidated()) { throw new DomainRuntimeException("HCP VO has not been validated."); } DomainFactory factory = getDomainFactory(); hcp.getName().setUppers(); Hcp doHcp = null; if (hcp instanceof MedicVo) { doHcp = MedicVoAssembler.extractMedic(factory, (MedicVo) hcp); } else if (hcp instanceof TherapistVo) { doHcp = TherapistVoAssembler.extractTherapist(factory, (TherapistVo) hcp); } else if (hcp instanceof NurseVo) { doHcp = NurseVoAssembler.extractNurse(factory, (NurseVo) hcp); } else { doHcp = HcpAssembler.extractHcp(factory, hcp); } factory.save(doHcp); hcp.setID_Hcp(doHcp.getId()); return hcp; }
public MedicVo getConsultantMedicForHCP(HcpRefVo hcp) { if (hcp == null || !hcp.getID_HcpIsNotNull()) return null; return MedicVoAssembler.create((Medic) getDomainFactory().getDomainObject(Medic.class, hcp.getID_Hcp())); }
public MedicVo getMedic(HcpRefVo hcpRef) { if (hcpRef == null || hcpRef.getID_Hcp() == null) { throw new CodingRuntimeException("Cannot get MedicVo on null Id "); } DomainFactory factory = getDomainFactory(); Medic domainSurgicalAudit = (Medic) factory.getDomainObject(Medic.class, hcpRef.getID_Hcp()); return MedicVoAssembler.create(domainSurgicalAudit); }
public MedicVo getMedicVo(MedicRefVo medic) { if(medic == null || medic.getID_Hcp() == null) throw new CodingRuntimeException("MedicRefVo is null or id not provided for getMedicVo"); return MedicVoAssembler.create((Medic) getDomainFactory().getDomainObject(medic)); }
public MedicVo getMedicFull(MedicRefVo medic) { if (medic == null || medic.getID_Hcp() == null) return null; return MedicVoAssembler.create((Medic) getDomainFactory().getDomainObject(Medic.class, medic.getID_Hcp())); }