public ims.core.vo.GpLiteVo getPatientGp(ims.core.patient.vo.PatientRefVo patient) { if(patient == null || !patient.getID_PatientIsNotNull()) throw new CodingRuntimeException("Can not get Patient Gp on null Patient."); DomainFactory factory = getDomainFactory(); List<?> gpList = factory.find("select gp from Patient as p left join p.gp as gp where (p.id = :patientid and gp.isRIE is null)", new String[] {"patientid"}, new Object[] {patient.getID_Patient()}); if(gpList == null || gpList.size() == 0) return null; return GpLiteVoAssembler.create((Gp) gpList.get(0)); }
public GpLiteVo getPatientGp(PatientRefVo patient) { if(patient == null || !patient.getID_PatientIsNotNull()) throw new CodingRuntimeException("Can not get Patient Gp on null Patient."); DomainFactory factory = getDomainFactory(); List<?> gpList = factory.find("select gp from Patient as p left join p.gp as gp where (p.id = :patientid and gp.isRIE is null)", new String[] {"patientid"}, new Object[] {patient.getID_Patient()}); if(gpList == null || gpList.size() == 0) return null; return GpLiteVoAssembler.create((Gp) gpList.get(0)); }
public GpLiteVo getPatientGp(PatientRefVo patient) { if(patient == null || !patient.getID_PatientIsNotNull()) throw new CodingRuntimeException("Can not get Patient Gp on null Patient."); DomainFactory factory = getDomainFactory(); List<?> gpList = factory.find("select gp from Patient as p left join p.gp as gp where p.id = :patientid", new String[] {"patientid"}, new Object[] {patient.getID_Patient()}); if(gpList == null || gpList.size() == 0) return null; return GpLiteVoAssembler.create((Gp) gpList.get(0)); }
public GpLiteVo getReferrerGP(CatsReferralRefVo catsRef) { if (catsRef == null || catsRef.getID_CatsReferral() == null) throw new CodingRuntimeException("catsRef is null or id not provided in method getReferrerGP"); String hql = "select refDetail.gPName from CatsReferral as cats left join cats.referralDetails as refDetail where cats.id = '" + catsRef.getID_CatsReferral() + "'"; List gps = getDomainFactory().find(hql); if(gps.size() > 0) { return GpLiteVoAssembler.create((Gp)gps.get(0)); } return null; }
public GpLiteVoCollection listGps(String nameFilter) { return GpLiteVoAssembler.createGpLiteVoCollectionFromGp(getDomainFactory().find("from Gp gp where gp.name.upperSurname like :name", new String[]{"name"}, new Object[]{nameFilter.toUpperCase() + "%"})); }