private void loadOrganisations() { form.lyrDetails().tabGenDetails().cmbRepOrganisation().clear(); form.lyrDetails().tabGenDetails().cmbRequestingOrg().clear(); OrgLiteVoCollection voColl = null; if (form.getLocalContext().getLoadedOrganisationsIsNotNull()) voColl = form.getLocalContext().getLoadedOrganisations(); else { voColl = domain.listOrganisationsLite(new OrgShortVo()); form.getLocalContext().setLoadedOrganisations(voColl); } for (int i = 0 ; voColl != null && i < voColl.size() ; i++) { if (voColl.get(i).getIsActiveIsNotNull() && voColl.get(i).getIsActive().booleanValue()) { form.lyrDetails().tabGenDetails().cmbRepOrganisation().newRow(voColl.get(i), voColl.get(i).getName(), null, null); form.lyrDetails().tabGenDetails().cmbRequestingOrg().newRow(voColl.get(i), voColl.get(i).getName(), null, null); } } }
private void loadData(TreeNode parentNode, OrgLiteVo organization) { if (parentNode == null || organization == null) return; OrgLiteVoCollection organizations = domain.listOrganizationsByOrganization(organization); if (organization != null) { for (int x = 0; x < organizations.size(); x++) { add(parentNode, organizations.get(x)); } } LocSiteLiteVoCollection locationSites = domain.listLocationSites(organization); if (locationSites != null) { for (int x = 0; x < locationSites.size(); x++) { // ---------------------------------------- if (locationSites.get(x).getIsActive() == true) // ---------------------------------------- add(parentNode, locationSites.get(x)); } } }
public OrgLiteVoCollection listAllSuppliers() { DomainFactory factory = getDomainFactory(); String hql = " from Organisation org "; StringBuffer condStr = new StringBuffer(); String andStr = " "; ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); condStr.append(andStr + " org.type.id = " + OrganisationType.SUPPLIER.getID()); andStr = " and "; condStr.append(andStr + "org.isActive = :isActive"); markers.add("isActive"); values.add(Boolean.TRUE); hql += " where "; hql += condStr.toString(); List locations = factory.find(hql, markers, values, 1000); return OrgLiteVoAssembler.createOrgLiteVoCollectionFromOrganisation(locations).sort(); }
private void populateLHO() throws FormOpenException { OrgLiteVoCollection orgColl = null; orgColl = domain.listLHOs(); if(orgColl == null || (orgColl != null && orgColl.size() == 0)) throw new FormOpenException("Please set up LHO before open form."); form.cmbLHO().clear(); for (int i = 0; i < orgColl.size(); i++) { OrgLiteVo vo = orgColl.get(i); form.cmbLHO().newRow(vo, vo.getName()); } }
private void populateRootOrganizations(OrgLiteVoCollection rootOrganizations) { form.treeLocation().getNodes().clear(); if (rootOrganizations == null) return; for (int x = 0; x < rootOrganizations.size(); x++) { add(rootOrganizations.get(x)); } }
private boolean hasAllowedLocations(OrgLiteVo organization, IAppUser user) { OrgLiteVoCollection organizationList = domain.listOrganizationsByOrganization(organization); LocSiteLiteVoCollection locationList = domain.listLocationSites(organization); ILocationProvider locationProvider = engine.getLocationProvider(); if (locationProvider != null && !locationProvider.shouldSelectLocation(user)) return true; // Test locations if (locationList != null) { for (int i = 0; i < locationList.size(); i++) { if (locationProvider != null && locationProvider.locationIsAllowed(locationList.get(i), user)) return true; if (hasAllowedLocations(locationList.get(i), user)) return true; } } // Test organizations if (organizationList != null) { for (int i = 0; i < organizationList.size(); i++) { if (hasAllowedLocations(organizationList.get(i), user)) return true; } } return false; }
public OrgLiteVoCollection listOrganisationsLite(OrgShortVo filter) { List orgs = listDomOrganisation(filter); OrgLiteVoCollection voCollOrg = OrgLiteVoAssembler.createOrgLiteVoCollectionFromOrganisation(orgs); voCollOrg.sort(); return voCollOrg; }
private void initialiseOnwardTab() { form.setMode(FormMode.VIEW); //load SecondaryCareProviders OrgLiteVoCollection voCollOrg = domain.listAllSuppliers(); form.lyrDetail().tabOnwardReferral().cmbSecondaryCareProvider().clear(); for(OrgLiteVo voOrg: voCollOrg) form.lyrDetail().tabOnwardReferral().cmbSecondaryCareProvider().newRow(voOrg, voOrg.getName()); form.lyrDetail().tabOnwardReferral().btnRemove().setVisible(false); form.lyrDetail().tabOnwardReferral().cmbReferredInto().setRequired(true); }
private boolean populateSuppliers() { OrgLiteVoCollection voColl = domain.listAllSuppliers(); for (int i = 0 ; voColl != null && i <voColl.size() ; i++) { form.cmbOnwardReferralOrganisation().newRow(voColl.get(i), voColl.get(i).getName()); } return (voColl != null && voColl.size() > 0) ? true : false; }
private void loadSuppliers() { OrgLiteVoCollection voColl = domain.listAllSuppliers(); for (int i = 0 ; voColl != null && i <voColl.size() ; i++) form.lyr1().tabDischargePatient().cmbSecondaryOrganisation().newRow(voColl.get(i), voColl.get(i).getName()); form.getLocalContext().setAllSuppliers(voColl); }
private void loadSuppliers() { OrgLiteVoCollection voColl = domain.listAllSuppliers(); for (int i = 0 ; voColl != null && i <voColl.size() ; i++) form.lyr1().tabTLT().lyrTLT().tabPageTLTOutcome().cmbTLTOrganisation().newRow(voColl.get(i), voColl.get(i).getName()); form.getLocalContext().setAllSuppliers(voColl); }
@SuppressWarnings("unchecked") public OrgLiteVoCollection listAllSuppliers() { DomainFactory factory = getDomainFactory(); String hql = " from Organisation org "; StringBuffer condStr = new StringBuffer(); String andStr = " "; ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); condStr.append(andStr + " org.type.id = " + OrganisationType.SUPPLIER.getID()); andStr = " and "; condStr.append(andStr + "org.isActive = :isActive"); markers.add("isActive"); values.add(Boolean.TRUE); hql += " where "; hql += condStr.toString(); List locations = factory.find(hql, markers, values, 1000); return OrgLiteVoAssembler.createOrgLiteVoCollectionFromOrganisation(locations).sort(); }
public OrgLiteVoCollection listLHOs() { StringBuffer hql = new StringBuffer(); hql.append(" from Organisation o"); hql.append(" where"); hql.append(" o.type.id = :lho and o.isActive = 1 order by o.name asc"); return OrgLiteVoAssembler.createOrgLiteVoCollectionFromOrganisation(getDomainFactory().find(hql.toString(), new String[] { "lho" }, new Object[] { OrganisationType.LHO.getID() })); }