Java 类ims.clinical.vo.DementiaFindVo 实例源码

项目:AvoinApotti    文件:Logic.java   
private boolean save() 
{
    // TODO Auto-generated method stub
    if(form.getLocalContext().getselectedDementiaIsNotNull() && form.getLocalContext().getselectedDementia().getStepOneFindIsNotNull())
    {
        DementiaFindVo dementiaToSave = populateDataFromScreen((DementiaFindVo) form.getLocalContext().getselectedDementia().getStepOneFind().clone());     

        String[] errors = dementiaToSave.validate(getUIErrors());
        if (errors != null && errors.length > 0)
        {
            engine.showErrors(errors);
            return false;
        }
        try
        {
            domain.saveDementia(dementiaToSave);
        }
        catch (StaleObjectException e)
        {
            engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());  
            engine.close(DialogResult.CANCEL);
            return false;
        }
    }
    return true;
}
项目:openMAXIMS    文件:Logic.java   
private boolean save() 
{
    // TODO Auto-generated method stub
    if(form.getLocalContext().getselectedDementiaIsNotNull() && form.getLocalContext().getselectedDementia().getStepOneFindIsNotNull())
    {
        DementiaFindVo dementiaToSave = populateDataFromScreen((DementiaFindVo) form.getLocalContext().getselectedDementia().getStepOneFind().clone());     

        String[] errors = dementiaToSave.validate(getUIErrors());
        if (errors != null && errors.length > 0)
        {
            engine.showErrors(errors);
            return false;
        }
        try
        {
            domain.saveDementia(dementiaToSave);
        }
        catch (StaleObjectException e)
        {
            engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());  
            engine.close(DialogResult.CANCEL);
            return false;
        }
    }
    return true;
}
项目:openMAXIMS    文件:Logic.java   
private boolean save() 
{
    // TODO Auto-generated method stub
    if(form.getLocalContext().getselectedDementiaIsNotNull() && form.getLocalContext().getselectedDementia().getStepOneFindIsNotNull())
    {
        DementiaFindVo dementiaToSave = populateDataFromScreen((DementiaFindVo) form.getLocalContext().getselectedDementia().getStepOneFind().clone());     

        String[] errors = dementiaToSave.validate(getUIErrors());
        if (errors != null && errors.length > 0)
        {
            engine.showErrors(errors);
            return false;
        }
        try
        {
            domain.saveDementia(dementiaToSave);
        }
        catch (StaleObjectException e)
        {
            engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());  
            engine.close(DialogResult.CANCEL);
            return false;
        }
    }
    return true;
}
项目:openmaxims-linux    文件:Logic.java   
private boolean save() 
{
    // TODO Auto-generated method stub
    if(form.getLocalContext().getselectedDementiaIsNotNull() && form.getLocalContext().getselectedDementia().getStepOneFindIsNotNull())
    {
        DementiaFindVo dementiaToSave = populateDataFromScreen((DementiaFindVo) form.getLocalContext().getselectedDementia().getStepOneFind().clone());     

        String[] errors = dementiaToSave.validate(getUIErrors());
        if (errors != null && errors.length > 0)
        {
            engine.showErrors(errors);
            return false;
        }
        try
        {
            domain.saveDementia(dementiaToSave);
        }
        catch (StaleObjectException e)
        {
            engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());  
            engine.close(DialogResult.CANCEL);
            return false;
        }
    }
    return true;
}
项目:AvoinApotti    文件:Logic.java   
private void populateScreenFromData(DementiaFindVo stepOneFindVo)
{
    hideShowQuery2(false);
    hideShowQuery3(false);

    if (stepOneFindVo == null)
        return;

    populateAuthoringControls(stepOneFindVo.getAuthoringInformation());
    boolean answeQuestion1 = YesNo.YES.equals(stepOneFindVo.getHasFormalDiagnosisOfDementia());
    form.GroupQuestion1().setValue(answeQuestion1 ? GroupQuestion1Enumeration.rdoQuestion1Yes : GroupQuestion1Enumeration.rdoQuestion1No);

    if (!answeQuestion1)
    {
        hideShowQuery2(true);
        form.GroupQuestion2a().setValue(YesNo.YES.equals(stepOneFindVo.getCAMSAcuteOnset()) ? GroupQuestion2aEnumeration.rdoQuestion2aYes : GroupQuestion2aEnumeration.rdoQuestion2aNo);
        form.GroupQuestion2b().setValue(YesNo.YES.equals(stepOneFindVo.getCAMSInattention()) ? GroupQuestion2bEnumeration.rdoQuestion2bYes : GroupQuestion2bEnumeration.rdoQuestion2bNo);
        form.GroupQuestion2c().setValue(YesNo.YES.equals(stepOneFindVo.getCAMSDisorganisedThinking()) ? GroupQuestion2cEnumeration.rdoQuestion2cYes : GroupQuestion2cEnumeration.rdoQuestion2cNo);
        form.GroupQuestion2d().setValue(YesNo.YES.equals(stepOneFindVo.getCAMSAlteredLevel()) ? GroupQuestion2dEnumeration.rdoQuestion2dYes : GroupQuestion2dEnumeration.rdoQuestion2dNo);

        boolean answeQuestionDC = YesNo.YES.equals(stepOneFindVo.getDeliriumConfirmed());
        form.GroupQuestion2DC().setValue(answeQuestionDC ? GroupQuestion2DCEnumeration.rdoQuestion2DCYes : GroupQuestion2DCEnumeration.rdoQuestion2DCNo);

        if (!answeQuestionDC)
        {
            hideShowQuery3(true);
            form.GroupQuestion3().setValue(YesNo.YES.equals(stepOneFindVo.getAwarenessQuestion()) ? GroupQuestion3Enumeration.rdoQuestion3Yes : GroupQuestion3Enumeration.rdoQuestion3No);
        }
    }

}
项目:AvoinApotti    文件:DementiaCorrectCompletionDateStep1DialogImpl.java   
public void saveDementia(DementiaFindVo stepOneFindToSave)  throws StaleObjectException 
{
    if (stepOneFindToSave == null )
    {
        throw new CodingRuntimeException("Cannot get DementiaFindVo on null Id ");
    }

    DomainFactory factory = getDomainFactory();

    DementiaFind domainDementia = DementiaFindVoAssembler.extractDementiaFind(factory, stepOneFindToSave);
    factory.save(domainDementia);   
}
项目:openMAXIMS    文件:DementiaCorrectCompletionDateStep1DialogImpl.java   
public void saveDementia(DementiaFindVo stepOneFindToSave)  throws StaleObjectException 
{
    if (stepOneFindToSave == null )
    {
        throw new CodingRuntimeException("Cannot get DementiaFindVo on null Id ");
    }

    DomainFactory factory = getDomainFactory();

    DementiaFind domainDementia = DementiaFindVoAssembler.extractDementiaFind(factory, stepOneFindToSave);
    factory.save(domainDementia);   
}
项目:openMAXIMS    文件:Logic.java   
private void populateScreenFromData(DementiaFindVo stepOneFindVo)
{
    hideShowQuery2(false);
    hideShowQuery3(false);

    if (stepOneFindVo == null)
        return;

    populateAuthoringControls(stepOneFindVo.getAuthoringInformation());
    boolean answeQuestion1 = YesNo.YES.equals(stepOneFindVo.getHasFormalDiagnosisOfDementia());
    form.GroupQuestion1().setValue(answeQuestion1 ? GroupQuestion1Enumeration.rdoQuestion1Yes : GroupQuestion1Enumeration.rdoQuestion1No);

    if (!answeQuestion1)
    {
        hideShowQuery2(true);
        form.GroupQuestion2a().setValue(YesNo.YES.equals(stepOneFindVo.getCAMSAcuteOnset()) ? GroupQuestion2aEnumeration.rdoQuestion2aYes : GroupQuestion2aEnumeration.rdoQuestion2aNo);
        form.GroupQuestion2b().setValue(YesNo.YES.equals(stepOneFindVo.getCAMSInattention()) ? GroupQuestion2bEnumeration.rdoQuestion2bYes : GroupQuestion2bEnumeration.rdoQuestion2bNo);
        form.GroupQuestion2c().setValue(YesNo.YES.equals(stepOneFindVo.getCAMSDisorganisedThinking()) ? GroupQuestion2cEnumeration.rdoQuestion2cYes : GroupQuestion2cEnumeration.rdoQuestion2cNo);
        form.GroupQuestion2d().setValue(YesNo.YES.equals(stepOneFindVo.getCAMSAlteredLevel()) ? GroupQuestion2dEnumeration.rdoQuestion2dYes : GroupQuestion2dEnumeration.rdoQuestion2dNo);

        boolean answeQuestionDC = YesNo.YES.equals(stepOneFindVo.getDeliriumConfirmed());
        form.GroupQuestion2DC().setValue(answeQuestionDC ? GroupQuestion2DCEnumeration.rdoQuestion2DCYes : GroupQuestion2DCEnumeration.rdoQuestion2DCNo);

        if (!answeQuestionDC)
        {
            hideShowQuery3(true);
            form.GroupQuestion3().setValue(YesNo.YES.equals(stepOneFindVo.getAwarenessQuestion()) ? GroupQuestion3Enumeration.rdoQuestion3Yes : GroupQuestion3Enumeration.rdoQuestion3No);
        }
    }

}
项目:openMAXIMS    文件:DementiaCorrectCompletionDateStep1DialogImpl.java   
public void saveDementia(DementiaFindVo stepOneFindToSave)  throws StaleObjectException 
{
    if (stepOneFindToSave == null )
    {
        throw new CodingRuntimeException("Cannot get DementiaFindVo on null Id ");
    }

    DomainFactory factory = getDomainFactory();

    DementiaFind domainDementia = DementiaFindVoAssembler.extractDementiaFind(factory, stepOneFindToSave);
    factory.save(domainDementia);   
}
项目:openmaxims-linux    文件:Logic.java   
private void populateScreenFromData(DementiaFindVo stepOneFindVo)
{
    hideShowQuery2(false);
    hideShowQuery3(false);

    if (stepOneFindVo == null)
        return;

    populateAuthoringControls(stepOneFindVo.getAuthoringInformation());
    boolean answeQuestion1 = YesNo.YES.equals(stepOneFindVo.getHasFormalDiagnosisOfDementia());
    form.GroupQuestion1().setValue(answeQuestion1 ? GroupQuestion1Enumeration.rdoQuestion1Yes : GroupQuestion1Enumeration.rdoQuestion1No);

    if (!answeQuestion1)
    {
        hideShowQuery2(true);
        form.GroupQuestion2a().setValue(YesNo.YES.equals(stepOneFindVo.getCAMSAcuteOnset()) ? GroupQuestion2aEnumeration.rdoQuestion2aYes : GroupQuestion2aEnumeration.rdoQuestion2aNo);
        form.GroupQuestion2b().setValue(YesNo.YES.equals(stepOneFindVo.getCAMSInattention()) ? GroupQuestion2bEnumeration.rdoQuestion2bYes : GroupQuestion2bEnumeration.rdoQuestion2bNo);
        form.GroupQuestion2c().setValue(YesNo.YES.equals(stepOneFindVo.getCAMSDisorganisedThinking()) ? GroupQuestion2cEnumeration.rdoQuestion2cYes : GroupQuestion2cEnumeration.rdoQuestion2cNo);
        form.GroupQuestion2d().setValue(YesNo.YES.equals(stepOneFindVo.getCAMSAlteredLevel()) ? GroupQuestion2dEnumeration.rdoQuestion2dYes : GroupQuestion2dEnumeration.rdoQuestion2dNo);

        boolean answeQuestionDC = YesNo.YES.equals(stepOneFindVo.getDeliriumConfirmed());
        form.GroupQuestion2DC().setValue(answeQuestionDC ? GroupQuestion2DCEnumeration.rdoQuestion2DCYes : GroupQuestion2DCEnumeration.rdoQuestion2DCNo);

        if (!answeQuestionDC)
        {
            hideShowQuery3(true);
            form.GroupQuestion3().setValue(YesNo.YES.equals(stepOneFindVo.getAwarenessQuestion()) ? GroupQuestion3Enumeration.rdoQuestion3Yes : GroupQuestion3Enumeration.rdoQuestion3No);
        }
    }

}
项目:openmaxims-linux    文件:DementiaCorrectCompletionDateStep1DialogImpl.java   
public void saveDementia(DementiaFindVo stepOneFindToSave)  throws StaleObjectException 
{
    if (stepOneFindToSave == null )
    {
        throw new CodingRuntimeException("Cannot get DementiaFindVo on null Id ");
    }

    DomainFactory factory = getDomainFactory();

    DementiaFind domainDementia = DementiaFindVoAssembler.extractDementiaFind(factory, stepOneFindToSave);
    factory.save(domainDementia);   
}
项目:AvoinApotti    文件:Logic.java   
private DementiaVo populateDataFromScreen(DementiaVo dementiaVo)
{
    DementiaFindVo dementiaFindVo = populateDataFromStep1Tab(dementiaVo.getStepOneFind());
    dementiaVo.setStepOneFind(dementiaFindVo);
    DementiaWorklistStatusVo tempCurrentStatus = null;
    // temporary used to set status to a specific type
    /*
     * tempCurrentStatus = populateStatus(DementiaWorklistStatus.STEP_ONE_FIND_OUTSTANDING,form.getLocalContext().getAuthoringInfo());
     * 
     * dementiaVo.setCurrentWorklistStatus(tempCurrentStatus);
     * 
     * DementiaWorklistStatusVoCollection tempStatusHistory = dementiaVo.getHistoricalWorklistStatus(); tempStatusHistory.add(tempCurrentStatus); dementiaVo.setHistoricalWorklistStatus(tempStatusHistory);
     */
    dementiaVo.setDementiaConfirmed(form.GroupQuestion1().getValue().equals(GroupQuestion1Enumeration.rdoQuestion1Yes));
    dementiaVo.setDeliriumConfirmed(form.GroupQuestion2DC().getValue().equals(GroupQuestion2DCEnumeration.rdoQuestion2DCYes) || (form.GroupQuestion2DC().getValue().equals(GroupQuestion2DCEnumeration.rdoQuestion2DCYes) && form.GroupQuestion3().getValue().equals(GroupQuestion3Enumeration.rdoQuestion3Yes)));

    if (dementiaFindVo != null)
    {
        AuthoringInformationVo voAuthor = new AuthoringInformationVo();
        voAuthor.setAuthoringDateTime(new DateTime());
        if (domain.getHcpLiteUser() != null)
            voAuthor.setAuthoringHcp((HcpLiteVo) domain.getHcpLiteUser());

        if (form.GroupQuestion1().getValue().equals(GroupQuestion1Enumeration.rdoQuestion1Yes) || (form.GroupQuestion1().getValue().equals(GroupQuestion1Enumeration.rdoQuestion1No) && form.GroupQuestion2DC().getValue().equals(GroupQuestion2DCEnumeration.rdoQuestion2DCNo) && form.GroupQuestion3().getValue().equals(GroupQuestion3Enumeration.rdoQuestion3No)))
        {
            if (dementiaVo.getCurrentWorklistStatusIsNotNull() && !DementiaWorklistStatus.COMPLETED.equals(dementiaVo.getCurrentWorklistStatus().getStatus()))
            {
                tempCurrentStatus = populateStatus(DementiaWorklistStatus.COMPLETED, voAuthor);
            }
        }
        else if (form.GroupQuestion2DC().getValue().equals(GroupQuestion2DCEnumeration.rdoQuestion2DCYes) || (form.GroupQuestion2DC().getValue().equals(GroupQuestion2DCEnumeration.rdoQuestion2DCNo) && form.GroupQuestion3().getValue().equals(GroupQuestion3Enumeration.rdoQuestion3Yes)))
        {
            if (dementiaVo.getCurrentWorklistStatusIsNotNull() && !DementiaWorklistStatus.STEP_TWO_ASSESS_INVESTIGATE_OUTSTANDING.equals(dementiaVo.getCurrentWorklistStatus().getStatus()) && dementiaVo.getStepTwoAssess()==null)
            {
                tempCurrentStatus = populateStatus(DementiaWorklistStatus.STEP_TWO_ASSESS_INVESTIGATE_OUTSTANDING, voAuthor);
            }
        }

        if (tempCurrentStatus != null)
        {
            dementiaVo.setCurrentWorklistStatus(tempCurrentStatus);

            DementiaWorklistStatusVoCollection tempStatusHistory = dementiaVo.getHistoricalWorklistStatus();
            tempStatusHistory.add(tempCurrentStatus);
            dementiaVo.setHistoricalWorklistStatus(tempStatusHistory);
        }

    }
    return dementiaVo;
}
项目:AvoinApotti    文件:Logic.java   
private void updateControlState()
{
    boolean bShowQ3Controls = false;
    if (form.getMode().equals(FormMode.EDIT))
    {
        if (!form.GroupQuestion2a().getValue().equals(GroupQuestion2aEnumeration.None) && !form.GroupQuestion2b().getValue().equals(GroupQuestion2bEnumeration.None) && !form.GroupQuestion2c().getValue().equals(GroupQuestion2cEnumeration.None) && !form.GroupQuestion2d().getValue().equals(GroupQuestion2dEnumeration.None))
            bShowQ3Controls = true;

        if (bShowQ3Controls && form.GroupQuestion2a().getValue().equals(GroupQuestion2aEnumeration.rdoQuestion2aYes) && form.GroupQuestion2b().getValue().equals(GroupQuestion2bEnumeration.rdoQuestion2bYes) && (form.GroupQuestion2c().getValue().equals(GroupQuestion2cEnumeration.rdoQuestion2cYes) || form.GroupQuestion2d().getValue().equals(GroupQuestion2dEnumeration.rdoQuestion2dYes)))
        {
            form.GroupQuestion2DC().setValue(GroupQuestion2DCEnumeration.rdoQuestion2DCYes);
        }
        else if (bShowQ3Controls)
        {
            form.GroupQuestion2DC().setValue(GroupQuestion2DCEnumeration.rdoQuestion2DCNo);
        }

        form.btnSave().setVisible(true);
        form.btnSave().setEnabled(form.GroupQuestion1().getValue().equals(GroupQuestion1Enumeration.rdoQuestion1Yes) || form.GroupQuestion2DC().getValue().equals(GroupQuestion2DCEnumeration.rdoQuestion2DCYes) || form.GroupQuestion3().getValue().equals(GroupQuestion3Enumeration.rdoQuestion3Yes) || form.GroupQuestion3().getValue().equals(GroupQuestion3Enumeration.rdoQuestion3No));

        hideShowQuery2(form.GroupQuestion1().getValue().equals(GroupQuestion1Enumeration.rdoQuestion1No));
        hideShowQuery3(form.GroupQuestion1().getValue().equals(GroupQuestion1Enumeration.rdoQuestion1No) && bShowQ3Controls && form.GroupQuestion2DC().getValue().equals(GroupQuestion2DCEnumeration.rdoQuestion2DCNo));
    }
    form.imbHelpIcon().setEnabled(false);

    Object hcp = domain.getHcpLiteUser();
    HcpLiteVo hcpLiteUser=null;
    if (hcp != null)
        hcpLiteUser=((HcpLiteVo) hcp);
    DementiaFindVo voStep1Find = (form.getLocalContext().getselectedDementiaIsNotNull()?form.getLocalContext().getselectedDementia().getStepOneFind():null);

    form.btnEdit().setVisible(hcpLiteUser!=null && form.getMode().equals(FormMode.VIEW)
            && form.getLocalContext().getselectedDementia() != null && voStep1Find !=null
            && ((voStep1Find.getAuthoringInformationIsNotNull() && voStep1Find.getAuthoringInformation().getAuthoringHcpIsNotNull() && voStep1Find.getAuthoringInformation().getAuthoringHcp().equals(hcpLiteUser)) || engine.hasRight(AppRight.CAN_EDIT_AND_RIE_DEMENTIA)));
    form.GroupQuestion1().setEnabled(form.getMode().equals(FormMode.EDIT));
    form.GroupQuestion2a().setEnabled(form.getMode().equals(FormMode.EDIT));
    form.GroupQuestion2b().setEnabled(form.getMode().equals(FormMode.EDIT));
    form.GroupQuestion2c().setEnabled(form.getMode().equals(FormMode.EDIT));
    form.GroupQuestion2d().setEnabled(form.getMode().equals(FormMode.EDIT));
    form.GroupQuestion2DC().setEnabled(false);
    form.GroupQuestion3().setEnabled(form.getMode().equals(FormMode.EDIT));

    form.btnRIE().setVisible(form.getMode().equals(FormMode.VIEW) 
            && form.getLocalContext().getselectedDementia() != null 
            && form.getLocalContext().getselectedDementia().getStepOneFind() !=null
            && engine.hasRight(AppRight.CAN_EDIT_AND_RIE_DEMENTIA)  );
    form.btnClose().setVisible(form.getMode().equals(FormMode.VIEW) && form.getLocalContext().getisParentFormDialog());
}
项目:AvoinApotti    文件:Logic.java   
protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException
{
    if (args != null)
    {
        if (args.length == 2 && args[0] != null && args[1] != null && args[0] instanceof DementiaForWorklistVo)
        {
            form.getLocalContext().setselectedDementia(domain.getDementia((DementiaForWorklistVo) args[0]));
            if (DementiaWorklistOpenFormModeEnum.STEP1EDIT.equals(args[1]))
            {
                form.lyrSteps().showtabPageStep1();
                form.lyrSteps().tabPageStep1().ccStep1Find().initialize(form.getLocalContext().getselectedDementia(), FormMode.EDIT, engine.isDialog());
                form.lyrSteps().tabPageStep2().setHeaderVisible(form.getLocalContext().getselectedDementia().getStepTwoAssessIsNotNull());
                form.lyrSteps().tabPageFollowUp().setHeaderVisible(form.getLocalContext().getselectedDementia().getFollowUpAssessmentsIsNotNull() && form.getLocalContext().getselectedDementia().getFollowUpAssessments().size() > 0);
            }
            else if (DementiaWorklistOpenFormModeEnum.VIEW.equals(args[1]))
            {
                open();
                return;
            }
            else if (DementiaWorklistOpenFormModeEnum.STEP2_AMTS_EDIT.equals(args[1]))
            {
                form.lyrSteps().showtabPageStep2();
                form.lyrSteps().tabPageStep2().ccAMTS().initialize(form.getLocalContext().getselectedDementia(), FormMode.EDIT, null);
                form.lyrSteps().tabPageStep2().setHeaderVisible(true);
                form.lyrSteps().tabPageFollowUp().setHeaderVisible(form.getLocalContext().getselectedDementia().getFollowUpAssessmentsIsNotNull() && form.getLocalContext().getselectedDementia().getFollowUpAssessments().size() > 0);
            }
            else if (DementiaWorklistOpenFormModeEnum.FOLLOWUP_AMTS_EDIT.equals(args[1]))
            {
                form.lyrSteps().showtabPageFollowUp();

                form.lyrSteps().tabPageStep1().ccStep1Find().initialize(form.getLocalContext().getselectedDementia(), FormMode.VIEW,engine.isDialog());
                form.lyrSteps().tabPageStep2().ccAMTS().initialize(form.getLocalContext().getselectedDementia(), FormMode.VIEW, null);

                initialiseFollowUp(true);
                return;
            }
            else if (DementiaWorklistOpenFormModeEnum.EDIT.equals(args[1])) //WDEV-16247
            {
                Object hcp = domain.getHcpLiteUser();
                HcpLiteVo hcpLiteUser=null;
                if (hcp != null)
                    hcpLiteUser=((HcpLiteVo) domain.getHcpLiteUser());

                DementiaFindVo voStep1Find = (form.getLocalContext().getselectedDementiaIsNotNull()?form.getLocalContext().getselectedDementia().getStepOneFind():null);
                DementiaAssessAndInvestigateVo voStep2AMTS = (form.getLocalContext().getselectedDementiaIsNotNull()?form.getLocalContext().getselectedDementia().getStepTwoAssess():null);
                if (form.getLocalContext().getselectedDementiaIsNotNull() && voStep1Find!=null && voStep2AMTS==null 
                    && ((voStep1Find.getAuthoringInformationIsNotNull() && voStep1Find.getAuthoringInformationIsNotNull() && voStep1Find.getAuthoringInformation().getAuthoringHcpIsNotNull() && voStep1Find.getAuthoringInformation().getAuthoringHcp().equals(hcpLiteUser)) 
                        || engine.hasRight(AppRight.CAN_EDIT_AND_RIE_DEMENTIA)))
                {
                    form.lyrSteps().showtabPageStep1();
                    form.lyrSteps().tabPageStep1().ccStep1Find().initialize(form.getLocalContext().getselectedDementia(), FormMode.EDIT, engine.isDialog());
                    form.lyrSteps().tabPageStep2().setHeaderVisible(form.getLocalContext().getselectedDementia().getStepTwoAssessIsNotNull());
                    form.lyrSteps().tabPageFollowUp().setHeaderVisible(form.getLocalContext().getselectedDementia().getFollowUpAssessmentsIsNotNull() && form.getLocalContext().getselectedDementia().getFollowUpAssessments().size() > 0);
                }
                else if (form.getLocalContext().getselectedDementiaIsNotNull() && voStep1Find!=null && voStep2AMTS!=null )
                {
                    if ((voStep2AMTS.getAuthoringInformationIsNotNull() && voStep2AMTS.getAuthoringInformationIsNotNull() && voStep2AMTS.getAuthoringInformation().getAuthoringHcpIsNotNull() && voStep2AMTS.getAuthoringInformation().getAuthoringHcp().equals(hcpLiteUser)) 
                                || engine.hasRight(AppRight.CAN_EDIT_AND_RIE_DEMENTIA))
                    {
                        form.lyrSteps().showtabPageStep2();
                        form.lyrSteps().tabPageStep2().ccAMTS().initialize(form.getLocalContext().getselectedDementia(), FormMode.EDIT, null);
                        form.lyrSteps().tabPageStep2().setHeaderVisible(true);
                        form.lyrSteps().tabPageFollowUp().setHeaderVisible(form.getLocalContext().getselectedDementia().getFollowUpAssessmentsIsNotNull() && form.getLocalContext().getselectedDementia().getFollowUpAssessments().size() > 0);
                    }
                    else if ((voStep2AMTS.getAuthoringInformationIsNotNull() && voStep2AMTS.getAuthoringInformationIsNotNull() && voStep2AMTS.getAuthoringInformation().getAuthoringHcpIsNotNull() && !voStep2AMTS.getAuthoringInformation().getAuthoringHcp().equals(hcpLiteUser))
                            && (voStep1Find.getAuthoringInformationIsNotNull() && voStep1Find.getAuthoringInformationIsNotNull() && voStep1Find.getAuthoringInformation().getAuthoringHcpIsNotNull() && voStep1Find.getAuthoringInformation().getAuthoringHcp().equals(hcpLiteUser)) )
                    {
                        form.lyrSteps().showtabPageStep1();
                        form.lyrSteps().tabPageStep1().ccStep1Find().initialize(form.getLocalContext().getselectedDementia(), FormMode.EDIT, engine.isDialog());
                        form.lyrSteps().tabPageStep2().setHeaderVisible(form.getLocalContext().getselectedDementia().getStepTwoAssessIsNotNull());
                        form.lyrSteps().tabPageFollowUp().setHeaderVisible(form.getLocalContext().getselectedDementia().getFollowUpAssessmentsIsNotNull() && form.getLocalContext().getselectedDementia().getFollowUpAssessments().size() > 0);
                    }


                }

            }
            initialiseFollowUp(false);
        }
    }
}
项目:AvoinApotti    文件:Logic.java   
private void updateControlsState()
{
    boolean enableControls = !form.getTimers().gettimerRefresh().isEnabled();

    DementialManualClassAssemblyVo selectedRowValue = (DementialManualClassAssemblyVo) form.dyngrdPatients().getValue();

    //WDEV-16247
    Object hcp = domain.getHcpLiteUser();
    HcpLiteVo hcpLiteUser=null;
    if (hcp != null)
        hcpLiteUser=((HcpLiteVo) domain.getHcpLiteUser());

    DementiaVo voDementia = (selectedRowValue!=null ? domain.getDementia(new DementiaRefVo(((DementialManualClassAssemblyVo) selectedRowValue).getDementiaId(),0)) : null);

    DementiaFindVo voStep1Find = (voDementia!=null?voDementia.getStepOneFind():null);
    DementiaAssessAndInvestigateVo voStep2AMTS = (voDementia!=null?voDementia.getStepTwoAssess():null);

    Integer hours = (voDementia!=null && voDementia.getAdmissionDateTime()!=null?calculateDateDiffInMinutes(voDementia.getAdmissionDateTime(),new DateTime())/60:null);

    form.cmbHospital().setEnabled(enableControls);
    form.qmbWard().setEnabled(form.cmbHospital().getValue() != null && enableControls);

    form.dteFrom().setEnabled(enableControls);
    form.dteTo().setEnabled(enableControls);

    form.ccConsultant().setEnabled(enableControls);
    form.cmbSpecialty().setEnabled(enableControls);
    form.cmbStatus().setEnabled(enableControls);

    form.txtSurname().setEnabled(enableControls);
    form.txtForename().setEnabled(enableControls);
    form.cmbIDType().setEnabled(enableControls);
    form.txtIDValue().setEnabled(enableControls);
    form.pdtDOB().setEnabled(enableControls);
    form.chkExclude().setEnabled(enableControls);
    form.chkDelirum().setEnabled(enableControls);
    form.chkDementiaConfirmed().setEnabled(enableControls);
    form.chkInpatientOnly().setEnabled(enableControls);

    form.imbSearch().setEnabled(enableControls);
    form.imbClear().setEnabled(enableControls);

    form.getContextMenus().Clinical.hideAllDementiaWorklistMenuMenuItems();
    form.getContextMenus().Clinical.getDementiaWorklistMenuVIEWItem().setVisible(selectedRowValue != null && voDementia.getStepOneFindIsNotNull());
    //EDIT Context Menu 
    form.getContextMenus().Clinical.getDementiaWorklistMenuEDITItem().setVisible(hcpLiteUser!=null && selectedRowValue != null && (voStep1Find!=null || voStep2AMTS!=null)
                                &&((voStep1Find!=null  && voStep1Find.getAuthoringInformationIsNotNull() &&voStep1Find.getAuthoringInformation().getAuthoringHcpIsNotNull() &&  voStep1Find.getAuthoringInformation().getAuthoringHcp().equals(hcpLiteUser))
                                    || (voStep2AMTS!=null && voStep2AMTS.getAuthoringInformationIsNotNull() && voStep2AMTS.getAuthoringInformation().getAuthoringHcpIsNotNull() && voStep2AMTS.getAuthoringInformation().getAuthoringHcp().equals(hcpLiteUser))
                                    || engine.hasRight(AppRight.CAN_EDIT_AND_RIE_DEMENTIA)));   
    form.getContextMenus().Clinical.getDementiaWorklistMenuSTEP1Item().setVisible(hcpLiteUser!=null 
            && selectedRowValue != null 
            && DementiaWorklistStatus.STEP_ONE_FIND_OUTSTANDING.equals(voDementia.getCurrentWorklistStatus().getStatus()));
    form.getContextMenus().Clinical.getDementiaWorklistMenuSTEP2Item().setVisible(hcpLiteUser!=null 
            && selectedRowValue != null 
            && (voDementia.getCurrentWorklistStatusIsNotNull() 
            && DementiaWorklistStatus.STEP_TWO_ASSESS_INVESTIGATE_OUTSTANDING.equals(voDementia.getCurrentWorklistStatus().getStatus())));
    form.getContextMenus().Clinical.getDementiaWorklistMenuRECORD_FOLLOWUP_AMTSItem().setVisible(hcpLiteUser!=null 
            && selectedRowValue != null && voDementia.getStepTwoAssessIsNotNull());
    form.getContextMenus().Clinical.getDementiaWorklistMenuEXCLUDE_FROM_DEMENTIA_SCREENINGItem().setVisible(selectedRowValue != null 
            && selectedRowValue.getIsExcludedFromWorklist()==null 
            && (hours!=null && hours>form.getGlobalContext().Admin.getDementiaConfiguration().getRemoveTimePeriod())
            && ! DementiaWorklistStatus.COMPLETED.equals(voDementia.getCurrentWorklistStatus().getStatus())
            && ! DementiaWorklistStatus.FOR_REFERRAL.equals(voDementia.getCurrentWorklistStatus().getStatus()) );
    form.getContextMenus().Clinical.getDementiaWorklistMenuCONFIRM_PATIENTItem().setVisible(selectedRowValue != null 
            && (voDementia.getCurrentWorklistStatusIsNotNull() 
                    && DementiaWorklistStatus.COMPLETED.equals(voDementia.getCurrentWorklistStatus().getStatus())) 
                    && (Boolean.TRUE.equals(selectedRowValue.getDementiaConfirmed())) 
                    && voDementia.getConfirmedPatientPutOnDementiaPathway()==null);
    form.getContextMenus().Clinical.getDementiaWorklistMenuRIE_REMOVE_FROM_WORKLISTItem().setVisible(selectedRowValue != null 
            && engine.hasRight(AppRight.CAN_EDIT_AND_RIE_DEMENTIA) );   
    form.getContextMenus().Clinical.getDementiaWorklistMenuCORRECT_CCOMPLETION_DATE_STEP1Item().setVisible(selectedRowValue != null 
            && voDementia.getStepOneFindIsNotNull());
    form.getContextMenus().Clinical.getDementiaWorklistMenuCORRECT_CCOMPLETION_DATE_STEP2Item().setVisible(selectedRowValue != null 
            && voDementia.getStepOneFindIsNotNull() && voDementia.getStepTwoAssessIsNotNull());


}
项目:AvoinApotti    文件:Logic.java   
private DementiaFindVo populateDataFromScreen(DementiaFindVo dementiaFindVo)
{
    dementiaFindVo.getAuthoringInformation().setAuthoringDateTime(form.dtimCorrected().getValue());

    return dementiaFindVo;
}
项目:openMAXIMS    文件:Logic.java   
private DementiaVo populateDataFromScreen(DementiaVo dementiaVo)
{
    DementiaFindVo dementiaFindVo = populateDataFromStep1Tab(dementiaVo.getStepOneFind());
    dementiaVo.setStepOneFind(dementiaFindVo);
    DementiaWorklistStatusVo tempCurrentStatus = null;
    // temporary used to set status to a specific type
    /*
     * tempCurrentStatus = populateStatus(DementiaWorklistStatus.STEP_ONE_FIND_OUTSTANDING,form.getLocalContext().getAuthoringInfo());
     * 
     * dementiaVo.setCurrentWorklistStatus(tempCurrentStatus);
     * 
     * DementiaWorklistStatusVoCollection tempStatusHistory = dementiaVo.getHistoricalWorklistStatus(); tempStatusHistory.add(tempCurrentStatus); dementiaVo.setHistoricalWorklistStatus(tempStatusHistory);
     */
    dementiaVo.setDementiaConfirmed(form.GroupQuestion1().getValue().equals(GroupQuestion1Enumeration.rdoQuestion1Yes));
    dementiaVo.setDeliriumConfirmed(form.GroupQuestion2DC().getValue().equals(GroupQuestion2DCEnumeration.rdoQuestion2DCYes) || (form.GroupQuestion2DC().getValue().equals(GroupQuestion2DCEnumeration.rdoQuestion2DCYes) && form.GroupQuestion3().getValue().equals(GroupQuestion3Enumeration.rdoQuestion3Yes)));

    if (dementiaFindVo != null)
    {
        AuthoringInformationVo voAuthor = new AuthoringInformationVo();
        voAuthor.setAuthoringDateTime(new DateTime());
        if (domain.getHcpLiteUser() != null)
            voAuthor.setAuthoringHcp((HcpLiteVo) domain.getHcpLiteUser());

        if (form.GroupQuestion1().getValue().equals(GroupQuestion1Enumeration.rdoQuestion1Yes) || (form.GroupQuestion1().getValue().equals(GroupQuestion1Enumeration.rdoQuestion1No) && form.GroupQuestion2DC().getValue().equals(GroupQuestion2DCEnumeration.rdoQuestion2DCNo) && form.GroupQuestion3().getValue().equals(GroupQuestion3Enumeration.rdoQuestion3No)))
        {
            if (dementiaVo.getCurrentWorklistStatusIsNotNull() && !DementiaWorklistStatus.COMPLETED.equals(dementiaVo.getCurrentWorklistStatus().getStatus()))
            {
                tempCurrentStatus = populateStatus(DementiaWorklistStatus.COMPLETED, voAuthor);
                //wdev-18784
                if( dementiaVo.getPatientIsNotNull())
                {
                    dementiaVo.getPatient().setDementiaWorklistStatus(null);
                    dementiaVo.getPatient().setDementiaBreachDateTime(null);

                }
            }
        }
        else if (form.GroupQuestion2DC().getValue().equals(GroupQuestion2DCEnumeration.rdoQuestion2DCYes) || (form.GroupQuestion2DC().getValue().equals(GroupQuestion2DCEnumeration.rdoQuestion2DCNo) && form.GroupQuestion3().getValue().equals(GroupQuestion3Enumeration.rdoQuestion3Yes)))
        {
            if (dementiaVo.getCurrentWorklistStatusIsNotNull() && !DementiaWorklistStatus.STEP_TWO_ASSESS_INVESTIGATE_OUTSTANDING.equals(dementiaVo.getCurrentWorklistStatus().getStatus()) && dementiaVo.getStepTwoAssess()==null)
            {
                tempCurrentStatus = populateStatus(DementiaWorklistStatus.STEP_TWO_ASSESS_INVESTIGATE_OUTSTANDING, voAuthor);
                //wdev-18784
                if( dementiaVo.getPatientIsNotNull())
                {
                    dementiaVo.getPatient().setDementiaWorklistStatus(DementiaWorklistStatus.STEP_TWO_ASSESS_INVESTIGATE_OUTSTANDING);
                    dementiaVo.getPatient().setDementiaBreachDateTime(dementiaVo.getBreachDateTime());

                }
            }
        }

        if (tempCurrentStatus != null)
        {
            dementiaVo.setCurrentWorklistStatus(tempCurrentStatus);

            DementiaWorklistStatusVoCollection tempStatusHistory = dementiaVo.getHistoricalWorklistStatus();
            tempStatusHistory.add(tempCurrentStatus);
            dementiaVo.setHistoricalWorklistStatus(tempStatusHistory);
        }

    }
    return dementiaVo;
}
项目:openMAXIMS    文件:Logic.java   
private void updateControlsState()
{
    boolean enableControls = !form.getTimers().gettimerRefresh().isEnabled();

    DementialManualClassAssemblyVo selectedRowValue = (DementialManualClassAssemblyVo) form.dyngrdPatients().getValue();

    //WDEV-16247
    Object hcp = domain.getHcpLiteUser();
    HcpLiteVo hcpLiteUser=null;
    if (hcp != null)
        hcpLiteUser=((HcpLiteVo) domain.getHcpLiteUser());

    DementiaVo voDementia = (selectedRowValue!=null ? domain.getDementia(new DementiaRefVo(((DementialManualClassAssemblyVo) selectedRowValue).getDementiaId(),0)) : null);

    DementiaFindVo voStep1Find = (voDementia!=null?voDementia.getStepOneFind():null);
    DementiaAssessAndInvestigateVo voStep2AMTS = (voDementia!=null?voDementia.getStepTwoAssess():null);

    Integer hours = (voDementia!=null && voDementia.getAdmissionDateTime()!=null?calculateDateDiffInMinutes(voDementia.getAdmissionDateTime(),new DateTime())/60:null);

    form.cmbHospital().setEnabled(enableControls);
    form.qmbWard().setEnabled(form.cmbHospital().getValue() != null && enableControls);

    form.dteFrom().setEnabled(enableControls);
    form.dteTo().setEnabled(enableControls);

    form.ccConsultant().setEnabled(enableControls);
    form.cmbSpecialty().setEnabled(enableControls);
    form.cmbStatus().setEnabled(enableControls);

    form.txtSurname().setEnabled(enableControls);
    form.txtForename().setEnabled(enableControls);
    form.cmbIDType().setEnabled(enableControls);
    form.txtIDValue().setEnabled(enableControls);
    form.pdtDOB().setEnabled(enableControls);
    form.chkExclude().setEnabled(enableControls);
    form.chkDelirum().setEnabled(enableControls);
    form.chkDementiaConfirmed().setEnabled(enableControls);
    form.chkInpatientOnly().setEnabled(enableControls);

    form.imbSearch().setEnabled(enableControls);
    form.imbClear().setEnabled(enableControls);

    form.getContextMenus().Clinical.hideAllDementiaWorklistMenuMenuItems();
    form.getContextMenus().Clinical.getDementiaWorklistMenuVIEWItem().setVisible(selectedRowValue != null && voDementia.getStepOneFindIsNotNull());
    //EDIT Context Menu 
    form.getContextMenus().Clinical.getDementiaWorklistMenuEDITItem().setVisible(hcpLiteUser!=null && selectedRowValue != null && (voStep1Find!=null || voStep2AMTS!=null)
                                &&((voStep1Find!=null  && voStep1Find.getAuthoringInformationIsNotNull() &&voStep1Find.getAuthoringInformation().getAuthoringHcpIsNotNull() &&  voStep1Find.getAuthoringInformation().getAuthoringHcp().equals(hcpLiteUser))
                                    || (voStep2AMTS!=null && voStep2AMTS.getAuthoringInformationIsNotNull() && voStep2AMTS.getAuthoringInformation().getAuthoringHcpIsNotNull() && voStep2AMTS.getAuthoringInformation().getAuthoringHcp().equals(hcpLiteUser))
                                    || engine.hasRight(AppRight.CAN_EDIT_AND_RIE_DEMENTIA)));   
    form.getContextMenus().Clinical.getDementiaWorklistMenuSTEP1Item().setVisible(hcpLiteUser!=null 
            && selectedRowValue != null 
            && DementiaWorklistStatus.STEP_ONE_FIND_OUTSTANDING.equals(voDementia.getCurrentWorklistStatus().getStatus()));
    form.getContextMenus().Clinical.getDementiaWorklistMenuSTEP2Item().setVisible(hcpLiteUser!=null 
            && selectedRowValue != null 
            && (voDementia.getCurrentWorklistStatusIsNotNull() 
            && DementiaWorklistStatus.STEP_TWO_ASSESS_INVESTIGATE_OUTSTANDING.equals(voDementia.getCurrentWorklistStatus().getStatus())));
    form.getContextMenus().Clinical.getDementiaWorklistMenuRECORD_FOLLOWUP_AMTSItem().setVisible(hcpLiteUser!=null 
            && selectedRowValue != null && voDementia.getStepTwoAssessIsNotNull());
    form.getContextMenus().Clinical.getDementiaWorklistMenuEXCLUDE_FROM_DEMENTIA_SCREENINGItem().setVisible(selectedRowValue != null 
            && selectedRowValue.getIsExcludedFromWorklist()==null 
            && (hours!=null && hours>form.getGlobalContext().Admin.getDementiaConfiguration().getRemoveTimePeriod())
            && ! DementiaWorklistStatus.COMPLETED.equals(voDementia.getCurrentWorklistStatus().getStatus())
            && ! DementiaWorklistStatus.FOR_REFERRAL.equals(voDementia.getCurrentWorklistStatus().getStatus()) );
    form.getContextMenus().Clinical.getDementiaWorklistMenuCONFIRM_PATIENTItem().setVisible(selectedRowValue != null 
            && (voDementia.getCurrentWorklistStatusIsNotNull() 
                    && DementiaWorklistStatus.COMPLETED.equals(voDementia.getCurrentWorklistStatus().getStatus())) 
                    && (Boolean.TRUE.equals(selectedRowValue.getDementiaConfirmed())) 
                    && voDementia.getConfirmedPatientPutOnDementiaPathway()==null);
    form.getContextMenus().Clinical.getDementiaWorklistMenuRIE_REMOVE_FROM_WORKLISTItem().setVisible(selectedRowValue != null 
            && engine.hasRight(AppRight.CAN_EDIT_AND_RIE_DEMENTIA) );   
    form.getContextMenus().Clinical.getDementiaWorklistMenuCORRECT_CCOMPLETION_DATE_STEP1Item().setVisible(selectedRowValue != null 
            && voDementia.getStepOneFindIsNotNull());
    form.getContextMenus().Clinical.getDementiaWorklistMenuCORRECT_CCOMPLETION_DATE_STEP2Item().setVisible(selectedRowValue != null 
            && voDementia.getStepOneFindIsNotNull() && voDementia.getStepTwoAssessIsNotNull());


}
项目:openMAXIMS    文件:Logic.java   
private DementiaFindVo populateDataFromScreen(DementiaFindVo dementiaFindVo)
{
    dementiaFindVo.getAuthoringInformation().setAuthoringDateTime(form.dtimCorrected().getValue());

    return dementiaFindVo;
}
项目:openMAXIMS    文件:Logic.java   
private DementiaVo populateDataFromScreen(DementiaVo dementiaVo)
{
    DementiaFindVo dementiaFindVo = populateDataFromStep1Tab(dementiaVo.getStepOneFind());
    dementiaVo.setStepOneFind(dementiaFindVo);
    DementiaWorklistStatusVo tempCurrentStatus = null;
    // temporary used to set status to a specific type
    /*
     * tempCurrentStatus = populateStatus(DementiaWorklistStatus.STEP_ONE_FIND_OUTSTANDING,form.getLocalContext().getAuthoringInfo());
     * 
     * dementiaVo.setCurrentWorklistStatus(tempCurrentStatus);
     * 
     * DementiaWorklistStatusVoCollection tempStatusHistory = dementiaVo.getHistoricalWorklistStatus(); tempStatusHistory.add(tempCurrentStatus); dementiaVo.setHistoricalWorklistStatus(tempStatusHistory);
     */
    dementiaVo.setDementiaConfirmed(form.GroupQuestion1().getValue().equals(GroupQuestion1Enumeration.rdoQuestion1Yes));
    dementiaVo.setDeliriumConfirmed(form.GroupQuestion2DC().getValue().equals(GroupQuestion2DCEnumeration.rdoQuestion2DCYes) || (form.GroupQuestion2DC().getValue().equals(GroupQuestion2DCEnumeration.rdoQuestion2DCYes) && form.GroupQuestion3().getValue().equals(GroupQuestion3Enumeration.rdoQuestion3Yes)));

    if (dementiaFindVo != null)
    {
        AuthoringInformationVo voAuthor = new AuthoringInformationVo();
        voAuthor.setAuthoringDateTime(new DateTime());
        if (domain.getHcpLiteUser() != null)
            voAuthor.setAuthoringHcp((HcpLiteVo) domain.getHcpLiteUser());

        if (form.GroupQuestion1().getValue().equals(GroupQuestion1Enumeration.rdoQuestion1Yes) || (form.GroupQuestion1().getValue().equals(GroupQuestion1Enumeration.rdoQuestion1No) && form.GroupQuestion2DC().getValue().equals(GroupQuestion2DCEnumeration.rdoQuestion2DCNo) && form.GroupQuestion3().getValue().equals(GroupQuestion3Enumeration.rdoQuestion3No)))
        {
            if (dementiaVo.getCurrentWorklistStatusIsNotNull() && !DementiaWorklistStatus.COMPLETED.equals(dementiaVo.getCurrentWorklistStatus().getStatus()))
            {
                tempCurrentStatus = populateStatus(DementiaWorklistStatus.COMPLETED, voAuthor);
            }
        }
        else if (form.GroupQuestion2DC().getValue().equals(GroupQuestion2DCEnumeration.rdoQuestion2DCYes) || (form.GroupQuestion2DC().getValue().equals(GroupQuestion2DCEnumeration.rdoQuestion2DCNo) && form.GroupQuestion3().getValue().equals(GroupQuestion3Enumeration.rdoQuestion3Yes)))
        {
            if (dementiaVo.getCurrentWorklistStatusIsNotNull() && !DementiaWorklistStatus.STEP_TWO_ASSESS_INVESTIGATE_OUTSTANDING.equals(dementiaVo.getCurrentWorklistStatus().getStatus()) && dementiaVo.getStepTwoAssess()==null)
            {
                tempCurrentStatus = populateStatus(DementiaWorklistStatus.STEP_TWO_ASSESS_INVESTIGATE_OUTSTANDING, voAuthor);
            }
        }

        if (tempCurrentStatus != null)
        {
            dementiaVo.setCurrentWorklistStatus(tempCurrentStatus);

            DementiaWorklistStatusVoCollection tempStatusHistory = dementiaVo.getHistoricalWorklistStatus();
            tempStatusHistory.add(tempCurrentStatus);
            dementiaVo.setHistoricalWorklistStatus(tempStatusHistory);
        }

    }
    return dementiaVo;
}
项目:openMAXIMS    文件:Logic.java   
private void updateControlState()
{
    boolean bShowQ3Controls = false;
    if (form.getMode().equals(FormMode.EDIT))
    {
        if (!form.GroupQuestion2a().getValue().equals(GroupQuestion2aEnumeration.None) && !form.GroupQuestion2b().getValue().equals(GroupQuestion2bEnumeration.None) && !form.GroupQuestion2c().getValue().equals(GroupQuestion2cEnumeration.None) && !form.GroupQuestion2d().getValue().equals(GroupQuestion2dEnumeration.None))
            bShowQ3Controls = true;

        if (bShowQ3Controls && form.GroupQuestion2a().getValue().equals(GroupQuestion2aEnumeration.rdoQuestion2aYes) && form.GroupQuestion2b().getValue().equals(GroupQuestion2bEnumeration.rdoQuestion2bYes) && (form.GroupQuestion2c().getValue().equals(GroupQuestion2cEnumeration.rdoQuestion2cYes) || form.GroupQuestion2d().getValue().equals(GroupQuestion2dEnumeration.rdoQuestion2dYes)))
        {
            form.GroupQuestion2DC().setValue(GroupQuestion2DCEnumeration.rdoQuestion2DCYes);
        }
        else if (bShowQ3Controls)
        {
            form.GroupQuestion2DC().setValue(GroupQuestion2DCEnumeration.rdoQuestion2DCNo);
        }

        form.btnSave().setVisible(true);
        form.btnSave().setEnabled(form.GroupQuestion1().getValue().equals(GroupQuestion1Enumeration.rdoQuestion1Yes) || form.GroupQuestion2DC().getValue().equals(GroupQuestion2DCEnumeration.rdoQuestion2DCYes) || form.GroupQuestion3().getValue().equals(GroupQuestion3Enumeration.rdoQuestion3Yes) || form.GroupQuestion3().getValue().equals(GroupQuestion3Enumeration.rdoQuestion3No));

        hideShowQuery2(form.GroupQuestion1().getValue().equals(GroupQuestion1Enumeration.rdoQuestion1No));
        hideShowQuery3(form.GroupQuestion1().getValue().equals(GroupQuestion1Enumeration.rdoQuestion1No) && bShowQ3Controls && form.GroupQuestion2DC().getValue().equals(GroupQuestion2DCEnumeration.rdoQuestion2DCNo));
    }
    form.imbHelpIcon().setEnabled(false);

    Object hcp = domain.getHcpLiteUser();
    HcpLiteVo hcpLiteUser=null;
    if (hcp != null)
        hcpLiteUser=((HcpLiteVo) hcp);
    DementiaFindVo voStep1Find = (form.getLocalContext().getselectedDementiaIsNotNull()?form.getLocalContext().getselectedDementia().getStepOneFind():null);

    form.btnEdit().setVisible(hcpLiteUser!=null && form.getMode().equals(FormMode.VIEW)
            && form.getLocalContext().getselectedDementia() != null && voStep1Find !=null
            && ((voStep1Find.getAuthoringInformationIsNotNull() && voStep1Find.getAuthoringInformation().getAuthoringHcpIsNotNull() && voStep1Find.getAuthoringInformation().getAuthoringHcp().equals(hcpLiteUser)) || engine.hasRight(AppRight.CAN_EDIT_AND_RIE_DEMENTIA)));
    form.GroupQuestion1().setEnabled(form.getMode().equals(FormMode.EDIT));
    form.GroupQuestion2a().setEnabled(form.getMode().equals(FormMode.EDIT));
    form.GroupQuestion2b().setEnabled(form.getMode().equals(FormMode.EDIT));
    form.GroupQuestion2c().setEnabled(form.getMode().equals(FormMode.EDIT));
    form.GroupQuestion2d().setEnabled(form.getMode().equals(FormMode.EDIT));
    form.GroupQuestion2DC().setEnabled(false);
    form.GroupQuestion3().setEnabled(form.getMode().equals(FormMode.EDIT));

    form.btnRIE().setVisible(form.getMode().equals(FormMode.VIEW) 
            && form.getLocalContext().getselectedDementia() != null 
            && form.getLocalContext().getselectedDementia().getStepOneFind() !=null
            && engine.hasRight(AppRight.CAN_EDIT_AND_RIE_DEMENTIA)  );
    form.btnClose().setVisible(form.getMode().equals(FormMode.VIEW) && form.getLocalContext().getisParentFormDialog());
}
项目:openMAXIMS    文件:Logic.java   
protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException
{
    if (args != null)
    {
        if (args.length == 2 && args[0] != null && args[1] != null && args[0] instanceof DementiaForWorklistVo)
        {
            form.getLocalContext().setselectedDementia(domain.getDementia((DementiaForWorklistVo) args[0]));
            if (DementiaWorklistOpenFormModeEnum.STEP1EDIT.equals(args[1]))
            {
                form.lyrSteps().showtabPageStep1();
                form.lyrSteps().tabPageStep1().ccStep1Find().initialize(form.getLocalContext().getselectedDementia(), FormMode.EDIT, engine.isDialog());
                form.lyrSteps().tabPageStep2().setHeaderVisible(form.getLocalContext().getselectedDementia().getStepTwoAssessIsNotNull());
                form.lyrSteps().tabPageFollowUp().setHeaderVisible(form.getLocalContext().getselectedDementia().getFollowUpAssessmentsIsNotNull() && form.getLocalContext().getselectedDementia().getFollowUpAssessments().size() > 0);
            }
            else if (DementiaWorklistOpenFormModeEnum.VIEW.equals(args[1]))
            {
                open();
                return;
            }
            else if (DementiaWorklistOpenFormModeEnum.STEP2_AMTS_EDIT.equals(args[1]))
            {
                form.lyrSteps().showtabPageStep2();
                form.lyrSteps().tabPageStep2().ccAMTS().initialize(form.getLocalContext().getselectedDementia(), FormMode.EDIT, null);
                form.lyrSteps().tabPageStep2().setHeaderVisible(true);
                form.lyrSteps().tabPageFollowUp().setHeaderVisible(form.getLocalContext().getselectedDementia().getFollowUpAssessmentsIsNotNull() && form.getLocalContext().getselectedDementia().getFollowUpAssessments().size() > 0);
            }
            else if (DementiaWorklistOpenFormModeEnum.FOLLOWUP_AMTS_EDIT.equals(args[1]))
            {
                form.lyrSteps().showtabPageFollowUp();

                form.lyrSteps().tabPageStep1().ccStep1Find().initialize(form.getLocalContext().getselectedDementia(), FormMode.VIEW,engine.isDialog());
                form.lyrSteps().tabPageStep2().ccAMTS().initialize(form.getLocalContext().getselectedDementia(), FormMode.VIEW, null);

                initialiseFollowUp(true);
                return;
            }
            else if (DementiaWorklistOpenFormModeEnum.EDIT.equals(args[1])) //WDEV-16247
            {
                Object hcp = domain.getHcpLiteUser();
                HcpLiteVo hcpLiteUser=null;
                if (hcp != null)
                    hcpLiteUser=((HcpLiteVo) domain.getHcpLiteUser());

                DementiaFindVo voStep1Find = (form.getLocalContext().getselectedDementiaIsNotNull()?form.getLocalContext().getselectedDementia().getStepOneFind():null);
                DementiaAssessAndInvestigateVo voStep2AMTS = (form.getLocalContext().getselectedDementiaIsNotNull()?form.getLocalContext().getselectedDementia().getStepTwoAssess():null);
                if (form.getLocalContext().getselectedDementiaIsNotNull() && voStep1Find!=null && voStep2AMTS==null 
                    && ((voStep1Find.getAuthoringInformationIsNotNull() && voStep1Find.getAuthoringInformationIsNotNull() && voStep1Find.getAuthoringInformation().getAuthoringHcpIsNotNull() && voStep1Find.getAuthoringInformation().getAuthoringHcp().equals(hcpLiteUser)) 
                        || engine.hasRight(AppRight.CAN_EDIT_AND_RIE_DEMENTIA)))
                {
                    form.lyrSteps().showtabPageStep1();
                    form.lyrSteps().tabPageStep1().ccStep1Find().initialize(form.getLocalContext().getselectedDementia(), FormMode.EDIT, engine.isDialog());
                    form.lyrSteps().tabPageStep2().setHeaderVisible(form.getLocalContext().getselectedDementia().getStepTwoAssessIsNotNull());
                    form.lyrSteps().tabPageFollowUp().setHeaderVisible(form.getLocalContext().getselectedDementia().getFollowUpAssessmentsIsNotNull() && form.getLocalContext().getselectedDementia().getFollowUpAssessments().size() > 0);
                }
                else if (form.getLocalContext().getselectedDementiaIsNotNull() && voStep1Find!=null && voStep2AMTS!=null )
                {
                    if ((voStep2AMTS.getAuthoringInformationIsNotNull() && voStep2AMTS.getAuthoringInformationIsNotNull() && voStep2AMTS.getAuthoringInformation().getAuthoringHcpIsNotNull() && voStep2AMTS.getAuthoringInformation().getAuthoringHcp().equals(hcpLiteUser)) 
                                || engine.hasRight(AppRight.CAN_EDIT_AND_RIE_DEMENTIA))
                    {
                        form.lyrSteps().showtabPageStep2();
                        form.lyrSteps().tabPageStep2().ccAMTS().initialize(form.getLocalContext().getselectedDementia(), FormMode.EDIT, null);
                        form.lyrSteps().tabPageStep2().setHeaderVisible(true);
                        form.lyrSteps().tabPageFollowUp().setHeaderVisible(form.getLocalContext().getselectedDementia().getFollowUpAssessmentsIsNotNull() && form.getLocalContext().getselectedDementia().getFollowUpAssessments().size() > 0);
                    }
                    else if ((voStep2AMTS.getAuthoringInformationIsNotNull() && voStep2AMTS.getAuthoringInformationIsNotNull() && voStep2AMTS.getAuthoringInformation().getAuthoringHcpIsNotNull() && !voStep2AMTS.getAuthoringInformation().getAuthoringHcp().equals(hcpLiteUser))
                            && (voStep1Find.getAuthoringInformationIsNotNull() && voStep1Find.getAuthoringInformationIsNotNull() && voStep1Find.getAuthoringInformation().getAuthoringHcpIsNotNull() && voStep1Find.getAuthoringInformation().getAuthoringHcp().equals(hcpLiteUser)) )
                    {
                        form.lyrSteps().showtabPageStep1();
                        form.lyrSteps().tabPageStep1().ccStep1Find().initialize(form.getLocalContext().getselectedDementia(), FormMode.EDIT, engine.isDialog());
                        form.lyrSteps().tabPageStep2().setHeaderVisible(form.getLocalContext().getselectedDementia().getStepTwoAssessIsNotNull());
                        form.lyrSteps().tabPageFollowUp().setHeaderVisible(form.getLocalContext().getselectedDementia().getFollowUpAssessmentsIsNotNull() && form.getLocalContext().getselectedDementia().getFollowUpAssessments().size() > 0);
                    }


                }

            }
            initialiseFollowUp(false);
        }
    }
}
项目:openMAXIMS    文件:Logic.java   
private void updateControlsState()
{
    boolean enableControls = !form.getTimers().gettimerRefresh().isEnabled();

    DementialManualClassAssemblyVo selectedRowValue = (DementialManualClassAssemblyVo) form.dyngrdPatients().getValue();

    //WDEV-16247
    Object hcp = domain.getHcpLiteUser();
    HcpLiteVo hcpLiteUser=null;
    if (hcp != null)
        hcpLiteUser=((HcpLiteVo) domain.getHcpLiteUser());

    DementiaVo voDementia = (selectedRowValue!=null ? domain.getDementia(new DementiaRefVo(((DementialManualClassAssemblyVo) selectedRowValue).getDementiaId(),0)) : null);

    DementiaFindVo voStep1Find = (voDementia!=null?voDementia.getStepOneFind():null);
    DementiaAssessAndInvestigateVo voStep2AMTS = (voDementia!=null?voDementia.getStepTwoAssess():null);

    Integer hours = (voDementia!=null && voDementia.getAdmissionDateTime()!=null?calculateDateDiffInMinutes(voDementia.getAdmissionDateTime(),new DateTime())/60:null);

    form.cmbHospital().setEnabled(enableControls);
    form.qmbWard().setEnabled(form.cmbHospital().getValue() != null && enableControls);

    form.dteFrom().setEnabled(enableControls);
    form.dteTo().setEnabled(enableControls);

    form.ccConsultant().setEnabled(enableControls);
    form.cmbSpecialty().setEnabled(enableControls);
    form.cmbStatus().setEnabled(enableControls);

    form.txtSurname().setEnabled(enableControls);
    form.txtForename().setEnabled(enableControls);
    form.cmbIDType().setEnabled(enableControls);
    form.txtIDValue().setEnabled(enableControls);
    form.pdtDOB().setEnabled(enableControls);
    form.chkExclude().setEnabled(enableControls);
    form.chkDelirum().setEnabled(enableControls);
    form.chkDementiaConfirmed().setEnabled(enableControls);
    form.chkInpatientOnly().setEnabled(enableControls);

    form.imbSearch().setEnabled(enableControls);
    form.imbClear().setEnabled(enableControls);

    form.getContextMenus().Clinical.hideAllDementiaWorklistMenuMenuItems();
    form.getContextMenus().Clinical.getDementiaWorklistMenuVIEWItem().setVisible(selectedRowValue != null && voDementia.getStepOneFindIsNotNull());
    //EDIT Context Menu 
    form.getContextMenus().Clinical.getDementiaWorklistMenuEDITItem().setVisible(hcpLiteUser!=null && selectedRowValue != null && (voStep1Find!=null || voStep2AMTS!=null)
                                &&((voStep1Find!=null  && voStep1Find.getAuthoringInformationIsNotNull() &&voStep1Find.getAuthoringInformation().getAuthoringHcpIsNotNull() &&  voStep1Find.getAuthoringInformation().getAuthoringHcp().equals(hcpLiteUser))
                                    || (voStep2AMTS!=null && voStep2AMTS.getAuthoringInformationIsNotNull() && voStep2AMTS.getAuthoringInformation().getAuthoringHcpIsNotNull() && voStep2AMTS.getAuthoringInformation().getAuthoringHcp().equals(hcpLiteUser))
                                    || engine.hasRight(AppRight.CAN_EDIT_AND_RIE_DEMENTIA)));   
    form.getContextMenus().Clinical.getDementiaWorklistMenuSTEP1Item().setVisible(hcpLiteUser!=null 
            && selectedRowValue != null 
            && DementiaWorklistStatus.STEP_ONE_FIND_OUTSTANDING.equals(voDementia.getCurrentWorklistStatus().getStatus()));
    form.getContextMenus().Clinical.getDementiaWorklistMenuSTEP2Item().setVisible(hcpLiteUser!=null 
            && selectedRowValue != null 
            && (voDementia.getCurrentWorklistStatusIsNotNull() 
            && DementiaWorklistStatus.STEP_TWO_ASSESS_INVESTIGATE_OUTSTANDING.equals(voDementia.getCurrentWorklistStatus().getStatus())));
    form.getContextMenus().Clinical.getDementiaWorklistMenuRECORD_FOLLOWUP_AMTSItem().setVisible(hcpLiteUser!=null 
            && selectedRowValue != null && voDementia.getStepTwoAssessIsNotNull());
    form.getContextMenus().Clinical.getDementiaWorklistMenuEXCLUDE_FROM_DEMENTIA_SCREENINGItem().setVisible(selectedRowValue != null 
            && selectedRowValue.getIsExcludedFromWorklist()==null 
            && (hours!=null && hours>form.getGlobalContext().Admin.getDementiaConfiguration().getRemoveTimePeriod())
            && ! DementiaWorklistStatus.COMPLETED.equals(voDementia.getCurrentWorklistStatus().getStatus())
            && ! DementiaWorklistStatus.FOR_REFERRAL.equals(voDementia.getCurrentWorklistStatus().getStatus()) );
    form.getContextMenus().Clinical.getDementiaWorklistMenuCONFIRM_PATIENTItem().setVisible(selectedRowValue != null 
            && (voDementia.getCurrentWorklistStatusIsNotNull() 
                    && DementiaWorklistStatus.COMPLETED.equals(voDementia.getCurrentWorklistStatus().getStatus())) 
                    && (Boolean.TRUE.equals(selectedRowValue.getDementiaConfirmed())) 
                    && voDementia.getConfirmedPatientPutOnDementiaPathway()==null);
    form.getContextMenus().Clinical.getDementiaWorklistMenuRIE_REMOVE_FROM_WORKLISTItem().setVisible(selectedRowValue != null 
            && engine.hasRight(AppRight.CAN_EDIT_AND_RIE_DEMENTIA) );   
    form.getContextMenus().Clinical.getDementiaWorklistMenuCORRECT_CCOMPLETION_DATE_STEP1Item().setVisible(selectedRowValue != null 
            && voDementia.getStepOneFindIsNotNull());
    form.getContextMenus().Clinical.getDementiaWorklistMenuCORRECT_CCOMPLETION_DATE_STEP2Item().setVisible(selectedRowValue != null 
            && voDementia.getStepOneFindIsNotNull() && voDementia.getStepTwoAssessIsNotNull());


}
项目:openMAXIMS    文件:Logic.java   
private DementiaFindVo populateDataFromScreen(DementiaFindVo dementiaFindVo)
{
    dementiaFindVo.getAuthoringInformation().setAuthoringDateTime(form.dtimCorrected().getValue());

    return dementiaFindVo;
}
项目:openmaxims-linux    文件:Logic.java   
private DementiaVo populateDataFromScreen(DementiaVo dementiaVo)
{
    DementiaFindVo dementiaFindVo = populateDataFromStep1Tab(dementiaVo.getStepOneFind());
    dementiaVo.setStepOneFind(dementiaFindVo);
    DementiaWorklistStatusVo tempCurrentStatus = null;
    // temporary used to set status to a specific type
    /*
     * tempCurrentStatus = populateStatus(DementiaWorklistStatus.STEP_ONE_FIND_OUTSTANDING,form.getLocalContext().getAuthoringInfo());
     * 
     * dementiaVo.setCurrentWorklistStatus(tempCurrentStatus);
     * 
     * DementiaWorklistStatusVoCollection tempStatusHistory = dementiaVo.getHistoricalWorklistStatus(); tempStatusHistory.add(tempCurrentStatus); dementiaVo.setHistoricalWorklistStatus(tempStatusHistory);
     */
    dementiaVo.setDementiaConfirmed(form.GroupQuestion1().getValue().equals(GroupQuestion1Enumeration.rdoQuestion1Yes));
    dementiaVo.setDeliriumConfirmed(form.GroupQuestion2DC().getValue().equals(GroupQuestion2DCEnumeration.rdoQuestion2DCYes) || (form.GroupQuestion2DC().getValue().equals(GroupQuestion2DCEnumeration.rdoQuestion2DCYes) && form.GroupQuestion3().getValue().equals(GroupQuestion3Enumeration.rdoQuestion3Yes)));

    if (dementiaFindVo != null)
    {
        AuthoringInformationVo voAuthor = new AuthoringInformationVo();
        voAuthor.setAuthoringDateTime(new DateTime());
        if (domain.getHcpLiteUser() != null)
            voAuthor.setAuthoringHcp((HcpLiteVo) domain.getHcpLiteUser());

        if (form.GroupQuestion1().getValue().equals(GroupQuestion1Enumeration.rdoQuestion1Yes) || (form.GroupQuestion1().getValue().equals(GroupQuestion1Enumeration.rdoQuestion1No) && form.GroupQuestion2DC().getValue().equals(GroupQuestion2DCEnumeration.rdoQuestion2DCNo) && form.GroupQuestion3().getValue().equals(GroupQuestion3Enumeration.rdoQuestion3No)))
        {
            if (dementiaVo.getCurrentWorklistStatusIsNotNull() && !DementiaWorklistStatus.COMPLETED.equals(dementiaVo.getCurrentWorklistStatus().getStatus()))
            {
                tempCurrentStatus = populateStatus(DementiaWorklistStatus.COMPLETED, voAuthor);
            }
        }
        else if (form.GroupQuestion2DC().getValue().equals(GroupQuestion2DCEnumeration.rdoQuestion2DCYes) || (form.GroupQuestion2DC().getValue().equals(GroupQuestion2DCEnumeration.rdoQuestion2DCNo) && form.GroupQuestion3().getValue().equals(GroupQuestion3Enumeration.rdoQuestion3Yes)))
        {
            if (dementiaVo.getCurrentWorklistStatusIsNotNull() && !DementiaWorklistStatus.STEP_TWO_ASSESS_INVESTIGATE_OUTSTANDING.equals(dementiaVo.getCurrentWorklistStatus().getStatus()) && dementiaVo.getStepTwoAssess()==null)
            {
                tempCurrentStatus = populateStatus(DementiaWorklistStatus.STEP_TWO_ASSESS_INVESTIGATE_OUTSTANDING, voAuthor);
            }
        }

        if (tempCurrentStatus != null)
        {
            dementiaVo.setCurrentWorklistStatus(tempCurrentStatus);

            DementiaWorklistStatusVoCollection tempStatusHistory = dementiaVo.getHistoricalWorklistStatus();
            tempStatusHistory.add(tempCurrentStatus);
            dementiaVo.setHistoricalWorklistStatus(tempStatusHistory);
        }

    }
    return dementiaVo;
}
项目:openmaxims-linux    文件:Logic.java   
private void updateControlState()
{
    boolean bShowQ3Controls = false;
    if (form.getMode().equals(FormMode.EDIT))
    {
        if (!form.GroupQuestion2a().getValue().equals(GroupQuestion2aEnumeration.None) && !form.GroupQuestion2b().getValue().equals(GroupQuestion2bEnumeration.None) && !form.GroupQuestion2c().getValue().equals(GroupQuestion2cEnumeration.None) && !form.GroupQuestion2d().getValue().equals(GroupQuestion2dEnumeration.None))
            bShowQ3Controls = true;

        if (bShowQ3Controls && form.GroupQuestion2a().getValue().equals(GroupQuestion2aEnumeration.rdoQuestion2aYes) && form.GroupQuestion2b().getValue().equals(GroupQuestion2bEnumeration.rdoQuestion2bYes) && (form.GroupQuestion2c().getValue().equals(GroupQuestion2cEnumeration.rdoQuestion2cYes) || form.GroupQuestion2d().getValue().equals(GroupQuestion2dEnumeration.rdoQuestion2dYes)))
        {
            form.GroupQuestion2DC().setValue(GroupQuestion2DCEnumeration.rdoQuestion2DCYes);
        }
        else if (bShowQ3Controls)
        {
            form.GroupQuestion2DC().setValue(GroupQuestion2DCEnumeration.rdoQuestion2DCNo);
        }

        form.btnSave().setVisible(true);
        form.btnSave().setEnabled(form.GroupQuestion1().getValue().equals(GroupQuestion1Enumeration.rdoQuestion1Yes) || form.GroupQuestion2DC().getValue().equals(GroupQuestion2DCEnumeration.rdoQuestion2DCYes) || form.GroupQuestion3().getValue().equals(GroupQuestion3Enumeration.rdoQuestion3Yes) || form.GroupQuestion3().getValue().equals(GroupQuestion3Enumeration.rdoQuestion3No));

        hideShowQuery2(form.GroupQuestion1().getValue().equals(GroupQuestion1Enumeration.rdoQuestion1No));
        hideShowQuery3(form.GroupQuestion1().getValue().equals(GroupQuestion1Enumeration.rdoQuestion1No) && bShowQ3Controls && form.GroupQuestion2DC().getValue().equals(GroupQuestion2DCEnumeration.rdoQuestion2DCNo));
    }
    form.imbHelpIcon().setEnabled(false);

    Object hcp = domain.getHcpLiteUser();
    HcpLiteVo hcpLiteUser=null;
    if (hcp != null)
        hcpLiteUser=((HcpLiteVo) hcp);
    DementiaFindVo voStep1Find = (form.getLocalContext().getselectedDementiaIsNotNull()?form.getLocalContext().getselectedDementia().getStepOneFind():null);

    form.btnEdit().setVisible(hcpLiteUser!=null && form.getMode().equals(FormMode.VIEW)
            && form.getLocalContext().getselectedDementia() != null && voStep1Find !=null
            && ((voStep1Find.getAuthoringInformationIsNotNull() && voStep1Find.getAuthoringInformation().getAuthoringHcpIsNotNull() && voStep1Find.getAuthoringInformation().getAuthoringHcp().equals(hcpLiteUser)) || engine.hasRight(AppRight.CAN_EDIT_AND_RIE_DEMENTIA)));
    form.GroupQuestion1().setEnabled(form.getMode().equals(FormMode.EDIT));
    form.GroupQuestion2a().setEnabled(form.getMode().equals(FormMode.EDIT));
    form.GroupQuestion2b().setEnabled(form.getMode().equals(FormMode.EDIT));
    form.GroupQuestion2c().setEnabled(form.getMode().equals(FormMode.EDIT));
    form.GroupQuestion2d().setEnabled(form.getMode().equals(FormMode.EDIT));
    form.GroupQuestion2DC().setEnabled(false);
    form.GroupQuestion3().setEnabled(form.getMode().equals(FormMode.EDIT));

    form.btnRIE().setVisible(form.getMode().equals(FormMode.VIEW) 
            && form.getLocalContext().getselectedDementia() != null 
            && form.getLocalContext().getselectedDementia().getStepOneFind() !=null
            && engine.hasRight(AppRight.CAN_EDIT_AND_RIE_DEMENTIA)  );
    form.btnClose().setVisible(form.getMode().equals(FormMode.VIEW) && form.getLocalContext().getisParentFormDialog());
}
项目:openmaxims-linux    文件:Logic.java   
protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException
{
    if (args != null)
    {
        if (args.length == 2 && args[0] != null && args[1] != null && args[0] instanceof DementiaForWorklistVo)
        {
            form.getLocalContext().setselectedDementia(domain.getDementia((DementiaForWorklistVo) args[0]));
            if (DementiaWorklistOpenFormModeEnum.STEP1EDIT.equals(args[1]))
            {
                form.lyrSteps().showtabPageStep1();
                form.lyrSteps().tabPageStep1().ccStep1Find().initialize(form.getLocalContext().getselectedDementia(), FormMode.EDIT, engine.isDialog());
                form.lyrSteps().tabPageStep2().setHeaderVisible(form.getLocalContext().getselectedDementia().getStepTwoAssessIsNotNull());
                form.lyrSteps().tabPageFollowUp().setHeaderVisible(form.getLocalContext().getselectedDementia().getFollowUpAssessmentsIsNotNull() && form.getLocalContext().getselectedDementia().getFollowUpAssessments().size() > 0);
            }
            else if (DementiaWorklistOpenFormModeEnum.VIEW.equals(args[1]))
            {
                open();
                return;
            }
            else if (DementiaWorklistOpenFormModeEnum.STEP2_AMTS_EDIT.equals(args[1]))
            {
                form.lyrSteps().showtabPageStep2();
                form.lyrSteps().tabPageStep2().ccAMTS().initialize(form.getLocalContext().getselectedDementia(), FormMode.EDIT, null);
                form.lyrSteps().tabPageStep2().setHeaderVisible(true);
                form.lyrSteps().tabPageFollowUp().setHeaderVisible(form.getLocalContext().getselectedDementia().getFollowUpAssessmentsIsNotNull() && form.getLocalContext().getselectedDementia().getFollowUpAssessments().size() > 0);
            }
            else if (DementiaWorklistOpenFormModeEnum.FOLLOWUP_AMTS_EDIT.equals(args[1]))
            {
                form.lyrSteps().showtabPageFollowUp();

                form.lyrSteps().tabPageStep1().ccStep1Find().initialize(form.getLocalContext().getselectedDementia(), FormMode.VIEW,engine.isDialog());
                form.lyrSteps().tabPageStep2().ccAMTS().initialize(form.getLocalContext().getselectedDementia(), FormMode.VIEW, null);

                initialiseFollowUp(true);
                return;
            }
            else if (DementiaWorklistOpenFormModeEnum.EDIT.equals(args[1])) //WDEV-16247
            {
                Object hcp = domain.getHcpLiteUser();
                HcpLiteVo hcpLiteUser=null;
                if (hcp != null)
                    hcpLiteUser=((HcpLiteVo) domain.getHcpLiteUser());

                DementiaFindVo voStep1Find = (form.getLocalContext().getselectedDementiaIsNotNull()?form.getLocalContext().getselectedDementia().getStepOneFind():null);
                DementiaAssessAndInvestigateVo voStep2AMTS = (form.getLocalContext().getselectedDementiaIsNotNull()?form.getLocalContext().getselectedDementia().getStepTwoAssess():null);
                if (form.getLocalContext().getselectedDementiaIsNotNull() && voStep1Find!=null && voStep2AMTS==null 
                    && ((voStep1Find.getAuthoringInformationIsNotNull() && voStep1Find.getAuthoringInformationIsNotNull() && voStep1Find.getAuthoringInformation().getAuthoringHcpIsNotNull() && voStep1Find.getAuthoringInformation().getAuthoringHcp().equals(hcpLiteUser)) 
                        || engine.hasRight(AppRight.CAN_EDIT_AND_RIE_DEMENTIA)))
                {
                    form.lyrSteps().showtabPageStep1();
                    form.lyrSteps().tabPageStep1().ccStep1Find().initialize(form.getLocalContext().getselectedDementia(), FormMode.EDIT, engine.isDialog());
                    form.lyrSteps().tabPageStep2().setHeaderVisible(form.getLocalContext().getselectedDementia().getStepTwoAssessIsNotNull());
                    form.lyrSteps().tabPageFollowUp().setHeaderVisible(form.getLocalContext().getselectedDementia().getFollowUpAssessmentsIsNotNull() && form.getLocalContext().getselectedDementia().getFollowUpAssessments().size() > 0);
                }
                else if (form.getLocalContext().getselectedDementiaIsNotNull() && voStep1Find!=null && voStep2AMTS!=null )
                {
                    if ((voStep2AMTS.getAuthoringInformationIsNotNull() && voStep2AMTS.getAuthoringInformationIsNotNull() && voStep2AMTS.getAuthoringInformation().getAuthoringHcpIsNotNull() && voStep2AMTS.getAuthoringInformation().getAuthoringHcp().equals(hcpLiteUser)) 
                                || engine.hasRight(AppRight.CAN_EDIT_AND_RIE_DEMENTIA))
                    {
                        form.lyrSteps().showtabPageStep2();
                        form.lyrSteps().tabPageStep2().ccAMTS().initialize(form.getLocalContext().getselectedDementia(), FormMode.EDIT, null);
                        form.lyrSteps().tabPageStep2().setHeaderVisible(true);
                        form.lyrSteps().tabPageFollowUp().setHeaderVisible(form.getLocalContext().getselectedDementia().getFollowUpAssessmentsIsNotNull() && form.getLocalContext().getselectedDementia().getFollowUpAssessments().size() > 0);
                    }
                    else if ((voStep2AMTS.getAuthoringInformationIsNotNull() && voStep2AMTS.getAuthoringInformationIsNotNull() && voStep2AMTS.getAuthoringInformation().getAuthoringHcpIsNotNull() && !voStep2AMTS.getAuthoringInformation().getAuthoringHcp().equals(hcpLiteUser))
                            && (voStep1Find.getAuthoringInformationIsNotNull() && voStep1Find.getAuthoringInformationIsNotNull() && voStep1Find.getAuthoringInformation().getAuthoringHcpIsNotNull() && voStep1Find.getAuthoringInformation().getAuthoringHcp().equals(hcpLiteUser)) )
                    {
                        form.lyrSteps().showtabPageStep1();
                        form.lyrSteps().tabPageStep1().ccStep1Find().initialize(form.getLocalContext().getselectedDementia(), FormMode.EDIT, engine.isDialog());
                        form.lyrSteps().tabPageStep2().setHeaderVisible(form.getLocalContext().getselectedDementia().getStepTwoAssessIsNotNull());
                        form.lyrSteps().tabPageFollowUp().setHeaderVisible(form.getLocalContext().getselectedDementia().getFollowUpAssessmentsIsNotNull() && form.getLocalContext().getselectedDementia().getFollowUpAssessments().size() > 0);
                    }


                }

            }
            initialiseFollowUp(false);
        }
    }
}
项目:openmaxims-linux    文件:Logic.java   
private void updateControlsState()
{
    boolean enableControls = !form.getTimers().gettimerRefresh().isEnabled();

    DementialManualClassAssemblyVo selectedRowValue = (DementialManualClassAssemblyVo) form.dyngrdPatients().getValue();

    //WDEV-16247
    Object hcp = domain.getHcpLiteUser();
    HcpLiteVo hcpLiteUser=null;
    if (hcp != null)
        hcpLiteUser=((HcpLiteVo) domain.getHcpLiteUser());

    DementiaVo voDementia = (selectedRowValue!=null ? domain.getDementia(new DementiaRefVo(((DementialManualClassAssemblyVo) selectedRowValue).getDementiaId(),0)) : null);

    DementiaFindVo voStep1Find = (voDementia!=null?voDementia.getStepOneFind():null);
    DementiaAssessAndInvestigateVo voStep2AMTS = (voDementia!=null?voDementia.getStepTwoAssess():null);

    Integer hours = (voDementia!=null && voDementia.getAdmissionDateTime()!=null?calculateDateDiffInMinutes(voDementia.getAdmissionDateTime(),new DateTime())/60:null);

    form.cmbHospital().setEnabled(enableControls);
    form.qmbWard().setEnabled(form.cmbHospital().getValue() != null && enableControls);

    form.dteFrom().setEnabled(enableControls);
    form.dteTo().setEnabled(enableControls);

    form.ccConsultant().setEnabled(enableControls);
    form.cmbSpecialty().setEnabled(enableControls);
    form.cmbStatus().setEnabled(enableControls);

    form.txtSurname().setEnabled(enableControls);
    form.txtForename().setEnabled(enableControls);
    form.cmbIDType().setEnabled(enableControls);
    form.txtIDValue().setEnabled(enableControls);
    form.pdtDOB().setEnabled(enableControls);
    form.chkExclude().setEnabled(enableControls);
    form.chkDelirum().setEnabled(enableControls);
    form.chkDementiaConfirmed().setEnabled(enableControls);
    form.chkInpatientOnly().setEnabled(enableControls);

    form.imbSearch().setEnabled(enableControls);
    form.imbClear().setEnabled(enableControls);

    form.getContextMenus().Clinical.hideAllDementiaWorklistMenuMenuItems();
    form.getContextMenus().Clinical.getDementiaWorklistMenuVIEWItem().setVisible(selectedRowValue != null && voDementia.getStepOneFindIsNotNull());
    //EDIT Context Menu 
    form.getContextMenus().Clinical.getDementiaWorklistMenuEDITItem().setVisible(hcpLiteUser!=null && selectedRowValue != null && (voStep1Find!=null || voStep2AMTS!=null)
                                &&((voStep1Find!=null  && voStep1Find.getAuthoringInformationIsNotNull() &&voStep1Find.getAuthoringInformation().getAuthoringHcpIsNotNull() &&  voStep1Find.getAuthoringInformation().getAuthoringHcp().equals(hcpLiteUser))
                                    || (voStep2AMTS!=null && voStep2AMTS.getAuthoringInformationIsNotNull() && voStep2AMTS.getAuthoringInformation().getAuthoringHcpIsNotNull() && voStep2AMTS.getAuthoringInformation().getAuthoringHcp().equals(hcpLiteUser))
                                    || engine.hasRight(AppRight.CAN_EDIT_AND_RIE_DEMENTIA)));   
    form.getContextMenus().Clinical.getDementiaWorklistMenuSTEP1Item().setVisible(hcpLiteUser!=null 
            && selectedRowValue != null 
            && DementiaWorklistStatus.STEP_ONE_FIND_OUTSTANDING.equals(voDementia.getCurrentWorklistStatus().getStatus()));
    form.getContextMenus().Clinical.getDementiaWorklistMenuSTEP2Item().setVisible(hcpLiteUser!=null 
            && selectedRowValue != null 
            && (voDementia.getCurrentWorklistStatusIsNotNull() 
            && DementiaWorklistStatus.STEP_TWO_ASSESS_INVESTIGATE_OUTSTANDING.equals(voDementia.getCurrentWorklistStatus().getStatus())));
    form.getContextMenus().Clinical.getDementiaWorklistMenuRECORD_FOLLOWUP_AMTSItem().setVisible(hcpLiteUser!=null 
            && selectedRowValue != null && voDementia.getStepTwoAssessIsNotNull());
    form.getContextMenus().Clinical.getDementiaWorklistMenuEXCLUDE_FROM_DEMENTIA_SCREENINGItem().setVisible(selectedRowValue != null 
            && selectedRowValue.getIsExcludedFromWorklist()==null 
            && (hours!=null && hours>form.getGlobalContext().Admin.getDementiaConfiguration().getRemoveTimePeriod())
            && ! DementiaWorklistStatus.COMPLETED.equals(voDementia.getCurrentWorklistStatus().getStatus())
            && ! DementiaWorklistStatus.FOR_REFERRAL.equals(voDementia.getCurrentWorklistStatus().getStatus()) );
    form.getContextMenus().Clinical.getDementiaWorklistMenuCONFIRM_PATIENTItem().setVisible(selectedRowValue != null 
            && (voDementia.getCurrentWorklistStatusIsNotNull() 
                    && DementiaWorklistStatus.COMPLETED.equals(voDementia.getCurrentWorklistStatus().getStatus())) 
                    && (Boolean.TRUE.equals(selectedRowValue.getDementiaConfirmed())) 
                    && voDementia.getConfirmedPatientPutOnDementiaPathway()==null);
    form.getContextMenus().Clinical.getDementiaWorklistMenuRIE_REMOVE_FROM_WORKLISTItem().setVisible(selectedRowValue != null 
            && engine.hasRight(AppRight.CAN_EDIT_AND_RIE_DEMENTIA) );   
    form.getContextMenus().Clinical.getDementiaWorklistMenuCORRECT_CCOMPLETION_DATE_STEP1Item().setVisible(selectedRowValue != null 
            && voDementia.getStepOneFindIsNotNull());
    form.getContextMenus().Clinical.getDementiaWorklistMenuCORRECT_CCOMPLETION_DATE_STEP2Item().setVisible(selectedRowValue != null 
            && voDementia.getStepOneFindIsNotNull() && voDementia.getStepTwoAssessIsNotNull());


}
项目:openmaxims-linux    文件:Logic.java   
private DementiaFindVo populateDataFromScreen(DementiaFindVo dementiaFindVo)
{
    dementiaFindVo.getAuthoringInformation().setAuthoringDateTime(form.dtimCorrected().getValue());

    return dementiaFindVo;
}