Java 类ims.core.vo.LocationLiteVoCollection 实例源码

项目:AvoinApotti    文件:CDSGenerateImpl.java   
@SuppressWarnings({"rawtypes"})
public LocationLiteVoCollection listLocation(String name)
{
    if(name == null)
        throw new CodingRuntimeException("Can't search for a null string !");

    String tmp = name;

    if(!tmp.endsWith("%"))
        tmp += "%";
    if(!tmp.startsWith("%"))
        tmp = "%" + tmp;

    DomainFactory factory = getDomainFactory();

    List lst = factory.find("from Location loc where loc.isActive = 1 and loc.name like :NAME and loc.type.id <> -853 order by loc.name", new String[] {"NAME"}, new Object[] {tmp});

    return LocationLiteVoAssembler.createLocationLiteVoCollectionFromLocation(lst);
}
项目:AvoinApotti    文件:Logic.java   
private void populateHospitalCombo()
{
    form.cmbHospital().clear();

    LocationLiteVoCollection voLocColl = domain.listActiveHospitals();

    if (voLocColl != null)
    {
        for (LocationLiteVo hospital : voLocColl)
        {
            form.cmbHospital().newRow(hospital, hospital.getName());
        }
    }

    ILocation location = engine.getCurrentLocation();

    if (location != null)
    {
        LocationLiteVo hospitalForCurrentLocation = domain.getHospitalForCurrentLocation(location.getID());
        form.cmbHospital().setValue(hospitalForCurrentLocation);
    }

    populateLocationCombo();

}
项目:AvoinApotti    文件:Logic.java   
private void loadClinicLocationCombo()
{
    LocationLiteVoCollection voLocationLiteColl = domain.listActiveHospitalsLite();
    if (voLocationLiteColl != null)
    {
        String currentLocName = "";
        for (int i = 0; i < voLocationLiteColl.size(); i++)
        {
            form.cmbLocation().newRow(voLocationLiteColl.get(i), voLocationLiteColl.get(i).getName().toString());
            //WDEV-4585

            if (engine.getCurrentLocation() != null)
            {
                // WDEV-2847
                currentLocName = engine.getCurrentLocation().getName();
                if (currentLocName.equals(voLocationLiteColl.get(i).getName()))
                {
                    form.cmbLocation().setValue(voLocationLiteColl.get(i));
                    form.qmbClinic().setEnabled(true);
                }
            }
        }
    }
}
项目:AvoinApotti    文件:Logic.java   
@Override
protected void onQmbWardTextSubmited(String value) throws PresentationLogicException
{
    if (form.qmbHospital().getValue()==null)
        return;

    LocationLiteVoCollection wards = domain.listWards(value,form.qmbHospital().getValue());

    if (wards == null || wards.size()==0)
        return;

    for (int i = 0; i < wards.size(); i++)
    {
        form.qmbWard().newRow(wards.get(i), wards.get(i).getName());
    }

    if (wards.size()==1)
    {
        form.qmbWard().setValue(wards.get(0));
    }
    else
    {
        form.qmbWard().showOpened();
    }
}
项目:AvoinApotti    文件:MyOrderImpl.java   
public LocationLiteVoCollection listWardsForHospitalByNameLite(LocationRefVo location, String name)
{
    OrganisationAndLocation impl = (OrganisationAndLocation) getDomainImpl(OrganisationAndLocationImpl.class);

    //WDEV-6721 - if user enters more than 1 '%' - search was failing
    String[] arr = null;
    if(name.contains("%"))
    {
        arr = name.split("%");
        if(arr.length > 0)
            name = arr[0] + "%";
        else
            name = "%";
    }

    return impl.listActiveWardsForHospitalByNameLite(location, name);
}
项目:AvoinApotti    文件:Logic.java   
private void populateWardCombo(LocationLiteVoCollection locliteVoColl)
{
    if(locliteVoColl != null && locliteVoColl.size() > 0)
    {
        for(int i = 0; i < locliteVoColl.size();i++)
        {
            if(locliteVoColl.get(i) != null)
                form.qmbWard().newRow(locliteVoColl.get(i), locliteVoColl.get(i).getName());
        }
        if(locliteVoColl.size() > 1)
            form.qmbWard().showOpened();
        else if(locliteVoColl.size() == 1)
        {
            form.qmbWard().setValue(locliteVoColl.get(0));
        }
    }
}
项目:AvoinApotti    文件:Logic.java   
private void bindWardCombo(CareContextVo careContext) 
{
    if(careContext == null || careContext.getPasEvent() == null || careContext.getPasEvent().getLocation() == null)
        return;

    LocationLiteVoCollection wards = domain.listWardsForCurrentHospital(careContext.getPasEvent().getLocation());

    if(wards == null || wards.size() == 0)
        return;

    form.cmbWard().clear();

    for(int i=0; i<wards.size(); i++)
    {
        if(wards.get(i) == null)
            continue;

        form.cmbWard().newRow(wards.get(i), wards.get(i).getIItemText());
    }

    form.cmbWard().setValue(careContext.getPasEvent().getLocation());
}
项目:AvoinApotti    文件:WaitingListConfigurationImpl.java   
public LocationLiteVoCollection listHospitals(String name)
{
    DomainFactory factory = getDomainFactory();

    ArrayList<String> markers = new ArrayList<String>();
    ArrayList<Object> values = new ArrayList<Object>();

    StringBuffer hql = new StringBuffer();

    hql.append(" select loc from Location as loc ");
    hql.append(" where loc.upperName like :LocName and loc.isActive = 1 and loc.isVirtual = 0 and loc.type <> :surgery ");
    hql.append(" order by loc.upperName asc");

    markers.add("LocName");
    values.add(name.toUpperCase()+"%");

    markers.add("surgery");
    values.add(getDomLookup(LocationType.SURGERY));

    return LocationLiteVoAssembler.createLocationLiteVoCollectionFromLocation(factory.find(hql.toString(), markers, values));
}
项目:AvoinApotti    文件:TestEditImpl.java   
public LocationLiteVoCollection listProvidersByCategory(Category lookupCategory)
{
    if (lookupCategory == null)
        return null;

    DomainFactory factory = getDomainFactory();

    java.util.List locations = null;
    LookupInstance type = null;

    if (lookupCategory.equals(Category.PATHOLOGY))
        type = getDomLookup(LocationType.PATHOLOGYLABORATORY);
    else if (lookupCategory.equals(Category.CLINICALIMAGING))
        type = getDomLookup(LocationType.CLINICALIMAGINGDEPARTMENT);
    else if (lookupCategory.equals(Category.CLINICAL))
        type = getDomLookup(LocationType.CLINICAL);

    if (type == null)
        throw new DomainRuntimeException("type id not found (listProvidersByCategory method)");

    locations = factory.find("from Location loc where loc.type = :type", new String[]{"type"}, new Object[]{type});

    return LocationLiteVoAssembler.createLocationLiteVoCollectionFromLocation(locations).sort();
}
项目:AvoinApotti    文件:Logic.java   
private void loadHospitals()
{
    LocationLiteVoCollection voColl = domain.listActiveHospitalsLite();
    form.cmbCurrentHosp().clear();
    form.cmbDestHosp().clear();

    for (int i = 0; voColl != null && i < voColl.size(); i++)
    {
        form.cmbCurrentHosp().newRow(voColl.get(i), voColl.get(i).getName());
        form.cmbDestHosp().newRow(voColl.get(i), voColl.get(i).getName());

        if (engine.getCurrentLocation() != null && voColl.get(i).getID_Location().equals(engine.getCurrentLocation().getID()))
        {
            form.cmbCurrentHosp().setValue(voColl.get(i));
            form.cmbDestHosp().setValue(voColl.get(i));
        }

    }
}
项目:AvoinApotti    文件:Logic.java   
private boolean hasAllowedLocations(LocSiteLiteVo location, IAppUser user)
{
    LocationLiteVoCollection locationList = domain.listLocationsByLocationSite(location);

    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;
        }
    }

    return false;
}
项目:AvoinApotti    文件:Logic.java   
@Override
protected void onQmbWardTextSubmited(String value) throws PresentationLogicException
{
    if (form.cmbCurrentHosp().getValue() == null)
    {
        engine.showMessage("Please select a Current Hospital to find a Ward for.");
        return;
    }

    LocationLiteVoCollection wards = domain.listWards(form.cmbCurrentHosp().getValue().getID_Location(), value);
    if (wards != null)
    {
        form.qmbCurrentWard().clear();//wdev-8431
        for (LocationLiteVo item : wards)
            form.qmbCurrentWard().newRow(item, item.getName());
    }
    if (wards.size() == 1)
        form.qmbCurrentWard().setValue(wards.get(0));
    else if (wards.size() > 1)
        form.qmbCurrentWard().showOpened();

}
项目:AvoinApotti    文件:Logic.java   
@Override
protected void onQmbWardTextSubmited(String value) throws ims.framework.exceptions.PresentationLogicException
{
    if (form.cmbHospital().getValue() == null)
    {
        engine.showMessage("Please select a Hospital to find a Ward for.");
        return;
    }

    if (value != null)
    {
        LocationLiteVoCollection voColl = domain.listWards(form.cmbHospital().getValue().getID_Location(), value);

        voColl.sort();
        form.qmbWard().clear();
        for (int i = 0; i < voColl.size(); i++)
            form.qmbWard().newRow(voColl.get(i), voColl.get(i).getName());

        if (voColl.size() == 1)
            form.qmbWard().setValue(voColl.get(0));
        else if (voColl.size() > 1)
            form.qmbWard().showOpened();
    }
}
项目:AvoinApotti    文件:Logic.java   
private void loadOutpatientDepartment()
{
    form.lyrDetails().tabGenDetails().cmbDepartment().clear();

    LocationRefVo hospital = getLocationRef(form.lyrDetails().tabGenDetails().cmbHospital().getValue());

    if (hospital == null)
        return;

    LocationLiteVoCollection departments = domain.listActiveOutpatientDepartment(hospital);

    for (int i = 0; i < departments.size(); i++)
    {
        LocationLiteVo department = departments.get(i);

        if (department == null)
            continue;

        form.lyrDetails().tabGenDetails().cmbDepartment().newRow(department, department.getIItemText());
    }

    if (departments.size() == 1)
    {
        form.lyrDetails().tabGenDetails().cmbDepartment().setValue(departments.get(0));
    }
}
项目:AvoinApotti    文件:Logic.java   
private LocationLiteVoCollection getExistentHospitalsFromGrid()
{
    if (form.ctnDetails().grdHospitals().getRows().size()==0)
        return null;

    LocationLiteVoCollection collHosp = new LocationLiteVoCollection();

    for (int i=0;i<form.ctnDetails().grdHospitals().getRows().size();i++)
    {
        if (form.ctnDetails().grdHospitals().getRows().get(i).getColHospitals().getValue()==null)
            continue;

        collHosp.add((LocationLiteVo) form.ctnDetails().grdHospitals().getRows().get(i).getColHospitals().getValue());
    }

    return collHosp;
}
项目:AvoinApotti    文件:NewResultsAllTabComponentImpl.java   
private LocationLiteVoCollection listLocations(String name, LocationType locType)
{
    ArrayList<String> names = new ArrayList<String>();
    ArrayList<Object> values = new ArrayList<Object>();

    String hql = "from Location loc where (loc.type.id = :typeId";
    names.add("typeId");
    values.add(new Integer(locType.getId()));

    if (name != null)
    {
        hql += " and loc.upperName like :name ";
        names.add("name");
        values.add(name.toUpperCase() + "%");
    }
    hql += (" and loc.isVirtual = :virtual and loc.isActive = 1) order by loc.upperName asc");
    names.add("virtual");
    values.add(Boolean.FALSE);

    List<?> l = this.getDomainFactory().find(hql, names, values);
    return LocationLiteVoAssembler.createLocationLiteVoCollectionFromLocation(l);
}
项目:AvoinApotti    文件:Logic.java   
private void initialiseWardCombo()
{
    //WDEv-18388
    if (form.qmbHospital().getValue()==null)
        return;

    LocationLiteVoCollection wards = domain.listWards(form.qmbWard().getEditedText(),form.qmbHospital().getValue());

    if (wards == null)
        return;

    for (int i = 0; i < wards.size(); i++)
    {
        form.qmbWard().newRow(wards.get(i), wards.get(i).getName());//WDEV-18388
    }
}
项目:AvoinApotti    文件:Logic.java   
private void loadHospitals() 
{
    LocationLiteVoCollection hospitals = domain.getActiveHospitals();
    if (hospitals!=null)
    {
        for (LocationLiteVo item: hospitals)
        {
            form.cmbCurrentHospital().newRow(item, item.getName());
            if(form.cmbCurrentHospital().getValue() == null)
            {
                if (engine.getCurrentLocation() != null && item.getID_Location().equals(engine.getCurrentLocation().getID()))
                {
                    form.cmbCurrentHospital().setValue(item);

                    loadWards();//wdev-7858
                }
            }
        }
    }
}
项目:AvoinApotti    文件:Logic.java   
private void loadWards()
{
    form.cmbCurrentWard().clear();
    if (form.cmbCurrentHospital().getValue()!=null)
    {

        LocationLiteVoCollection wards = domain.getWards(form.cmbCurrentHospital().getValue().getID_Location());
        if (wards!=null)
        {
            for (LocationLiteVo item : wards) 
            {
                form.cmbCurrentWard().newRow(item, item.getName());
            }
        }
    }
}
项目:AvoinApotti    文件:Logic.java   
@Override
protected void onQmbLocationTextSubmited(String value) throws PresentationLogicException
{
    form.qmbLocation().clear();

    LocationLiteVoCollection col = domain.listLocation(value);

    for(LocationLiteVo loc : col)
    {
        form.qmbLocation().newRow(loc, loc.getName());  
    }

    if(col.size() == 1)
    {
        form.qmbLocation().setValue(col.get(0));
        onQmbLocationValueChanged();
    }
    else
        form.qmbLocation().showOpened();
}
项目:AvoinApotti    文件:ClinicListwithICPActionsImpl.java   
public LocationLiteVoCollection getActiveHospitals(MemberOfStaffRefVo mos)
{
    if (mos == null || !mos.getID_MemberOfStaffIsNotNull())
        return null;

    StringBuilder query = new StringBuilder();
    query.append("select location from MemberOfStaff as mos left join mos.locations as hcpLocation left join hcpLocation.location as location ");
    query.append(" where location.type = :LocType and location.isActive = :isActive and location.isVirtual = :isVirtual and mos.id = :mosID");

    ArrayList<String> paramNames = new ArrayList<String>();
    ArrayList<Object> paramValues = new ArrayList<Object>();

    paramNames.add("LocType");
    paramValues.add(getDomLookup(LocationType.HOSP));

    paramNames.add("isActive");
    paramValues.add(Boolean.TRUE);

    paramNames.add("isVirtual");
    paramValues.add(Boolean.FALSE);

    paramNames.add("mosID");
    paramValues.add(mos.getID_MemberOfStaff());

    return LocationLiteVoAssembler.createLocationLiteVoCollectionFromLocation(getDomainFactory().find(query.toString(), paramNames, paramValues));
}
项目:AvoinApotti    文件:Logic.java   
@Override
protected void onQmbWardTextSubmited(String value) throws ims.framework.exceptions.PresentationLogicException
{
    form.getLocalContext().setEventFired(null);

    if (form.cmbHospital().getValue() == null)
    {
        engine.showMessage("Please select a Hospital to find a Ward for.");
        return;
    }

    LocationLiteVoCollection wards = domain.listWards(form.cmbHospital().getValue().getID_Location(), value);
    if (wards != null)
    {
        for (LocationLiteVo item : wards)
            form.qmbWard().newRow(item, item.getName());
    }
    if (wards.size() == 1)
        form.qmbWard().setValue(wards.get(0));
    else if (wards.size() > 1)
        form.qmbWard().showOpened();
}
项目:AvoinApotti    文件:Logic.java   
private void loadBaysForSelectedWard(WardBayConfigVo voWardBayConfig) 
{   
    form.cmbBay().clear();

    if (form.cmbWard().getValue() == null)
        return;


    LocationLiteVoCollection baysColl = domain.listBaysForCurrentWard(form.cmbWard().getValue());
    if(baysColl != null)
    {
        for(int x = 0; x < baysColl.size(); x++)
        {
            if(isfloorBedSpaceLayoutActive(voWardBayConfig, baysColl.get(x)))
                addBays(baysColl.get(x));
        }

        if (form.cmbBay().getValues().size() == 1)
        {
            form.cmbBay().setValue((LocationLiteVo) form.cmbBay().getValues().get(0));
            bayValueChanged();
        }
    }
}
项目:AvoinApotti    文件:Logic.java   
private void loadWardsForSelectedHosp()
{
    form.cmbWard().clear();

    if(form.cmbHospital().getValue() != null)
    {
        LocationLiteVoCollection wardsColl = domain.listWardsForCurrentLocation(form.cmbHospital().getValue());
        if(wardsColl != null)
        {
            for(int x = 0; x < wardsColl.size(); x++)
            {
                addWard(wardsColl.get(x));
            }

            //WDEV-15908 
            if(wardsColl.size() == 1)
            {
                form.cmbWard().setValue(wardsColl.get(0));
                wardValueChanged();
            }
        }
    }
}
项目:AvoinApotti    文件:Logic.java   
private void loadLocations() {
    form.cmbLocation().clear();

    LocationLiteVoCollection voCollLoc = null;

    if (ConfigFlag.UI.DISABLE_MULTI_SITE_CATS_FUNCTIONALITY.getValue()) {
        // single site
        voCollLoc = domain.listLocationLite();
    } else {
        // multi site
        voCollLoc = domain.listLocationLiteForReferralContract(form
                .getGlobalContext().RefMan.getCatsReferral());
    }

    if (voCollLoc != null) {
        for (LocationLiteVo item : voCollLoc)
            form.cmbLocation().newRow(item, item.getName());
    }
}
项目:AvoinApotti    文件:CareContextSelectDialogImpl.java   
public LocationLiteVoCollection listWardsForCurrentHospital(LocationRefVo currentWard) 
{
    if(currentWard == null || !currentWard.getID_LocationIsNotNull())
        throw new CodingRuntimeException("Can not list Wards for a null Location Id");

    Location hospital = getHospitalByWard(currentWard);

    if(hospital == null)
        return null;

    LocationRefVo hospitalRef = LocationLiteVoAssembler.create(hospital);

    OrganisationAndLocation organisatonImpl = (OrganisationAndLocation) getDomainImpl(OrganisationAndLocationImpl.class);

    return organisatonImpl.listActiveWardsForHospitalLite(hospitalRef);
}
项目:AvoinApotti    文件:Logic.java   
private void loadLocations(LocationLiteVoCollection voCollLoc)
    {
        form.cmbSite().clear();

        if(voCollLoc == null)
            return;

        for(LocationLiteVo item : voCollLoc)
            form.cmbSite().newRow(item, item.getName());

//      wdev-12682
        if( form.getGlobalContext().RefMan.getDiagnosticReferralForApplicationIsNotNull()
            && form.getGlobalContext().RefMan.getDiagnosticReferralForApplication())
        {           
            if(engine.getCurrentLocation() != null)
            {
                form.cmbSite().setValue(engine.getCurrentLocation());

                if(form.cmbSite().getValue() != null)
                    siteOrDateChanged(false);
            }
        }
    }
