Java 类ims.core.vo.domain.ServiceVoAssembler 实例源码

项目:AvoinApotti    文件:ServiceImpl.java   
public ServiceVoCollection listService(Integer[] nServiceIds)
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hqlStart = new StringBuffer();
    String hql;

    hqlStart.append("from Service s where s.id in ( ");
    for (int i = 0; i < nServiceIds.length; i++)
        hqlStart.append(nServiceIds[i] + ",");

    if (hqlStart.toString().endsWith(","))
        hql = hqlStart.toString().substring(0, hqlStart.length() - 1);
    else
        hql = hqlStart.toString();

    hql += " )";

    return ServiceVoAssembler.createServiceVoCollectionFromService(factory.find(hql));
}
项目:AvoinApotti    文件:ReferralDetailsComponentImpl.java   
private EpisodeofCareShortVo updateEpisodeOfCareSpecialty(CatsReferralWizardVo catsReferralVo, ReferralLetterDetailsVo referralDetailsVo, DomainFactory factory) throws StaleObjectException
{
    CareContextVo voCC = CareContextVoAssembler.create((CareContext) getDomainFactory().getDomainObject(CareContext.class, catsReferralVo.getCareContext().getID_CareContext()));
    ServiceVo voServ = ServiceVoAssembler.create((ims.core.clinical.domain.objects.Service) getDomainFactory().getDomainObject(ims.core.clinical.domain.objects.Service.class, referralDetailsVo.getService().getID_Service()));

    EpisodeOfCare doEOC = (EpisodeOfCare) factory.getDomainObject(EpisodeOfCare.class, voCC.getEpisodeOfCare().getID_EpisodeOfCare());
    if (doEOC != null)
    {
        //WDEV-11535 - if referral service.specialty is null set it back to DAD
        Specialty spec = null;
        if(voServ.getSpecialty() == null)
            spec = Specialty.DAD;
        else
            spec = voServ.getSpecialty();

        doEOC.setSpecialty(getDomLookup(spec));         
        factory.save(doEOC);

        return EpisodeofCareShortVoAssembler.create(doEOC);
    }

    return null;
}
项目:AvoinApotti    文件:PresentationComponentImpl.java   
@SuppressWarnings("unchecked")
public ServiceVo getService(Integer id)
{
    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("select service from CatsReferral as catsRef join catsRef.referralDetails" +
            " as referal join referal.service as service where catsRef.id = "+id);

    List domService = factory.find(hql.toString());

    ServiceVoCollection serviceColl = ServiceVoAssembler.createServiceVoCollectionFromService(domService);
    if(serviceColl.size() > 0)
        return serviceColl.get(0);
    else
        return null;

}
项目:openMAXIMS    文件:ServiceConfigurationImpl.java   
public ServiceVo getService(ServiceRefVo service)
{
    if(service == null || service.getID_Service() == null)
        return null;

    DomainFactory factory = getDomainFactory();
    ServiceVo serviceVo = ServiceVoAssembler.create((Service) factory.getDomainObject(Service.class, service.getID_Service()));

    String hql = "select count(s.id) from ReferralService as rs left join rs.referralServices as s where s.id = :ServiceId";
    Object[] count = factory.find(hql, new String[] {"ServiceId"}, new Object[] {serviceVo.getID_Service()}).toArray();

    if(count != null && count.length > 0 && ((Long) count[0]).intValue() > 0)
        serviceVo.setCanReferIntoTheService(true);
    else
        serviceVo.setCanReferIntoTheService(false);

    return serviceVo;
}
项目:openMAXIMS    文件:ServiceImpl.java   
public ServiceVoCollection listService(Integer[] nServiceIds)
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hqlStart = new StringBuffer();
    String hql;

    hqlStart.append("from Service s where s.id in ( ");
    for (int i = 0; i < nServiceIds.length; i++)
        hqlStart.append(nServiceIds[i] + ",");

    if (hqlStart.toString().endsWith(","))
        hql = hqlStart.toString().substring(0, hqlStart.length() - 1);
    else
        hql = hqlStart.toString();

    hql += " )";

    return ServiceVoAssembler.createServiceVoCollectionFromService(factory.find(hql));
}
项目:openMAXIMS    文件:ReferralDetailsComponentImpl.java   
private EpisodeofCareShortVo updateEpisodeOfCareSpecialty(CatsReferralWizardVo catsReferralVo, ReferralLetterDetailsVo referralDetailsVo, DomainFactory factory) throws StaleObjectException
{
    CareContextVo voCC = CareContextVoAssembler.create((CareContext) getDomainFactory().getDomainObject(CareContext.class, catsReferralVo.getCareContext().getID_CareContext()));
    ServiceVo voServ = ServiceVoAssembler.create((ims.core.clinical.domain.objects.Service) getDomainFactory().getDomainObject(ims.core.clinical.domain.objects.Service.class, referralDetailsVo.getService().getID_Service()));

    EpisodeOfCare doEOC = (EpisodeOfCare) factory.getDomainObject(EpisodeOfCare.class, voCC.getEpisodeOfCare().getID_EpisodeOfCare());
    if (doEOC != null)
    {
        //WDEV-11535 - if referral service.specialty is null set it back to DAD
        Specialty spec = null;
        if(voServ.getSpecialty() == null)
            spec = Specialty.DAD;
        else
            spec = voServ.getSpecialty();

        doEOC.setSpecialty(getDomLookup(spec));         
        factory.save(doEOC);

        return EpisodeofCareShortVoAssembler.create(doEOC);
    }

    return null;
}
项目:openMAXIMS    文件:PresentationComponentImpl.java   
@SuppressWarnings("unchecked")
public ServiceVo getService(Integer id)
{
    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("select service from CatsReferral as catsRef join catsRef.referralDetails" +
            " as referal join referal.service as service where catsRef.id = "+id);

    List domService = factory.find(hql.toString());

    ServiceVoCollection serviceColl = ServiceVoAssembler.createServiceVoCollectionFromService(domService);
    if(serviceColl.size() > 0)
        return serviceColl.get(0);
    else
        return null;

}
项目:openMAXIMS    文件:ServiceImpl.java   
public ServiceVoCollection listService(Integer[] nServiceIds)
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hqlStart = new StringBuffer();
    String hql;

    hqlStart.append("from Service s where s.id in ( ");
    for (int i = 0; i < nServiceIds.length; i++)
        hqlStart.append(nServiceIds[i] + ",");

    if (hqlStart.toString().endsWith(","))
        hql = hqlStart.toString().substring(0, hqlStart.length() - 1);
    else
        hql = hqlStart.toString();

    hql += " )";

    return ServiceVoAssembler.createServiceVoCollectionFromService(factory.find(hql));
}
项目:openMAXIMS    文件:ReferralDetailsComponentImpl.java   
private EpisodeofCareShortVo updateEpisodeOfCareSpecialty(CatsReferralWizardVo catsReferralVo, ReferralLetterDetailsVo referralDetailsVo, DomainFactory factory) throws StaleObjectException
{
    CareContextVo voCC = CareContextVoAssembler.create((CareContext) getDomainFactory().getDomainObject(CareContext.class, catsReferralVo.getCareContext().getID_CareContext()));
    ServiceVo voServ = ServiceVoAssembler.create((ims.core.clinical.domain.objects.Service) getDomainFactory().getDomainObject(ims.core.clinical.domain.objects.Service.class, referralDetailsVo.getService().getID_Service()));

    EpisodeOfCare doEOC = (EpisodeOfCare) factory.getDomainObject(EpisodeOfCare.class, voCC.getEpisodeOfCare().getID_EpisodeOfCare());
    if (doEOC != null)
    {
        //WDEV-11535 - if referral service.specialty is null set it back to DAD
        Specialty spec = null;
        if(voServ.getSpecialty() == null)
            spec = Specialty.DAD;
        else
            spec = voServ.getSpecialty();

        doEOC.setSpecialty(getDomLookup(spec));         
        factory.save(doEOC);

        return EpisodeofCareShortVoAssembler.create(doEOC);
    }

    return null;
}
项目:openMAXIMS    文件:PresentationComponentImpl.java   
@SuppressWarnings("unchecked")
public ServiceVo getService(Integer id)
{
    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("select service from CatsReferral as catsRef join catsRef.referralDetails" +
            " as referal join referal.service as service where catsRef.id = "+id);

    List domService = factory.find(hql.toString());

    ServiceVoCollection serviceColl = ServiceVoAssembler.createServiceVoCollectionFromService(domService);
    if(serviceColl.size() > 0)
        return serviceColl.get(0);
    else
        return null;

}
项目:openmaxims-linux    文件:LocationServiceImpl.java   
public ServiceVoCollection listService(Boolean activeOnly)
{
    DomainFactory factory = getDomainFactory();
    if (activeOnly.booleanValue())
        return ServiceVoAssembler.createServiceVoCollectionFromService(factory.find("from Service service where service.isActive = :active", new String[]{"active"}, new Object[]{activeOnly}));

    return ServiceVoAssembler.createServiceVoCollectionFromService(factory.listDomainObjects(Service.class)).sort();
}
项目:openmaxims-linux    文件:ServiceImpl.java   
public ServiceVoCollection listService(Integer[] nServiceIds)
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hqlStart = new StringBuffer();
    String hql;

    hqlStart.append("from Service s where s.id in ( ");
    for (int i = 0; i < nServiceIds.length; i++)
        hqlStart.append(nServiceIds[i] + ",");

    if (hqlStart.toString().endsWith(","))
        hql = hqlStart.toString().substring(0, hqlStart.length() - 1);
    else
        hql = hqlStart.toString();

    hql += " )";

    return ServiceVoAssembler.createServiceVoCollectionFromService(factory.find(hql));
}
项目:AvoinApotti    文件:SupportNetworkProfessionalServicesImpl.java   
public ServiceVoCollection listService(ServiceCategory serviceType)
{
    // will be called from servicefunction when implemented in Spinal
    DomainFactory factory = getDomainFactory();
    if (serviceType == null)
        return ServiceVoAssembler.createServiceVoCollectionFromService(factory.listDomainObjects(Service.class));

    String hql = "from Service s where s.serviceCategory = :serviceType and s.isActive = :active";
    java.util.List services = factory.find(hql, new String[]{"serviceType", "active"}, new Object[]{getDomLookup(serviceType), Boolean.TRUE});
    return ServiceVoAssembler.createServiceVoCollectionFromService(services);
}
项目:AvoinApotti    文件:SupportNetworkProfessionalServicesImpl.java   
public ServiceVoCollection listService(ServiceCategoryCollection excludedServices)
{
    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("from Service s where s.isActive = :active");
    ArrayList paramNames = new ArrayList();
    ArrayList paramValues = new ArrayList();

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

    if (excludedServices != null)
    {
        int servicesSize = excludedServices.size();
        for (int i = 0; i < servicesSize; i++)
        {
            if (i == 0)
                hql.append(" and (");

            ServiceCategory serviceCategory = excludedServices.get(i);
            String serviceType = "serviceType" + Integer.toString(i);
            paramNames.add(serviceType);
            paramValues.add(new Integer(serviceCategory.getID()));

            hql.append("s.serviceCategory.id <> :" + serviceType);

            if (i == (servicesSize - 1))
                hql.append(")");
            else
                hql.append(" and ");
        }
    }
    hql.append(" order by UPPER(s.serviceName) asc  ");
    java.util.List services = factory.find(hql.toString(), paramNames, paramValues);

    return ServiceVoAssembler.createServiceVoCollectionFromService(services);
}
项目:AvoinApotti    文件:SupportServicesImpl.java   
public ServiceVoCollection listService( ServiceCategoryCollection excludedServices) 
{
    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("from Service s where s.isActive = :active");
    ArrayList paramNames = new ArrayList();
    ArrayList paramValues = new ArrayList();

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

    if (excludedServices != null)
    {
        int servicesSize = excludedServices.size();
        for (int i = 0; i < servicesSize; i++)
        {
            if (i == 0)
                hql.append(" and (");

            ServiceCategory serviceCategory = excludedServices.get(i);
            String serviceType = "serviceType" + Integer.toString(i);
            paramNames.add(serviceType);
            paramValues.add(new Integer(serviceCategory.getID()));

            hql.append("s.serviceCategory.id <> :" + serviceType);

            if (i == (servicesSize - 1))
                hql.append(")");
            else
                hql.append(" and ");
        }
    }
    //WDEV-18210
    hql.append(" order by UPPER(s.serviceName) asc");

    java.util.List services = factory.find(hql.toString(), paramNames, paramValues);

    return ServiceVoAssembler.createServiceVoCollectionFromService(services);
}
项目:AvoinApotti    文件:LocationServiceImpl.java   
public ServiceVo getService(Integer serviceId)
{
    DomainFactory factory = getDomainFactory();

    if (serviceId != null)
    {
        Service domSserv = (Service) factory.getDomainObject(Service.class, serviceId);
        return ServiceVoAssembler.create(domSserv);
    }
    return null;
}
项目:AvoinApotti    文件:LocationServiceImpl.java   
public ServiceVoCollection listService(Boolean activeOnly)
{
    DomainFactory factory = getDomainFactory();
    if (activeOnly.booleanValue())
        return ServiceVoAssembler.createServiceVoCollectionFromService(factory.find("from Service service where service.isActive = :active", new String[]{"active"}, new Object[]{activeOnly}));

    return ServiceVoAssembler.createServiceVoCollectionFromService(factory.listDomainObjects(Service.class)).sort();
}
项目:AvoinApotti    文件:PrescriptionComponentImpl.java   
/**
* getCatsReferralService
*/
public ims.core.vo.ServiceShortVo getCatsReferralService(ims.RefMan.vo.CatsReferralRefVo catsRefVo)
{
    if(catsRefVo == null || catsRefVo.getID_CatsReferral() == null) {
        throw new CodingRuntimeException("CatsReferralVo is null or id not provided");
    }

    CatsReferralListVo voCatsReferral = CatsReferralListVoAssembler.create((CatsReferral)getDomainFactory().getDomainObject(CatsReferral.class, catsRefVo.getID_CatsReferral()));
    if (voCatsReferral != null && voCatsReferral.getReferralDetailsIsNotNull()&& voCatsReferral.getReferralDetails().getServiceIsNotNull()) {
        return ServiceVoAssembler.create((Service)getDomainFactory().getDomainObject(Service.class, voCatsReferral.getReferralDetails().getService().getID_Service())); 
    }

    return null;
}
项目:AvoinApotti    文件:AtConsultationComponentImpl.java   
public ServiceShortVo getCatsReferralService(CatsReferralRefVo voCatsReferralRef) 
{
    CatsReferralListVo voCatsReferral = CatsReferralListVoAssembler.create((CatsReferral)getDomainFactory().getDomainObject(CatsReferral.class, voCatsReferralRef.getID_CatsReferral()));
    if (voCatsReferral != null)
        return ServiceVoAssembler.create((Service)getDomainFactory().getDomainObject(Service.class, voCatsReferral.getReferralDetails().getService().getID_Service()));

    return null;
}
项目:AvoinApotti    文件:ReferralOutcomeComponentImpl.java   
public ServiceVo getCatsReferralService(CatsReferralRefVo voCatsReferralRef) 
{
    CatsReferralListVo voCatsReferral = CatsReferralListVoAssembler.create((CatsReferral)getDomainFactory().getDomainObject(CatsReferral.class, voCatsReferralRef.getID_CatsReferral()));
    if (voCatsReferral != null
        && voCatsReferral.getReferralDetailsIsNotNull()
        && voCatsReferral.getReferralDetails().getServiceIsNotNull())
        return ServiceVoAssembler.create((Service)getDomainFactory().getDomainObject(Service.class, voCatsReferral.getReferralDetails().getService().getID_Service()));

    return null;
}
项目:openMAXIMS    文件:SupportNetworkProfessionalServicesImpl.java   
public ServiceVoCollection listService(ServiceCategory serviceType)
{
    // will be called from servicefunction when implemented in Spinal
    DomainFactory factory = getDomainFactory();
    if (serviceType == null)
        return ServiceVoAssembler.createServiceVoCollectionFromService(factory.listDomainObjects(Service.class));

    String hql = "from Service s where s.serviceCategory = :serviceType and s.isActive = :active";
    java.util.List services = factory.find(hql, new String[]{"serviceType", "active"}, new Object[]{getDomLookup(serviceType), Boolean.TRUE});
    return ServiceVoAssembler.createServiceVoCollectionFromService(services);
}
项目:openMAXIMS    文件:SupportNetworkProfessionalServicesImpl.java   
public ServiceVoCollection listService(ServiceCategoryCollection excludedServices)
{
    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("from Service s where s.isActive = :active");
    ArrayList paramNames = new ArrayList();
    ArrayList paramValues = new ArrayList();

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

    if (excludedServices != null)
    {
        int servicesSize = excludedServices.size();
        for (int i = 0; i < servicesSize; i++)
        {
            if (i == 0)
                hql.append(" and (");

            ServiceCategory serviceCategory = excludedServices.get(i);
            String serviceType = "serviceType" + Integer.toString(i);
            paramNames.add(serviceType);
            paramValues.add(new Integer(serviceCategory.getID()));

            hql.append("s.serviceCategory.id <> :" + serviceType);

            if (i == (servicesSize - 1))
                hql.append(")");
            else
                hql.append(" and ");
        }
    }
    hql.append(" order by s.upperName asc  "); //WDEV-20219 UPPER(s.serviceName)
    java.util.List services = factory.find(hql.toString(), paramNames, paramValues);

    return ServiceVoAssembler.createServiceVoCollectionFromService(services);
}
项目:openMAXIMS    文件:SupportServicesImpl.java   
public ServiceVoCollection listService( ServiceCategoryCollection excludedServices) 
{
    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("from Service s where s.isActive = :active");
    ArrayList paramNames = new ArrayList();
    ArrayList paramValues = new ArrayList();

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

    if (excludedServices != null)
    {
        int servicesSize = excludedServices.size();
        for (int i = 0; i < servicesSize; i++)
        {
            if (i == 0)
                hql.append(" and (");

            ServiceCategory serviceCategory = excludedServices.get(i);
            String serviceType = "serviceType" + Integer.toString(i);
            paramNames.add(serviceType);
            paramValues.add(new Integer(serviceCategory.getID()));

            hql.append("s.serviceCategory.id <> :" + serviceType);

            if (i == (servicesSize - 1))
                hql.append(")");
            else
                hql.append(" and ");
        }
    }
    //WDEV-18210
    hql.append(" order by s.upperName asc"); //WDEV-20219 UPPER(s.serviceName)

    java.util.List services = factory.find(hql.toString(), paramNames, paramValues);

    return ServiceVoAssembler.createServiceVoCollectionFromService(services);
}
项目:openMAXIMS    文件:LocationServiceImpl.java   
public ServiceVo getService(Integer serviceId)
{
    DomainFactory factory = getDomainFactory();

    if (serviceId != null)
    {
        Service domSserv = (Service) factory.getDomainObject(Service.class, serviceId);
        return ServiceVoAssembler.create(domSserv);
    }
    return null;
}
项目:openMAXIMS    文件:LocationServiceImpl.java   
public ServiceVoCollection listService(Boolean activeOnly)
{
    DomainFactory factory = getDomainFactory();
    if (activeOnly.booleanValue())
        return ServiceVoAssembler.createServiceVoCollectionFromService(factory.find("from Service service where service.isActive = :active order by service.serviceName asc  ", new String[]{"active"}, new Object[]{activeOnly})); //WDEV-22950

    return ServiceVoAssembler.createServiceVoCollectionFromService(factory.listDomainObjects(Service.class)).sort();
}
项目:openMAXIMS    文件:PrescriptionComponentImpl.java   
/**
* getCatsReferralService
*/
public ims.core.vo.ServiceShortVo getCatsReferralService(ims.RefMan.vo.CatsReferralRefVo catsRefVo)
{
    if(catsRefVo == null || catsRefVo.getID_CatsReferral() == null) {
        throw new CodingRuntimeException("CatsReferralVo is null or id not provided");
    }

    CatsReferralListVo voCatsReferral = CatsReferralListVoAssembler.create((CatsReferral)getDomainFactory().getDomainObject(CatsReferral.class, catsRefVo.getID_CatsReferral()));
    if (voCatsReferral != null && voCatsReferral.getReferralDetailsIsNotNull()&& voCatsReferral.getReferralDetails().getServiceIsNotNull()) {
        return ServiceVoAssembler.create((Service)getDomainFactory().getDomainObject(Service.class, voCatsReferral.getReferralDetails().getService().getID_Service())); 
    }

    return null;
}
项目:openMAXIMS    文件:AtConsultationComponentImpl.java   
public ServiceShortVo getCatsReferralService(CatsReferralRefVo voCatsReferralRef) 
{
    CatsReferralListVo voCatsReferral = CatsReferralListVoAssembler.create((CatsReferral)getDomainFactory().getDomainObject(CatsReferral.class, voCatsReferralRef.getID_CatsReferral()));
    if (voCatsReferral != null)
        return ServiceVoAssembler.create((Service)getDomainFactory().getDomainObject(Service.class, voCatsReferral.getReferralDetails().getService().getID_Service()));

    return null;
}
项目:openMAXIMS    文件:ReferralOutcomeComponentImpl.java   
public ServiceVo getCatsReferralService(CatsReferralRefVo voCatsReferralRef) 
{
    CatsReferralListVo voCatsReferral = CatsReferralListVoAssembler.create((CatsReferral)getDomainFactory().getDomainObject(CatsReferral.class, voCatsReferralRef.getID_CatsReferral()));
    if (voCatsReferral != null
        && voCatsReferral.getReferralDetailsIsNotNull()
        && voCatsReferral.getReferralDetails().getServiceIsNotNull())
        return ServiceVoAssembler.create((Service)getDomainFactory().getDomainObject(Service.class, voCatsReferral.getReferralDetails().getService().getID_Service()));

    return null;
}
项目:openMAXIMS    文件:SupportNetworkProfessionalServicesImpl.java   
public ServiceVoCollection listService(ServiceCategory serviceType)
{
    // will be called from servicefunction when implemented in Spinal
    DomainFactory factory = getDomainFactory();
    if (serviceType == null)
        return ServiceVoAssembler.createServiceVoCollectionFromService(factory.listDomainObjects(Service.class));

    String hql = "from Service s where s.serviceCategory = :serviceType and s.isActive = :active";
    java.util.List services = factory.find(hql, new String[]{"serviceType", "active"}, new Object[]{getDomLookup(serviceType), Boolean.TRUE});
    return ServiceVoAssembler.createServiceVoCollectionFromService(services);
}
项目:openMAXIMS    文件:SupportNetworkProfessionalServicesImpl.java   
public ServiceVoCollection listService(ServiceCategoryCollection excludedServices)
{
    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("from Service s where s.isActive = :active");
    ArrayList paramNames = new ArrayList();
    ArrayList paramValues = new ArrayList();

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

    if (excludedServices != null)
    {
        int servicesSize = excludedServices.size();
        for (int i = 0; i < servicesSize; i++)
        {
            if (i == 0)
                hql.append(" and (");

            ServiceCategory serviceCategory = excludedServices.get(i);
            String serviceType = "serviceType" + Integer.toString(i);
            paramNames.add(serviceType);
            paramValues.add(new Integer(serviceCategory.getID()));

            hql.append("s.serviceCategory.id <> :" + serviceType);

            if (i == (servicesSize - 1))
                hql.append(")");
            else
                hql.append(" and ");
        }
    }
    hql.append(" order by UPPER(s.serviceName) asc  ");
    java.util.List services = factory.find(hql.toString(), paramNames, paramValues);

    return ServiceVoAssembler.createServiceVoCollectionFromService(services);
}
项目:openMAXIMS    文件:SupportServicesImpl.java   
public ServiceVoCollection listService( ServiceCategoryCollection excludedServices) 
{
    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("from Service s where s.isActive = :active");
    ArrayList paramNames = new ArrayList();
    ArrayList paramValues = new ArrayList();

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

    if (excludedServices != null)
    {
        int servicesSize = excludedServices.size();
        for (int i = 0; i < servicesSize; i++)
        {
            if (i == 0)
                hql.append(" and (");

            ServiceCategory serviceCategory = excludedServices.get(i);
            String serviceType = "serviceType" + Integer.toString(i);
            paramNames.add(serviceType);
            paramValues.add(new Integer(serviceCategory.getID()));

            hql.append("s.serviceCategory.id <> :" + serviceType);

            if (i == (servicesSize - 1))
                hql.append(")");
            else
                hql.append(" and ");
        }
    }
    //WDEV-18210
    hql.append(" order by UPPER(s.serviceName) asc");

    java.util.List services = factory.find(hql.toString(), paramNames, paramValues);

    return ServiceVoAssembler.createServiceVoCollectionFromService(services);
}
项目:openMAXIMS    文件:LocationServiceImpl.java   
public ServiceVo getService(Integer serviceId)
{
    DomainFactory factory = getDomainFactory();

    if (serviceId != null)
    {
        Service domSserv = (Service) factory.getDomainObject(Service.class, serviceId);
        return ServiceVoAssembler.create(domSserv);
    }
    return null;
}
项目:openMAXIMS    文件:LocationServiceImpl.java   
public ServiceVoCollection listService(Boolean activeOnly)
{
    DomainFactory factory = getDomainFactory();
    if (activeOnly.booleanValue())
        return ServiceVoAssembler.createServiceVoCollectionFromService(factory.find("from Service service where service.isActive = :active", new String[]{"active"}, new Object[]{activeOnly}));

    return ServiceVoAssembler.createServiceVoCollectionFromService(factory.listDomainObjects(Service.class)).sort();
}
项目:openMAXIMS    文件:PrescriptionComponentImpl.java   
/**
* getCatsReferralService
*/
public ims.core.vo.ServiceShortVo getCatsReferralService(ims.RefMan.vo.CatsReferralRefVo catsRefVo)
{
    if(catsRefVo == null || catsRefVo.getID_CatsReferral() == null) {
        throw new CodingRuntimeException("CatsReferralVo is null or id not provided");
    }

    CatsReferralListVo voCatsReferral = CatsReferralListVoAssembler.create((CatsReferral)getDomainFactory().getDomainObject(CatsReferral.class, catsRefVo.getID_CatsReferral()));
    if (voCatsReferral != null && voCatsReferral.getReferralDetailsIsNotNull()&& voCatsReferral.getReferralDetails().getServiceIsNotNull()) {
        return ServiceVoAssembler.create((Service)getDomainFactory().getDomainObject(Service.class, voCatsReferral.getReferralDetails().getService().getID_Service())); 
    }

    return null;
}
项目:openMAXIMS    文件:AtConsultationComponentImpl.java   
public ServiceShortVo getCatsReferralService(CatsReferralRefVo voCatsReferralRef) 
{
    CatsReferralListVo voCatsReferral = CatsReferralListVoAssembler.create((CatsReferral)getDomainFactory().getDomainObject(CatsReferral.class, voCatsReferralRef.getID_CatsReferral()));
    if (voCatsReferral != null)
        return ServiceVoAssembler.create((Service)getDomainFactory().getDomainObject(Service.class, voCatsReferral.getReferralDetails().getService().getID_Service()));

    return null;
}
项目:openMAXIMS    文件:ReferralOutcomeComponentImpl.java   
public ServiceVo getCatsReferralService(CatsReferralRefVo voCatsReferralRef) 
{
    CatsReferralListVo voCatsReferral = CatsReferralListVoAssembler.create((CatsReferral)getDomainFactory().getDomainObject(CatsReferral.class, voCatsReferralRef.getID_CatsReferral()));
    if (voCatsReferral != null
        && voCatsReferral.getReferralDetailsIsNotNull()
        && voCatsReferral.getReferralDetails().getServiceIsNotNull())
        return ServiceVoAssembler.create((Service)getDomainFactory().getDomainObject(Service.class, voCatsReferral.getReferralDetails().getService().getID_Service()));

    return null;
}
项目:openmaxims-linux    文件:SupportNetworkProfessionalServicesImpl.java   
public ServiceVoCollection listService(ServiceCategory serviceType)
{
    // will be called from servicefunction when implemented in Spinal
    DomainFactory factory = getDomainFactory();
    if (serviceType == null)
        return ServiceVoAssembler.createServiceVoCollectionFromService(factory.listDomainObjects(Service.class));

    String hql = "from Service s where s.serviceCategory = :serviceType and s.isActive = :active";
    java.util.List services = factory.find(hql, new String[]{"serviceType", "active"}, new Object[]{getDomLookup(serviceType), Boolean.TRUE});
    return ServiceVoAssembler.createServiceVoCollectionFromService(services);
}
项目:openmaxims-linux    文件:SupportNetworkProfessionalServicesImpl.java   
public ServiceVoCollection listService(ServiceCategoryCollection excludedServices)
{
    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("from Service s where s.isActive = :active");
    ArrayList paramNames = new ArrayList();
    ArrayList paramValues = new ArrayList();

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

    if (excludedServices != null)
    {
        int servicesSize = excludedServices.size();
        for (int i = 0; i < servicesSize; i++)
        {
            if (i == 0)
                hql.append(" and (");

            ServiceCategory serviceCategory = excludedServices.get(i);
            String serviceType = "serviceType" + Integer.toString(i);
            paramNames.add(serviceType);
            paramValues.add(new Integer(serviceCategory.getID()));

            hql.append("s.serviceCategory.id <> :" + serviceType);

            if (i == (servicesSize - 1))
                hql.append(")");
            else
                hql.append(" and ");
        }
    }
    hql.append(" order by UPPER(s.serviceName) asc  ");
    java.util.List services = factory.find(hql.toString(), paramNames, paramValues);

    return ServiceVoAssembler.createServiceVoCollectionFromService(services);
}
项目:openmaxims-linux    文件:SupportServicesImpl.java   
public ServiceVoCollection listService( ServiceCategoryCollection excludedServices) 
{
    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("from Service s where s.isActive = :active");
    ArrayList paramNames = new ArrayList();
    ArrayList paramValues = new ArrayList();

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

    if (excludedServices != null)
    {
        int servicesSize = excludedServices.size();
        for (int i = 0; i < servicesSize; i++)
        {
            if (i == 0)
                hql.append(" and (");

            ServiceCategory serviceCategory = excludedServices.get(i);
            String serviceType = "serviceType" + Integer.toString(i);
            paramNames.add(serviceType);
            paramValues.add(new Integer(serviceCategory.getID()));

            hql.append("s.serviceCategory.id <> :" + serviceType);

            if (i == (servicesSize - 1))
                hql.append(")");
            else
                hql.append(" and ");
        }
    }
    //WDEV-18210
    hql.append(" order by UPPER(s.serviceName) asc");

    java.util.List services = factory.find(hql.toString(), paramNames, paramValues);

    return ServiceVoAssembler.createServiceVoCollectionFromService(services);
}
项目:openmaxims-linux    文件:LocationServiceImpl.java   
public ServiceVo getService(Integer serviceId)
{
    DomainFactory factory = getDomainFactory();

    if (serviceId != null)
    {
        Service domSserv = (Service) factory.getDomainObject(Service.class, serviceId);
        return ServiceVoAssembler.create(domSserv);
    }
    return null;
}