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

项目:AvoinApotti    文件:Logic.java   
private void searchProfiles()
{
    form.grdProfiles().getRows().clear();
    clearScreen();//WDEV-14644
    //WDEV-16799
    ProfileShortVoCollection coll = domain.listProfiles((ServiceVo) form.cmbFilterSpecialty().getValue(), form.qmbFilterDirectoryOfService().getValue(), form.cmbHospFilter().getValue(), form.chkActiveOnly().getValue() == false ? null : true, form.chkFilterOutpatients().getValue(), form.chkFilterTheatre().getValue(), form.txtName().getValue(), form.ccListOwner().getValue());
    if (coll == null || coll.size() == 0)
        return;

    GenForm.grdProfilesRow row;
    for (int i = 0; i < coll.size(); i++)
    {
        ProfileShortVo prfile = coll.get(i);
        row = form.grdProfiles().getRows().newRow();
        row.setValue(prfile);
        if (prfile.getEffToIsNotNull())
            row.setcolEndDate(prfile.getEffTo().toString());
        if (prfile.getEffFrmIsNotNull())
            row.setcolStartDate(prfile.getEffFrm().toString());
        row.setcolProfileDescription(prfile.getDescription());
        if (prfile.getServiceIsNotNull())
            row.setcolSpeciality(prfile.getService().getServiceName());
    }
}
项目:AvoinApotti    文件:Logic.java   
public void populateScreenFromData(ServiceVo voService, TreeNode node)
{
    // clear out instance data for next edit
    clearInstanceControls();

    super.populateScreenFromData(voService); // do this anyway for
                                                // ServiceVo info
    cmbCategoryValueChanged();              //wdev-16371

    // additional info for ServiceFunction and ServiceActivity
    // set local context function and activity collections for current
    // service selection
    populateScreenFromDataActivityFunction(node);

    populateScreenFromDataServiceInfo();
}
项目:AvoinApotti    文件:Logic.java   
private String formatServicevoTooltip(ServiceVo voService)
{
    String out = makeTextile("*" + ConfigFlag.UI.DISPLAY_NAME_SERVICE.getValue(true) + ": *", "DarkRed", "tahoma", "14");
    out += makeTextile(voService.getServiceNameIsNotNull() ? voService.getServiceName() : "", "black", "tahoma", "12");
    out += makeNewLine(new Integer(1));
    if (voService.getServiceDescriptionIsNotNull())
    {
        out += makeNewLine(new Integer(1));
        out += makeTextile("*Description: *", "DarkRed", "tahoma", "12");
        out += makeTextile(voService.getServiceDescription(), "black", "tahoma", "12");
    }
    if (voService.getIsActiveIsNotNull())
    {
        out += makeNewLine(new Integer(1));
        out += makeTextile("*Active: *", "DarkRed", "tahoma", "12");
        out += makeTextile(voService.getIsActive().toString(), "black", "tahoma", "12");
    }
    return new TextileString(out).toString();
}
项目:AvoinApotti    文件:Logic.java   
public boolean populateActivityFunctionDataFromScreen(ServiceVo voService) throws UniqueKeyViolationException
{
    boolean ret = false;
    if (checkForErrorsOnActivityFunction())
    {
        // update taxonomy contexts for last selected function and activity
        saveServiceActivityTaxonomy(voService);
        saveServiceFunctionTaxonomy(voService);

        // add/remove activities
        ret = saveServiceActivity();
        if (!ret)
            return ret;

        ret = saveServiceFunction();

        return ret;
    }

    return false;
}
项目:AvoinApotti    文件:Logic.java   
private void treeExpandCollapse(TreeNode node)
{
    if (node.isExpanded())
    {
        if (node.getNodes().size() > 0 && node.getNodes().get(0).getValue() == null)
        {
            if (node.getValue() instanceof ServiceVo)
                form.getLocalContext().setSelectedRecord((ServiceVo) node.getValue());
            populateServiceFunctionAndActivity(node);
        }
    }
    else
    {
        if (!ConfigFlag.UI.SERVICE_TABS.getValue(false).equalsIgnoreCase("NONE"))
        {
            if (node.getNodes().get(0).getText() == form.getLocalContext().gettreMessage())
            {
                node.getNodes().get(0).setText("Loading Please wait...");
            }
        }
    }
}
项目:AvoinApotti    文件:LocationServiceImpl.java   
/**
 * expects parameters returns null if the parameters are not set
 */
