Java 类ims.core.vo.lookups.ExternalResourceType 实例源码

项目:AvoinApotti    文件:Logic.java   
@Override
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException
{
    if (formName.equals(form.getForms().Core.ExternalResourceSearch) && DialogResult.OK.equals(result))
    {
        if (ADTAdmissionDetailEvent.REFERRED_FROM_SEARCH.equals(form.getLocalContext().getSelectedEvent()))
        {
            form.getLocalContext().setSelectedExternalResourceForReferredFrom(form.getGlobalContext().Core.getExternalResourceSelected());
            populateReferrerDetails(form.getLocalContext().getSelectedExternalResourceForReferredFrom());
            if (ExternalResourceType.ERT_HOSPITAL.equals(form.cmbReferredFrom().getValue()))
            {
                form.cmbAdmittedFrom().setValue(ExternalResourceType.ERT_HOSPITAL);
                populateAdmittedFromDetails(form.getLocalContext().getSelectedExternalResourceForReferredFrom());
                updateControlsState();
                form.getLocalContext().setSelectedExternalResourceForAdmittedFrom(form.getGlobalContext().Core.getExternalResourceSelected());

            }
        }
        else if (ADTAdmissionDetailEvent.ADMITTED_FROM_SEARCH.equals(form.getLocalContext().getSelectedEvent()))
        {
            form.getLocalContext().setSelectedExternalResourceForAdmittedFrom(form.getGlobalContext().Core.getExternalResourceSelected());
            populateAdmittedFromDetails(form.getLocalContext().getSelectedExternalResourceForAdmittedFrom());
        }
    }
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException
{
    if (formName.equals(form.getForms().Core.ExternalResourceSearch) && DialogResult.OK.equals(result))
    {
        if (ADTAdmissionDetailEvent.REFERRED_FROM_SEARCH.equals(form.getLocalContext().getSelectedEvent()))
        {
            form.getLocalContext().setSelectedExternalResourceForReferredFrom(form.getGlobalContext().Core.getExternalResourceSelected());
            populateReferrerDetails(form.getLocalContext().getSelectedExternalResourceForReferredFrom());
            if (ExternalResourceType.ERT_HOSPITAL.equals(form.cmbReferredFrom().getValue()))
            {
                form.cmbAdmittedFrom().setValue(ExternalResourceType.ERT_HOSPITAL);
                populateAdmittedFromDetails(form.getLocalContext().getSelectedExternalResourceForReferredFrom());
                updateControlsState();
                form.getLocalContext().setSelectedExternalResourceForAdmittedFrom(form.getGlobalContext().Core.getExternalResourceSelected());

            }
        }
        else if (ADTAdmissionDetailEvent.ADMITTED_FROM_SEARCH.equals(form.getLocalContext().getSelectedEvent()))
        {
            form.getLocalContext().setSelectedExternalResourceForAdmittedFrom(form.getGlobalContext().Core.getExternalResourceSelected());
            populateAdmittedFromDetails(form.getLocalContext().getSelectedExternalResourceForAdmittedFrom());
        }
    }
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException
{
    if (formName.equals(form.getForms().Core.ExternalResourceSearch) && DialogResult.OK.equals(result))
    {
        if (ADTAdmissionDetailEvent.REFERRED_FROM_SEARCH.equals(form.getLocalContext().getSelectedEvent()))
        {
            form.getLocalContext().setSelectedExternalResourceForReferredFrom(form.getGlobalContext().Core.getExternalResourceSelected());
            populateReferrerDetails(form.getLocalContext().getSelectedExternalResourceForReferredFrom());
            if (ExternalResourceType.ERT_HOSPITAL.equals(form.cmbReferredFrom().getValue()))
            {
                form.cmbAdmittedFrom().setValue(ExternalResourceType.ERT_HOSPITAL);
                populateAdmittedFromDetails(form.getLocalContext().getSelectedExternalResourceForReferredFrom());
                updateControlsState();
                form.getLocalContext().setSelectedExternalResourceForAdmittedFrom(form.getGlobalContext().Core.getExternalResourceSelected());

            }
        }
        else if (ADTAdmissionDetailEvent.ADMITTED_FROM_SEARCH.equals(form.getLocalContext().getSelectedEvent()))
        {
            form.getLocalContext().setSelectedExternalResourceForAdmittedFrom(form.getGlobalContext().Core.getExternalResourceSelected());
            populateAdmittedFromDetails(form.getLocalContext().getSelectedExternalResourceForAdmittedFrom());
        }
    }
}
项目:openmaxims-linux    文件:Logic.java   
@Override
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException
{
    if (formName.equals(form.getForms().Core.ExternalResourceSearch) && DialogResult.OK.equals(result))
    {
        if (ADTAdmissionDetailEvent.REFERRED_FROM_SEARCH.equals(form.getLocalContext().getSelectedEvent()))
        {
            form.getLocalContext().setSelectedExternalResourceForReferredFrom(form.getGlobalContext().Core.getExternalResourceSelected());
            populateReferrerDetails(form.getLocalContext().getSelectedExternalResourceForReferredFrom());
            if (ExternalResourceType.ERT_HOSPITAL.equals(form.cmbReferredFrom().getValue()))
            {
                form.cmbAdmittedFrom().setValue(ExternalResourceType.ERT_HOSPITAL);
                populateAdmittedFromDetails(form.getLocalContext().getSelectedExternalResourceForReferredFrom());
                updateControlsState();
                form.getLocalContext().setSelectedExternalResourceForAdmittedFrom(form.getGlobalContext().Core.getExternalResourceSelected());

            }
        }
        else if (ADTAdmissionDetailEvent.ADMITTED_FROM_SEARCH.equals(form.getLocalContext().getSelectedEvent()))
        {
            form.getLocalContext().setSelectedExternalResourceForAdmittedFrom(form.getGlobalContext().Core.getExternalResourceSelected());
            populateAdmittedFromDetails(form.getLocalContext().getSelectedExternalResourceForAdmittedFrom());
        }
    }
}
项目:AvoinApotti    文件:Logic.java   
@Override
protected void onCmbAdmittedFromValueChanged() throws ims.framework.exceptions.PresentationLogicException
{
    clearAdmittedFromAdr();
    updateControlsState();

    if (ExternalResourceType.ERT_HOMEADDRESS.equals(form.cmbAdmittedFrom().getValue()))
    {
        if (form.getGlobalContext().Core.getPatientShort() != null)
            populateAdmittedDetailsWithPatientAddress(form.getGlobalContext().Core.getPatientShort().getAddress());
    }

}
项目:AvoinApotti    文件:Logic.java   
private void removeItemsFromReferredAdmittedComboBoxes()
{
    // remove items from RefferedFrom comboBox (This comboBox should Contain
    // only HCP, Hospital, Local Placement Forum
    form.cmbReferredFrom().removeRow(ExternalResourceType.ERT_NURSINGHOME);
    form.cmbReferredFrom().removeRow(ExternalResourceType.ERT_HOMEADDRESS);
    form.cmbReferredFrom().removeRow(ExternalResourceType.ERT_OTHER);

    // remove items from RefferedFrom comboBox (This comboBox should Contain
    // only Home Address, Hospital, Nursing Home, Other
    form.cmbAdmittedFrom().removeRow(ExternalResourceType.ERT_HCP);
    form.cmbAdmittedFrom().removeRow(ExternalResourceType.ERT_LOCALPLACEMENTFORUM);
}
项目:AvoinApotti    文件:Logic.java   
private void populateScreenFromData(AdmissionDetailVo admissionDetail)
{
    clearInstanceControls();

    if (admissionDetail == null)
        return;

    form.dtimAdmissionDateTime().setValue(admissionDetail.getAdmissionDateTime());
    if (form.getLocalContext().getCurrentAdmissionDetailIsNotNull() && form.getLocalContext().getCurrentAdmissionDetail().getPasEventIsNotNull())
    {
        form.cmbAdmissionWard().setValue(domain.getAdmissionWard(form.getLocalContext().getCurrentAdmissionDetail().getPasEvent()));

        if (!domain.isPatientDischarged(form.getLocalContext().getCurrentAdmissionDetail()))
            form.cmbAdmissionType().setValue(domain.getAdmissionTypeFromInpatientEpisode(form.getLocalContext().getCurrentAdmissionDetail().getPasEvent()));
        else
            form.cmbAdmissionType().setValue(domain.getAdmissionTypeFromDischargedEpisode(form.getLocalContext().getCurrentAdmissionDetail().getPasEvent()));
    }

    form.ccAdmittingConsultant().setValue(admissionDetail.getConsultant());
    form.cmbSpecialty().setValue(admissionDetail.getSpecialty());

    form.intBedNumber().setValue(admissionDetail.getExtendedDetails() != null ? admissionDetail.getExtendedDetails().getBedNumber() : null);

    populateReferrerDetailsFromData(admissionDetail);

    if (admissionDetail.getExtendedDetails()!=null && ExternalResourceType.ERT_HOMEADDRESS.equals(admissionDetail.getExtendedDetails().getAdmittedFromType()))
    {
        form.cmbAdmittedFrom().setValue(admissionDetail.getExtendedDetails().getAdmittedFromType());
        populateAdmittedDetailsWithPatientAddress(form.getGlobalContext().Core.getPatientShort().getAddress());
    }
    else
    {
        populateAdmittedFromDetailsFromData(admissionDetail);
    }
}
项目:AvoinApotti    文件:Logic.java   
private void updateControlsState()
{
    form.ccAdmittingConsultant().setEnabled(FormMode.EDIT.equals(form.getMode()) && form.getLocalContext().getCurrentAdmissionDetail() == null);
    form.cmbAdmissionWard().setEnabled(FormMode.EDIT.equals(form.getMode()) && form.getLocalContext().getCurrentAdmissionDetail() == null);

    form.txtAdmittedFromName().setEnabled(FormMode.EDIT.equals(form.getMode()));

    form.imbReferredFromSearch().setVisible(FormMode.EDIT.equals(form.getMode()) && (ExternalResourceType.ERT_HCP.equals(form.cmbReferredFrom().getValue()) || ExternalResourceType.ERT_HOSPITAL.equals(form.cmbReferredFrom().getValue()) || ExternalResourceType.ERT_LOCALPLACEMENTFORUM.equals(form.cmbReferredFrom().getValue())));
    form.imbReferredFromSearch().setEnabled(FormMode.EDIT.equals(form.getMode()));

    form.imbAdmittedFromSearch().setVisible(FormMode.EDIT.equals(form.getMode()) && (ExternalResourceType.ERT_NURSINGHOME.equals(form.cmbAdmittedFrom().getValue()) || ExternalResourceType.ERT_HOSPITAL.equals(form.cmbAdmittedFrom().getValue())));
    form.imbAdmittedFromSearch().setEnabled(FormMode.EDIT.equals(form.getMode()));

    // form.btnNew().setVisible(FormMode.VIEW.equals(form.getMode()) &&
    // (form.getLocalContext().getCurrentAdmissionDetail()==null ||
    // (form.getLocalContext().getCurrentAdmissionDetail()!=null &&
    // domain.isPatientDischarged(form.getLocalContext().getCurrentAdmissionDetail()))));
    form.btnNew().setVisible(FormMode.VIEW.equals(form.getMode()) && form.getLocalContext().getCurrentAdmissionDetail() == null && form.getLocalContext().getPatient().getWard() == null );
    form.btnEdit().setVisible(FormMode.VIEW.equals(form.getMode()) && form.getLocalContext().getCurrentAdmissionDetailIsNotNull() && !domain.isPatientDischarged(form.getLocalContext().getCurrentAdmissionDetail()));

    updateReferreDetailsState(false);
    updateAdmittedDetailsState(FormMode.EDIT.equals(form.getMode()) && form.cmbAdmittedFrom().getValue() != null && (ExternalResourceType.ERT_OTHER.equals(form.cmbAdmittedFrom().getValue())));

    if (form.imbReferredFromSearch().isVisible())
    {
        form.imbReferredFromSearch().setTooltip("Search for External Resource of type '"+form.cmbReferredFrom().getValue().getText()+"'");
    }

    if (form.imbAdmittedFromSearch().isVisible())
    {
        form.imbAdmittedFromSearch().setTooltip("Search for External Resource of type '"+form.cmbAdmittedFrom().getValue().getText()+"'");
    }
}
项目:AvoinApotti    文件:Logic.java   
@Override
protected void onCmbReferredFromValueChanged() throws PresentationLogicException
{
    clearReferredFromAdr();
    //WDEV-16689
    if (form.getLocalContext().getCurrentAdmissionDetail() == null && ExternalResourceType.ERT_HOSPITAL.equals(form.cmbAdmittedFrom().getValue()) && form.getGlobalContext().Core.getExternalResourceSelected().getID_ExternalResource().equals(form.getLocalContext().getSelectedExternalResourceForReferredFrom().getID_ExternalResource()))
    {   
    form.cmbAdmittedFrom().setValue(null);
    clearAdmittedFromAdr();
    }
    updateControlsState();
}
项目:AvoinApotti    文件:Logic.java   
@Override
protected void onFormOpen(Object[] args) throws PresentationLogicException
{
    if (args != null)
    {
        if (args.length == 1 && args[0] != null && args[0] instanceof ExternalResourceType)
        {
            form.ccExternalResourceSearch().initialize((ExternalResourceType) args[0]);
            form.btnOK().setEnabled(false);
        }
    }
}
项目:AvoinApotti    文件:Logic.java   
public void initialize(ExternalResourceType externalResourceType)
{
    form.cmbResourceType().setValue(externalResourceType);
    form.cmbResourceType().setEnabled(!(externalResourceType != null));
    form.cmbHCPType().setEnabled(ExternalResourceType.ERT_HCP.equals(externalResourceType));
    search();
}
项目:AvoinApotti    文件:ExternalResourceSearchComponentImpl.java   
public ExternalResourceVoCollection getExternalResources(ExternalResourceType externalResourceType, String name, HcpDisType hcpType, PreActiveActiveInactiveStatus status)
{
    ArrayList<String> names = new ArrayList<String>();
    ArrayList<Object> values = new ArrayList<Object>();
    String prepend = " where ";
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer("from ExternalResource as er ");
    if (externalResourceType != null)
    {
        hql.append(prepend + " er.externalResourceType.id = :resourceType ");
        names.add("resourceType");
        values.add(externalResourceType.getID());
        prepend = " and ";
    }
    if (name != null)
    {
        hql.append(prepend + " upper(er.resourcename) like :name");
        names.add("name");
        values.add(name.toUpperCase() + "%");
        prepend = " and ";
    }

    if (hcpType != null)
    {
        hql.append(prepend + " er.hCPType.id = :idHcpType ");
        names.add("idHcpType");
        values.add(hcpType.getID());
        prepend = " and ";
    }
    if (status != null)
    {
        hql.append(prepend + " er.resourceStatus.id = :idStatus ");
        names.add("idStatus");
        values.add(status.getID());

    }
    hql.append(" order by er.systemInformation.creationDateTime asc");
    List<?> extresources = factory.find(hql.toString(), names, values);
    return ExternalResourceVoAssembler.createExternalResourceVoCollectionFromExternalResource(extresources);
}
项目:AvoinApotti    文件:Logic.java   
private void initialize()
{
    form.cmbResourceType().removeRow(ExternalResourceType.ERT_HOMEADDRESS);
    form.cmbResourceType().removeRow(ExternalResourceType.ERT_OTHER);

    form.cmbExternalResourceTypeDetails().removeRow(ExternalResourceType.ERT_HOMEADDRESS);
    form.cmbExternalResourceTypeDetails().removeRow(ExternalResourceType.ERT_OTHER);
}
项目:AvoinApotti    文件:Logic.java   
private void updateControlsState()
{
    form.btnEdit().setVisible(form.getMode().equals(FormMode.VIEW) && form.grdExternalResource().getSelectedRow() != null);
    form.cmbHcpTypeDetails().setRequired(true);
    if( form.cmbExternalResourceTypeDetails().getValue() != null && form.cmbExternalResourceTypeDetails().getValue().equals(ExternalResourceType.ERT_HCP))
    {
        if( form.getMode().equals(FormMode.EDIT))
        {
            form.cmbHcpTypeDetails().setEnabled(true);
            form.cmbHcpTypeDetails().setRequired(true);
        }

    }
    else
    {
        if( form.getMode().equals(FormMode.EDIT))
        {
            form.cmbHcpTypeDetails().setEnabled(false);
        }
    }

    if( form.cmbResourceType().getValue() != null && form.cmbResourceType().getValue().equals(ExternalResourceType.ERT_HCP))
    {
        if( form.getMode().equals(FormMode.VIEW))
        {
            form.cmbHCPType().setEnabled(true);

        }

    }
    else
    {
        if( form.getMode().equals(FormMode.VIEW))
        {
            form.cmbHCPType().setEnabled(false);
        }
    }

    updateContextMenus();
}
项目:AvoinApotti    文件:Logic.java   
private void cmbExternalResourceTypeDetailsValueChanged()
{
    if( form.cmbExternalResourceTypeDetails().getValue() == null || !form.cmbExternalResourceTypeDetails().getValue().equals(ExternalResourceType.ERT_HCP))
    {
        form.cmbHcpTypeDetails().setValue(null);
    }

    updateControlsState();
}
项目:AvoinApotti    文件:Logic.java   
private void cmbResourceTypeValueChanged()
{
    if( form.cmbResourceType().getValue() == null || !form.cmbResourceType().getValue().equals(ExternalResourceType.ERT_HCP))
    {
        form.cmbHCPType().setValue(null);
    }

    updateControlsState();
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onCmbAdmittedFromValueChanged() throws ims.framework.exceptions.PresentationLogicException
{
    clearAdmittedFromAdr();
    updateControlsState();

    if (ExternalResourceType.ERT_HOMEADDRESS.equals(form.cmbAdmittedFrom().getValue()))
    {
        if (form.getGlobalContext().Core.getPatientShort() != null)
            populateAdmittedDetailsWithPatientAddress(form.getGlobalContext().Core.getPatientShort().getAddress());
    }

}
项目:openMAXIMS    文件:Logic.java   
private void removeItemsFromReferredAdmittedComboBoxes()
{
    // remove items from RefferedFrom comboBox (This comboBox should Contain
    // only HCP, Hospital, Local Placement Forum
    form.cmbReferredFrom().removeRow(ExternalResourceType.ERT_NURSINGHOME);
    form.cmbReferredFrom().removeRow(ExternalResourceType.ERT_HOMEADDRESS);
    form.cmbReferredFrom().removeRow(ExternalResourceType.ERT_OTHER);

    // remove items from RefferedFrom comboBox (This comboBox should Contain
    // only Home Address, Hospital, Nursing Home, Other
    form.cmbAdmittedFrom().removeRow(ExternalResourceType.ERT_HCP);
    form.cmbAdmittedFrom().removeRow(ExternalResourceType.ERT_LOCALPLACEMENTFORUM);
}
项目:openMAXIMS    文件:Logic.java   
private void populateScreenFromData(AdmissionDetailVo admissionDetail)
{
    clearInstanceControls();

    if (admissionDetail == null)
        return;

    form.dtimAdmissionDateTime().setValue(admissionDetail.getAdmissionDateTime());
    if (form.getLocalContext().getCurrentAdmissionDetailIsNotNull() && form.getLocalContext().getCurrentAdmissionDetail().getPasEventIsNotNull())
    {
        form.cmbAdmissionWard().setValue(domain.getAdmissionWard(form.getLocalContext().getCurrentAdmissionDetail().getPasEvent()));

        if (!domain.isPatientDischarged(form.getLocalContext().getCurrentAdmissionDetail()))
            form.cmbAdmissionType().setValue(domain.getAdmissionTypeFromInpatientEpisode(form.getLocalContext().getCurrentAdmissionDetail().getPasEvent()));
        else
            form.cmbAdmissionType().setValue(domain.getAdmissionTypeFromDischargedEpisode(form.getLocalContext().getCurrentAdmissionDetail().getPasEvent()));
    }

    form.ccAdmittingConsultant().setValue(admissionDetail.getConsultant());
    form.cmbSpecialty().setValue(admissionDetail.getSpecialty());

    form.intBedNumber().setValue(admissionDetail.getExtendedDetails() != null ? admissionDetail.getExtendedDetails().getBedNumber() : null);

    populateReferrerDetailsFromData(admissionDetail);

    if (admissionDetail.getExtendedDetails()!=null && ExternalResourceType.ERT_HOMEADDRESS.equals(admissionDetail.getExtendedDetails().getAdmittedFromType()))
    {
        form.cmbAdmittedFrom().setValue(admissionDetail.getExtendedDetails().getAdmittedFromType());
        populateAdmittedDetailsWithPatientAddress(form.getGlobalContext().Core.getPatientShort().getAddress());
    }
    else
    {
        populateAdmittedFromDetailsFromData(admissionDetail);
    }
}
项目:openMAXIMS    文件:Logic.java   
private void updateControlsState()
{
    form.ccAdmittingConsultant().setEnabled(FormMode.EDIT.equals(form.getMode()) && form.getLocalContext().getCurrentAdmissionDetail() == null);
    form.cmbAdmissionWard().setEnabled(FormMode.EDIT.equals(form.getMode()) && form.getLocalContext().getCurrentAdmissionDetail() == null);

    form.txtAdmittedFromName().setEnabled(FormMode.EDIT.equals(form.getMode()));

    form.imbReferredFromSearch().setVisible(FormMode.EDIT.equals(form.getMode()) && (ExternalResourceType.ERT_HCP.equals(form.cmbReferredFrom().getValue()) || ExternalResourceType.ERT_HOSPITAL.equals(form.cmbReferredFrom().getValue()) || ExternalResourceType.ERT_LOCALPLACEMENTFORUM.equals(form.cmbReferredFrom().getValue())));
    form.imbReferredFromSearch().setEnabled(FormMode.EDIT.equals(form.getMode()));

    form.imbAdmittedFromSearch().setVisible(FormMode.EDIT.equals(form.getMode()) && (ExternalResourceType.ERT_NURSINGHOME.equals(form.cmbAdmittedFrom().getValue()) || ExternalResourceType.ERT_HOSPITAL.equals(form.cmbAdmittedFrom().getValue())));
    form.imbAdmittedFromSearch().setEnabled(FormMode.EDIT.equals(form.getMode()));

    // form.btnNew().setVisible(FormMode.VIEW.equals(form.getMode()) &&
    // (form.getLocalContext().getCurrentAdmissionDetail()==null ||
    // (form.getLocalContext().getCurrentAdmissionDetail()!=null &&
    // domain.isPatientDischarged(form.getLocalContext().getCurrentAdmissionDetail()))));
    form.btnNew().setVisible(FormMode.VIEW.equals(form.getMode()) && form.getLocalContext().getCurrentAdmissionDetail() == null && form.getLocalContext().getPatient().getWard() == null );
    form.btnEdit().setVisible(FormMode.VIEW.equals(form.getMode()) && form.getLocalContext().getCurrentAdmissionDetailIsNotNull() && !domain.isPatientDischarged(form.getLocalContext().getCurrentAdmissionDetail()));

    updateReferreDetailsState(false);
    updateAdmittedDetailsState(FormMode.EDIT.equals(form.getMode()) && form.cmbAdmittedFrom().getValue() != null && (ExternalResourceType.ERT_OTHER.equals(form.cmbAdmittedFrom().getValue())));

    if (form.imbReferredFromSearch().isVisible())
    {
        form.imbReferredFromSearch().setTooltip("Search for External Resource of type '"+form.cmbReferredFrom().getValue().getText()+"'");
    }

    if (form.imbAdmittedFromSearch().isVisible())
    {
        form.imbAdmittedFromSearch().setTooltip("Search for External Resource of type '"+form.cmbAdmittedFrom().getValue().getText()+"'");
    }
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onCmbReferredFromValueChanged() throws PresentationLogicException
{
    clearReferredFromAdr();
    //WDEV-16689
    if (form.getLocalContext().getCurrentAdmissionDetail() == null && ExternalResourceType.ERT_HOSPITAL.equals(form.cmbAdmittedFrom().getValue()) && form.getGlobalContext().Core.getExternalResourceSelectedIsNotNull() && form.getLocalContext().getSelectedExternalResourceForReferredFromIsNotNull() && form.getGlobalContext().Core.getExternalResourceSelected().getID_ExternalResource().equals(form.getLocalContext().getSelectedExternalResourceForReferredFrom().getID_ExternalResource())) //wdev-19991
    {   
    form.cmbAdmittedFrom().setValue(null);
    clearAdmittedFromAdr();
    }
    updateControlsState();
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onFormOpen(Object[] args) throws PresentationLogicException
{
    if (args != null)
    {
        if (args.length == 1 && args[0] != null && args[0] instanceof ExternalResourceType)
        {
            form.ccExternalResourceSearch().initialize((ExternalResourceType) args[0]);
            form.btnOK().setEnabled(false);
        }
    }
}
项目:openMAXIMS    文件:Logic.java   
public void initialize(ExternalResourceType externalResourceType)
{
    form.cmbResourceType().setValue(externalResourceType);
    form.cmbResourceType().setEnabled(!(externalResourceType != null));
    form.cmbHCPType().setEnabled(ExternalResourceType.ERT_HCP.equals(externalResourceType));
    search();
}
项目:openMAXIMS    文件:ExternalResourceSearchComponentImpl.java   
public ExternalResourceVoCollection getExternalResources(ExternalResourceType externalResourceType, String name, HcpDisType hcpType, PreActiveActiveInactiveStatus status)
{
    ArrayList<String> names = new ArrayList<String>();
    ArrayList<Object> values = new ArrayList<Object>();
    String prepend = " where ";
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer("from ExternalResource as er ");
    if (externalResourceType != null)
    {
        hql.append(prepend + " er.externalResourceType.id = :resourceType ");
        names.add("resourceType");
        values.add(externalResourceType.getID());
        prepend = " and ";
    }
    if (name != null)
    {
        hql.append(prepend + " upper(er.resourcename) like :name");
        names.add("name");
        values.add(name.toUpperCase() + "%");
        prepend = " and ";
    }

    if (hcpType != null)
    {
        hql.append(prepend + " er.hCPType.id = :idHcpType ");
        names.add("idHcpType");
        values.add(hcpType.getID());
        prepend = " and ";
    }
    if (status != null)
    {
        hql.append(prepend + " er.resourceStatus.id = :idStatus ");
        names.add("idStatus");
        values.add(status.getID());

    }
    hql.append(" order by er.systemInformation.creationDateTime asc");
    List<?> extresources = factory.find(hql.toString(), names, values);
    return ExternalResourceVoAssembler.createExternalResourceVoCollectionFromExternalResource(extresources);
}
项目:openMAXIMS    文件:Logic.java   
private void initialize()
{
    form.cmbResourceType().removeRow(ExternalResourceType.ERT_HOMEADDRESS);
    form.cmbResourceType().removeRow(ExternalResourceType.ERT_OTHER);

    form.cmbExternalResourceTypeDetails().removeRow(ExternalResourceType.ERT_HOMEADDRESS);
    form.cmbExternalResourceTypeDetails().removeRow(ExternalResourceType.ERT_OTHER);
}
项目:openMAXIMS    文件:Logic.java   
private void cmbExternalResourceTypeDetailsValueChanged()
{
    if( form.cmbExternalResourceTypeDetails().getValue() == null || !form.cmbExternalResourceTypeDetails().getValue().equals(ExternalResourceType.ERT_HCP))
    {
        form.cmbHcpTypeDetails().setValue(null);
    }

    updateControlsState();
}
项目:openMAXIMS    文件:Logic.java   
private void cmbResourceTypeValueChanged()
{
    if( form.cmbResourceType().getValue() == null || !form.cmbResourceType().getValue().equals(ExternalResourceType.ERT_HCP))
    {
        form.cmbHCPType().setValue(null);
    }

    updateControlsState();
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onCmbAdmittedFromValueChanged() throws ims.framework.exceptions.PresentationLogicException
{
    clearAdmittedFromAdr();
    updateControlsState();

    if (ExternalResourceType.ERT_HOMEADDRESS.equals(form.cmbAdmittedFrom().getValue()))
    {
        if (form.getGlobalContext().Core.getPatientShort() != null)
            populateAdmittedDetailsWithPatientAddress(form.getGlobalContext().Core.getPatientShort().getAddress());
    }

}
项目:openMAXIMS    文件:Logic.java   
private void removeItemsFromReferredAdmittedComboBoxes()
{
    // remove items from RefferedFrom comboBox (This comboBox should Contain
    // only HCP, Hospital, Local Placement Forum
    form.cmbReferredFrom().removeRow(ExternalResourceType.ERT_NURSINGHOME);
    form.cmbReferredFrom().removeRow(ExternalResourceType.ERT_HOMEADDRESS);
    form.cmbReferredFrom().removeRow(ExternalResourceType.ERT_OTHER);

    // remove items from RefferedFrom comboBox (This comboBox should Contain
    // only Home Address, Hospital, Nursing Home, Other
    form.cmbAdmittedFrom().removeRow(ExternalResourceType.ERT_HCP);
    form.cmbAdmittedFrom().removeRow(ExternalResourceType.ERT_LOCALPLACEMENTFORUM);
}
项目:openMAXIMS    文件:Logic.java   
private void populateScreenFromData(AdmissionDetailVo admissionDetail)
{
    clearInstanceControls();

    if (admissionDetail == null)
        return;

    form.dtimAdmissionDateTime().setValue(admissionDetail.getAdmissionDateTime());
    if (form.getLocalContext().getCurrentAdmissionDetailIsNotNull() && form.getLocalContext().getCurrentAdmissionDetail().getPasEventIsNotNull())
    {
        form.cmbAdmissionWard().setValue(domain.getAdmissionWard(form.getLocalContext().getCurrentAdmissionDetail().getPasEvent()));

        if (!domain.isPatientDischarged(form.getLocalContext().getCurrentAdmissionDetail()))
            form.cmbAdmissionType().setValue(domain.getAdmissionTypeFromInpatientEpisode(form.getLocalContext().getCurrentAdmissionDetail().getPasEvent()));
        else
            form.cmbAdmissionType().setValue(domain.getAdmissionTypeFromDischargedEpisode(form.getLocalContext().getCurrentAdmissionDetail().getPasEvent()));
    }

    form.ccAdmittingConsultant().setValue(admissionDetail.getConsultant());
    form.cmbSpecialty().setValue(admissionDetail.getSpecialty());

    form.intBedNumber().setValue(admissionDetail.getExtendedDetails() != null ? admissionDetail.getExtendedDetails().getBedNumber() : null);

    populateReferrerDetailsFromData(admissionDetail);

    if (admissionDetail.getExtendedDetails()!=null && ExternalResourceType.ERT_HOMEADDRESS.equals(admissionDetail.getExtendedDetails().getAdmittedFromType()))
    {
        form.cmbAdmittedFrom().setValue(admissionDetail.getExtendedDetails().getAdmittedFromType());
        populateAdmittedDetailsWithPatientAddress(form.getGlobalContext().Core.getPatientShort().getAddress());
    }
    else
    {
        populateAdmittedFromDetailsFromData(admissionDetail);
    }
}
项目:openMAXIMS    文件:Logic.java   
private void updateControlsState()
{
    form.ccAdmittingConsultant().setEnabled(FormMode.EDIT.equals(form.getMode()) && form.getLocalContext().getCurrentAdmissionDetail() == null);
    form.cmbAdmissionWard().setEnabled(FormMode.EDIT.equals(form.getMode()) && form.getLocalContext().getCurrentAdmissionDetail() == null);

    form.txtAdmittedFromName().setEnabled(FormMode.EDIT.equals(form.getMode()));

    form.imbReferredFromSearch().setVisible(FormMode.EDIT.equals(form.getMode()) && (ExternalResourceType.ERT_HCP.equals(form.cmbReferredFrom().getValue()) || ExternalResourceType.ERT_HOSPITAL.equals(form.cmbReferredFrom().getValue()) || ExternalResourceType.ERT_LOCALPLACEMENTFORUM.equals(form.cmbReferredFrom().getValue())));
    form.imbReferredFromSearch().setEnabled(FormMode.EDIT.equals(form.getMode()));

    form.imbAdmittedFromSearch().setVisible(FormMode.EDIT.equals(form.getMode()) && (ExternalResourceType.ERT_NURSINGHOME.equals(form.cmbAdmittedFrom().getValue()) || ExternalResourceType.ERT_HOSPITAL.equals(form.cmbAdmittedFrom().getValue())));
    form.imbAdmittedFromSearch().setEnabled(FormMode.EDIT.equals(form.getMode()));

    // form.btnNew().setVisible(FormMode.VIEW.equals(form.getMode()) &&
    // (form.getLocalContext().getCurrentAdmissionDetail()==null ||
    // (form.getLocalContext().getCurrentAdmissionDetail()!=null &&
    // domain.isPatientDischarged(form.getLocalContext().getCurrentAdmissionDetail()))));
    form.btnNew().setVisible(FormMode.VIEW.equals(form.getMode()) && form.getLocalContext().getCurrentAdmissionDetail() == null && form.getLocalContext().getPatient().getWard() == null );
    form.btnEdit().setVisible(FormMode.VIEW.equals(form.getMode()) && form.getLocalContext().getCurrentAdmissionDetailIsNotNull() && !domain.isPatientDischarged(form.getLocalContext().getCurrentAdmissionDetail()));

    updateReferreDetailsState(false);
    updateAdmittedDetailsState(FormMode.EDIT.equals(form.getMode()) && form.cmbAdmittedFrom().getValue() != null && (ExternalResourceType.ERT_OTHER.equals(form.cmbAdmittedFrom().getValue())));

    if (form.imbReferredFromSearch().isVisible())
    {
        form.imbReferredFromSearch().setTooltip("Search for External Resource of type '"+form.cmbReferredFrom().getValue().getText()+"'");
    }

    if (form.imbAdmittedFromSearch().isVisible())
    {
        form.imbAdmittedFromSearch().setTooltip("Search for External Resource of type '"+form.cmbAdmittedFrom().getValue().getText()+"'");
    }
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onCmbReferredFromValueChanged() throws PresentationLogicException
{
    clearReferredFromAdr();
    //WDEV-16689
    if (form.getLocalContext().getCurrentAdmissionDetail() == null && ExternalResourceType.ERT_HOSPITAL.equals(form.cmbAdmittedFrom().getValue()) && form.getGlobalContext().Core.getExternalResourceSelected().getID_ExternalResource().equals(form.getLocalContext().getSelectedExternalResourceForReferredFrom().getID_ExternalResource()))
    {   
    form.cmbAdmittedFrom().setValue(null);
    clearAdmittedFromAdr();
    }
    updateControlsState();
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onFormOpen(Object[] args) throws PresentationLogicException
{
    if (args != null)
    {
        if (args.length == 1 && args[0] != null && args[0] instanceof ExternalResourceType)
        {
            form.ccExternalResourceSearch().initialize((ExternalResourceType) args[0]);
            form.btnOK().setEnabled(false);
        }
    }
}
项目:openMAXIMS    文件:Logic.java   
public void initialize(ExternalResourceType externalResourceType)
{
    form.cmbResourceType().setValue(externalResourceType);
    form.cmbResourceType().setEnabled(!(externalResourceType != null));
    form.cmbHCPType().setEnabled(ExternalResourceType.ERT_HCP.equals(externalResourceType));
    search();
}
项目:openMAXIMS    文件:ExternalResourceSearchComponentImpl.java   
public ExternalResourceVoCollection getExternalResources(ExternalResourceType externalResourceType, String name, HcpDisType hcpType, PreActiveActiveInactiveStatus status)
{
    ArrayList<String> names = new ArrayList<String>();
    ArrayList<Object> values = new ArrayList<Object>();
    String prepend = " where ";
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer("from ExternalResource as er ");
    if (externalResourceType != null)
    {
        hql.append(prepend + " er.externalResourceType.id = :resourceType ");
        names.add("resourceType");
        values.add(externalResourceType.getID());
        prepend = " and ";
    }
    if (name != null)
    {
        hql.append(prepend + " upper(er.resourcename) like :name");
        names.add("name");
        values.add(name.toUpperCase() + "%");
        prepend = " and ";
    }

    if (hcpType != null)
    {
        hql.append(prepend + " er.hCPType.id = :idHcpType ");
        names.add("idHcpType");
        values.add(hcpType.getID());
        prepend = " and ";
    }
    if (status != null)
    {
        hql.append(prepend + " er.resourceStatus.id = :idStatus ");
        names.add("idStatus");
        values.add(status.getID());

    }
    hql.append(" order by er.systemInformation.creationDateTime asc");
    List<?> extresources = factory.find(hql.toString(), names, values);
    return ExternalResourceVoAssembler.createExternalResourceVoCollectionFromExternalResource(extresources);
}
项目:openMAXIMS    文件:Logic.java   
private void initialize()
{
    form.cmbResourceType().removeRow(ExternalResourceType.ERT_HOMEADDRESS);
    form.cmbResourceType().removeRow(ExternalResourceType.ERT_OTHER);

    form.cmbExternalResourceTypeDetails().removeRow(ExternalResourceType.ERT_HOMEADDRESS);
    form.cmbExternalResourceTypeDetails().removeRow(ExternalResourceType.ERT_OTHER);
}
项目:openMAXIMS    文件:Logic.java   
private void updateControlsState()
{
    form.btnEdit().setVisible(form.getMode().equals(FormMode.VIEW) && form.grdExternalResource().getSelectedRow() != null);
    form.cmbHcpTypeDetails().setRequired(true);
    if( form.cmbExternalResourceTypeDetails().getValue() != null && form.cmbExternalResourceTypeDetails().getValue().equals(ExternalResourceType.ERT_HCP))
    {
        if( form.getMode().equals(FormMode.EDIT))
        {
            form.cmbHcpTypeDetails().setEnabled(true);
            form.cmbHcpTypeDetails().setRequired(true);
        }

    }
    else
    {
        if( form.getMode().equals(FormMode.EDIT))
        {
            form.cmbHcpTypeDetails().setEnabled(false);
        }
    }

    if( form.cmbResourceType().getValue() != null && form.cmbResourceType().getValue().equals(ExternalResourceType.ERT_HCP))
    {
        if( form.getMode().equals(FormMode.VIEW))
        {
            form.cmbHCPType().setEnabled(true);

        }

    }
    else
    {
        if( form.getMode().equals(FormMode.VIEW))
        {
            form.cmbHCPType().setEnabled(false);
        }
    }

    updateContextMenus();
}
项目:openMAXIMS    文件:Logic.java   
private void cmbExternalResourceTypeDetailsValueChanged()
{
    if( form.cmbExternalResourceTypeDetails().getValue() == null || !form.cmbExternalResourceTypeDetails().getValue().equals(ExternalResourceType.ERT_HCP))
    {
        form.cmbHcpTypeDetails().setValue(null);
    }

    updateControlsState();
}
项目:openMAXIMS    文件:Logic.java   
private void cmbResourceTypeValueChanged()
{
    if( form.cmbResourceType().getValue() == null || !form.cmbResourceType().getValue().equals(ExternalResourceType.ERT_HCP))
    {
        form.cmbHCPType().setValue(null);
    }

    updateControlsState();
}
项目:openmaxims-linux    文件:Logic.java   
@Override
protected void onCmbAdmittedFromValueChanged() throws ims.framework.exceptions.PresentationLogicException
{
    clearAdmittedFromAdr();
    updateControlsState();

    if (ExternalResourceType.ERT_HOMEADDRESS.equals(form.cmbAdmittedFrom().getValue()))
    {
        if (form.getGlobalContext().Core.getPatientShort() != null)
            populateAdmittedDetailsWithPatientAddress(form.getGlobalContext().Core.getPatientShort().getAddress());
    }

}