public GpShortVo getGpPatient(PatientRefVo patient) { if(patient == null) throw new CodingRuntimeException("Patient not provided"); DomainFactory factory = getDomainFactory(); String hsql = "select g1_1 from Patient as p1_1 left join p1_1.gp as g1_1 where (p1_1.id = :id)"; List gps = factory.find(hsql, new String[] {"id"}, new Object[] {patient.getID_Patient()}); if(gps != null && gps.size() > 0) { GpShortVoCollection gpColl = GpShortVoAssembler.createGpShortVoCollectionFromGp(gps); if(gpColl != null && gpColl.size() > 0) return gpColl.get(0); } return null; }
public GpShortVoCollection listGPsBySurname(String text) { if(text == null) throw new CodingRuntimeException("text is mandatory in method listGPsBySurname"); text = text.replaceAll("%", ""); String hql = "from Gp gp where gp.name.upperSurname like :surname and gp.status = :activeStatus order by gp.name.upperSurname"; return GpShortVoAssembler.createGpShortVoCollectionFromGp(getDomainFactory().find(hql, new String[] {"surname", "activeStatus"}, new Object[] {text.toUpperCase() + "%", getDomLookup(GPStatus.ACTIVE)})); }
private void populateGpGrid(GpShortVoCollection collection) { form.grdGps().getRows().clear(); GpShortVo voGpPract = null; GenForm.grdGpsRow row = null; for(int i=0;i<collection.size();i++) { voGpPract = collection.get(i); row = form.grdGps().getRows().newRow(); row.setName(voGpPract.getName().toString()); if (null != voGpPract && voGpPract.getPracticesIsNotNull()) { for (int j=0; j < voGpPract.getPractices().size(); j++) { if (voGpPract.getPractices().get(j).getIsPrimaryPracticeIsNotNull() && (voGpPract.getPractices().get(j).getIsPrimaryPractice().equals(Boolean.TRUE)) && //WDEV-2725 voGpPract.getPractices().get(j).getPracticeIsNotNull() && voGpPract.getPractices().get(j).getPractice().getAddressIsNotNull()) { row.setAddress(voGpPract.getPractices().get(j).getPractice().getAddress().toDisplayString()); break; } } } if (voGpPract.getStatusIsNotNull()) row.setStatus(voGpPract.getStatus().toString()); row.setValue(voGpPract); } }
public GpShortVoCollection listReferralGps(GP voGpFilter) { DomainFactory factory = getDomainFactory(); String andStr = " "; StringBuffer clause = new StringBuffer(); ArrayList names = new ArrayList(); ArrayList values = new ArrayList(); if (voGpFilter.getNameIsNotNull()) { if (voGpFilter.getName().getForenameIsNotNull()) { clause.append(" gp.name.upperForename like :forename"); names.add("forename"); values.add("%" + voGpFilter.getName().getForename().toUpperCase() + "%"); andStr = " and "; } if (voGpFilter.getName().getSurnameIsNotNull()) { clause.append(andStr + " gp.name.upperSurname like :surname"); names.add("surname"); values.add("%" + voGpFilter.getName().getSurname().toUpperCase() + "%"); andStr = " and "; } } if (voGpFilter.getPracticesIsNotNull()) { if (voGpFilter.getPractices() != null) { if (voGpFilter.getPractices().get(0).getPractice().getAddress().getLine1() != null && voGpFilter.getPractices().get(0).getPractice().getAddress().getLine1().length() > 0) { clause.append(andStr + " gp.id = Pract.gp.id and (upper(Pract.practice.address.line1) like :partialAddress "); clause.append(" or upper(Pract.practice.address.line2) like :partialAddress"); clause.append(" or upper(Pract.practice.address.line3) like :partialAddress"); clause.append(" or upper(Pract.practice.address.line4) like :partialAddress"); clause.append(" or upper(Pract.practice.address.line5) like :partialAddress )"); //clause.append(" gp.id = Pract.gp.id and Pract.practice.address.line1 like :partialAddress "); names.add("partialAddress"); values.add("%" + voGpFilter.getPractices().get(0).getPractice().getAddress().getLine1().toUpperCase() + "%"); andStr = " and "; } } } String hql = "select distinct gp from Gp gp, GpToPractice Pract where "; hql += clause.toString(); List gps = factory.find(hql,names,values); return GpShortVoAssembler.createGpShortVoCollectionFromGp(gps).sort(); }
protected void onQmbReferredByTextSubmited(String value) throws ims.framework.exceptions.PresentationLogicException { form.qmbReferredBy().clear(); if (form.cmbSourceofReferral().getValue() != null && form.cmbSourceofReferral().getValue().equals(ReferralSource.GPREFERRAL)) { GpShortVoCollection gpColl = domain.listGPsBySurname(value); if(gpColl != null) { for (int i = 0; i < gpColl.size(); i++) form.qmbReferredBy().newRow(gpColl.get(i), gpColl.get(i).toString()); if (gpColl.size() == 1) { form.qmbReferredBy().setValue(gpColl.get(0)); loadGPsPractice(gpColl.get(0)); } else if (gpColl.size() > 1) form.qmbReferredBy().showOpened(); } } else { HcpFilter filter = new HcpFilter(); PersonName name = new PersonName(); name.setSurname(value); filter.setQueryName(name); filter.setHcpType(HcpDisType.MEDICAL); HcpCollection coll = domain.listHcps(filter, HcpDisType.MEDICAL); if(coll != null) { for (int i = 0; i < coll.size(); i++) form.qmbReferredBy().newRow(coll.get(i), coll.get(i).toString()); if (coll.size() == 1) form.qmbReferredBy().setValue(coll.get(0)); else if (coll.size() > 1) form.qmbReferredBy().showOpened(); } } }
public GpShortVoCollection listGPsBySurname(String surname) { GPAdmin gps = (GPAdmin) getDomainImpl(GPAdminImpl.class); return gps.listGPsBySurname(surname); }
public GpShortVoCollection listGPsBySurname(String surname) { GPAdmin impl = (GPAdmin)getDomainImpl(GPAdminImpl.class); return impl.listGPsBySurname(surname); }
public GpShortVoCollection listGPsBySurname(String surname) { ReportRunnerDialog impl = (ReportRunnerDialog) getDomainImpl(ReportRunnerDialogImpl.class); return impl.listGPsBySurname(surname); }
public GpShortVoCollection listGPsBySurname(String surname) { GPAdmin gpAdmin = (GPAdmin) getDomainImpl(GPAdminImpl.class); return gpAdmin.listGPsBySurname(surname); }
protected void onDyngrdReportToCellTextSubmited(DynamicGridCell cell) { cell.getItems().clear(); if (cell.getTypedText() == null || cell.getTypedText().equals("")) { engine.showMessage("Please enter at least one character to search on."); return; } if (cell.getIdentifier() != null && cell.getIdentifier().equals(MemberOfStaffRefVo.class)) { MemberOfStaffShortVoCollection voCollMos = domain.listMos(cell.getTypedText()); if (voCollMos != null && voCollMos.size() > 0) { voCollMos.sort(); for (int i = 0; i < voCollMos.size(); i++) { cell.getItems().newItem(voCollMos.get(i), voCollMos.get(i).toString()); } if (voCollMos.size() == 1) { cell.setValue(voCollMos.get(0)); onDyngrdReportToCellValueChanged(cell); } else if (voCollMos.size() > 1) cell.showOpened(); } else engine.showMessage("No matching records found"); } else if (cell.getIdentifier() != null && (cell.getIdentifier().equals(LocationType.WARD) || (cell.getIdentifier().equals(LocationType.OUTPATIENT_DEPT)))) { LocShortVoCollection voCollLocations = null; DynamicGridCell cellHosp = cell.getRow().getCells().get(form.lyrDetails().tabGenDetails().dyngrdReportTo().getColumns().getByIdentifier(REPORTTO_COLUMN)); if (cell.getIdentifier().equals(LocationType.WARD)) voCollLocations = domain.listWardsForHospitalByNameShort((LocationRefVo) cellHosp.getValue(), cell.getTypedText()); else if (cell.getIdentifier().equals(LocationType.OUTPATIENT_DEPT)) voCollLocations = domain.listOutpatDeptsForHospitalByNameShort((LocationRefVo) cellHosp.getValue(), cell.getTypedText()); if (voCollLocations != null && voCollLocations.size() > 0) { voCollLocations.sort(); for (int i = 0; i < voCollLocations.size(); i++) { cell.getItems().newItem(voCollLocations.get(i), voCollLocations.get(i).toString()); } if (voCollLocations.size() == 1) { cell.setValue(voCollLocations.get(0)); onDyngrdReportToCellValueChanged(cell); } else if (voCollLocations.size() > 1) cell.showOpened(); } else engine.showMessage("No matching locations found"); } else { GpShortVoCollection voCollGps = domain.listGPsBySurname(cell.getTypedText()); if (voCollGps != null && voCollGps.size() > 0) { voCollGps.sort(); for (int i = 0; i < voCollGps.size(); i++) { cell.getItems().newItem(voCollGps.get(i), voCollGps.get(i).toString()); } if (voCollGps.size() == 1) { cell.setValue(voCollGps.get(0)); onDyngrdReportToCellValueChanged(cell); } else if (voCollGps.size() > 1) cell.showOpened(); } else engine.showMessage("No matching records found"); } }
protected void onQmbReferredByTextSubmited(String value) throws ims.framework.exceptions.PresentationLogicException { form.lyr().tabReferralDetails().qmbReferredBy().clear(); if (form.lyr().tabReferralDetails().cmbSourceofReferral().getValue() != null && form.lyr().tabReferralDetails().cmbSourceofReferral().getValue().equals(ReferralSource.GPREFERRAL)) { GpShortVoCollection gpColl = domain.listGPsBySurname(value); if(gpColl != null) { for (int i = 0; i < gpColl.size(); i++) form.lyr().tabReferralDetails().qmbReferredBy().newRow(gpColl.get(i), gpColl.get(i).toString()); if (gpColl.size() == 1) { form.lyr().tabReferralDetails().qmbReferredBy().setValue(gpColl.get(0)); onQmbReferredByValueChanged(); } else if (gpColl.size() > 1) form.lyr().tabReferralDetails().qmbReferredBy().showOpened(); } } else { HcpFilter filter = new HcpFilter(); PersonName name = new PersonName(); name.setSurname(value); filter.setQueryName(name); filter.setHcpType(HcpDisType.MEDICAL); HcpCollection coll = domain.listHcps(filter, HcpDisType.MEDICAL); if(coll != null) { for (int i = 0; i < coll.size(); i++) form.lyr().tabReferralDetails().qmbReferredBy().newRow(coll.get(i), coll.get(i).toString()); if (coll.size() == 1){ form.lyr().tabReferralDetails().qmbReferredBy().setValue(coll.get(0)); onQmbReferredByValueChanged(); } else if (coll.size() > 1) form.lyr().tabReferralDetails().qmbReferredBy().showOpened(); } } }
@Override protected void onQmbReferredByTextSubmited(String value) throws ims.framework.exceptions.PresentationLogicException { form.qmbReferredBy().clear(); if (form.cmbSourceReferral().getValue() != null && form.cmbSourceReferral().getValue().equals(ReferralSource.GPREFERRAL)) { GpShortVoCollection gpColl = domain.listGPsBySurname(value); if(gpColl != null) { for (int i = 0; i < gpColl.size(); i++) form.qmbReferredBy().newRow(gpColl.get(i), gpColl.get(i).toString()); if (gpColl.size() == 1) { form.qmbReferredBy().setValue(gpColl.get(0)); loadGPsPractice(gpColl.get(0)); } else if (gpColl.size() > 1) form.qmbReferredBy().showOpened(); } } else { HcpFilter filter = new HcpFilter(); PersonName name = new PersonName(); name.setSurname(value); filter.setQueryName(name); filter.setHcpType(HcpDisType.MEDICAL); HcpCollection coll = domain.listHcps(filter, null);//HcpDisType.MEDICAL); if(coll != null) { for (int i = 0; i < coll.size(); i++) form.qmbReferredBy().newRow(coll.get(i), coll.get(i).toString()); if (coll.size() == 1) form.qmbReferredBy().setValue(coll.get(0)); else if (coll.size() > 1) form.qmbReferredBy().showOpened(); } } }