public LocationServiceVoCollection listServicesForLocation(LocationRefVo location, ServiceVo service)
{
    DomainFactory factory = getDomainFactory();

    if (location == null || service == null)
        return null;

    if (location.getID_LocationIsNotNull() && service.getID_ServiceIsNotNull())
    {
        java.util.List servactList = factory.find("from  LocationService locService where locService.location.id = :locationId and locService.service.id = :serviceId", new String[]{"locationId", "serviceId"}, new Object[]{location.getID_Location(), service.getID_Service()});
        return LocationServiceVoAssembler.createLocationServiceVoCollectionFromLocationService(servactList).sort();
    }

    return null;
}
项目:AvoinApotti    文件:ServiceImpl.java   
private String activeLocationServiceLinks(ims.core.vo.ServiceVo voService)
{
    LocationService impl = (LocationService) getDomainImpl(LocationServiceImpl.class);
    LocationServiceVo voLocSer = new LocationServiceVo();
    voLocSer.setService(voService);
    voLocSer.setIsActive(new Boolean(true));
    LocationServiceVoCollection voColl = impl.listLocationService(voLocSer);
    if (voColl != null && voColl.size() > 0)
    {

        String activeMessage = "These " + ConfigFlag.UI.DISPLAY_NAME_LOCATION.getValue(true) + " contain active records for the " + ConfigFlag.UI.DISPLAY_NAME_SERVICE.getValue(false) + " : " + voService.getServiceName();
        for (int i = 0; i < voColl.size(); i++)
        {
            activeMessage += "\r\n" + voColl.get(i).getLocation().getName();
        }

        return activeMessage;
    }
    else
        return null;
}
项目:AvoinApotti    文件:ServiceImpl.java   
public String isServiceActivityUnique(TaxonomyMapCollection map, ServiceVo voService)
{
    DomainFactory factory = getDomainFactory();

    if (map != null)
    {
        String result = "";
        for (int i = 0; i < map.size(); i++)
        {
            java.util.List list = factory.find("select s1_1.service.id, s2_1.serviceName, t1_1.taxonomyCode, l1_1.id from ServiceActivity as s1_1 left join s1_1.service as s2_1 left join s1_1.taxonomyMap as t1_1 left join t1_1.taxonomyName as l1_1 where (t1_1.taxonomyCode = :code and s2_1.serviceName <> :name and l1_1.id = :id)", new String[]{"code", "name", "id"}, new Object[]{map.get(i).getTaxonomyCode(), voService.getServiceName(), new Integer(map.get(i).getTaxonomyName().getID())});

            if (list.size() != 0 && map.get(i).getTaxonomyCodeIsNotNull())
                result = result + (map.get(i).getTaxonomyCode() + " ");

        }
        return result;
    }

    return "";
}
项目: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    文件:Logic.java   
private void populateServiceDetails(ServiceVo service)
{
    clearServiceDetailsScreen();

    if(service == null)
        return;

    form.lyrService().tabServiceDetails().txtService().setValue(service.getServiceName());
    form.lyrService().tabServiceDetails().txtDescription().setValue(service.getServiceDescription());
    form.lyrService().tabServiceDetails().cmbCat().setValue(service.getServiceCategory());
    form.lyrService().tabServiceDetails().cmbSpec().setValue(service.getSpecialty());
    form.lyrService().tabServiceDetails().chkActiveOnly().setValue(Boolean.TRUE.equals(service.getIsActive()));
    form.lyrService().tabServiceDetails().chkCanBeScheduled().setValue(Boolean.TRUE.equals(service.getCanBeScheduled()));
    form.lyrService().tabServiceDetails().chkPreAssessmentCompletionExempt().setValue(Boolean.TRUE.equals(service.getIsPreAssessmentCompletionExempt()));
    form.lyrService().tabServiceDetails().chkRTT().setValue(Boolean.TRUE.equals(service.getIsSubjectToRTTClock()));
    form.lyrService().tabServiceDetails().chkMaternityIndicator().setValue(Boolean.TRUE.equals(service.getMaternityIndicator()));
    form.lyrService().tabServiceDetails().chkCanReferIntoTheService().setValue(Boolean.TRUE.equals(service.getCanReferIntoTheService()));
    form.lyrService().tabServiceDetails().chkDirectSelfReferralsAccepted().setValue(Boolean.TRUE.equals(service.getDirectSelfReferralsAccepted()));

    form.lyrService().tabServiceDetails().txtAlternativeCode().setValue(service.getAlternateServiceCode());
    form.lyrService().tabServiceDetails().cmbTurnAroundMeasure().setValue(service.getTurnaroundMeasure());
    form.lyrService().tabServiceDetails().intExpectedTurnAround().setValue(service.getExpectedTurnaround());

    form.lyrService().tabServiceDetails().ccServiceCodeMappings().setValue(service.getTaxonomyMap());
}
项目: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    文件:LocationServiceImpl.java   
/**
 * expects parameters returns null if the parameters are not set
 */