项目:AvoinApotti    文件:Logic.java   
private void loadLocations(Category value)
{
    LocationLiteVo backup = form.lyrInvestigations().tabGeneralDet().cmbProvider().getValue();//WDEV-12979

    form.lyrInvestigations().tabGeneralDet().cmbProvider().clear();

    if (value == null)
        return;

    LocationLiteVoCollection coll = domain.listProvidersByCategory(value);
    for (int i = 0; i < coll.size(); i++)
    {
        form.lyrInvestigations().tabGeneralDet().cmbProvider().newRow(coll.get(i), coll.get(i).getName());
    }

    form.lyrInvestigations().tabGeneralDet().cmbProvider().setValue(backup);////WDEV-12979
}
项目:AvoinApotti    文件:Logic.java   
private void populateLocationQueryComboBox(grdFuturePlanRow row, LocationLiteVoCollection locationCollection)
{
    // Clear the QueryCombobox
    row.getColLoc().clear();
    row.getColLoc().setEditedText(null);

    // Terminate function if location collection is null
    if (locationCollection == null || locationCollection.size() == 0)
        return;

    for (LocationLiteVo value : locationCollection)
    {
        row.getColLoc().newRow(value, value.getName());
    }

    if (locationCollection.size() == 1)
    {
        row.getColLoc().setValue(locationCollection.get(0));
    }
    else
    {
        row.getColLoc().showOpened();
    }
}
项目:AvoinApotti    文件:Logic.java   
private void loadWards() 
{
    if (form.cmbHospital().getValue() == null)
        return;

    form.cmbWard().clear();
    LocationLiteVoCollection listWards = domain.listWards(form.cmbHospital().getValue().getID_Location());
    if (listWards!=null)
    {
        for (LocationLiteVo item: listWards)
        {
            form.cmbWard().newRow(item, item.getName());

            if(Boolean.TRUE.equals(ConfigFlag.UI.DEFAULT_CONSULTANT_AND_WARD_ON_INPATIENT_ICP_FORM.getValue())) //wdev-13775
            {
                if(engine.getCurrentLocation() != null)
                {
                    if (engine.getCurrentLocation().getID() == item.getID_Location().intValue())
                        form.cmbWard().setValue(item);
                }
            }
        }
    }

}
项目:AvoinApotti    文件:PendingDischargesImpl.java   
public LocationLiteVoCollection getWards(Integer hospital) 
{
    DomainFactory factory = getDomainFactory();
    OrganisationAndLocation impl = (OrganisationAndLocation) getDomainImpl(OrganisationAndLocationImpl.class);
    LocationRefVo loc=new LocationRefVo();
    loc.setID_Location(hospital);
    LocShortMappingsVoCollection wards = impl.listActiveWardsForHospital(loc);
    LocationLiteVoCollection locations=new LocationLiteVoCollection();

    if (wards.size()>0)
    {
        for (int i=0;i<wards.size();i++)
        {
            LocationLiteVo location=new LocationLiteVo();
            location=wards.get(i);
            locations.add(location);
        }

    }
    return locations;

}
项目:AvoinApotti    文件:DirectoryOfServiceAdminImpl.java   
/**
 * list active locations by name excluding the following types ( 'Pathology Laboratory','Radiology' & 'Surgery')
 */
