private boolean alreadyLinked(ReferralLiteVoCollection linkedReferrals, ReferralLiteVo voReferralLite) { if(voReferralLite == null) return false; if(linkedReferrals!=null) { for(int i=0;i<linkedReferrals.size();i++) { if(linkedReferrals.get(i).equals(voReferralLite)) return true; } } return false; }
private void loadReferralsGrid() { ReferralLiteVoCollection voCollReferrals = domain.listReferralsByPatient(form.getGlobalContext().Core.getPatientShort()); for(int i=0;i<voCollReferrals.size();i++) { grdReferralsRow row = form.grdReferrals().getRows().newRow(); if(voCollReferrals.get(i).getReferralReceivedDateIsNotNull()) row.setColReceivedDate(voCollReferrals.get(i).getReferralReceivedDate().toString()); if(voCollReferrals.get(i).getReferralTypeIsNotNull()) row.setColReferralType(voCollReferrals.get(i).getReferralType().toString()); if(voCollReferrals.get(i).getDetailsIsNotNull()) row.setColDetails(voCollReferrals.get(i).getDetails()); row.setValue(voCollReferrals.get(i)); } }
private void updateControlsState() { if(engine.hasRight(AppRight.CAN_UNLINK_REFERRAL_FROM_EPISODE) && form.grdReferrals().getSelectedRow() != null && form.grdReferrals().getSelectedRow().getColLink()) { ReferralLiteVoCollection linkedReferrals = form.getLocalContext().getLinkedReferrals(); ReferralLiteVo voReferralLite = form.grdReferrals().getSelectedRow().getValue(); boolean alreadyLinked = alreadyLinked(linkedReferrals, voReferralLite); form.getContextMenus().Core.getReferralsUnlinkReferralItem().setVisible(alreadyLinked); form.getContextMenus().Core.getReferralsUnlinkReferralItem().setEnabled(alreadyLinked); } else form.getContextMenus().Core.getReferralsUnlinkReferralItem().setVisible(false); }
private void loadReferrals(boolean searchAfterCatsReferral) throws PresentationLogicException { form.cmbReferrals().clear(); updateControlsState(); //ReferralLiteVoCollection referrals = domain.listReferrals(form.getGlobalContext().Core.getPatientShort()); ReferralLiteVoCollection referrals = domain.listReferralWithPathways(form.getGlobalContext().Core.getPatientShort()); //wdev-14124 if(referrals != null) { for(int x = 0; x < referrals.size(); x++) { form.cmbReferrals().newRow(referrals.get(x), referrals.get(x).toString()); } // wdev-7327 default referral into combo if only 1 if (referrals.size() == 1) { form.cmbReferrals().setValue(referrals.get(0)); cmbReferralValueChanged(); } if (Boolean.TRUE.equals(searchAfterCatsReferral) && referrals.size() > 1 && form.getGlobalContext().RefMan.getCatsReferralIsNotNull() ) { form.cmbReferrals().setValue(domain.getReferralFromSelectedCatsReferral(form.getGlobalContext().RefMan.getCatsReferral().getID_CatsReferral())); cmbReferralValueChanged(); } } }
/** * Lists all referrals for a patient */ public ims.core.vo.ReferralLiteVoCollection listReferrals(ims.core.patient.vo.PatientRefVo patient) { if(patient == null) throw new DomainRuntimeException("Invalid patient"); DomainFactory factory = getDomainFactory(); return ReferralLiteVoAssembler.createReferralLiteVoCollectionFromReferral(factory.find("from Referral rf where rf.patient.id = " + patient.getID_Patient())); }
private void loadReferrals(boolean searchAfterCatsReferral) throws PresentationLogicException { form.cmbReferrals().clear(); updateControlsState(); //ReferralLiteVoCollection referrals = domain.listReferrals(form.getGlobalContext().Core.getPatientShort()); ReferralLiteVoCollection referrals = domain.listReferralWithPathways(form.getGlobalContext().Core.getPatientShort()); //wdev-14124 if(referrals != null) { for(int x = 0; x < referrals.size(); x++) { //WDEV-19927 if (referrals.get(x).getCatsReferralDetailsIsNotNull()) { String dateOfReferral = referrals.get(x).getCatsReferralDetails().getReferralDetailsIsNotNull() && referrals.get(x).getCatsReferralDetails().getReferralDetails().getDateOfReferralIsNotNull() ? referrals.get(x).getCatsReferralDetails().getReferralDetails().getDateOfReferral().toString() : " '' "; String urgency = referrals.get(x).getCatsReferralDetails().getUrgencyIsNotNull() ? referrals.get(x).getCatsReferralDetails().getUrgency().getIItemText() : " '' "; String service = referrals.get(x).getCatsReferralDetails().getReferralDetailsIsNotNull() && referrals.get(x).getCatsReferralDetails().getReferralDetails().getServiceIsNotNull() ? referrals.get(x).getCatsReferralDetails().getReferralDetails().getService().getServiceName() : " '' "; String consultant = referrals.get(x).getCatsReferralDetails().getReferralDetailsIsNotNull() && referrals.get(x).getCatsReferralDetails().getReferralDetails().getReferringConsultantIsNotNull() ? referrals.get(x).getCatsReferralDetails().getReferralDetails().getReferringConsultant().toString() : " '' "; String comboValue = dateOfReferral + " - " + urgency + " - " + service + " - " + consultant; form.cmbReferrals().newRow(referrals.get(x), comboValue); } else form.cmbReferrals().newRow(referrals.get(x), referrals.get(x).toString()); } // wdev-7327 default referral into combo if only 1 if (referrals.size() == 1) { form.cmbReferrals().setValue(referrals.get(0)); cmbReferralValueChanged(); } if (Boolean.TRUE.equals(searchAfterCatsReferral) && referrals.size() > 1 && form.getGlobalContext().RefMan.getCatsReferralIsNotNull() ) { form.cmbReferrals().setValue(domain.getReferralFromSelectedCatsReferral(form.getGlobalContext().RefMan.getCatsReferral().getID_CatsReferral())); cmbReferralValueChanged(); } } }
private void loadReferrals(boolean searchAfterCatsReferral) throws PresentationLogicException { form.cmbReferrals().clear(); updateControlsState(); //ReferralLiteVoCollection referrals = domain.listReferrals(form.getGlobalContext().Core.getPatientShort()); ReferralLiteVoCollection referrals = domain.listReferralWithPathways(form.getGlobalContext().Core.getPatientShort()); //wdev-14124 if(referrals != null) { for(int x = 0; x < referrals.size(); x++) { form.cmbReferrals().newRow(referrals.get(x), referrals.get(x).toString()); } // wdev-7327 default referral into combo if only 1 if (referrals.size() == 1) { form.cmbReferrals().setValue(referrals.get(0)); cmbReferralValueChanged(); } if (Boolean.TRUE.equals(searchAfterCatsReferral) && referrals.size() > 1 && form.getGlobalContext().CareUk.getCatsReferralIsNotNull() ) { form.cmbReferrals().setValue(domain.getReferralFromSelectedCatsReferral(form.getGlobalContext().CareUk.getCatsReferral().getID_CatsReferral())); cmbReferralValueChanged(); } } }
public ReferralLiteVoCollection listReferralWithPathways(PatientRefVo patient) { if(patient == null) throw new DomainRuntimeException("Invalid patient"); ReferralLiteVoCollection referralColl = new ReferralLiteVoCollection(); DomainFactory factory = getDomainFactory(); ArrayList<String> marques = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); String query = " select catsRef, p1_1.referral from CatsReferral as catsRef, PatientPathwayJourney as p1_1 join p1_1.referral as r1_1 where p1_1.patient.id =:id and catsRef.journey.id = p1_1.id "; marques.add("id"); values.add(patient.getID_Patient()); List<?> list = factory.find(query, marques, values); for (int i = 0; list != null && i < list.size(); i++) { if (list.get(i) instanceof Object[]) { Object[] result = (Object[]) list.get(i); CatsReferralForJourneyVo catsReferral = null; ReferralLiteVo referral = null; if (result[0] instanceof CatsReferral) { catsReferral = CatsReferralForJourneyVoAssembler.create((CatsReferral) result[0]); } if (result[1] instanceof Referral) { referral = ReferralLiteVoAssembler.create((Referral) result[1]); } if (catsReferral != null && referral != null) { referral.setCatsReferralDetails(catsReferral); } referralColl.add(referral); } } return referralColl; }
private void loadReferrals(boolean searchAfterCatsReferral , PatientPathwayJourneyRefVo patientPathwayJourneyRefVo) throws PresentationLogicException //WDEV-21371 { form.cmbReferral().clear(); updateControlsState(); ReferralLiteVoCollection referrals = domain.listReferralWithPathways(form.getGlobalContext().Core.getPatientShort()).sort(new dateReferralComparator()); //wdev-14124 if(referrals != null) { for(int x = 0; x < referrals.size(); x++) { //WDEV-19927 if (referrals.get(x).getCatsReferralDetailsIsNotNull()) { String dateOfReferral = referrals.get(x).getCatsReferralDetails().getReferralDetailsIsNotNull() && referrals.get(x).getCatsReferralDetails().getReferralDetails().getDateOfReferralIsNotNull() ? referrals.get(x).getCatsReferralDetails().getReferralDetails().getDateOfReferral().toString() : " '' "; String urgency = referrals.get(x).getCatsReferralDetails().getUrgencyIsNotNull() ? referrals.get(x).getCatsReferralDetails().getUrgency().getIItemText() : " '' "; String service = referrals.get(x).getCatsReferralDetails().getReferralDetailsIsNotNull() && referrals.get(x).getCatsReferralDetails().getReferralDetails().getServiceIsNotNull() ? referrals.get(x).getCatsReferralDetails().getReferralDetails().getService().getServiceName() : " '' "; String consultant = referrals.get(x).getCatsReferralDetails().getReferralDetailsIsNotNull() && referrals.get(x).getCatsReferralDetails().getReferralDetails().getReferringConsultantIsNotNull() ? referrals.get(x).getCatsReferralDetails().getReferralDetails().getReferringConsultant().toString() : " '' "; String comboValue = dateOfReferral + " - " + urgency + " - " + service + " - " + consultant; form.cmbReferral().newRow(referrals.get(x), comboValue); //WDEV-21371 Populate screen with the pathway that was passed from the Awaiting Validation Worklist form if (patientPathwayJourneyRefVo != null && patientPathwayJourneyRefVo.getID_PatientPathwayJourney() != null) { if (referrals.get(x).getCatsReferralDetails().getJourneyIsNotNull() && referrals.get(x).getCatsReferralDetails().getJourney().getID_PatientPathwayJourneyIsNotNull() && referrals.get(x).getCatsReferralDetails().getJourney().getID_PatientPathwayJourney().equals(patientPathwayJourneyRefVo.getID_PatientPathwayJourney())) { form.cmbReferral().setValue(referrals.get(x)); } } //WDEV-21371 } } if (referrals.size() == 1) { form.cmbReferral().setValue(referrals.get(0)); //WDEV-23296 if(referrals.get(0).getCatsReferralDetails() != null) { form.getGlobalContext().RefMan.setCatsReferral(referrals.get(0).getCatsReferralDetails().toCatsReferralRefVo()); form.getGlobalContext().Core.setCurrentCareContext(domain.getCareContextShortVo(referrals.get(0).getCatsReferralDetails().toCatsReferralRefVo())); } } } OnCmbReferralChanged(); }
@Override public ReferralLiteVoCollection listReferralWithPathways(PatientRefVo patient) { PatientJourney impl = (PatientJourney)getDomainImpl(PatientJourneyImpl.class); return impl.listReferralWithPathways(patient); }
public ReferralLiteVoCollection listReferralsByPatient(PatientRefVo patient) { DomainFactory factory = getDomainFactory(); String hql = "from Referral r where r.isActive = true and r.patient.id = " + patient.getID_Patient(); return ReferralLiteVoAssembler.createReferralLiteVoCollectionFromReferral(factory.find(hql)).sort(SortOrder.DESCENDING); }
public ReferralLiteVoCollection listReferralWithPathways(PatientRefVo patient) { if(patient == null) throw new DomainRuntimeException("Invalid patient"); DomainFactory factory = getDomainFactory(); return ReferralLiteVoAssembler.createReferralLiteVoCollectionFromReferral(factory.find("select p1_1.referral from PatientPathwayJourney as p1_1 join p1_1.referral as r1_1 where p1_1.patient.id = " + patient.getID_Patient())); }