public LocationServiceVoCollection listServicesForLocation(LocationRefVo location, ServiceVo service)
{
    DomainFactory factory = getDomainFactory();

    if (location == null || service == null)
        return null;

    if (location.getID_LocationIsNotNull() && service.getID_ServiceIsNotNull())
    {
        java.util.List servactList = factory.find("from  LocationService locService where locService.location.id = :locationId and locService.service.id = :serviceId", new String[]{"locationId", "serviceId"}, new Object[]{location.getID_Location(), service.getID_Service()});
        return LocationServiceVoAssembler.createLocationServiceVoCollectionFromLocationService(servactList).sort();
    }

    return null;
}
项目:openMAXIMS    文件:ServiceImpl.java   
private String activeLocationServiceLinks(ims.core.vo.ServiceVo voService)
{
    LocationService impl = (LocationService) getDomainImpl(LocationServiceImpl.class);
    LocationServiceVo voLocSer = new LocationServiceVo();
    voLocSer.setService(voService);
    voLocSer.setIsActive(new Boolean(true));
    LocationServiceVoCollection voColl = impl.listLocationService(voLocSer);
    if (voColl != null && voColl.size() > 0)
    {

        String activeMessage = "These " + ConfigFlag.UI.DISPLAY_NAME_LOCATION.getValue(true) + " contain active records for the " + ConfigFlag.UI.DISPLAY_NAME_SERVICE.getValue(false) + " : " + voService.getServiceName();
        for (int i = 0; i < voColl.size(); i++)
        {
            activeMessage += "\r\n" + voColl.get(i).getLocation().getName();
        }

        return activeMessage;
    }
    else
        return null;
}
项目:openMAXIMS    文件:ServiceImpl.java   
public String isServiceActivityUnique(TaxonomyMapCollection map, ServiceVo voService)
{
    DomainFactory factory = getDomainFactory();

    if (map != null)
    {
        String result = "";
        for (int i = 0; i < map.size(); i++)
        {
            java.util.List list = factory.find("select s1_1.service.id, s2_1.serviceName, t1_1.taxonomyCode, l1_1.id from ServiceActivity as s1_1 left join s1_1.service as s2_1 left join s1_1.taxonomyMap as t1_1 left join t1_1.taxonomyName as l1_1 where (t1_1.taxonomyCode = :code and s2_1.serviceName <> :name and l1_1.id = :id)", new String[]{"code", "name", "id"}, new Object[]{map.get(i).getTaxonomyCode(), voService.getServiceName(), new Integer(map.get(i).getTaxonomyName().getID())});

            if (list.size() != 0 && map.get(i).getTaxonomyCodeIsNotNull())
                result = result + (map.get(i).getTaxonomyCode() + " ");

        }
        return result;
    }

    return "";
}
项目: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    文件:Logic.java   
private void searchProfiles()
{
    form.grdProfiles().getRows().clear();
    clearScreen();//WDEV-14644
    //WDEV-16799
    ProfileShortVoCollection coll = domain.listProfiles((ServiceVo) form.cmbFilterSpecialty().getValue(), form.qmbFilterDirectoryOfService().getValue(), form.cmbHospFilter().getValue(), form.chkActiveOnly().getValue() == false ? null : true, form.chkFilterOutpatients().getValue(), form.chkFilterTheatre().getValue(), form.txtName().getValue(), form.ccListOwner().getValue());
    if (coll == null || coll.size() == 0)
        return;

    GenForm.grdProfilesRow row;
    for (int i = 0; i < coll.size(); i++)
    {
        ProfileShortVo prfile = coll.get(i);
        row = form.grdProfiles().getRows().newRow();
        row.setValue(prfile);
        if (prfile.getEffToIsNotNull())
            row.setcolEndDate(prfile.getEffTo().toString());
        if (prfile.getEffFrmIsNotNull())
            row.setcolStartDate(prfile.getEffFrm().toString());
        row.setcolProfileDescription(prfile.getDescription());
        if (prfile.getServiceIsNotNull())
            row.setcolSpeciality(prfile.getService().getServiceName());
    }
}
项目:openMAXIMS    文件:Logic.java   
public void populateScreenFromData(ServiceVo voService, TreeNode node)
{
    // clear out instance data for next edit
    clearInstanceControls();

    super.populateScreenFromData(voService); // do this anyway for
                                                // ServiceVo info
    cmbCategoryValueChanged();              //wdev-16371

    // additional info for ServiceFunction and ServiceActivity
    // set local context function and activity collections for current
    // service selection
    populateScreenFromDataActivityFunction(node);

    populateScreenFromDataServiceInfo();
}
项目:openMAXIMS    文件:Logic.java   
private String formatServicevoTooltip(ServiceVo voService)
{
    String out = makeTextile("*" + ConfigFlag.UI.DISPLAY_NAME_SERVICE.getValue(true) + ": *", "DarkRed", "tahoma", "14");
    out += makeTextile(voService.getServiceNameIsNotNull() ? voService.getServiceName() : "", "black", "tahoma", "12");
    out += makeNewLine(new Integer(1));
    if (voService.getServiceDescriptionIsNotNull())
    {
        out += makeNewLine(new Integer(1));
        out += makeTextile("*Description: *", "DarkRed", "tahoma", "12");
        out += makeTextile(voService.getServiceDescription(), "black", "tahoma", "12");
    }
    if (voService.getIsActiveIsNotNull())
    {
        out += makeNewLine(new Integer(1));
        out += makeTextile("*Active: *", "DarkRed", "tahoma", "12");
        out += makeTextile(voService.getIsActive().toString(), "black", "tahoma", "12");
    }
    return new TextileString(out).toString();
}
项目:openMAXIMS    文件:Logic.java   
public boolean populateActivityFunctionDataFromScreen(ServiceVo voService) throws UniqueKeyViolationException
{
    boolean ret = false;
    if (checkForErrorsOnActivityFunction())
    {
        // update taxonomy contexts for last selected function and activity
        saveServiceActivityTaxonomy(voService);
        saveServiceFunctionTaxonomy(voService);

        // add/remove activities
        ret = saveServiceActivity();
        if (!ret)
            return ret;

        ret = saveServiceFunction();

        return ret;
    }

    return false;
}
项目:openMAXIMS    文件:Logic.java   
private void treeExpandCollapse(TreeNode node)
{
    if (node.isExpanded())
    {
        if (node.getNodes().size() > 0 && node.getNodes().get(0).getValue() == null)
        {
            if (node.getValue() instanceof ServiceVo)
                form.getLocalContext().setSelectedRecord((ServiceVo) node.getValue());
            populateServiceFunctionAndActivity(node);
        }
    }
    else
    {
        if (!ConfigFlag.UI.SERVICE_TABS.getValue(false).equalsIgnoreCase("NONE"))
        {
            if (node.getNodes().get(0).getText() == form.getLocalContext().gettreMessage())
            {
                node.getNodes().get(0).setText("Loading Please wait...");
            }
        }
    }
}
项目:openMAXIMS    文件:LocationServiceImpl.java   
/**
 * expects parameters returns null if the parameters are not set
 */