public LocationLiteVoCollection listLocationLiteByName(String name)
{   
    DomainFactory factory = getDomainFactory();
    String hql = "from Location loc where loc.isActive = :active and loc.type.id not in (:path,:rad,:surgery) ";
    if(name != null)
    {
        name = name.replaceAll("%","");
        hql += " and loc.upperName like '" + name.toUpperCase() + "%'"; 
    }

    hql += " order by loc.upperName asc";

    List<?> locs = factory.find(hql, new String[]{"active","path","rad","surgery"}, new Object[]{Boolean.TRUE,LocationType.PATHOLOGYLABORATORY.getID(),LocationType.CLINICALIMAGINGDEPARTMENT.getID(),LocationType.SURGERY.getID()});
    return LocationLiteVoAssembler.createLocationLiteVoCollectionFromLocation(locs);
}
项目:AvoinApotti    文件:Logic.java   
protected void onQmbLocationTextSubmited(String value) throws PresentationLogicException
{
    form.qmbLocation().clear();

    if (value == null || value.equals(""))
    {
        engine.showMessage("Please enter at least one character to search on");
        return;
    }

    LocationLiteVoCollection voCollLocLite = domain.listActiveLocations(value);
    if (voCollLocLite != null && voCollLocLite.size() > 0)
    {
        for (int i = 0; i < voCollLocLite.size(); i++)
        {
            form.qmbLocation().newRow(voCollLocLite.get(i), voCollLocLite.get(i).getName().toString());
        }
        if (voCollLocLite.size() == 1)
            form.qmbLocation().setValue(voCollLocLite.get(0));
        else if (voCollLocLite.size() > 1)
            form.qmbLocation().showOpened();
    }
    else
        engine.showMessage("No matching records found");

}
项目:AvoinApotti    文件:Logic.java   
private void loadLocation()
{
    form.cmbDepartment().clear();

    LocationLiteVoCollection voColl = domain.listLocation(LocationType.CLINICALIMAGINGDEPARTMENT, Boolean.TRUE);
    int currentLocId;
    for (int i = 0; voColl != null && i < voColl.size(); i++)
    {
        LocationLiteVo voLocation = voColl.get(i);
        form.cmbDepartment().newRow(voLocation, voLocation.getName());

        //WDEV-2847
        if(engine.getCurrentLocation() != null)
        {
            if (engine.getCurrentLocation().getID() == voLocation.getID_Location().intValue())
                form.cmbDepartment().setValue(voLocation);
        }
    }

    setDefaultDepartmentValue();
}
项目:AvoinApotti    文件:Logic.java   
private void loadHospitals()
{
    LocationLiteVoCollection hospitals = domain.getActiveHospitals(domain.getMosUser() instanceof MemberOfStaffRefVo ? (MemberOfStaffRefVo) domain.getMosUser() : null);
    if (hospitals != null)
    {
        for (LocationLiteVo item : hospitals)
        {
            form.cmbHospital().newRow(item, item.getName());

            if (engine.getCurrentLocation() != null)
            {
                if (engine.getCurrentLocation().getID() == item.getID_Location().intValue() && form.dteDate().getValue() != null)
                {
                    form.cmbHospital().setValue(item);
                    loadClinics(false);
                }
            }
        }
    }
}
项目:AvoinApotti    文件:Logic.java   
private Boolean getLocattionRefresh()
{

    LocationLiteVoCollection voCollLocLite= domain.listLocationLiteByNameAndOrganisation("%%%", form.cmbContract().getValue().getContractOrganisation());
    if (voCollLocLite != null && voCollLocLite.size() > 0)
    {
        for (int i = 0; i < voCollLocLite.size(); i++)
        {
            if( form.qmbLocation().getValue().equals(voCollLocLite.get(i)))
                return true;

        }
    }

    form.qmbLocation().clear();
    if (voCollLocLite != null && voCollLocLite.size() > 0)
    {
        for (int i = 0; i < voCollLocLite.size(); i++)
        {
            form.qmbLocation().newRow(voCollLocLite.get(i), voCollLocLite.get(i).getName().toString());
        }

    }
    return false;

}
项目:AvoinApotti    文件:Logic.java   
protected void onQmbLocationTextSubmited(String value) throws PresentationLogicException
{
    form.qmbLocation().clear();

    //WDEV-11662LocationLiteVoCollection voCollLocLite = form.cmbOrganisation().getValue() instanceof OrganisationLiteVo ? domain.listLocationLiteByNameAndOrganisation(value, form.cmbOrganisation().getValue()) : domain.listLocationLiteByName(value);
    if (form.cmbContract().getValue() == null || !form.cmbContract().getValue().getContractOrganisationIsNotNull())
        return;
    LocationLiteVoCollection voCollLocLite= domain.listLocationLiteByNameAndOrganisation(value, form.cmbContract().getValue().getContractOrganisation());
    //WDEV-11662 end
    if (voCollLocLite != null && voCollLocLite.size() > 0)
    {
        for (int i = 0; i < voCollLocLite.size(); i++)
        {
            form.qmbLocation().newRow(voCollLocLite.get(i), voCollLocLite.get(i).getName().toString());
        }
        if (voCollLocLite.size() == 1)
            form.qmbLocation().setValue(voCollLocLite.get(0));
        else if (voCollLocLite.size() > 1)
            form.qmbLocation().showOpened();
    }
    else
        engine.showMessage("No matching records found");
}
项目:AvoinApotti    文件:Logic.java   
private void populateHospital() 
{
    form.cmbHospital().clear();

    LocationLiteVoCollection hospColl = domain.listHospitals();

    if(hospColl == null)
        return;

    for (int i = 0; i < hospColl.size(); i++)
    {
        LocationLiteVo hosp = hospColl.get(i);
        form.cmbHospital().newRow(hosp, hosp.getName());
    }

    LocationLiteVo currentHospital = domain.getCurrentHospital(engine.getCurrentLocation());
    form.cmbHospital().setValue(currentHospital);
}
项目:AvoinApotti    文件:Logic.java   
private void searchLocations(String value)
{
    if (value == null)
        return;

    form.qmbOrderingLocation().clear();

    LocationLiteVoCollection locations = domain.listWards(value, form.cmbHospital().getValue());

    if (locations != null)
    {
        for (int x = 0; x < locations.size(); x++)
        {
            addLocation(locations.get(x));
        }
    }

    if (locations != null && locations.size() > 1)
        form.qmbOrderingLocation().showOpened();
    else if (locations != null && locations.size() == 1)
        form.qmbOrderingLocation().setValue(locations.get(0));
}
项目:AvoinApotti    文件:Logic.java   
private void bindWardCombo(LocSiteLiteVo locSiteLite) 
{
    form.cmbWard().clear();

    if(locSiteLite != null)
    {
        LocationLiteVoCollection wards = domain.listWards(locSiteLite);

        if(wards == null || wards.size() == 0)
            return;

        for(LocationLiteVo ward : wards)
        {
            if(ward == null)
                continue;

            form.cmbWard().newRow(ward, ward.getName());
        }
    }
}