private void addToSelection(MedicLiteVo item) { GenForm.grdSelectedTestsRow row = form.grdSelectedTests().getRows().newRow(); row.setValue(item); row.setcolName( item != null && item.getMosIsNotNull() && item.getMos().getNameIsNotNull() ? item.getMos().getName().toString() : ""); }
private void addToList(MedicLiteVo item) { if (item == null) return; GenForm.grdListedTestsRow row = form.grdListedTests().getRows().newRow(); row.setValue(item); row.setcolName( item != null && item.getMosIsNotNull() && item.getMos().getNameIsNotNull() ? item.getMos().getName().toString() : ""); }
/** toMedicLite() - will return null if the HCP is not of type Medic */ public ims.core.vo.MedicLiteVo toMedicLite() { if (ims.core.vo.lookups.HcpDisType.MEDICAL.equals(this.hcptype)) { ims.core.vo.MedicLiteVo medic = new ims.core.vo.MedicLiteVo(this.id, this.version); medic.setIsActive(this.isactive); medic.setIsAResponsibleEDClinician(this.isaresponsibleedclinician); medic.setIsHCPaResponsibleHCP(this.ishcparesponsiblehcp); medic.setMos(this.mos); return medic; } return null; }
public MedicLiteVoCollection listConsultants(MedicLiteVo filterVo) throws DomainInterfaceException { if (filterVo == null) throw new DomainInterfaceException("Can not search on null medic filter"); if (filterVo.getName() == null || (filterVo.getName().getSurname() == null && filterVo.getName().getForename() == null) || (filterVo.getName().getSurname().length() == 00 && filterVo.getName().getForename().length() == 0)) throw new DomainInterfaceException("Can not search on null or zero length consultant name"); String[] names; if (filterVo.getName().getSurnameIsNotNull() && filterVo.getName().getSurname().length() > 0) names = filterVo.getName().getSurname().split(" "); else names = filterVo.getName().getForename().split(" "); DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(); String query = " from Medic md "; ArrayList<String> markers = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); // Build search criteria { if (markers.size() > 0) hql.append(" AND ("); else hql.append("("); for (int i = 0; i < names.length; i++) { hql.append("md.mos.name.upperSurname like :SURNAME" + i); markers.add("SURNAME" + i); values.add("%" + names[i].toUpperCase() + "%"); hql.append(" OR "); hql.append("md.mos.name.upperForename like :FORENAME" + i); markers.add("FORENAME" + i); values.add("%" + names[i].toUpperCase() + "%"); if (i != names.length - 1) hql.append(" OR "); } hql.append(")"); } if (markers.size() > 0) query += " where "; query += hql.toString(); try { List<DomainObject> listMedics; listMedics = factory.find(query, markers, values); return MedicLiteVoAssembler.createMedicLiteVoCollectionFromMedic(listMedics); } catch (RuntimeException e) { e.printStackTrace(); return null; } }
@Override protected void onQmbConsultantTextSubmited(String value) throws PresentationLogicException { form.qmbConsultant().clear(); if (value != null) { MedicLiteVo med = null; MedicLiteVoCollection voMedicColl = domain.listActiveMedics(value); if (voMedicColl != null) { for (int i = 0; i < voMedicColl.size(); i++) { med = voMedicColl.get(i); form.qmbConsultant().newRow(med, med.toString()); } } if (voMedicColl != null && voMedicColl.size() == 1) form.qmbConsultant().setValue(voMedicColl.get(0)); else if (voMedicColl != null && voMedicColl.size() > 1) form.qmbConsultant().showOpened(); Integer id = engine.getLoggedInUser().getHcpId(); if (med != null && id != null && id.equals(med.getID_Hcp())) form.qmbConsultant().setValue(med); } }
private void initialize() { form.grdSelectedTests().getRows().clear(); form.grdListedTests().getRows().clear(); if (form.getGlobalContext().Clinical.getSelectedHCPsIsNotNull()) { ArrayList<Object> tempArray = form.getGlobalContext().Clinical.getSelectedHCPs(); for (int i = 0; i < tempArray.size(); i++) { grdSelectedTestsRow row = form.grdSelectedTests().getRows().newRow(); row.setcolSelected(false); if (tempArray.get(i) instanceof MedicLiteVo) { MedicLiteVo tempVo = (MedicLiteVo) tempArray.get(i); row.setcolName( tempVo != null && tempVo.getMosIsNotNull() && tempVo.getMos().getNameIsNotNull() ? tempVo.getMos().getName().toString() : ""); row.setValue(tempVo); } else if (tempArray.get(i) instanceof NurseVo) { NurseVo tempNurseVo = (NurseVo) tempArray.get(i); row.setcolName( tempNurseVo != null && tempNurseVo.getMosIsNotNull() && tempNurseVo.getMos().getNameIsNotNull() ? tempNurseVo.getMos().getName().toString() : ""); row.setValue(tempNurseVo); } else if (tempArray.get(i) instanceof HcpLiteVo) // WDEV-15691 { HcpLiteVo tempRadiographerVo = (HcpLiteVo) tempArray.get(i); row.setcolName( tempRadiographerVo != null && tempRadiographerVo.getMosIsNotNull() && tempRadiographerVo.getMos().getNameIsNotNull() ? tempRadiographerVo.getMos().getName().toString() : ""); row.setValue(tempRadiographerVo); } } } }
public int compare(Object ob1, Object ob2) { PersonName pdate1 = null; PersonName pdate2 = null; if (ob1 instanceof MedicLiteVo) { MedicLiteVo ps1 = (MedicLiteVo) ob1; pdate1 = ps1.getMosIsNotNull() && ps1.getMos().getNameIsNotNull() ? ps1.getMos().getName() : null; } if (ob2 instanceof MedicLiteVo) { MedicLiteVo ps2 = (MedicLiteVo) ob2; pdate2 = ps2.getMosIsNotNull() && ps2.getMos().getNameIsNotNull() ? ps2.getMos().getName() : null; } if (pdate1 != null) return pdate1.compareTo(pdate2) * direction; if (pdate2 != null) return (-1) * direction; return 0; }
protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException { LocationLiteVo locVo = null; LocSiteLiteVo locSiteVo = null; initialize(); if (domain.getCurrentLocation() instanceof LocationLiteVo) { locVo = (LocationLiteVo) domain.getCurrentLocation(); } else if (domain.getCurrentLocation() instanceof LocSiteLiteVo) { locSiteVo = (LocSiteLiteVo) domain.getCurrentLocation(); } // WDEV-15691 if (form.getGlobalContext().Clinical.getSelectedHcpIsNotNull() && (form.getGlobalContext().Clinical.getSelectedHcp().equals(HcpDisType.ANAESTHETIST) || form.getGlobalContext().Clinical.getSelectedHcp().equals(HcpDisType.MEDICAL))) { MedicLiteVoCollection medicColl = null; if (locVo != null) { if (locVo.getTypeIsNotNull() && locVo.getType().equals(LocationType.HOSP)) { if (form.getGlobalContext().Clinical.getSelectedHcp().equals(HcpDisType.ANAESTHETIST) && MedicGrade.CONS.equals(form.getGlobalContext().Clinical.getSelectedHcpGrade())) medicColl = domain.getMedics( locVo, HcpDisType.MEDICAL, form.getGlobalContext().Clinical.getSelectedHcp(), MedicGrade.CONS); else if (form.getGlobalContext().Clinical.getSelectedHcp().equals(HcpDisType.ANAESTHETIST) && form.getGlobalContext().Clinical.getSelectedHcpGrade() == null) medicColl = domain.getMedics( locVo, HcpDisType.MEDICAL, form.getGlobalContext().Clinical.getSelectedHcp(), null); else if (form.getGlobalContext().Clinical.getSelectedHcp().equals(HcpDisType.MEDICAL)) medicColl = domain.getMedics(locVo, HcpDisType.MEDICAL, null, null); } else if (locVo.getTypeIsNotNull() && !locVo.getType().equals(LocationType.HOSP)) { locVo = domain.getLocationLite(locVo); if (form.getGlobalContext().Clinical.getSelectedHcp().equals(HcpDisType.ANAESTHETIST) && MedicGrade.CONS.equals(form.getGlobalContext().Clinical.getSelectedHcpGrade())) medicColl = domain.getMedics( locVo, HcpDisType.MEDICAL, form.getGlobalContext().Clinical.getSelectedHcp(), MedicGrade.CONS); else if (form.getGlobalContext().Clinical.getSelectedHcp().equals(HcpDisType.ANAESTHETIST) && form.getGlobalContext().Clinical.getSelectedHcpGrade() == null) medicColl = domain.getMedics( locVo, HcpDisType.MEDICAL, form.getGlobalContext().Clinical.getSelectedHcp(), null); else if (form.getGlobalContext().Clinical.getSelectedHcp().equals(HcpDisType.MEDICAL)) medicColl = domain.getMedics(locVo, HcpDisType.MEDICAL, null, null); } } else if (locSiteVo != null) { locVo = domain.getLocationLite(locSiteVo); if (form.getGlobalContext().Clinical.getSelectedHcp().equals(HcpDisType.ANAESTHETIST) && MedicGrade.CONS.equals(form.getGlobalContext().Clinical.getSelectedHcpGrade())) medicColl = domain.getMedics( locVo, HcpDisType.MEDICAL, form.getGlobalContext().Clinical.getSelectedHcp(), MedicGrade.CONS); else if (form.getGlobalContext().Clinical.getSelectedHcp().equals(HcpDisType.ANAESTHETIST) && form.getGlobalContext().Clinical.getSelectedHcpGrade() == null) medicColl = domain.getMedics( locVo, HcpDisType.MEDICAL, form.getGlobalContext().Clinical.getSelectedHcp(), null); else if (form.getGlobalContext().Clinical.getSelectedHcp().equals(HcpDisType.MEDICAL)) medicColl = domain.getMedics(locVo, HcpDisType.MEDICAL, null, null); } if (medicColl != null) { if (form.getGlobalContext().Clinical.getMedicsSurgicalAuditIsNotNull()) { MedicLiteVoCollection tempColl = form.getGlobalContext().Clinical.getMedicsSurgicalAudit(); for (int i = 0; tempColl != null && i < tempColl.size(); i++) { if (medicColl != null && medicColl.contains(tempColl.get(i))) medicColl.remove(tempColl.get(i)); } } medicColl.sort(new MedicComparator(SortOrder.ASCENDING)); for (int i = 0; i < medicColl.size(); i++) { grdListedTestsRow row = form.grdListedTests().getRows().newRow(); row.setcolSelected(false); MedicLiteVo tempVo = medicColl.get(i); row.setcolName( tempVo != null && tempVo.getMosIsNotNull() && tempVo.getMos().getNameIsNotNull() ? tempVo.getMos().getName().toString() : ""); row.setValue(tempVo); } } } else if (form.getGlobalContext().Clinical.getSelectedHcpIsNotNull() && form.getGlobalContext().Clinical.getSelectedHcp().equals(HcpDisType.NURSING)) { NurseVoCollection nurseColl = null; if (locVo != null) { if (locVo.getTypeIsNotNull() && locVo.getType().equals(LocationType.HOSP)) { nurseColl = domain.getNurses(locVo, form.getGlobalContext().Clinical.getSelectedHcp()); } else if (locVo.getTypeIsNotNull() && !locVo.getType().equals(LocationType.HOSP)) { locVo = domain.getLocationLite(locVo); nurseColl = domain.getNurses(locVo, form.getGlobalContext().Clinical.getSelectedHcp()); } } else if (locSiteVo != null) { locVo = domain.getLocationLite(locSiteVo); nurseColl = domain.getNurses(locVo, form.getGlobalContext().Clinical.getSelectedHcp()); } if (nurseColl != null) { if (form.getGlobalContext().Clinical.getNursessSurgicalAuditIsNotNull()) { NurseVoCollection tempnColl = form.getGlobalContext().Clinical.getNursessSurgicalAudit(); for (int j = 0; tempnColl != null && j < tempnColl.size(); j++) { if (nurseColl.contains(tempnColl.get(j))) nurseColl.remove(tempnColl.get(j)); } } nurseColl.sort(new NurseComparator(SortOrder.ASCENDING)); for (int i = 0; i < nurseColl.size(); i++) { grdListedTestsRow row = form.grdListedTests().getRows().newRow(); row.setcolSelected(false); NurseVo tempVo = nurseColl.get(i); row.setcolName( tempVo != null && tempVo.getMosIsNotNull() && tempVo.getMos().getNameIsNotNull() ? tempVo.getMos().getName().toString() : ""); row.setValue(tempVo); } } } // WDEV-15691 else if (form.getGlobalContext().Clinical.getSelectedHcpIsNotNull() && form.getGlobalContext().Clinical.getSelectedHcp().equals(HcpDisType.RADIOGRAPHER)) { HcpLiteVoCollection radiographerColl = null; // WDEV-15691 if (locVo != null) { if (locVo.getTypeIsNotNull() && locVo.getType().equals(LocationType.HOSP)) { radiographerColl = domain.getOtheDisciplineHcp(locVo, form.getGlobalContext().Clinical.getSelectedHcp()); } else if (locVo.getTypeIsNotNull() && !locVo.getType().equals(LocationType.HOSP)) { locVo = domain.getLocationLite(locVo); radiographerColl = domain.getOtheDisciplineHcp(locVo, form.getGlobalContext().Clinical.getSelectedHcp()); } } else if (locSiteVo != null) { locVo = domain.getLocationLite(locSiteVo); radiographerColl = domain.getOtheDisciplineHcp(locVo, form.getGlobalContext().Clinical.getSelectedHcp()); } if (radiographerColl != null) { if (form.getGlobalContext().Clinical.getRadiographerSurgAuditProcDetailsIsNotNull()) { HcpLiteVoCollection tempnColl = form.getGlobalContext().Clinical.getRadiographerSurgAuditProcDetails(); for (int j = 0; tempnColl != null && j < tempnColl.size(); j++) { if (radiographerColl.contains(tempnColl.get(j))) radiographerColl.remove(tempnColl.get(j)); } } for (int i = 0; i < radiographerColl.size(); i++) { grdListedTestsRow row = form.grdListedTests().getRows().newRow(); row.setcolSelected(false); HcpLiteVo tempVo = radiographerColl.get(i); row.setcolName( tempVo != null && tempVo.getMosIsNotNull() && tempVo.getMos().getNameIsNotNull() ? tempVo.getMos().getName().toString() : ""); row.setValue(tempVo); } } } }