public LocationServiceVoCollection listServicesForLocation(LocationRefVo location, ServiceVo service)
{
    DomainFactory factory = getDomainFactory();

    if (location == null || service == null)
        return null;

    if (location.getID_LocationIsNotNull() && service.getID_ServiceIsNotNull())
    {
        java.util.List servactList = factory.find("from  LocationService locService where locService.location.id = :locationId and locService.service.id = :serviceId", new String[]{"locationId", "serviceId"}, new Object[]{location.getID_Location(), service.getID_Service()});
        return LocationServiceVoAssembler.createLocationServiceVoCollectionFromLocationService(servactList).sort();
    }

    return null;
}
项目:openMAXIMS    文件:ServiceImpl.java   
private String activeLocationServiceLinks(ims.core.vo.ServiceVo voService)
{
    LocationService impl = (LocationService) getDomainImpl(LocationServiceImpl.class);
    LocationServiceVo voLocSer = new LocationServiceVo();
    voLocSer.setService(voService);
    voLocSer.setIsActive(new Boolean(true));
    LocationServiceVoCollection voColl = impl.listLocationService(voLocSer);
    if (voColl != null && voColl.size() > 0)
    {

        String activeMessage = "These " + ConfigFlag.UI.DISPLAY_NAME_LOCATION.getValue(true) + " contain active records for the " + ConfigFlag.UI.DISPLAY_NAME_SERVICE.getValue(false) + " : " + voService.getServiceName();
        for (int i = 0; i < voColl.size(); i++)
        {
            activeMessage += "\r\n" + voColl.get(i).getLocation().getName();
        }

        return activeMessage;
    }
    else
        return null;
}
项目:openMAXIMS    文件:ServiceImpl.java   
public String isServiceActivityUnique(TaxonomyMapCollection map, ServiceVo voService)
{
    DomainFactory factory = getDomainFactory();

    if (map != null)
    {
        String result = "";
        for (int i = 0; i < map.size(); i++)
        {
            java.util.List list = factory.find("select s1_1.service.id, s2_1.serviceName, t1_1.taxonomyCode, l1_1.id from ServiceActivity as s1_1 left join s1_1.service as s2_1 left join s1_1.taxonomyMap as t1_1 left join t1_1.taxonomyName as l1_1 where (t1_1.taxonomyCode = :code and s2_1.serviceName <> :name and l1_1.id = :id)", new String[]{"code", "name", "id"}, new Object[]{map.get(i).getTaxonomyCode(), voService.getServiceName(), new Integer(map.get(i).getTaxonomyName().getID())});

            if (list.size() != 0 && map.get(i).getTaxonomyCodeIsNotNull())
                result = result + (map.get(i).getTaxonomyCode() + " ");

        }
        return result;
    }

    return "";
}
项目: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    文件:Logic.java   
private void searchProfiles()
{
    form.grdProfiles().getRows().clear();
    clearScreen();//WDEV-14644
    //WDEV-16799
    ProfileShortVoCollection coll = domain.listProfiles((ServiceVo) form.cmbFilterSpecialty().getValue(), form.qmbFilterDirectoryOfService().getValue(), form.cmbHospFilter().getValue(), form.chkActiveOnly().getValue() == false ? null : true, form.chkFilterOutpatients().getValue(), form.chkFilterTheatre().getValue(), form.txtName().getValue(), form.ccListOwner().getValue());
    if (coll == null || coll.size() == 0)
        return;

    GenForm.grdProfilesRow row;
    for (int i = 0; i < coll.size(); i++)
    {
        ProfileShortVo prfile = coll.get(i);
        row = form.grdProfiles().getRows().newRow();
        row.setValue(prfile);
        if (prfile.getEffToIsNotNull())
            row.setcolEndDate(prfile.getEffTo().toString());
        if (prfile.getEffFrmIsNotNull())
            row.setcolStartDate(prfile.getEffFrm().toString());
        row.setcolProfileDescription(prfile.getDescription());
        if (prfile.getServiceIsNotNull())
            row.setcolSpeciality(prfile.getService().getServiceName());
    }
}
项目:openmaxims-linux    文件:Logic.java   
public void populateScreenFromData(ServiceVo voService, TreeNode node)
{
    // clear out instance data for next edit
    clearInstanceControls();

    super.populateScreenFromData(voService); // do this anyway for
                                                // ServiceVo info
    cmbCategoryValueChanged();              //wdev-16371

    // additional info for ServiceFunction and ServiceActivity
    // set local context function and activity collections for current
    // service selection
    populateScreenFromDataActivityFunction(node);

    populateScreenFromDataServiceInfo();
}
项目:openmaxims-linux    文件:Logic.java   
private String formatServicevoTooltip(ServiceVo voService)
{
    String out = makeTextile("*" + ConfigFlag.UI.DISPLAY_NAME_SERVICE.getValue(true) + ": *", "DarkRed", "tahoma", "14");
    out += makeTextile(voService.getServiceNameIsNotNull() ? voService.getServiceName() : "", "black", "tahoma", "12");
    out += makeNewLine(new Integer(1));
    if (voService.getServiceDescriptionIsNotNull())
    {
        out += makeNewLine(new Integer(1));
        out += makeTextile("*Description: *", "DarkRed", "tahoma", "12");
        out += makeTextile(voService.getServiceDescription(), "black", "tahoma", "12");
    }
    if (voService.getIsActiveIsNotNull())
    {
        out += makeNewLine(new Integer(1));
        out += makeTextile("*Active: *", "DarkRed", "tahoma", "12");
        out += makeTextile(voService.getIsActive().toString(), "black", "tahoma", "12");
    }
    return new TextileString(out).toString();
}
项目:openmaxims-linux    文件:Logic.java   
public boolean populateActivityFunctionDataFromScreen(ServiceVo voService) throws UniqueKeyViolationException
{
    boolean ret = false;
    if (checkForErrorsOnActivityFunction())
    {
        // update taxonomy contexts for last selected function and activity
        saveServiceActivityTaxonomy(voService);
        saveServiceFunctionTaxonomy(voService);

        // add/remove activities
        ret = saveServiceActivity();
        if (!ret)
            return ret;

        ret = saveServiceFunction();

        return ret;
    }

    return false;
}
项目:openmaxims-linux    文件:Logic.java   
private void treeExpandCollapse(TreeNode node)
{
    if (node.isExpanded())
    {
        if (node.getNodes().size() > 0 && node.getNodes().get(0).getValue() == null)
        {
            if (node.getValue() instanceof ServiceVo)
                form.getLocalContext().setSelectedRecord((ServiceVo) node.getValue());
            populateServiceFunctionAndActivity(node);
        }
    }
    else
    {
        if (!ConfigFlag.UI.SERVICE_TABS.getValue(false).equalsIgnoreCase("NONE"))
        {
            if (node.getNodes().get(0).getText() == form.getLocalContext().gettreMessage())
            {
                node.getNodes().get(0).setText("Loading Please wait...");
            }
        }
    }
}
项目:openmaxims-linux    文件:LocationServiceImpl.java   
/**
 * expects parameters returns null if the parameters are not set
 */
