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; }
public ReferralLiteVo getReferralFromSelectedCatsReferral(Integer catsReferralID) { if (catsReferralID == null) return null; DomainFactory factory = getDomainFactory(); ArrayList<String> marques = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); marques.add("id"); values.add(catsReferralID); String query = " select referral from CatsReferral as catsReferral left join catsReferral.journey as referralJourney left join referralJourney.referral as referral where catsReferral.id = :id "; List<?> referral = factory.find(query, marques, values); if(referral != null && referral.size() > 0 && referral.get(0) instanceof Referral) return ReferralLiteVoAssembler.create((Referral) referral.get(0)); return null; }
private boolean notAlreadyInHistory(ReferralRefVoCollection linkedReferralsHistory, ReferralLiteVo voReferral) { for(int i=0;i<linkedReferralsHistory.size();i++) { if(!linkedReferralsHistory.get(i).equals(voReferral)) return true; } return false; }
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 displayJourney() throws PresentationLogicException { if(form.getGlobalContext().Pathways.getSelectedPatientPathwayJourneyIsNotNull()) { loadReferrals(false); ReferralLiteVo voReferral = domain.getReferralByJourney(form.getGlobalContext().Pathways.getSelectedPatientPathwayJourney()); form.cmbReferrals().setValue(voReferral); cmbReferralValueChanged(); for(int i=0;i<form.cmbPatientJourney().getValues().size();i++) { if(form.cmbPatientJourney().getValues().get(i) instanceof PatientJourneyDummyVo) { if( ((PatientJourneyDummyVo)form.cmbPatientJourney().getValues().get(i)).getPatientJourneyID().equals(form.getGlobalContext().Pathways.getSelectedPatientPathwayJourney().getID_PatientPathwayJourney())) { form.cmbPatientJourney().setValue(form.cmbPatientJourney().getValues().get(i)); break; } } else if(form.cmbPatientJourney().getValues().get(i) instanceof PatwayHistoryDummyVo) { if( ((PatwayHistoryDummyVo)form.cmbPatientJourney().getValues().get(i)).getPatientJourneyID().equals(form.getGlobalContext().Pathways.getSelectedPatientPathwayJourney().getID_PatientPathwayJourney())) { form.cmbPatientJourney().setValue(form.cmbPatientJourney().getValues().get(i)); break; } } } viewSelectedJourney(); } }
public ReferralLiteVo getReferralByJourney(PatientPathwayJourneyRefVo journey) { DomainFactory factory = getDomainFactory(); String hql = "select pj.referral from PatientPathwayJourney as pj left join pj.referral as referral " + "where (pj.id = " + journey.getID_PatientPathwayJourney() + " )"; List referralList = factory.find(hql); if(referralList != null && referralList.size() == 1) return ReferralLiteVoAssembler.create((Referral) referralList.get(0)); return null; }
private void populateAdjustedRTTBreachDate(ReferralLiteVo value, Date breachDate) { int adjustedDays = domain.getCurrentPauseDetails(form.cmbReferrals().getValue()); form.lblAdjusted().setVisible(form.txtRTTBreachDate().isVisible() && adjustedDays != 0); form.txtAdjustedDate().setEnabled(false); form.txtAdjustedDate().setVisible(form.txtRTTBreachDate().isVisible() && adjustedDays != 0); form.txtAdjustedDate().setValue(form.txtRTTBreachDate().isVisible() && adjustedDays != 0 && breachDate != null ? breachDate.addDay(adjustedDays).toString() : null); }
private void populateRTTBreachDate(ReferralLiteVo value) { Date breachDate = domain.getRTTBreachDate(form.cmbReferrals().getValue()); form.lblRTTBreachDate().setVisible(breachDate != null); form.txtRTTBreachDate().setEnabled(false); form.txtRTTBreachDate().setVisible(breachDate != null); form.txtRTTBreachDate().setValue(breachDate != null ? breachDate.toString() : null); populateAdjustedRTTBreachDate(value, breachDate); }
@Override public int compare(ReferralLiteVo a, ReferralLiteVo b) { if(a!=null&&b!=null &&a.getCatsReferralDetails()!=null&&b.getCatsReferralDetails()!=null &&a.getCatsReferralDetails().getReferralDetails()!=null&&b.getCatsReferralDetails().getReferralDetails()!=null) { Date dateOfReferralA = a.getCatsReferralDetails().getReferralDetails().getDateOfReferral(); Date dateOfReferralB = b.getCatsReferralDetails().getReferralDetails().getDateOfReferral(); if(dateOfReferralA!=null&&dateOfReferralB!=null) { return dateOfReferralA.isGreaterThan( dateOfReferralB) ? -1 : dateOfReferralA.equals(dateOfReferralB) ? 0 : 1; } } return 0; }
@Override public CATSReferralRTTManagementVo getReferralDetails(ReferralLiteVo referral) { if (referral == null || referral.getCatsReferralDetails() == null) return null; return getCatsReferralRTTManagement(referral.getCatsReferralDetails()); }
public PatientJourneyVo getPatientJourney(ReferralLiteVo referral) throws DomainInterfaceException { return PatientJourneyVoAssembler.create(PatientPathwayJourney.getPatientPathwayJourneyFromExtReferralKey(getDomainFactory(), referral.getExtReferralKey())); }
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; }
PatientJourneyVo createPatientJourney(PatientJourneyVo patJourney, ReferralLiteVo referral, Specialty specialty, HcpRefVo consultant,Boolean non18week) throws StaleObjectException, DomainInterfaceException;