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

项目:AvoinApotti    文件:Logic.java   
protected void onBtnOkClick() throws PresentationLogicException 
{
    if(form.cmbEpisode().getValues().size() < 1)
    {
        engine.showMessage("No previous episodes to copy from.");
        engine.close(DialogResult.CANCEL);
        return;
    }

    SupportNetworkProfessionalVoCollection voColl = new SupportNetworkProfessionalVoCollection();

    if(form.grdProfessional().getRows() != null)
    {
        GenForm.grdProfessionalRow row = null;
        for(int i=0;i<form.grdProfessional().getRows().size();i++)
        {
            row = form.grdProfessional().getRows().get(i);
            if(row.getSelect() == true)
            {
                voColl.add(row.getValue());
            }
        }   
    }

    if(voColl.size() > 0)
    {
        form.getGlobalContext().COE.setSupportNetworkProfessionalCollection(voColl);
        engine.close(DialogResult.OK);
    }
    else
        engine.showMessage("Please select at least one professional.");

}
项目:AvoinApotti    文件:SupportNetworkProfessionalServicesImpl.java   
public SupportNetworkProfessionalVoCollection listSupportNetworkProfessionalByPatient(Boolean activeOnly, PatientRefVo patient)
{
    DomainFactory factory = getDomainFactory();

    String hql = "select snw.professional from SupportNetwork as snw where snw.patient.id = :idPatient";
    if (activeOnly)
        hql = " select prof from SupportNetwork as snw left join snw.professional as prof where prof.isCurrActiveProfSupp = true and snw.patient.id = :idPatient";

    List supportNetworkProf = factory.find(hql, new String[]{"idPatient"}, new Object[]{patient.getID_Patient()});
    return SupportNetworkProfessionalVoAssembler.createSupportNetworkProfessionalVoCollectionFromSupportNetworkProfessional(supportNetworkProf).sort();
}
项目:openMAXIMS    文件:Logic.java   
protected void onBtnOkClick() throws PresentationLogicException 
{
    if(form.cmbEpisode().getValues().size() < 1)
    {
        engine.showMessage("No previous episodes to copy from.");
        engine.close(DialogResult.CANCEL);
        return;
    }

    SupportNetworkProfessionalVoCollection voColl = new SupportNetworkProfessionalVoCollection();

    if(form.grdProfessional().getRows() != null)
    {
        GenForm.grdProfessionalRow row = null;
        for(int i=0;i<form.grdProfessional().getRows().size();i++)
        {
            row = form.grdProfessional().getRows().get(i);
            if(row.getSelect() == true)
            {
                voColl.add(row.getValue());
            }
        }   
    }

    if(voColl.size() > 0)
    {
        form.getGlobalContext().COE.setSupportNetworkProfessionalCollection(voColl);
        engine.close(DialogResult.OK);
    }
    else
        engine.showMessage("Please select at least one professional.");

}
项目:openMAXIMS    文件:SupportNetworkProfessionalServicesImpl.java   
public SupportNetworkProfessionalVoCollection listSupportNetworkProfessionalByPatient(Boolean activeOnly, PatientRefVo patient)
{
    DomainFactory factory = getDomainFactory();

    String hql = "select snw.professional from SupportNetwork as snw where snw.patient.id = :idPatient";
    if (activeOnly)
        hql = " select prof from SupportNetwork as snw left join snw.professional as prof where prof.isCurrActiveProfSupp = true and snw.patient.id = :idPatient";

    List supportNetworkProf = factory.find(hql, new String[]{"idPatient"}, new Object[]{patient.getID_Patient()});
    return SupportNetworkProfessionalVoAssembler.createSupportNetworkProfessionalVoCollectionFromSupportNetworkProfessional(supportNetworkProf).sort();
}
项目:openMAXIMS    文件:Logic.java   
protected void onBtnOkClick() throws PresentationLogicException 
{
    if(form.cmbEpisode().getValues().size() < 1)
    {
        engine.showMessage("No previous episodes to copy from.");
        engine.close(DialogResult.CANCEL);
        return;
    }

    SupportNetworkProfessionalVoCollection voColl = new SupportNetworkProfessionalVoCollection();

    if(form.grdProfessional().getRows() != null)
    {
        GenForm.grdProfessionalRow row = null;
        for(int i=0;i<form.grdProfessional().getRows().size();i++)
        {
            row = form.grdProfessional().getRows().get(i);
            if(row.getSelect() == true)
            {
                voColl.add(row.getValue());
            }
        }   
    }

    if(voColl.size() > 0)
    {
        form.getGlobalContext().COE.setSupportNetworkProfessionalCollection(voColl);
        engine.close(DialogResult.OK);
    }
    else
        engine.showMessage("Please select at least one professional.");

}
项目:openMAXIMS    文件:SupportNetworkProfessionalServicesImpl.java   
public SupportNetworkProfessionalVoCollection listSupportNetworkProfessionalByPatient(Boolean activeOnly, PatientRefVo patient)
{
    DomainFactory factory = getDomainFactory();

    String hql = "select snw.professional from SupportNetwork as snw where snw.patient.id = :idPatient";
    if (activeOnly)
        hql = " select prof from SupportNetwork as snw left join snw.professional as prof where prof.isCurrActiveProfSupp = true and snw.patient.id = :idPatient";

    List supportNetworkProf = factory.find(hql, new String[]{"idPatient"}, new Object[]{patient.getID_Patient()});
    return SupportNetworkProfessionalVoAssembler.createSupportNetworkProfessionalVoCollectionFromSupportNetworkProfessional(supportNetworkProf).sort();
}
项目:openmaxims-linux    文件:Logic.java   
protected void onBtnOkClick() throws PresentationLogicException 
{
    if(form.cmbEpisode().getValues().size() < 1)
    {
        engine.showMessage("No previous episodes to copy from.");
        engine.close(DialogResult.CANCEL);
        return;
    }

    SupportNetworkProfessionalVoCollection voColl = new SupportNetworkProfessionalVoCollection();

    if(form.grdProfessional().getRows() != null)
    {
        GenForm.grdProfessionalRow row = null;
        for(int i=0;i<form.grdProfessional().getRows().size();i++)
        {
            row = form.grdProfessional().getRows().get(i);
            if(row.getSelect() == true)
            {
                voColl.add(row.getValue());
            }
        }   
    }

    if(voColl.size() > 0)
    {
        form.getGlobalContext().COE.setSupportNetworkProfessionalCollection(voColl);
        engine.close(DialogResult.OK);
    }
    else
        engine.showMessage("Please select at least one professional.");

}
项目:openmaxims-linux    文件:SupportNetworkProfessionalServicesImpl.java   
public SupportNetworkProfessionalVoCollection listSupportNetworkProfessionalByPatient(Boolean activeOnly, PatientRefVo patient)
{
    DomainFactory factory = getDomainFactory();

    String hql = "select snw.professional from SupportNetwork as snw where snw.patient.id = :idPatient";
    if (activeOnly)
        hql = " select prof from SupportNetwork as snw left join snw.professional as prof where prof.isCurrActiveProfSupp = true and snw.patient.id = :idPatient";

    List supportNetworkProf = factory.find(hql, new String[]{"idPatient"}, new Object[]{patient.getID_Patient()});
    return SupportNetworkProfessionalVoAssembler.createSupportNetworkProfessionalVoCollectionFromSupportNetworkProfessional(supportNetworkProf).sort();
}
项目:AvoinApotti    文件:Logic.java   
protected void onCmbEpisodeValueChanged() throws PresentationLogicException 
{
    form.grdProfessional().getRows().clear();
    //09/09/2005 - check for null
    CareContextShortVo voCareContextShort = form.cmbEpisode().getValue();
    if(voCareContextShort == null)
        return;
    SupportNetworkProfessionalVoCollection voColl = domain.listSupportNetworkProfessionalByCareContext(voCareContextShort, Boolean.TRUE);

    SupportNetworkProfessionalVo voProf = null;
    GenForm.grdProfessionalRow row = null;


    if(voColl == null)
        return;

    for(int i = 0 ; i < voColl.size() ; i++)
    {
        voProf = voColl.get(i);
        row = form.grdProfessional().getRows().newRow();

        if(voProf.getMOS() != null)
        {
            row.setName(voProf.getMOS().toString());
            if(voProf.getHcpSubType() != null)
                row.setProfession(voProf.getHcpSubType().getText());

            MemberOfStaffVo voMos = domain.getMos(voProf.getMOS());

            if(voMos != null && voMos.getLocations() != null)
            {
                for(int k = 0 ; k < voMos.getLocations().size() ; k++)
                {
                    if (voMos.getLocations().get(k).getIsPrimaryIsNotNull() && voMos.getLocations().get(k).getIsPrimary().equals(Boolean.TRUE))
                        if (voMos.getLocations().get(k).getLocation().getAddressIsNotNull())
                            row.setPhone(voMos.getLocations().get(k).getLocation().getAddress().getPhone());
                }
            }
        }

        row.setSelect(true);
        row.setValue(voProf);
    }           
}
项目:AvoinApotti    文件:Logic.java   
private void listSupportNetworkProfessional(boolean bFromPrevoiousEpisode)
{
    SupportNetworkProfessionalVoCollection voColl = null;
    if (bFromPrevoiousEpisode == false)
    {
        Boolean bActiveOnly = Boolean.FALSE;
        if (form.lyrProServices().tabProfessional().grpProfFilter().getValue().equals(GenForm.lyrProServicesLayer.tabProfessionalContainer.grpProfFilterEnumeration.rdoActiveProf))
            bActiveOnly = Boolean.TRUE;

        /*
         * if(form.getGlobalContext().Core.getCurrentCareContextIsNotNull())
         * voColl =
         * domain.listSupportNetworkProfessionalByCareContext(form.getGlobalContext().Core.getCurrentCareContext(),
         * bActiveOnly); else voColl =
         * domain.listSupportNetworkProfessionalByPatient(bActiveOnly,
         * form.getGlobalContext().Core.getPatientShort());
         */

        // WDEV-2257 - previous commented code did it selectively by
        // CareContext or Patient
        voColl = domain.listSupportNetworkProfessionalByPatient(bActiveOnly, form.getGlobalContext().Core.getPatientShort());
    }
    else
    {
        voColl = form.getGlobalContext().COE.getSupportNetworkProfessionalCollection();
    }

    SupportNetworkProfessionalVo voProf = null;
    GenForm.lyrProServicesLayer.tabProfessionalContainer.grdProfessionalRow row = null;

    form.lyrProServices().tabProfessional().grdProfessional().getRows().clear();

    if (voColl == null)
        return;

    boolean bActiveProfessionals = false;
    for (int i = 0; i < voColl.size(); i++)
    {
        voProf = voColl.get(i);
        row = form.lyrProServices().tabProfessional().grdProfessional().getRows().newRow();

        if (voProf.getMOSIsNotNull())
        {
            row.setColName(voProf.getMOS().toString());
        }
        else if (voProf.getSuppliedProfessionalIsNotNull())
        {
            row.setColName(voProf.getSuppliedProfessional().getName());
            row.setColWorkPhone(voProf.getSuppliedProfessional().getWorkPhone());
        }

        if (voProf.getHcpSubTypeIsNotNull())
            row.setColProfessionService(voProf.getHcpSubType().getText());

        if (voProf.getCurrentLocationIsNotNull() && voProf.getCurrentLocation().getAddressIsNotNull())
        {
            row.setColWorkPhone(voProf.getCurrentLocation().getAddress().getPhone());
        }

        if (voProf.getIsCurrActiveProfSupp().booleanValue()){
            row.setColIsActive(form.getImages().Core.AnswerBox_Yes);
            bActiveProfessionals = true;
        }
        else
        {
            row.setColIsActive(form.getImages().Core.AnswerBox_No);
            row.setBackColor(Color.LightGray);
        }

        row.setValue(voProf);
    }

    form.getLocalContext().setActiveProfessionals(bActiveProfessionals);

    SupportNetworkProfessionalVo voSupportNetworkProfessional = form.getLocalContext().getsupportNetworkProfessional();
    if (voSupportNetworkProfessional != null && form.lyrProServices().tabProfessional().grdProfessional().getRowByValue(voSupportNetworkProfessional) != null)
    {
        form.lyrProServices().tabProfessional().grdProfessional().setValue(voSupportNetworkProfessional);
        grdProSelectionChanged();
    }
}
项目:AvoinApotti    文件:SupportNetworkProfessionalServicesImpl.java   
public SupportNetworkProfessionalVoCollection listSupportNetworkProfessionalByCareContext(CareContextRefVo voCareContextRef, Boolean activeOnly)
{
    if (voCareContextRef == null)
        throw new CodingRuntimeException("Care Context was not supplied. Mandatory argument");

    DomainFactory factory = getDomainFactory();

    String hqlQuery = " from SupportNetwork snw ";
    StringBuffer condStr = new StringBuffer();
    ArrayList markerNames = new ArrayList();
    ArrayList markerValues = new ArrayList();

    condStr.append(" where ");

    if (voCareContextRef != null)
    {
        condStr.append(" snw.careContext.id = :careContext");
        markerNames.add("careContext");
        markerValues.add(voCareContextRef.getID_CareContext());
    }

    hqlQuery += condStr.toString();

    java.util.List lst = factory.find(hqlQuery, markerNames, markerValues);

    // Should be only one / none Support Network in the list for the
    // CLinical Contact
    if (lst.size() > 0)
    {
        SupportNetwork snw = (SupportNetwork) lst.get(0);
        if (activeOnly.booleanValue() == false)
            return SupportNetworkProfessionalVoAssembler.createSupportNetworkProfessionalVoCollectionFromSupportNetworkProfessional(snw.getProfessional()).sort();
        else
        {
            if (snw != null)
            {
                java.util.List lst2 = factory.find(snw.getProfessional(), " where this.isCurrActiveProfSupp = :active", new String[]{"active"}, new Object[]{Boolean.TRUE});
                return SupportNetworkProfessionalVoAssembler.createSupportNetworkProfessionalVoCollectionFromSupportNetworkProfessional(lst2);
            }
            return null;
        }
    }
    else
        return null;
}
项目:AvoinApotti    文件:Logic.java   
private void listSupportNetworkProfessional()
{
    //WDEV-14594
    form.getLocalContext().setSelectedRecord(domain.getSupportServices(form.getLocalContext().getSelectedRecord(), form.getLocalContext().getCareContextRef()));

    SupportNetworkProfessionalVoCollection voColl = form.getLocalContext().getSelectedRecord() != null ? form.getLocalContext().getSelectedRecord().getSupportNetworkProfessionals() : null;
    if(voColl == null)
        return;

    SupportNetworkProfessionalVo voProf = null;
    GenForm.lyrSupportServicesLayer.tabPageProfContainer.grdProfessionalRow row = null;

    form.lyrSupportServices().tabPageProf().grdProfessional().getRows().clear();

    boolean bActiveProfessionals = false;
    for (int i = 0; i < voColl.size(); i++)
    {
        voProf = voColl.get(i);

        if(form.lyrSupportServices().tabPageProf().grpProfFilter().getValue().equals(GenForm.lyrSupportServicesLayer.tabPageProfContainer.grpProfFilterEnumeration.rdoActiveProf)
            && voProf.getIsCurrActiveProfSuppIsNotNull()
            && voProf.getIsCurrActiveProfSupp().equals(Boolean.FALSE))
            continue;

        row = form.lyrSupportServices().tabPageProf().grdProfessional().getRows().newRow();

        if (voProf.getMOSIsNotNull())
        {
            row.setColName(voProf.getMOS().toString());
            row.setTooltipForColName(voProf.getMOS().toString());
        }
        else if (voProf.getSuppliedProfessionalIsNotNull())
        {
            row.setColName(voProf.getSuppliedProfessional().getName());
            row.setTooltipForColName(voProf.getSuppliedProfessional().getName());
            row.setColWorkPhone(voProf.getSuppliedProfessional().getWorkPhone());
            row.setTooltipForColWorkPhone(voProf.getSuppliedProfessional().getWorkPhone());
        }

        if (voProf.getHcpSubTypeIsNotNull())
        {
            row.setColProfessionService(voProf.getHcpSubType().getText());
            row.setTooltipForColProfessionService(voProf.getHcpSubType().getText());
        }

        if (voProf.getCurrentLocationIsNotNull() && voProf.getCurrentLocation().getAddressIsNotNull())
        {
            row.setColWorkPhone(voProf.getCurrentLocation().getAddress().getPhone());
            row.setTooltipForColWorkPhone(voProf.getCurrentLocation().getAddress().getPhone());
        }

        if (voProf.getIsCurrActiveProfSupp().booleanValue())
        {
            row.setColIsActive(form.getImages().Core.AnswerBox_Yes);
            bActiveProfessionals = true;
        }
        else
        {
            row.setColIsActive(form.getImages().Core.AnswerBox_No);
            row.setBackColor(Color.LightGray);
        }

        row.setValue(voProf);
    }

    form.getLocalContext().setActiveProfessionals(bActiveProfessionals);

    SupportNetworkProfessionalVo voSupportNetworkProfessional = form.getLocalContext().getSelectedSupportNetworkProfessional();
    if (voSupportNetworkProfessional != null && form.lyrSupportServices().tabPageProf().grdProfessional().getRowByValue(voSupportNetworkProfessional) != null)
    {
        form.lyrSupportServices().tabPageProf().grdProfessional().setValue(voSupportNetworkProfessional);
        grdProSelectionChanged();
    }
}
项目:AvoinApotti    文件:Logic.java   
private boolean saveProfessional(SupportNetworkProfessionalVo supportNetworkProf) 
{
    if (form.getLocalContext().getSelectedRecord() == null)
        populateBaseDischargeServices();

    ArrayList<String> screenErrors = new ArrayList<String>();

    if (form.lyrSupportServices().tabPageProf().cmbProfessional().getValue() == null)
        screenErrors.add("Profession is mandatory");

    if (form.lyrSupportServices().tabPageProf().cmbHcpSubType().getValue() == null)
        screenErrors.add("Type is mandatory");

    if (form.lyrSupportServices().tabPageProf().qmbHcpName().isEnabled() && (!form.lyrSupportServices().tabPageProf().chkSupplyHcp().getValue()) && (form.lyrSupportServices().tabPageProf().qmbHcpName().getValue() == null) )
        screenErrors.add("HCP Name is mandatory");
    else if (form.lyrSupportServices().tabPageProf().txtHcpName().isEnabled() && (form.lyrSupportServices().tabPageProf().chkSupplyHcp().getValue()) && (form.lyrSupportServices().tabPageProf().txtHcpName().getValue() == null))
        screenErrors.add("HCP Name is mandatory");

    if (form.lyrSupportServices().tabPageProf().customControlAuth().getValue()==null)
    {
        screenErrors.add("Authoring HCP and Date/Time are mandatory");
    }

    String[] sScreenErrors = screenErrors(screenErrors);
    if(sScreenErrors.length > 0)
    {
        engine.showErrors(sScreenErrors);
        return false;
    }

    SupportNetworkProfessionalVo voSupportProfessional = null;
    if (supportNetworkProf == null)
        voSupportProfessional = populateProfessionalInstanceData();
    else
        voSupportProfessional = supportNetworkProf;

    //WDEV-14594
    String[] arrErrorsProf = voSupportProfessional.validate();
    if(arrErrorsProf != null)
    {
        engine.showErrors(arrErrorsProf);
        return false;
    }

    if (form.getLocalContext().getSelectedRecord().getSupportNetworkProfessionals() == null)
        form.getLocalContext().getSelectedRecord().setSupportNetworkProfessionals(new SupportNetworkProfessionalVoCollection());

    if (form.getLocalContext().getSelectedRecord().getSupportNetworkProfessionals().indexOf(voSupportProfessional) >= 0)
        form.getLocalContext().getSelectedRecord().getSupportNetworkProfessionals().set(form.getLocalContext().getSelectedRecord().getSupportNetworkProfessionals().indexOf(voSupportProfessional), voSupportProfessional);
    else
        form.getLocalContext().getSelectedRecord().getSupportNetworkProfessionals().add(voSupportProfessional);


    String[] arrErrors = form.getLocalContext().getSelectedRecord().validate();
    if(arrErrors != null)
    {
        engine.showErrors(arrErrors);
        return false;
    }

    try 
    {
        form.getLocalContext().setSelectedRecord(domain.saveSupportServices(form.getLocalContext().getSelectedRecord()));
    } 
    catch (StaleObjectException e) 
    {
        engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
        openSupportServices();
        return false;
    }

    savePatientNoSupportNetworkStatusInfo(false);

    return true;
}
项目:openMAXIMS    文件:Logic.java   
protected void onCmbEpisodeValueChanged() throws PresentationLogicException 
{
    form.grdProfessional().getRows().clear();
    //09/09/2005 - check for null
    CareContextShortVo voCareContextShort = form.cmbEpisode().getValue();
    if(voCareContextShort == null)
        return;
    SupportNetworkProfessionalVoCollection voColl = domain.listSupportNetworkProfessionalByCareContext(voCareContextShort, Boolean.TRUE);

    SupportNetworkProfessionalVo voProf = null;
    GenForm.grdProfessionalRow row = null;


    if(voColl == null)
        return;

    for(int i = 0 ; i < voColl.size() ; i++)
    {
        voProf = voColl.get(i);
        row = form.grdProfessional().getRows().newRow();

        if(voProf.getMOS() != null)
        {
            row.setName(voProf.getMOS().toString());
            if(voProf.getHcpSubType() != null)
                row.setProfession(voProf.getHcpSubType().getText());

            MemberOfStaffVo voMos = domain.getMos(voProf.getMOS());

            if(voMos != null && voMos.getLocations() != null)
            {
                for(int k = 0 ; k < voMos.getLocations().size() ; k++)
                {
                    if (voMos.getLocations().get(k).getIsPrimaryIsNotNull() && voMos.getLocations().get(k).getIsPrimary().equals(Boolean.TRUE))
                        if (voMos.getLocations().get(k).getLocation().getAddressIsNotNull())
                            row.setPhone(voMos.getLocations().get(k).getLocation().getAddress().getPhone());
                }
            }
        }

        row.setSelect(true);
        row.setValue(voProf);
    }           
}
项目:openMAXIMS    文件:Logic.java   
private void listSupportNetworkProfessional(boolean bFromPrevoiousEpisode)
{
    SupportNetworkProfessionalVoCollection voColl = null;
    if (bFromPrevoiousEpisode == false)
    {
        Boolean bActiveOnly = Boolean.FALSE;
        if (form.lyrProServices().tabProfessional().grpProfFilter().getValue().equals(GenForm.lyrProServicesLayer.tabProfessionalContainer.grpProfFilterEnumeration.rdoActiveProf))
            bActiveOnly = Boolean.TRUE;

        /*
         * if(form.getGlobalContext().Core.getCurrentCareContextIsNotNull())
         * voColl =
         * domain.listSupportNetworkProfessionalByCareContext(form.getGlobalContext().Core.getCurrentCareContext(),
         * bActiveOnly); else voColl =
         * domain.listSupportNetworkProfessionalByPatient(bActiveOnly,
         * form.getGlobalContext().Core.getPatientShort());
         */

        // WDEV-2257 - previous commented code did it selectively by
        // CareContext or Patient
        voColl = domain.listSupportNetworkProfessionalByPatient(bActiveOnly, form.getGlobalContext().Core.getPatientShort());
    }
    else
    {
        voColl = form.getGlobalContext().COE.getSupportNetworkProfessionalCollection();
    }

    SupportNetworkProfessionalVo voProf = null;
    GenForm.lyrProServicesLayer.tabProfessionalContainer.grdProfessionalRow row = null;

    form.lyrProServices().tabProfessional().grdProfessional().getRows().clear();

    if (voColl == null)
        return;

    boolean bActiveProfessionals = false;
    for (int i = 0; i < voColl.size(); i++)
    {
        voProf = voColl.get(i);
        row = form.lyrProServices().tabProfessional().grdProfessional().getRows().newRow();

        if (voProf.getMOSIsNotNull())
        {
            row.setColName(voProf.getMOS().toString());
        }
        else if (voProf.getSuppliedProfessionalIsNotNull())
        {
            row.setColName(voProf.getSuppliedProfessional().getName());
            row.setColWorkPhone(voProf.getSuppliedProfessional().getWorkPhone());
        }

        if (voProf.getHcpSubTypeIsNotNull())
            row.setColProfessionService(voProf.getHcpSubType().getText());

        if (voProf.getCurrentLocationIsNotNull() && voProf.getCurrentLocation().getAddressIsNotNull())
        {
            row.setColWorkPhone(voProf.getCurrentLocation().getAddress().getPhone());
        }

        if (voProf.getIsCurrActiveProfSupp().booleanValue()){
            row.setColIsActive(form.getImages().Core.AnswerBox_Yes);
            bActiveProfessionals = true;
        }
        else
        {
            row.setColIsActive(form.getImages().Core.AnswerBox_No);
            row.setBackColor(Color.LightGray);
        }

        row.setValue(voProf);
    }

    form.getLocalContext().setActiveProfessionals(bActiveProfessionals);

    SupportNetworkProfessionalVo voSupportNetworkProfessional = form.getLocalContext().getsupportNetworkProfessional();
    if (voSupportNetworkProfessional != null && form.lyrProServices().tabProfessional().grdProfessional().getRowByValue(voSupportNetworkProfessional) != null)
    {
        form.lyrProServices().tabProfessional().grdProfessional().setValue(voSupportNetworkProfessional);
        grdProSelectionChanged();
    }
}
项目:openMAXIMS    文件:SupportNetworkProfessionalServicesImpl.java   
public SupportNetworkProfessionalVoCollection listSupportNetworkProfessionalByCareContext(CareContextRefVo voCareContextRef, Boolean activeOnly)
{
    if (voCareContextRef == null)
        throw new CodingRuntimeException("Care Context was not supplied. Mandatory argument");

    DomainFactory factory = getDomainFactory();

    String hqlQuery = " from SupportNetwork snw ";
    StringBuffer condStr = new StringBuffer();
    ArrayList markerNames = new ArrayList();
    ArrayList markerValues = new ArrayList();

    condStr.append(" where ");

    if (voCareContextRef != null)
    {
        condStr.append(" snw.careContext.id = :careContext");
        markerNames.add("careContext");
        markerValues.add(voCareContextRef.getID_CareContext());
    }

    hqlQuery += condStr.toString();

    java.util.List lst = factory.find(hqlQuery, markerNames, markerValues);

    // Should be only one / none Support Network in the list for the
    // CLinical Contact
    if (lst.size() > 0)
    {
        SupportNetwork snw = (SupportNetwork) lst.get(0);
        if (activeOnly.booleanValue() == false)
            return SupportNetworkProfessionalVoAssembler.createSupportNetworkProfessionalVoCollectionFromSupportNetworkProfessional(snw.getProfessional()).sort();
        else
        {
            if (snw != null)
            {
                java.util.List lst2 = factory.find(snw.getProfessional(), " where this.isCurrActiveProfSupp = :active", new String[]{"active"}, new Object[]{Boolean.TRUE});
                return SupportNetworkProfessionalVoAssembler.createSupportNetworkProfessionalVoCollectionFromSupportNetworkProfessional(lst2);
            }
            return null;
        }
    }
    else
        return null;
}
项目:openMAXIMS    文件:Logic.java   
private void listSupportNetworkProfessional()
{
    //WDEV-14594
    form.getLocalContext().setSelectedRecord(domain.getSupportServices(form.getLocalContext().getSelectedRecord(), form.getLocalContext().getCareContextRef()));

    SupportNetworkProfessionalVoCollection voColl = form.getLocalContext().getSelectedRecord() != null ? form.getLocalContext().getSelectedRecord().getSupportNetworkProfessionals() : null;
    if(voColl == null)
        return;

    SupportNetworkProfessionalVo voProf = null;
    GenForm.lyrSupportServicesLayer.tabPageProfContainer.grdProfessionalRow row = null;

    form.lyrSupportServices().tabPageProf().grdProfessional().getRows().clear();

    boolean bActiveProfessionals = false;
    for (int i = 0; i < voColl.size(); i++)
    {
        voProf = voColl.get(i);

        if(form.lyrSupportServices().tabPageProf().grpProfFilter().getValue().equals(GenForm.lyrSupportServicesLayer.tabPageProfContainer.grpProfFilterEnumeration.rdoActiveProf)
            && voProf.getIsCurrActiveProfSuppIsNotNull()
            && voProf.getIsCurrActiveProfSupp().equals(Boolean.FALSE))
            continue;

        row = form.lyrSupportServices().tabPageProf().grdProfessional().getRows().newRow();

        if (voProf.getMOSIsNotNull())
        {
            row.setColName(voProf.getMOS().toString());
            row.setTooltipForColName(voProf.getMOS().toString());
        }
        else if (voProf.getSuppliedProfessionalIsNotNull())
        {
            row.setColName(voProf.getSuppliedProfessional().getName());
            row.setTooltipForColName(voProf.getSuppliedProfessional().getName());
            row.setColWorkPhone(voProf.getSuppliedProfessional().getWorkPhone());
            row.setTooltipForColWorkPhone(voProf.getSuppliedProfessional().getWorkPhone());
        }

        if (voProf.getHcpSubTypeIsNotNull())
        {
            row.setColProfessionService(voProf.getHcpSubType().getText());
            row.setTooltipForColProfessionService(voProf.getHcpSubType().getText());
        }

        if (voProf.getCurrentLocationIsNotNull() && voProf.getCurrentLocation().getAddressIsNotNull())
        {
            row.setColWorkPhone(voProf.getCurrentLocation().getAddress().getPhone());
            row.setTooltipForColWorkPhone(voProf.getCurrentLocation().getAddress().getPhone());
        }

        if (voProf.getIsCurrActiveProfSupp().booleanValue())
        {
            row.setColIsActive(form.getImages().Core.AnswerBox_Yes);
            bActiveProfessionals = true;
        }
        else
        {
            row.setColIsActive(form.getImages().Core.AnswerBox_No);
            row.setBackColor(Color.LightGray);
        }

        row.setValue(voProf);
    }

    form.getLocalContext().setActiveProfessionals(bActiveProfessionals);

    SupportNetworkProfessionalVo voSupportNetworkProfessional = form.getLocalContext().getSelectedSupportNetworkProfessional();
    if (voSupportNetworkProfessional != null && form.lyrSupportServices().tabPageProf().grdProfessional().getRowByValue(voSupportNetworkProfessional) != null)
    {
        form.lyrSupportServices().tabPageProf().grdProfessional().setValue(voSupportNetworkProfessional);
        grdProSelectionChanged();
    }
}
项目:openMAXIMS    文件:Logic.java   
private boolean saveProfessional(SupportNetworkProfessionalVo supportNetworkProf) 
{
    if (form.getLocalContext().getSelectedRecord() == null)
        populateBaseDischargeServices();

    ArrayList<String> screenErrors = new ArrayList<String>();

    if (form.lyrSupportServices().tabPageProf().cmbProfessional().getValue() == null)
        screenErrors.add("Profession is mandatory");

    if (form.lyrSupportServices().tabPageProf().cmbHcpSubType().getValue() == null)
        screenErrors.add("Type is mandatory");

    if (form.lyrSupportServices().tabPageProf().qmbHcpName().isEnabled() && (!form.lyrSupportServices().tabPageProf().chkSupplyHcp().getValue()) && (form.lyrSupportServices().tabPageProf().qmbHcpName().getValue() == null) )
        screenErrors.add("HCP Name is mandatory");
    else if (form.lyrSupportServices().tabPageProf().txtHcpName().isEnabled() && (form.lyrSupportServices().tabPageProf().chkSupplyHcp().getValue()) && (form.lyrSupportServices().tabPageProf().txtHcpName().getValue() == null))
        screenErrors.add("HCP Name is mandatory");

    if (form.lyrSupportServices().tabPageProf().customControlAuth().getValue()==null)
    {
        screenErrors.add("Authoring HCP and Date/Time are mandatory");
    }

    String[] sScreenErrors = screenErrors(screenErrors);
    if(sScreenErrors.length > 0)
    {
        engine.showErrors(sScreenErrors);
        return false;
    }

    SupportNetworkProfessionalVo voSupportProfessional = null;
    if (supportNetworkProf == null)
        voSupportProfessional = populateProfessionalInstanceData();
    else
        voSupportProfessional = supportNetworkProf;

    //WDEV-14594
    String[] arrErrorsProf = voSupportProfessional.validate();
    if(arrErrorsProf != null)
    {
        engine.showErrors(arrErrorsProf);
        return false;
    }

    if (form.getLocalContext().getSelectedRecord().getSupportNetworkProfessionals() == null)
        form.getLocalContext().getSelectedRecord().setSupportNetworkProfessionals(new SupportNetworkProfessionalVoCollection());

    if (form.getLocalContext().getSelectedRecord().getSupportNetworkProfessionals().indexOf(voSupportProfessional) >= 0)
        form.getLocalContext().getSelectedRecord().getSupportNetworkProfessionals().set(form.getLocalContext().getSelectedRecord().getSupportNetworkProfessionals().indexOf(voSupportProfessional), voSupportProfessional);
    else
        form.getLocalContext().getSelectedRecord().getSupportNetworkProfessionals().add(voSupportProfessional);


    String[] arrErrors = form.getLocalContext().getSelectedRecord().validate();
    if(arrErrors != null)
    {
        engine.showErrors(arrErrors);
        return false;
    }

    try 
    {
        form.getLocalContext().setSelectedRecord(domain.saveSupportServices(form.getLocalContext().getSelectedRecord()));
    } 
    catch (StaleObjectException e) 
    {
        engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
        openSupportServices();
        return false;
    }

    savePatientNoSupportNetworkStatusInfo(false);

    return true;
}
项目:openMAXIMS    文件:Logic.java   
protected void onCmbEpisodeValueChanged() throws PresentationLogicException 
{
    form.grdProfessional().getRows().clear();
    //09/09/2005 - check for null
    CareContextShortVo voCareContextShort = form.cmbEpisode().getValue();
    if(voCareContextShort == null)
        return;
    SupportNetworkProfessionalVoCollection voColl = domain.listSupportNetworkProfessionalByCareContext(voCareContextShort, Boolean.TRUE);

    SupportNetworkProfessionalVo voProf = null;
    GenForm.grdProfessionalRow row = null;


    if(voColl == null)
        return;

    for(int i = 0 ; i < voColl.size() ; i++)
    {
        voProf = voColl.get(i);
        row = form.grdProfessional().getRows().newRow();

        if(voProf.getMOS() != null)
        {
            row.setName(voProf.getMOS().toString());
            if(voProf.getHcpSubType() != null)
                row.setProfession(voProf.getHcpSubType().getText());

            MemberOfStaffVo voMos = domain.getMos(voProf.getMOS());

            if(voMos != null && voMos.getLocations() != null)
            {
                for(int k = 0 ; k < voMos.getLocations().size() ; k++)
                {
                    if (voMos.getLocations().get(k).getIsPrimaryIsNotNull() && voMos.getLocations().get(k).getIsPrimary().equals(Boolean.TRUE))
                        if (voMos.getLocations().get(k).getLocation().getAddressIsNotNull())
                            row.setPhone(voMos.getLocations().get(k).getLocation().getAddress().getPhone());
                }
            }
        }

        row.setSelect(true);
        row.setValue(voProf);
    }           
}
项目:openMAXIMS    文件:Logic.java   
private void listSupportNetworkProfessional(boolean bFromPrevoiousEpisode)
{
    SupportNetworkProfessionalVoCollection voColl = null;
    if (bFromPrevoiousEpisode == false)
    {
        Boolean bActiveOnly = Boolean.FALSE;
        if (form.lyrProServices().tabProfessional().grpProfFilter().getValue().equals(GenForm.lyrProServicesLayer.tabProfessionalContainer.grpProfFilterEnumeration.rdoActiveProf))
            bActiveOnly = Boolean.TRUE;

        /*
         * if(form.getGlobalContext().Core.getCurrentCareContextIsNotNull())
         * voColl =
         * domain.listSupportNetworkProfessionalByCareContext(form.getGlobalContext().Core.getCurrentCareContext(),
         * bActiveOnly); else voColl =
         * domain.listSupportNetworkProfessionalByPatient(bActiveOnly,
         * form.getGlobalContext().Core.getPatientShort());
         */

        // WDEV-2257 - previous commented code did it selectively by
        // CareContext or Patient
        voColl = domain.listSupportNetworkProfessionalByPatient(bActiveOnly, form.getGlobalContext().Core.getPatientShort());
    }
    else
    {
        voColl = form.getGlobalContext().COE.getSupportNetworkProfessionalCollection();
    }

    SupportNetworkProfessionalVo voProf = null;
    GenForm.lyrProServicesLayer.tabProfessionalContainer.grdProfessionalRow row = null;

    form.lyrProServices().tabProfessional().grdProfessional().getRows().clear();

    if (voColl == null)
        return;

    boolean bActiveProfessionals = false;
    for (int i = 0; i < voColl.size(); i++)
    {
        voProf = voColl.get(i);
        row = form.lyrProServices().tabProfessional().grdProfessional().getRows().newRow();

        if (voProf.getMOSIsNotNull())
        {
            row.setColName(voProf.getMOS().toString());
        }
        else if (voProf.getSuppliedProfessionalIsNotNull())
        {
            row.setColName(voProf.getSuppliedProfessional().getName());
            row.setColWorkPhone(voProf.getSuppliedProfessional().getWorkPhone());
        }

        if (voProf.getHcpSubTypeIsNotNull())
            row.setColProfessionService(voProf.getHcpSubType().getText());

        if (voProf.getCurrentLocationIsNotNull() && voProf.getCurrentLocation().getAddressIsNotNull())
        {
            row.setColWorkPhone(voProf.getCurrentLocation().getAddress().getPhone());
        }

        if (voProf.getIsCurrActiveProfSupp().booleanValue()){
            row.setColIsActive(form.getImages().Core.AnswerBox_Yes);
            bActiveProfessionals = true;
        }
        else
        {
            row.setColIsActive(form.getImages().Core.AnswerBox_No);
            row.setBackColor(Color.LightGray);
        }

        row.setValue(voProf);
    }

    form.getLocalContext().setActiveProfessionals(bActiveProfessionals);

    SupportNetworkProfessionalVo voSupportNetworkProfessional = form.getLocalContext().getsupportNetworkProfessional();
    if (voSupportNetworkProfessional != null && form.lyrProServices().tabProfessional().grdProfessional().getRowByValue(voSupportNetworkProfessional) != null)
    {
        form.lyrProServices().tabProfessional().grdProfessional().setValue(voSupportNetworkProfessional);
        grdProSelectionChanged();
    }
}
项目:openMAXIMS    文件:SupportNetworkProfessionalServicesImpl.java   
public SupportNetworkProfessionalVoCollection listSupportNetworkProfessionalByCareContext(CareContextRefVo voCareContextRef, Boolean activeOnly)
{
    if (voCareContextRef == null)
        throw new CodingRuntimeException("Care Context was not supplied. Mandatory argument");

    DomainFactory factory = getDomainFactory();

    String hqlQuery = " from SupportNetwork snw ";
    StringBuffer condStr = new StringBuffer();
    ArrayList markerNames = new ArrayList();
    ArrayList markerValues = new ArrayList();

    condStr.append(" where ");

    if (voCareContextRef != null)
    {
        condStr.append(" snw.careContext.id = :careContext");
        markerNames.add("careContext");
        markerValues.add(voCareContextRef.getID_CareContext());
    }

    hqlQuery += condStr.toString();

    java.util.List lst = factory.find(hqlQuery, markerNames, markerValues);

    // Should be only one / none Support Network in the list for the
    // CLinical Contact
    if (lst.size() > 0)
    {
        SupportNetwork snw = (SupportNetwork) lst.get(0);
        if (activeOnly.booleanValue() == false)
            return SupportNetworkProfessionalVoAssembler.createSupportNetworkProfessionalVoCollectionFromSupportNetworkProfessional(snw.getProfessional()).sort();
        else
        {
            if (snw != null)
            {
                java.util.List lst2 = factory.find(snw.getProfessional(), " where this.isCurrActiveProfSupp = :active", new String[]{"active"}, new Object[]{Boolean.TRUE});
                return SupportNetworkProfessionalVoAssembler.createSupportNetworkProfessionalVoCollectionFromSupportNetworkProfessional(lst2);
            }
            return null;
        }
    }
    else
        return null;
}
项目:openMAXIMS    文件:Logic.java   
private void listSupportNetworkProfessional()
{
    //WDEV-14594
    form.getLocalContext().setSelectedRecord(domain.getSupportServices(form.getLocalContext().getSelectedRecord(), form.getLocalContext().getCareContextRef()));

    SupportNetworkProfessionalVoCollection voColl = form.getLocalContext().getSelectedRecord() != null ? form.getLocalContext().getSelectedRecord().getSupportNetworkProfessionals() : null;
    if(voColl == null)
        return;

    SupportNetworkProfessionalVo voProf = null;
    GenForm.lyrSupportServicesLayer.tabPageProfContainer.grdProfessionalRow row = null;

    form.lyrSupportServices().tabPageProf().grdProfessional().getRows().clear();

    boolean bActiveProfessionals = false;
    for (int i = 0; i < voColl.size(); i++)
    {
        voProf = voColl.get(i);

        if(form.lyrSupportServices().tabPageProf().grpProfFilter().getValue().equals(GenForm.lyrSupportServicesLayer.tabPageProfContainer.grpProfFilterEnumeration.rdoActiveProf)
            && voProf.getIsCurrActiveProfSuppIsNotNull()
            && voProf.getIsCurrActiveProfSupp().equals(Boolean.FALSE))
            continue;

        row = form.lyrSupportServices().tabPageProf().grdProfessional().getRows().newRow();

        if (voProf.getMOSIsNotNull())
        {
            row.setColName(voProf.getMOS().toString());
            row.setTooltipForColName(voProf.getMOS().toString());
        }
        else if (voProf.getSuppliedProfessionalIsNotNull())
        {
            row.setColName(voProf.getSuppliedProfessional().getName());
            row.setTooltipForColName(voProf.getSuppliedProfessional().getName());
            row.setColWorkPhone(voProf.getSuppliedProfessional().getWorkPhone());
            row.setTooltipForColWorkPhone(voProf.getSuppliedProfessional().getWorkPhone());
        }

        if (voProf.getHcpSubTypeIsNotNull())
        {
            row.setColProfessionService(voProf.getHcpSubType().getText());
            row.setTooltipForColProfessionService(voProf.getHcpSubType().getText());
        }

        if (voProf.getCurrentLocationIsNotNull() && voProf.getCurrentLocation().getAddressIsNotNull())
        {
            row.setColWorkPhone(voProf.getCurrentLocation().getAddress().getPhone());
            row.setTooltipForColWorkPhone(voProf.getCurrentLocation().getAddress().getPhone());
        }

        if (voProf.getIsCurrActiveProfSupp().booleanValue())
        {
            row.setColIsActive(form.getImages().Core.AnswerBox_Yes);
            bActiveProfessionals = true;
        }
        else
        {
            row.setColIsActive(form.getImages().Core.AnswerBox_No);
            row.setBackColor(Color.LightGray);
        }

        row.setValue(voProf);
    }

    form.getLocalContext().setActiveProfessionals(bActiveProfessionals);

    SupportNetworkProfessionalVo voSupportNetworkProfessional = form.getLocalContext().getSelectedSupportNetworkProfessional();
    if (voSupportNetworkProfessional != null && form.lyrSupportServices().tabPageProf().grdProfessional().getRowByValue(voSupportNetworkProfessional) != null)
    {
        form.lyrSupportServices().tabPageProf().grdProfessional().setValue(voSupportNetworkProfessional);
        grdProSelectionChanged();
    }
}
项目:openMAXIMS    文件:Logic.java   
private boolean saveProfessional(SupportNetworkProfessionalVo supportNetworkProf) 
{
    if (form.getLocalContext().getSelectedRecord() == null)
        populateBaseDischargeServices();

    ArrayList<String> screenErrors = new ArrayList<String>();

    if (form.lyrSupportServices().tabPageProf().cmbProfessional().getValue() == null)
        screenErrors.add("Profession is mandatory");

    if (form.lyrSupportServices().tabPageProf().cmbHcpSubType().getValue() == null)
        screenErrors.add("Type is mandatory");

    if (form.lyrSupportServices().tabPageProf().qmbHcpName().isEnabled() && (!form.lyrSupportServices().tabPageProf().chkSupplyHcp().getValue()) && (form.lyrSupportServices().tabPageProf().qmbHcpName().getValue() == null) )
        screenErrors.add("HCP Name is mandatory");
    else if (form.lyrSupportServices().tabPageProf().txtHcpName().isEnabled() && (form.lyrSupportServices().tabPageProf().chkSupplyHcp().getValue()) && (form.lyrSupportServices().tabPageProf().txtHcpName().getValue() == null))
        screenErrors.add("HCP Name is mandatory");

    if (form.lyrSupportServices().tabPageProf().customControlAuth().getValue()==null)
    {
        screenErrors.add("Authoring HCP and Date/Time are mandatory");
    }

    String[] sScreenErrors = screenErrors(screenErrors);
    if(sScreenErrors.length > 0)
    {
        engine.showErrors(sScreenErrors);
        return false;
    }

    SupportNetworkProfessionalVo voSupportProfessional = null;
    if (supportNetworkProf == null)
        voSupportProfessional = populateProfessionalInstanceData();
    else
        voSupportProfessional = supportNetworkProf;

    //WDEV-14594
    String[] arrErrorsProf = voSupportProfessional.validate();
    if(arrErrorsProf != null)
    {
        engine.showErrors(arrErrorsProf);
        return false;
    }

    if (form.getLocalContext().getSelectedRecord().getSupportNetworkProfessionals() == null)
        form.getLocalContext().getSelectedRecord().setSupportNetworkProfessionals(new SupportNetworkProfessionalVoCollection());

    if (form.getLocalContext().getSelectedRecord().getSupportNetworkProfessionals().indexOf(voSupportProfessional) >= 0)
        form.getLocalContext().getSelectedRecord().getSupportNetworkProfessionals().set(form.getLocalContext().getSelectedRecord().getSupportNetworkProfessionals().indexOf(voSupportProfessional), voSupportProfessional);
    else
        form.getLocalContext().getSelectedRecord().getSupportNetworkProfessionals().add(voSupportProfessional);


    String[] arrErrors = form.getLocalContext().getSelectedRecord().validate();
    if(arrErrors != null)
    {
        engine.showErrors(arrErrors);
        return false;
    }

    try 
    {
        form.getLocalContext().setSelectedRecord(domain.saveSupportServices(form.getLocalContext().getSelectedRecord()));
    } 
    catch (StaleObjectException e) 
    {
        engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
        openSupportServices();
        return false;
    }

    savePatientNoSupportNetworkStatusInfo(false);

    return true;
}
项目:openmaxims-linux    文件:Logic.java   
protected void onCmbEpisodeValueChanged() throws PresentationLogicException 
{
    form.grdProfessional().getRows().clear();
    //09/09/2005 - check for null
    CareContextShortVo voCareContextShort = form.cmbEpisode().getValue();
    if(voCareContextShort == null)
        return;
    SupportNetworkProfessionalVoCollection voColl = domain.listSupportNetworkProfessionalByCareContext(voCareContextShort, Boolean.TRUE);

    SupportNetworkProfessionalVo voProf = null;
    GenForm.grdProfessionalRow row = null;


    if(voColl == null)
        return;

    for(int i = 0 ; i < voColl.size() ; i++)
    {
        voProf = voColl.get(i);
        row = form.grdProfessional().getRows().newRow();

        if(voProf.getMOS() != null)
        {
            row.setName(voProf.getMOS().toString());
            if(voProf.getHcpSubType() != null)
                row.setProfession(voProf.getHcpSubType().getText());

            MemberOfStaffVo voMos = domain.getMos(voProf.getMOS());

            if(voMos != null && voMos.getLocations() != null)
            {
                for(int k = 0 ; k < voMos.getLocations().size() ; k++)
                {
                    if (voMos.getLocations().get(k).getIsPrimaryIsNotNull() && voMos.getLocations().get(k).getIsPrimary().equals(Boolean.TRUE))
                        if (voMos.getLocations().get(k).getLocation().getAddressIsNotNull())
                            row.setPhone(voMos.getLocations().get(k).getLocation().getAddress().getPhone());
                }
            }
        }

        row.setSelect(true);
        row.setValue(voProf);
    }           
}
项目:openmaxims-linux    文件:Logic.java   
private void listSupportNetworkProfessional(boolean bFromPrevoiousEpisode)
{
    SupportNetworkProfessionalVoCollection voColl = null;
    if (bFromPrevoiousEpisode == false)
    {
        Boolean bActiveOnly = Boolean.FALSE;
        if (form.lyrProServices().tabProfessional().grpProfFilter().getValue().equals(GenForm.lyrProServicesLayer.tabProfessionalContainer.grpProfFilterEnumeration.rdoActiveProf))
            bActiveOnly = Boolean.TRUE;

        /*
         * if(form.getGlobalContext().Core.getCurrentCareContextIsNotNull())
         * voColl =
         * domain.listSupportNetworkProfessionalByCareContext(form.getGlobalContext().Core.getCurrentCareContext(),
         * bActiveOnly); else voColl =
         * domain.listSupportNetworkProfessionalByPatient(bActiveOnly,
         * form.getGlobalContext().Core.getPatientShort());
         */

        // WDEV-2257 - previous commented code did it selectively by
        // CareContext or Patient
        voColl = domain.listSupportNetworkProfessionalByPatient(bActiveOnly, form.getGlobalContext().Core.getPatientShort());
    }
    else
    {
        voColl = form.getGlobalContext().COE.getSupportNetworkProfessionalCollection();
    }

    SupportNetworkProfessionalVo voProf = null;
    GenForm.lyrProServicesLayer.tabProfessionalContainer.grdProfessionalRow row = null;

    form.lyrProServices().tabProfessional().grdProfessional().getRows().clear();

    if (voColl == null)
        return;

    boolean bActiveProfessionals = false;
    for (int i = 0; i < voColl.size(); i++)
    {
        voProf = voColl.get(i);
        row = form.lyrProServices().tabProfessional().grdProfessional().getRows().newRow();

        if (voProf.getMOSIsNotNull())
        {
            row.setColName(voProf.getMOS().toString());
        }
        else if (voProf.getSuppliedProfessionalIsNotNull())
        {
            row.setColName(voProf.getSuppliedProfessional().getName());
            row.setColWorkPhone(voProf.getSuppliedProfessional().getWorkPhone());
        }

        if (voProf.getHcpSubTypeIsNotNull())
            row.setColProfessionService(voProf.getHcpSubType().getText());

        if (voProf.getCurrentLocationIsNotNull() && voProf.getCurrentLocation().getAddressIsNotNull())
        {
            row.setColWorkPhone(voProf.getCurrentLocation().getAddress().getPhone());
        }

        if (voProf.getIsCurrActiveProfSupp().booleanValue()){
            row.setColIsActive(form.getImages().Core.AnswerBox_Yes);
            bActiveProfessionals = true;
        }
        else
        {
            row.setColIsActive(form.getImages().Core.AnswerBox_No);
            row.setBackColor(Color.LightGray);
        }

        row.setValue(voProf);
    }

    form.getLocalContext().setActiveProfessionals(bActiveProfessionals);

    SupportNetworkProfessionalVo voSupportNetworkProfessional = form.getLocalContext().getsupportNetworkProfessional();
    if (voSupportNetworkProfessional != null && form.lyrProServices().tabProfessional().grdProfessional().getRowByValue(voSupportNetworkProfessional) != null)
    {
        form.lyrProServices().tabProfessional().grdProfessional().setValue(voSupportNetworkProfessional);
        grdProSelectionChanged();
    }
}
项目:openmaxims-linux    文件:SupportNetworkProfessionalServicesImpl.java   
public SupportNetworkProfessionalVoCollection listSupportNetworkProfessionalByCareContext(CareContextRefVo voCareContextRef, Boolean activeOnly)
{
    if (voCareContextRef == null)
        throw new CodingRuntimeException("Care Context was not supplied. Mandatory argument");

    DomainFactory factory = getDomainFactory();

    String hqlQuery = " from SupportNetwork snw ";
    StringBuffer condStr = new StringBuffer();
    ArrayList markerNames = new ArrayList();
    ArrayList markerValues = new ArrayList();

    condStr.append(" where ");

    if (voCareContextRef != null)
    {
        condStr.append(" snw.careContext.id = :careContext");
        markerNames.add("careContext");
        markerValues.add(voCareContextRef.getID_CareContext());
    }

    hqlQuery += condStr.toString();

    java.util.List lst = factory.find(hqlQuery, markerNames, markerValues);

    // Should be only one / none Support Network in the list for the
    // CLinical Contact
    if (lst.size() > 0)
    {
        SupportNetwork snw = (SupportNetwork) lst.get(0);
        if (activeOnly.booleanValue() == false)
            return SupportNetworkProfessionalVoAssembler.createSupportNetworkProfessionalVoCollectionFromSupportNetworkProfessional(snw.getProfessional()).sort();
        else
        {
            if (snw != null)
            {
                java.util.List lst2 = factory.find(snw.getProfessional(), " where this.isCurrActiveProfSupp = :active", new String[]{"active"}, new Object[]{Boolean.TRUE});
                return SupportNetworkProfessionalVoAssembler.createSupportNetworkProfessionalVoCollectionFromSupportNetworkProfessional(lst2);
            }
            return null;
        }
    }
    else
        return null;
}
项目:openmaxims-linux    文件:Logic.java   
private void listSupportNetworkProfessional()
{
    //WDEV-14594
    form.getLocalContext().setSelectedRecord(domain.getSupportServices(form.getLocalContext().getSelectedRecord(), form.getLocalContext().getCareContextRef()));

    SupportNetworkProfessionalVoCollection voColl = form.getLocalContext().getSelectedRecord() != null ? form.getLocalContext().getSelectedRecord().getSupportNetworkProfessionals() : null;
    if(voColl == null)
        return;

    SupportNetworkProfessionalVo voProf = null;
    GenForm.lyrSupportServicesLayer.tabPageProfContainer.grdProfessionalRow row = null;

    form.lyrSupportServices().tabPageProf().grdProfessional().getRows().clear();

    boolean bActiveProfessionals = false;
    for (int i = 0; i < voColl.size(); i++)
    {
        voProf = voColl.get(i);

        if(form.lyrSupportServices().tabPageProf().grpProfFilter().getValue().equals(GenForm.lyrSupportServicesLayer.tabPageProfContainer.grpProfFilterEnumeration.rdoActiveProf)
            && voProf.getIsCurrActiveProfSuppIsNotNull()
            && voProf.getIsCurrActiveProfSupp().equals(Boolean.FALSE))
            continue;

        row = form.lyrSupportServices().tabPageProf().grdProfessional().getRows().newRow();

        if (voProf.getMOSIsNotNull())
        {
            row.setColName(voProf.getMOS().toString());
            row.setTooltipForColName(voProf.getMOS().toString());
        }
        else if (voProf.getSuppliedProfessionalIsNotNull())
        {
            row.setColName(voProf.getSuppliedProfessional().getName());
            row.setTooltipForColName(voProf.getSuppliedProfessional().getName());
            row.setColWorkPhone(voProf.getSuppliedProfessional().getWorkPhone());
            row.setTooltipForColWorkPhone(voProf.getSuppliedProfessional().getWorkPhone());
        }

        if (voProf.getHcpSubTypeIsNotNull())
        {
            row.setColProfessionService(voProf.getHcpSubType().getText());
            row.setTooltipForColProfessionService(voProf.getHcpSubType().getText());
        }

        if (voProf.getCurrentLocationIsNotNull() && voProf.getCurrentLocation().getAddressIsNotNull())
        {
            row.setColWorkPhone(voProf.getCurrentLocation().getAddress().getPhone());
            row.setTooltipForColWorkPhone(voProf.getCurrentLocation().getAddress().getPhone());
        }

        if (voProf.getIsCurrActiveProfSupp().booleanValue())
        {
            row.setColIsActive(form.getImages().Core.AnswerBox_Yes);
            bActiveProfessionals = true;
        }
        else
        {
            row.setColIsActive(form.getImages().Core.AnswerBox_No);
            row.setBackColor(Color.LightGray);
        }

        row.setValue(voProf);
    }

    form.getLocalContext().setActiveProfessionals(bActiveProfessionals);

    SupportNetworkProfessionalVo voSupportNetworkProfessional = form.getLocalContext().getSelectedSupportNetworkProfessional();
    if (voSupportNetworkProfessional != null && form.lyrSupportServices().tabPageProf().grdProfessional().getRowByValue(voSupportNetworkProfessional) != null)
    {
        form.lyrSupportServices().tabPageProf().grdProfessional().setValue(voSupportNetworkProfessional);
        grdProSelectionChanged();
    }
}
项目:openmaxims-linux    文件:Logic.java   
private boolean saveProfessional(SupportNetworkProfessionalVo supportNetworkProf) 
{
    if (form.getLocalContext().getSelectedRecord() == null)
        populateBaseDischargeServices();

    ArrayList<String> screenErrors = new ArrayList<String>();

    if (form.lyrSupportServices().tabPageProf().cmbProfessional().getValue() == null)
        screenErrors.add("Profession is mandatory");

    if (form.lyrSupportServices().tabPageProf().cmbHcpSubType().getValue() == null)
        screenErrors.add("Type is mandatory");

    if (form.lyrSupportServices().tabPageProf().qmbHcpName().isEnabled() && (!form.lyrSupportServices().tabPageProf().chkSupplyHcp().getValue()) && (form.lyrSupportServices().tabPageProf().qmbHcpName().getValue() == null) )
        screenErrors.add("HCP Name is mandatory");
    else if (form.lyrSupportServices().tabPageProf().txtHcpName().isEnabled() && (form.lyrSupportServices().tabPageProf().chkSupplyHcp().getValue()) && (form.lyrSupportServices().tabPageProf().txtHcpName().getValue() == null))
        screenErrors.add("HCP Name is mandatory");

    if (form.lyrSupportServices().tabPageProf().customControlAuth().getValue()==null)
    {
        screenErrors.add("Authoring HCP and Date/Time are mandatory");
    }

    String[] sScreenErrors = screenErrors(screenErrors);
    if(sScreenErrors.length > 0)
    {
        engine.showErrors(sScreenErrors);
        return false;
    }

    SupportNetworkProfessionalVo voSupportProfessional = null;
    if (supportNetworkProf == null)
        voSupportProfessional = populateProfessionalInstanceData();
    else
        voSupportProfessional = supportNetworkProf;

    //WDEV-14594
    String[] arrErrorsProf = voSupportProfessional.validate();
    if(arrErrorsProf != null)
    {
        engine.showErrors(arrErrorsProf);
        return false;
    }

    if (form.getLocalContext().getSelectedRecord().getSupportNetworkProfessionals() == null)
        form.getLocalContext().getSelectedRecord().setSupportNetworkProfessionals(new SupportNetworkProfessionalVoCollection());

    if (form.getLocalContext().getSelectedRecord().getSupportNetworkProfessionals().indexOf(voSupportProfessional) >= 0)
        form.getLocalContext().getSelectedRecord().getSupportNetworkProfessionals().set(form.getLocalContext().getSelectedRecord().getSupportNetworkProfessionals().indexOf(voSupportProfessional), voSupportProfessional);
    else
        form.getLocalContext().getSelectedRecord().getSupportNetworkProfessionals().add(voSupportProfessional);


    String[] arrErrors = form.getLocalContext().getSelectedRecord().validate();
    if(arrErrors != null)
    {
        engine.showErrors(arrErrors);
        return false;
    }

    try 
    {
        form.getLocalContext().setSelectedRecord(domain.saveSupportServices(form.getLocalContext().getSelectedRecord()));
    } 
    catch (StaleObjectException e) 
    {
        engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
        openSupportServices();
        return false;
    }

    savePatientNoSupportNetworkStatusInfo(false);

    return true;
}