public LocationServiceVoCollection listServicesForLocation(LocationRefVo location, ServiceVo service)
{
    DomainFactory factory = getDomainFactory();

    if (location == null || service == null)
        return null;

    if (location.getID_LocationIsNotNull() && service.getID_ServiceIsNotNull())
    {
        java.util.List servactList = factory.find("from  LocationService locService where locService.location.id = :locationId and locService.service.id = :serviceId", new String[]{"locationId", "serviceId"}, new Object[]{location.getID_Location(), service.getID_Service()});
        return LocationServiceVoAssembler.createLocationServiceVoCollectionFromLocationService(servactList).sort();
    }

    return null;
}
项目:openmaxims-linux    文件:ServiceImpl.java   
private String activeLocationServiceLinks(ims.core.vo.ServiceVo voService)
{
    LocationService impl = (LocationService) getDomainImpl(LocationServiceImpl.class);
    LocationServiceVo voLocSer = new LocationServiceVo();
    voLocSer.setService(voService);
    voLocSer.setIsActive(new Boolean(true));
    LocationServiceVoCollection voColl = impl.listLocationService(voLocSer);
    if (voColl != null && voColl.size() > 0)
    {

        String activeMessage = "These " + ConfigFlag.UI.DISPLAY_NAME_LOCATION.getValue(true) + " contain active records for the " + ConfigFlag.UI.DISPLAY_NAME_SERVICE.getValue(false) + " : " + voService.getServiceName();
        for (int i = 0; i < voColl.size(); i++)
        {
            activeMessage += "\r\n" + voColl.get(i).getLocation().getName();
        }

        return activeMessage;
    }
    else
        return null;
}
项目:openmaxims-linux    文件:ServiceImpl.java   
public String isServiceActivityUnique(TaxonomyMapCollection map, ServiceVo voService)
{
    DomainFactory factory = getDomainFactory();

    if (map != null)
    {
        String result = "";
        for (int i = 0; i < map.size(); i++)
        {
            java.util.List list = factory.find("select s1_1.service.id, s2_1.serviceName, t1_1.taxonomyCode, l1_1.id from ServiceActivity as s1_1 left join s1_1.service as s2_1 left join s1_1.taxonomyMap as t1_1 left join t1_1.taxonomyName as l1_1 where (t1_1.taxonomyCode = :code and s2_1.serviceName <> :name and l1_1.id = :id)", new String[]{"code", "name", "id"}, new Object[]{map.get(i).getTaxonomyCode(), voService.getServiceName(), new Integer(map.get(i).getTaxonomyName().getID())});

            if (list.size() != 0 && map.get(i).getTaxonomyCodeIsNotNull())
                result = result + (map.get(i).getTaxonomyCode() + " ");

        }
        return result;
    }

    return "";
}
项目:AvoinApotti    文件:Logic.java   
private boolean checkServiceExists(ServiceShortVo voServiceShort, LocationServiceVo voLocationService)
{
    ServiceVo voService = new ServiceVo();
    voService.setID_Service(voServiceShort.getID_Service());
    voLocationService.setService(voService);
    return (domain.listLocationService(voLocationService).size() > 0);
}
项目:AvoinApotti    文件:Logic.java   
protected void onFormOpen() throws ims.framework.exceptions.PresentationLogicException
{
    initalize();
    // Screen called from WorkQueue - display Patient and Case
    if (form.getGlobalContext().NTPF.getTargetObjectIdIsNotNull())
    {
        clearInstanceControls();

        ServiceVo voService = new ServiceVo();
        voService.setID_Service(form.getGlobalContext().NTPF.getTargetObjectId());
        form.getLocalContext().setSelectedRecord(domain.getServiceById(voService));

        if (form.getLocalContext().getSelectedRecordIsNotNull())
        {
            ServiceVoCollection voColl = new ServiceVoCollection();
            voColl.add(form.getLocalContext().getSelectedRecord());
            populateListControl(voColl);
            form.treService().setValue(form.getLocalContext().getSelectedRecord());

            selectionChange(form.treService().getSelectedNode());

            form.treService().getSelectedNode().setExpanded(true);

            treeExpandCollapse(form.treService().getSelectedNode());

        }

        form.getGlobalContext().NTPF.setTargetObjectId(null);

        form.lnkBack().setVisible(true);
        form.getLocalContext().setPreviousForm(getPrevForm());

        return;
    }
    else
        form.lnkBack().setVisible(false);

    open();
}
项目:AvoinApotti    文件:Logic.java   
/**
 * populates the screen from data from specified Vo Collection
 * 
 * @param ServiceVoCollection
 * @return void
 */
public void populateListControl(ServiceVoCollection voColl)
{
    clear();

    if (voColl == null || voColl.size() == 0)
    {
        engine.showMessage("No results found.");
        return;
    }

    for (int i = 0; i < voColl.size(); i++)
    {
        ServiceVo voService = voColl.get(i);
        if (voService.getServiceNameIsNotNull())
        {
            TreeNode newNode = form.treService().getNodes().add(voService, (voService.getServiceNameIsNotNull() ? voService.getServiceName() : ""));
            newNode.setTooltip(formatServicevoTooltip(voService));
            newNode.setExpandedImage(form.getImages().Admin.Service);
            newNode.setCollapsedImage(form.getImages().Admin.Service);
            newNode.setSelectedImage(form.getImages().Admin.Service);
            if (voService.getIsActiveIsNotNull() && !voService.getIsActive().booleanValue())
                newNode.setTextColor(Color.Red);

            if (!ConfigFlag.UI.SERVICE_TABS.getValue(false).equalsIgnoreCase("NONE"))
                newNode.getNodes().add(null, "Loading Please wait...");
        }
    }
}
项目:AvoinApotti    文件:Logic.java   
private void setScreenViewMode()
{
    form.setMode(FormMode.VIEW);
    if ((form.treService().getSelectedNode() != null) && (form.treService().getValue() instanceof ServiceVo))
        populateScreenFromData((ServiceVo) form.treService().getValue(), form.treService().getSelectedNode());

}
项目:AvoinApotti    文件:Logic.java   
protected void onGrdActivitySelectionChanged() throws PresentationLogicException
{   

    if (form.getLocalContext().getSelectedActivityIsNotNull() && ConfigFlag.DOM.ENABLE_EXCHEQUER_CODES_VALIDATION.getValue())
    {
        if (didPreviousDisplayedActivityTaxonomyHaveEXCH(form.getLocalContext().getSelectedActivity()))
        {
            form.lyr1().Edit().lyrActivityFunction().tabPageActivity().grdActivity().setValue(form.getLocalContext().getSelectedActivity());
            return;
        }
    }
    grdActivityRow row;
    row = form.lyr1().Edit().lyrActivityFunction().tabPageActivity().grdActivity().getSelectedRow();

    form.getLocalContext().setSelectedActivity(row.getValue());

    if (form.getLocalContext().getSelectedRecordIsNotNull())
        saveServiceActivityTaxonomy(form.getLocalContext().getSelectedRecord());
    else
        saveServiceActivityTaxonomy(populateDataFromScreen(new ServiceVo()));

    //WDEV-16672
    updateDetailsTabContextMenusState();
    form.getContextMenus().getGenericGridUpdateItem().setText("Edit " + ConfigFlag.UI.DISPLAY_NAME_ACTIVITY.getValue(false) + " Taxonomy");

    form.lyr1().Edit().lyrActivityFunction().tabPageActivity().grdActivityTaxonomy().setEnabled(true);
    form.lyr1().Edit().lyrActivityFunction().tabPageActivity().grdActivityTaxonomy().setReadOnly(false);

    form.lyr1().Edit().lyrActivityFunction().tabPageActivity().grdActivityTaxonomy().getRows().clear();

    ServiceActivityVo vo = inActivityList(row.getValue(), form.getLocalContext().getserviceActivities());

    form.getLocalContext().setSelectedRecordActivity(vo);

    getActivityTaxonomy(vo, true);
}