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

项目:openMAXIMS    文件:DementiaAssessmentFormImpl.java   
public DementiaVo getDementiaForPatient(PatientRefVo patient)
{
    if (patient == null || patient.getID_Patient() == null)
        return null;

    String query = "SELECT dem FROM Dementia AS dem LEFT JOIN dem.patient AS pat LEFT JOIN dem.currentWorklistStatus AS curStatus LEFT JOIN curStatus.status AS status WHERE pat.id = :PAT_ID AND (dem.isRIE is null OR dem.isRIE = 0) AND status.id <> :EXCLUDED";

    ArrayList<String> paramNames = new ArrayList<String>();
    ArrayList<Object> paramValues = new ArrayList<Object>();

    paramNames.add("PAT_ID");
    paramValues.add(patient.getID_Patient());

    paramNames.add("EXCLUDED");
    paramValues.add(DementiaWorklistStatus.EXCLUDED.getID());

    return DementiaVoAssembler.create((Dementia) getDomainFactory().findFirst(query, paramNames, paramValues));
}
项目:AvoinApotti    文件:Logic.java   
private DementiaWorklistStatusVo populateStatus(DementiaWorklistStatus status, AuthoringInformationVo authoringInfo)
{
    DementiaWorklistStatusVo statusRecord = new DementiaWorklistStatusVo();

    statusRecord.setStatus(status);
    statusRecord.setAuthoringInformation(authoringInfo);

    return statusRecord;
}
项目:AvoinApotti    文件:Logic.java   
protected void onCcAMTSValueChanged() throws PresentationLogicException
{
    if (DementiaEventEnumeration.SAVE.equals(form.lyrSteps().tabPageStep2().ccAMTS().getSelectedEvent()) 
        || DementiaEventEnumeration.CANCEL.equals(form.lyrSteps().tabPageStep2().ccAMTS().getSelectedEvent()))
    {
        form.lyrSteps().tabPageStep2().ccAMTS().resetSelectedEvent();
        form.getLocalContext().setselectedDementia(form.lyrSteps().tabPageStep2().ccAMTS().getValue());
        open();
        //in here needed to cater for situation that amts was shown and cancel is pressed.....the tab gets hidden and you have to reopen the dialog
        form.lyrSteps().tabPageStep2().setHeaderVisible( form.getLocalContext().getselectedDementia().getStepTwoAssessIsNotNull()
            ||  (form.getLocalContext().getselectedDementia().getCurrentWorklistStatusIsNotNull() 
                && DementiaWorklistStatus.STEP_TWO_ASSESS_INVESTIGATE_OUTSTANDING.equals(form.getLocalContext().getselectedDementia().getCurrentWorklistStatus().getStatus())));
        form.lyrSteps().showtabPageStep2();
        return;
    }
    else if (DementiaEventEnumeration.EDIT.equals(form.lyrSteps().tabPageStep2().ccAMTS().getSelectedEvent()))
    {
        form.lyrSteps().tabPageStep2().ccAMTS().resetSelectedEvent();
        form.setMode(FormMode.EDIT);
    }
    else if (DementiaEventEnumeration.CLOSE.equals(form.lyrSteps().tabPageStep2().ccAMTS().getSelectedEvent()))
    {
        form.lyrSteps().tabPageStep2().ccAMTS().resetSelectedEvent();
        engine.close(DialogResult.CANCEL);
    }
    else if (DementiaEventEnumeration.SOE.equals(form.lyrSteps().tabPageStep2().ccAMTS().getSelectedEvent()))
    {
        form.lyrSteps().tabPageStep2().ccAMTS().resetSelectedEvent(); // WDEV-16372 
        open();
    }
    else if (DementiaEventEnumeration.MARK_RIE.equals(form.lyrSteps().tabPageStep2().ccAMTS().getSelectedEvent()))
    {
        form.lyrSteps().tabPageStep2().ccAMTS().resetSelectedEvent();
        doRIE();
    }
}
项目:AvoinApotti    文件:Logic.java   
public int compare(Object ob1, Object ob2) 
{
    Integer hoursToBreach1 = null;
    Integer hoursToBreach2 = null;
    if (ob1 instanceof DementialManualClassAssemblyVo)
    {
        DementialManualClassAssemblyVo dem1=(DementialManualClassAssemblyVo)ob1;
        if (dem1.getDischargeDateTime()==null && dem1.getCurrentStatusIsNotNull() && DementiaWorklistStatus.STEP_ONE_FIND_OUTSTANDING.equals(dem1.getCurrentStatus()) && dem1.getBreachDateTimeIsNotNull())
        {
            hoursToBreach1 = calculateDateDiffInMinutes(new DateTime(), dem1.getBreachDateTime())/60;
        }
        else
        {
            //hoursToBreach1=Integer.MIN_VALUE;
            hoursToBreach1=null;
        }
    }
    if (ob2 instanceof DementialManualClassAssemblyVo)
    {
        DementialManualClassAssemblyVo dem2=(DementialManualClassAssemblyVo)ob2;
        if (dem2.getDischargeDateTime()==null && dem2.getCurrentStatusIsNotNull() && DementiaWorklistStatus.STEP_ONE_FIND_OUTSTANDING.equals(dem2.getCurrentStatus()) && dem2.getBreachDateTimeIsNotNull())
        {
            hoursToBreach2 = calculateDateDiffInMinutes(new DateTime(), dem2.getBreachDateTime())/60;
        }
        else
        {
            //hoursToBreach2=Integer.MIN_VALUE;
            hoursToBreach2=null;
        }

    }
    if(hoursToBreach1 != null && hoursToBreach2 != null)
        return  hoursToBreach1.compareTo(hoursToBreach2)*direction;
    if(hoursToBreach1 == null && hoursToBreach2!=null)
        return 1;
    if (hoursToBreach2==null && hoursToBreach1 != null)
        return -1;

    return 0;
}
项目:openMAXIMS    文件:ContextEvalProvider.java   
private String buildDementiaTooltip(DementiaWorklistStatus dementiaWorklistStatus, DateTime dementiaBreachDateTime)
{
    StringBuilder tooltip = new StringBuilder();
    tooltip.append("<b>Dementia Status:</b> ").append(dementiaWorklistStatus.getText());

    if (dementiaBreachDateTime != null)
        tooltip.append("<br><b>Breach date time:</b> ").append(dementiaBreachDateTime.toString(DateTimeFormat.STANDARD));

    return tooltip.toString();
}
项目:openMAXIMS    文件:Logic.java   
private DementiaWorklistStatusVo populateStatus(DementiaWorklistStatus status, AuthoringInformationVo authoringInfo)
{
    DementiaWorklistStatusVo statusRecord = new DementiaWorklistStatusVo();

    statusRecord.setStatus(status);
    statusRecord.setAuthoringInformation(authoringInfo);

    return statusRecord;
}
项目:openMAXIMS    文件:Logic.java   
public int compare(Object ob1, Object ob2) 
{
    Integer hoursToBreach1 = null;
    Integer hoursToBreach2 = null;
    if (ob1 instanceof DementialManualClassAssemblyVo)
    {
        DementialManualClassAssemblyVo dem1=(DementialManualClassAssemblyVo)ob1;
        if (dem1.getDischargeDateTime()==null && dem1.getCurrentStatusIsNotNull() && DementiaWorklistStatus.STEP_ONE_FIND_OUTSTANDING.equals(dem1.getCurrentStatus()) && dem1.getBreachDateTimeIsNotNull())
        {
            hoursToBreach1 = calculateDateDiffInMinutes(new DateTime(), dem1.getBreachDateTime())/60;
        }
        else
        {
            //hoursToBreach1=Integer.MIN_VALUE;
            hoursToBreach1=null;
        }
    }
    if (ob2 instanceof DementialManualClassAssemblyVo)
    {
        DementialManualClassAssemblyVo dem2=(DementialManualClassAssemblyVo)ob2;
        if (dem2.getDischargeDateTime()==null && dem2.getCurrentStatusIsNotNull() && DementiaWorklistStatus.STEP_ONE_FIND_OUTSTANDING.equals(dem2.getCurrentStatus()) && dem2.getBreachDateTimeIsNotNull())
        {
            hoursToBreach2 = calculateDateDiffInMinutes(new DateTime(), dem2.getBreachDateTime())/60;
        }
        else
        {
            //hoursToBreach2=Integer.MIN_VALUE;
            hoursToBreach2=null;
        }

    }
    if(hoursToBreach1 != null && hoursToBreach2 != null)
        return  hoursToBreach1.compareTo(hoursToBreach2)*direction;
    if(hoursToBreach1 == null && hoursToBreach2!=null)
        return 1;
    if (hoursToBreach2==null && hoursToBreach1 != null)
        return -1;

    return 0;
}
项目:openMAXIMS    文件:Logic.java   
private DementiaWorklistStatusVo populateStatus(DementiaWorklistStatus status, AuthoringInformationVo authoringInfo)
{
    DementiaWorklistStatusVo statusRecord = new DementiaWorklistStatusVo();

    statusRecord.setStatus(status);
    statusRecord.setAuthoringInformation(authoringInfo);

    return statusRecord;
}
项目:openMAXIMS    文件:Logic.java   
protected void onCcAMTSValueChanged() throws PresentationLogicException
{
    if (DementiaEventEnumeration.SAVE.equals(form.lyrSteps().tabPageStep2().ccAMTS().getSelectedEvent()) 
        || DementiaEventEnumeration.CANCEL.equals(form.lyrSteps().tabPageStep2().ccAMTS().getSelectedEvent()))
    {
        form.lyrSteps().tabPageStep2().ccAMTS().resetSelectedEvent();
        form.getLocalContext().setselectedDementia(form.lyrSteps().tabPageStep2().ccAMTS().getValue());
        open();
        //in here needed to cater for situation that amts was shown and cancel is pressed.....the tab gets hidden and you have to reopen the dialog
        form.lyrSteps().tabPageStep2().setHeaderVisible( form.getLocalContext().getselectedDementia().getStepTwoAssessIsNotNull()
            ||  (form.getLocalContext().getselectedDementia().getCurrentWorklistStatusIsNotNull() 
                && DementiaWorklistStatus.STEP_TWO_ASSESS_INVESTIGATE_OUTSTANDING.equals(form.getLocalContext().getselectedDementia().getCurrentWorklistStatus().getStatus())));
        form.lyrSteps().showtabPageStep2();
        return;
    }
    else if (DementiaEventEnumeration.EDIT.equals(form.lyrSteps().tabPageStep2().ccAMTS().getSelectedEvent()))
    {
        form.lyrSteps().tabPageStep2().ccAMTS().resetSelectedEvent();
        form.setMode(FormMode.EDIT);
    }
    else if (DementiaEventEnumeration.CLOSE.equals(form.lyrSteps().tabPageStep2().ccAMTS().getSelectedEvent()))
    {
        form.lyrSteps().tabPageStep2().ccAMTS().resetSelectedEvent();
        engine.close(DialogResult.CANCEL);
    }
    else if (DementiaEventEnumeration.SOE.equals(form.lyrSteps().tabPageStep2().ccAMTS().getSelectedEvent()))
    {
        form.lyrSteps().tabPageStep2().ccAMTS().resetSelectedEvent(); // WDEV-16372 
        open();
    }
    else if (DementiaEventEnumeration.MARK_RIE.equals(form.lyrSteps().tabPageStep2().ccAMTS().getSelectedEvent()))
    {
        form.lyrSteps().tabPageStep2().ccAMTS().resetSelectedEvent();
        doRIE();
    }
}
项目:openMAXIMS    文件:Logic.java   
public int compare(Object ob1, Object ob2) 
{
    Integer hoursToBreach1 = null;
    Integer hoursToBreach2 = null;
    if (ob1 instanceof DementialManualClassAssemblyVo)
    {
        DementialManualClassAssemblyVo dem1=(DementialManualClassAssemblyVo)ob1;
        if (dem1.getDischargeDateTime()==null && dem1.getCurrentStatusIsNotNull() && DementiaWorklistStatus.STEP_ONE_FIND_OUTSTANDING.equals(dem1.getCurrentStatus()) && dem1.getBreachDateTimeIsNotNull())
        {
            hoursToBreach1 = calculateDateDiffInMinutes(new DateTime(), dem1.getBreachDateTime())/60;
        }
        else
        {
            //hoursToBreach1=Integer.MIN_VALUE;
            hoursToBreach1=null;
        }
    }
    if (ob2 instanceof DementialManualClassAssemblyVo)
    {
        DementialManualClassAssemblyVo dem2=(DementialManualClassAssemblyVo)ob2;
        if (dem2.getDischargeDateTime()==null && dem2.getCurrentStatusIsNotNull() && DementiaWorklistStatus.STEP_ONE_FIND_OUTSTANDING.equals(dem2.getCurrentStatus()) && dem2.getBreachDateTimeIsNotNull())
        {
            hoursToBreach2 = calculateDateDiffInMinutes(new DateTime(), dem2.getBreachDateTime())/60;
        }
        else
        {
            //hoursToBreach2=Integer.MIN_VALUE;
            hoursToBreach2=null;
        }

    }
    if(hoursToBreach1 != null && hoursToBreach2 != null)
        return  hoursToBreach1.compareTo(hoursToBreach2)*direction;
    if(hoursToBreach1 == null && hoursToBreach2!=null)
        return 1;
    if (hoursToBreach2==null && hoursToBreach1 != null)
        return -1;

    return 0;
}
项目:openmaxims-linux    文件:Logic.java   
private DementiaWorklistStatusVo populateStatus(DementiaWorklistStatus status, AuthoringInformationVo authoringInfo)
{
    DementiaWorklistStatusVo statusRecord = new DementiaWorklistStatusVo();

    statusRecord.setStatus(status);
    statusRecord.setAuthoringInformation(authoringInfo);

    return statusRecord;
}
项目:openmaxims-linux    文件:Logic.java   
protected void onCcAMTSValueChanged() throws PresentationLogicException
{
    if (DementiaEventEnumeration.SAVE.equals(form.lyrSteps().tabPageStep2().ccAMTS().getSelectedEvent()) 
        || DementiaEventEnumeration.CANCEL.equals(form.lyrSteps().tabPageStep2().ccAMTS().getSelectedEvent()))
    {
        form.lyrSteps().tabPageStep2().ccAMTS().resetSelectedEvent();
        form.getLocalContext().setselectedDementia(form.lyrSteps().tabPageStep2().ccAMTS().getValue());
        open();
        //in here needed to cater for situation that amts was shown and cancel is pressed.....the tab gets hidden and you have to reopen the dialog
        form.lyrSteps().tabPageStep2().setHeaderVisible( form.getLocalContext().getselectedDementia().getStepTwoAssessIsNotNull()
            ||  (form.getLocalContext().getselectedDementia().getCurrentWorklistStatusIsNotNull() 
                && DementiaWorklistStatus.STEP_TWO_ASSESS_INVESTIGATE_OUTSTANDING.equals(form.getLocalContext().getselectedDementia().getCurrentWorklistStatus().getStatus())));
        form.lyrSteps().showtabPageStep2();
        return;
    }
    else if (DementiaEventEnumeration.EDIT.equals(form.lyrSteps().tabPageStep2().ccAMTS().getSelectedEvent()))
    {
        form.lyrSteps().tabPageStep2().ccAMTS().resetSelectedEvent();
        form.setMode(FormMode.EDIT);
    }
    else if (DementiaEventEnumeration.CLOSE.equals(form.lyrSteps().tabPageStep2().ccAMTS().getSelectedEvent()))
    {
        form.lyrSteps().tabPageStep2().ccAMTS().resetSelectedEvent();
        engine.close(DialogResult.CANCEL);
    }
    else if (DementiaEventEnumeration.SOE.equals(form.lyrSteps().tabPageStep2().ccAMTS().getSelectedEvent()))
    {
        form.lyrSteps().tabPageStep2().ccAMTS().resetSelectedEvent(); // WDEV-16372 
        open();
    }
    else if (DementiaEventEnumeration.MARK_RIE.equals(form.lyrSteps().tabPageStep2().ccAMTS().getSelectedEvent()))
    {
        form.lyrSteps().tabPageStep2().ccAMTS().resetSelectedEvent();
        doRIE();
    }
}
项目:openmaxims-linux    文件:Logic.java   
public int compare(Object ob1, Object ob2) 
{
    Integer hoursToBreach1 = null;
    Integer hoursToBreach2 = null;
    if (ob1 instanceof DementialManualClassAssemblyVo)
    {
        DementialManualClassAssemblyVo dem1=(DementialManualClassAssemblyVo)ob1;
        if (dem1.getDischargeDateTime()==null && dem1.getCurrentStatusIsNotNull() && DementiaWorklistStatus.STEP_ONE_FIND_OUTSTANDING.equals(dem1.getCurrentStatus()) && dem1.getBreachDateTimeIsNotNull())
        {
            hoursToBreach1 = calculateDateDiffInMinutes(new DateTime(), dem1.getBreachDateTime())/60;
        }
        else
        {
            //hoursToBreach1=Integer.MIN_VALUE;
            hoursToBreach1=null;
        }
    }
    if (ob2 instanceof DementialManualClassAssemblyVo)
    {
        DementialManualClassAssemblyVo dem2=(DementialManualClassAssemblyVo)ob2;
        if (dem2.getDischargeDateTime()==null && dem2.getCurrentStatusIsNotNull() && DementiaWorklistStatus.STEP_ONE_FIND_OUTSTANDING.equals(dem2.getCurrentStatus()) && dem2.getBreachDateTimeIsNotNull())
        {
            hoursToBreach2 = calculateDateDiffInMinutes(new DateTime(), dem2.getBreachDateTime())/60;
        }
        else
        {
            //hoursToBreach2=Integer.MIN_VALUE;
            hoursToBreach2=null;
        }

    }
    if(hoursToBreach1 != null && hoursToBreach2 != null)
        return  hoursToBreach1.compareTo(hoursToBreach2)*direction;
    if(hoursToBreach1 == null && hoursToBreach2!=null)
        return 1;
    if (hoursToBreach2==null && hoursToBreach1 != null)
        return -1;

    return 0;
}
项目: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   
protected void onCcStep1FindValueChanged() throws PresentationLogicException
    {
        if (DementiaEventEnumeration.SAVE.equals(form.lyrSteps().tabPageStep1().ccStep1Find().getSelectedEvent()))
        {
            form.getLocalContext().setselectedDementia(form.lyrSteps().tabPageStep1().ccStep1Find().getValue());
            if (form.getLocalContext().getselectedDementia().getCurrentWorklistStatusIsNotNull() 
                && DementiaWorklistStatus.STEP_TWO_ASSESS_INVESTIGATE_OUTSTANDING.equals(form.getLocalContext().getselectedDementia().getCurrentWorklistStatus().getStatus()))
            {
                form.lyrSteps().tabPageStep1().ccStep1Find().resetSelectedEvent();
                if (form.getLocalContext().getselectedDementia().getStepTwoAssessIsNotNull())
                {
                    open();
                }
                else
                {
                    form.lyrSteps().tabPageStep1().ccStep1Find().initialize(form.getLocalContext().getselectedDementia(), FormMode.VIEW, engine.isDialog());
                    form.lyrSteps().showtabPageStep2();
                    form.lyrSteps().tabPageStep2().setHeaderVisible(true);
                    form.lyrSteps().tabPageStep2().ccAMTS().initialize(form.getLocalContext().getselectedDementia(), FormMode.EDIT, null);
                    form.setMode(form.lyrSteps().tabPageStep2().ccAMTS().getMode());
                }
            }
            else if (form.getLocalContext().getselectedDementia().getStepTwoAssessIsNotNull() || form.lyrSteps().tabPageFollowUp().isHeaderVisible())
            {
                form.lyrSteps().tabPageStep1().ccStep1Find().resetSelectedEvent();
                open();
            }
            else    
            {
                form.lyrSteps().tabPageStep1().ccStep1Find().resetSelectedEvent();
                engine.close(DialogResult.CANCEL);
            }
        }
        else if (DementiaEventEnumeration.CLOSE.equals(form.lyrSteps().tabPageStep1().ccStep1Find().getSelectedEvent()))
        {
            form.lyrSteps().tabPageStep1().ccStep1Find().resetSelectedEvent();
            engine.close(DialogResult.CANCEL);
        }
        else if (DementiaEventEnumeration.NEW.equals(form.lyrSteps().tabPageStep1().ccStep1Find().getSelectedEvent()))
        {
            form.lyrSteps().tabPageStep1().ccStep1Find().resetSelectedEvent();
//          FormMode step1Mode = form.lyrSteps().tabPageStep1().ccStep1Find().getMode();
//          form.setMode(step1Mode);
            form.setMode(FormMode.EDIT);
        }
        else if (DementiaEventEnumeration.MARK_RIE.equals(form.lyrSteps().tabPageStep1().ccStep1Find().getSelectedEvent()))
        {
            form.lyrSteps().tabPageStep1().ccStep1Find().resetSelectedEvent();
            doRIE();
        }
        //SOE
        else if (DementiaEventEnumeration.CANCEL.equals(form.lyrSteps().tabPageStep1().ccStep1Find().getSelectedEvent()) 
            || DementiaEventEnumeration.SOE.equals(form.lyrSteps().tabPageStep1().ccStep1Find().getSelectedEvent()))
        {
            open();
        }

    }
项目: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 boolean manageDialog()
{
    PatientDiagnosisEDischargeListVoCollection listComor = domain.listComorbidity(form.getGlobalContext().Core.getEpisodeofCareShort());
    PatientDiagnosisEDischargeListVoCollection listComp = domain.listComplications(form.getGlobalContext().Core.getEpisodeofCareShort());

    StringBuffer sb = new StringBuffer();

    if ( (listComor.size() == 0 && ! form.chkNoComorbidities().getValue())
        || (listComp.size() == 0 && ! form.chkNoComplications().getValue())) 
    {
        sb.append("No ");

        if (listComor.size() == 0 && ! form.chkNoComorbidities().getValue())
        {
            sb.append("Co-Morbidites");
        }

        if (listComor.size() == 0 && ! form.chkNoComorbidities().getValue()
            && listComp.size() == 0 && ! form.chkNoComplications().getValue() )
            sb.append(" or Complications");
        else if (listComp.size() == 0 && ! form.chkNoComplications().getValue() )
            sb.append("Complications");

        sb.append(" recorded for this Patient's episode.");
    }

    if (form.lblTTARequired().getValue().equals("Not Specified"))
        sb.append("\n\n No TTA Required information recorded.");

    StringBuffer sbDementiaWarning = new StringBuffer();
    if(form.getLocalContext().getDementiaStatusIsNotNull()
        && form.getLocalContext().getDementiaStatus().getCurrentWorklistStatusIsNotNull())//wdev-16251
    {
        if ( !form.getLocalContext().getDementiaStatus().getCurrentWorklistStatus().getStatus().equals(DementiaWorklistStatus.COMPLETED)
            && !form.getLocalContext().getDementiaStatus().getCurrentWorklistStatus().getStatus().equals(DementiaWorklistStatus.FOR_REFERRAL)
            && !form.getLocalContext().getDementiaStatus().getCurrentWorklistStatus().getStatus().equals(DementiaWorklistStatus.EXCLUDED)
            && ! ConfigFlag.GEN.DEMENTIA_ALLOW_SAVE_EDISCHARGE_DISCHARGEDETAILS.getValue())
        {

            if( form.getLocalContext().getDementiaStatus().getDischargeDateTime() == null)
                sb.append("\n\nDementia FAIR process is not completed. Please complete the Dementia record so eDischarge can be completed.");
            else
                sbDementiaWarning.append("Dementia FAIR process is not completed, however eDischarge will still be saved as there is a Discharge date on the Dementia record.");
        }
    }
    if (sb.length() > 0)
    {
//      form.htmPreview().setVisible(false);
        engine.showMessage(sb.toString());
        return false;
    }
    else if (sbDementiaWarning.length() > 0)
    {
//      form.htmPreview().setVisible(false);        
        engine.showMessage(sbDementiaWarning.toString());
        return true;
    }

    return true;
}
项目:AvoinApotti    文件:DementiaAssessmentFormImpl.java   
public DementiaVo rieAMTSRecord(DementiaVo voDementia, FormName formName, Integer patientId, Integer contactId, Integer careContextId, String rieMessage) throws DomainInterfaceException, StaleObjectException
{
    //RIE AMTS and its Comment 
    if (voDementia.getStepTwoAssessIsNotNull())
    {
        if (voDementia.getStepTwoAssess().getStepTwoAssessNoteIsNotNull())
            markAsRie(voDementia.getStepTwoAssess().getStepTwoAssessNote(), formName, patientId, contactId, careContextId, rieMessage);

        markAsRie(voDementia.getStepTwoAssess(), formName, patientId, contactId, careContextId, rieMessage);
    }

    //RIE the AMTS record
    if (voDementia.getStepOneFindIsNotNull())
        markAsRie(voDementia.getStepOneFind(), formName, patientId, contactId, careContextId, rieMessage);

    //also need to update dementia with NULL for the AMTSStep2record / replace currentstatus record with one from history / remove most recent history record and NULL AMTS score
    voDementia.setStepOneFind(null);
    voDementia.setStepTwoAssess(null);

    for (int i = 0 ; i< voDementia.getHistoricalWorklistStatus().size() ; i++)
    {
        if (voDementia.getHistoricalWorklistStatus().get(i).getStatusIsNotNull()
            && voDementia.getHistoricalWorklistStatus().get(i).getStatus().equals(DementiaWorklistStatus.STEP_ONE_FIND_OUTSTANDING))
            voDementia.setCurrentWorklistStatus(voDementia.getHistoricalWorklistStatus().get(i));
//      else
//          markAsRie(voDementia.getHistoricalWorklistStatus().get(i), formName, patientId, contactId, careContextId, rieMessage);
    }


    voDementia.setAMTSScore(null);
    voDementia.setDeliriumConfirmed(null);
    voDementia.setDementiaConfirmed(null);
    voDementia.setConfirmedPatientPutOnDementiaPathway(null);
    voDementia.setIsExcludedFromWorklist(null);

    String[] arrErrors = voDementia.validate();
    if( arrErrors != null)
        throw new DomainRuntimeException("Error saving voDementia - not validated correctly");

    DomainFactory factory = getDomainFactory();

    Dementia domainDementia = DementiaVoAssembler.extractDementia(factory, voDementia);
    factory.save(domainDementia);
    return DementiaVoAssembler.create(domainDementia);
}
项目:openMAXIMS    文件:ContextEvalProvider.java   
public void setPatientInfoAndIcons(ValueObjectRef refVo)
{
    SessionData sessData = getSessionData();
    ims.core.vo.Patient voPat = null;

    if (refVo != null)
    {
        Demographics demog = (Demographics)getDomainImpl(DemographicsImpl.class);
        voPat = demog.getPatient((PatientRefVo)refVo);          
    }

    //restrictPatientAccess is set only by web service
    boolean restrictPatient = Boolean.valueOf(sessData.restrictPatientAccess.get());
    if (voPat != null && restrictPatient)
    {
        Integer patientId = sessData.restrictPatientId.get();
        if (patientId > 0)
        {
            if (Boolean.FALSE.equals(patientId.equals(voPat.getID_Patient())))
            {                       
                throw new DomainRuntimeException("Patient Context cannot be changed!!");                    
            }
        }
    }   

    sessData.clearAlertsByType(PatientInfo.class);
    sessData.clearAlertsByType(PatientAlert.class);
    sessData.clearAlertsByType(PatientAllergy.class);
    sessData.clearAlertsByType(PatientDementiaStatus.class);

    //Update status for TopButtons Patient Context dependent
    updateTopButtonsStatus(sessData, voPat == null ? true: false);

    if (voPat == null)
    {
        sessData.patientInfo.set(null);         
    }
    else
    {                       
        sessData.patientId.set(voPat.getID_Patient());
        sessData.patientInfo.set(voPat.getPatientInfo());
        sessData.patientInfoTextColor.set("");
        if (voPat.getIsDead() != null && voPat.getIsDead().booleanValue())
        {
            sessData.patientInfoTextColor.set(ConfigFlag.UI.RIP_INFO_COLOUR.getValue().toString());
        }

        // Replaced code removede in version 12 of this file with code in Version 11 - WDEV-3595
        sessData.addAlert(new PatientInfo(voPat.getPatientInfoButtonText()));

        if (voPat.getHasAlerts() != null && voPat.getHasAlerts().booleanValue() && hasAlertsForViewOrEdit(voPat))
            sessData.addAlert(new PatientAlert("The patient has alerts."));
        if (voPat.getHasAllergies() != null && voPat.getHasAllergies().booleanValue())
            sessData.addAlert(new PatientAllergy("The patient has allergies."));

        if (voPat.getDementiaWorklistStatus() != null 
                && (DementiaWorklistStatus.STEP_ONE_FIND_OUTSTANDING.equals(voPat.getDementiaWorklistStatus())
                        || DementiaWorklistStatus.STEP_TWO_ASSESS_INVESTIGATE_OUTSTANDING.equals(voPat.getDementiaWorklistStatus())))
            sessData.addAlert(new PatientDementiaStatus(buildDementiaTooltip(voPat.getDementiaWorklistStatus(), voPat.getDementiaBreachDateTime())));
    }

    // wdev-2689 If the read audit functionality is switched on, we want to record
    // the fact that this new patient was read
    if (refVo != null)
    {
        recordReadAudit(refVo, "Patient Demographics");
    }
}
项目: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   
@Override
protected void onCcStep1FindValueChanged() throws PresentationLogicException
{
    if (DementiaEventEnumeration.SAVE.equals(form.lyrSteps().tabPageStep1().ccStep1Find().getSelectedEvent()))
    {
        // Reset event for component
        form.lyrSteps().tabPageStep1().ccStep1Find().resetSelectedEvent();

        // Update Dementia record in context
        form.getLocalContext().setselectedDementia(form.lyrSteps().tabPageStep1().ccStep1Find().getValue());
        DementiaVo dementia = form.getLocalContext().getselectedDementia();

        // If Dementia record requires a STEP 2 ASSESSMENT and one is not recorded, present screen to user to record STEP 2 ASSESSMENT
        if ((dementia.getCurrentWorklistStatus() != null
                && DementiaWorklistStatus.STEP_TWO_ASSESS_INVESTIGATE_OUTSTANDING.equals(dementia.getCurrentWorklistStatus().getStatus()))
                || dementia.getStepTwoAssess() != null)
        {
            open(DementiaWorklistOpenFormModeEnum.STEP2_AMTS_EDIT);
        }
        else
        {
            if (engine.isDialog())
                engine.close(DialogResult.CANCEL);
            else
                open(DementiaWorklistOpenFormModeEnum.VIEW);
        }
    }
    else if (DementiaEventEnumeration.CLOSE.equals(form.lyrSteps().tabPageStep1().ccStep1Find().getSelectedEvent()))
    {
        form.lyrSteps().tabPageStep1().ccStep1Find().resetSelectedEvent();

        if (engine.isDialog())
            engine.close(DialogResult.CANCEL);
        else
            open(DementiaWorklistOpenFormModeEnum.VIEW);
    }
    else if (DementiaEventEnumeration.NEW.equals(form.lyrSteps().tabPageStep1().ccStep1Find().getSelectedEvent()))
    {
        form.lyrSteps().tabPageStep1().ccStep1Find().resetSelectedEvent();

        open(DementiaWorklistOpenFormModeEnum.STEP1EDIT);
    }
    else if (DementiaEventEnumeration.MARK_RIE.equals(form.lyrSteps().tabPageStep1().ccStep1Find().getSelectedEvent()))
    {
        form.lyrSteps().tabPageStep1().ccStep1Find().resetSelectedEvent();
        doRIE();
    }
    //SOE
    else if (DementiaEventEnumeration.CANCEL.equals(form.lyrSteps().tabPageStep1().ccStep1Find().getSelectedEvent()) 
        || DementiaEventEnumeration.SOE.equals(form.lyrSteps().tabPageStep1().ccStep1Find().getSelectedEvent()))
    {
        form.lyrSteps().tabPageStep1().ccStep1Find().resetSelectedEvent();
        open(DementiaWorklistOpenFormModeEnum.VIEW);
    }
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onCcAMTSValueChanged() throws PresentationLogicException
{
    if (DementiaEventEnumeration.SAVE.equals(form.lyrSteps().tabPageStep2().ccAMTS().getSelectedEvent()) 
        || DementiaEventEnumeration.CANCEL.equals(form.lyrSteps().tabPageStep2().ccAMTS().getSelectedEvent()))
    {
        // Reset event for component
        form.lyrSteps().tabPageStep2().ccAMTS().resetSelectedEvent();

        // Refresh dementia record
        form.getLocalContext().setselectedDementia(form.lyrSteps().tabPageStep2().ccAMTS().getValue());

        // Determine if STEP 2 was recorded for Dementia record
        boolean stepTwoVisible = form.getLocalContext().getselectedDementia().getStepTwoAssess() != null
                                    && form.getLocalContext().getselectedDementia().getCurrentWorklistStatus() != null
                                    && DementiaWorklistStatus.STEP_TWO_ASSESS_INVESTIGATE_OUTSTANDING.equals(form.getLocalContext().getselectedDementia().getCurrentWorklistStatus().getStatus());

        // If there was a STEP 2 recorded for Dementia record
        open(stepTwoVisible ? DementiaWorklistOpenFormModeEnum.STEP2_AMTS_VIEW : DementiaWorklistOpenFormModeEnum.VIEW);
    }
    else if (DementiaEventEnumeration.EDIT.equals(form.lyrSteps().tabPageStep2().ccAMTS().getSelectedEvent()))
    {
        // Reset event for component
        form.lyrSteps().tabPageStep2().ccAMTS().resetSelectedEvent();

        // Set form to edit STEP 2
        open(DementiaWorklistOpenFormModeEnum.STEP2_AMTS_EDIT);
    }
    else if (DementiaEventEnumeration.CLOSE.equals(form.lyrSteps().tabPageStep2().ccAMTS().getSelectedEvent()))
    {
        // Reset event for component
        form.lyrSteps().tabPageStep2().ccAMTS().resetSelectedEvent();

        if (engine.isDialog())
            engine.close(DialogResult.CANCEL);
        else
            open(DementiaWorklistOpenFormModeEnum.VIEW);
    }
    else if (DementiaEventEnumeration.SOE.equals(form.lyrSteps().tabPageStep2().ccAMTS().getSelectedEvent()))
    {
        // Reset event for component
        form.lyrSteps().tabPageStep2().ccAMTS().resetSelectedEvent();
        // Refresh the form
        open(DementiaWorklistOpenFormModeEnum.VIEW);
    }
    else if (DementiaEventEnumeration.MARK_RIE.equals(form.lyrSteps().tabPageStep2().ccAMTS().getSelectedEvent()))
    {
        // Reset event for component
        form.lyrSteps().tabPageStep2().ccAMTS().resetSelectedEvent();
        doRIE();
    }
}
项目: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    文件:DementiaAssessmentFormImpl.java   
public DementiaVo rieAMTSRecord(DementiaVo voDementia, FormName formName, Integer patientId, Integer contactId, Integer careContextId, String rieMessage) throws DomainInterfaceException, StaleObjectException
{
    //RIE AMTS and its Comment 
    if (voDementia.getStepTwoAssessIsNotNull())
    {
        if (voDementia.getStepTwoAssess().getStepTwoAssessNoteIsNotNull())
            markAsRie(voDementia.getStepTwoAssess().getStepTwoAssessNote(), formName, patientId, contactId, careContextId, rieMessage);

        markAsRie(voDementia.getStepTwoAssess(), formName, patientId, contactId, careContextId, rieMessage);
    }

    //RIE the AMTS record
    if (voDementia.getStepOneFindIsNotNull())
        markAsRie(voDementia.getStepOneFind(), formName, patientId, contactId, careContextId, rieMessage);

    //also need to update dementia with NULL for the AMTSStep2record / replace current status record with one from history / remove most recent history record and NULL AMTS score
    voDementia.setStepOneFind(null);
    voDementia.setStepTwoAssess(null);

    for (int i = 0 ; i< voDementia.getHistoricalWorklistStatus().size() ; i++)
    {
        if (voDementia.getHistoricalWorklistStatus().get(i).getStatusIsNotNull()
            && voDementia.getHistoricalWorklistStatus().get(i).getStatus().equals(DementiaWorklistStatus.STEP_ONE_FIND_OUTSTANDING))
        {
            voDementia.setCurrentWorklistStatus(voDementia.getHistoricalWorklistStatus().get(i));
            voDementia.getPatient().setDementiaWorklistStatus(voDementia.getCurrentWorklistStatus().getStatus());
        }
//      else
//          markAsRie(voDementia.getHistoricalWorklistStatus().get(i), formName, patientId, contactId, careContextId, rieMessage);
    }


    voDementia.setAMTSScore(null);
    voDementia.setDeliriumConfirmed(null);
    voDementia.setDementiaConfirmed(null);
    voDementia.setConfirmedPatientPutOnDementiaPathway(null);
    voDementia.setIsExcludedFromWorklist(null);

    String[] arrErrors = voDementia.validate();
    if( arrErrors != null)
        throw new DomainRuntimeException("Error saving voDementia - not validated correctly");

    DomainFactory factory = getDomainFactory();

    Dementia domainDementia = DementiaVoAssembler.extractDementia(factory, voDementia);
    factory.save(domainDementia);
    return DementiaVoAssembler.create(domainDementia);
}
项目: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   
protected void onCcStep1FindValueChanged() throws PresentationLogicException
    {
        if (DementiaEventEnumeration.SAVE.equals(form.lyrSteps().tabPageStep1().ccStep1Find().getSelectedEvent()))
        {
            form.getLocalContext().setselectedDementia(form.lyrSteps().tabPageStep1().ccStep1Find().getValue());
            if (form.getLocalContext().getselectedDementia().getCurrentWorklistStatusIsNotNull() 
                && DementiaWorklistStatus.STEP_TWO_ASSESS_INVESTIGATE_OUTSTANDING.equals(form.getLocalContext().getselectedDementia().getCurrentWorklistStatus().getStatus()))
            {
                form.lyrSteps().tabPageStep1().ccStep1Find().resetSelectedEvent();
                if (form.getLocalContext().getselectedDementia().getStepTwoAssessIsNotNull())
                {
                    open();
                }
                else
                {
                    form.lyrSteps().tabPageStep1().ccStep1Find().initialize(form.getLocalContext().getselectedDementia(), FormMode.VIEW, engine.isDialog());
                    form.lyrSteps().showtabPageStep2();
                    form.lyrSteps().tabPageStep2().setHeaderVisible(true);
                    form.lyrSteps().tabPageStep2().ccAMTS().initialize(form.getLocalContext().getselectedDementia(), FormMode.EDIT, null);
                    form.setMode(form.lyrSteps().tabPageStep2().ccAMTS().getMode());
                }
            }
            else if (form.getLocalContext().getselectedDementia().getStepTwoAssessIsNotNull() || form.lyrSteps().tabPageFollowUp().isHeaderVisible())
            {
                form.lyrSteps().tabPageStep1().ccStep1Find().resetSelectedEvent();
                open();
            }
            else    
            {
                form.lyrSteps().tabPageStep1().ccStep1Find().resetSelectedEvent();
                engine.close(DialogResult.CANCEL);
            }
        }
        else if (DementiaEventEnumeration.CLOSE.equals(form.lyrSteps().tabPageStep1().ccStep1Find().getSelectedEvent()))
        {
            form.lyrSteps().tabPageStep1().ccStep1Find().resetSelectedEvent();
            engine.close(DialogResult.CANCEL);
        }
        else if (DementiaEventEnumeration.NEW.equals(form.lyrSteps().tabPageStep1().ccStep1Find().getSelectedEvent()))
        {
            form.lyrSteps().tabPageStep1().ccStep1Find().resetSelectedEvent();
//          FormMode step1Mode = form.lyrSteps().tabPageStep1().ccStep1Find().getMode();
//          form.setMode(step1Mode);
            form.setMode(FormMode.EDIT);
        }
        else if (DementiaEventEnumeration.MARK_RIE.equals(form.lyrSteps().tabPageStep1().ccStep1Find().getSelectedEvent()))
        {
            form.lyrSteps().tabPageStep1().ccStep1Find().resetSelectedEvent();
            doRIE();
        }
        //SOE
        else if (DementiaEventEnumeration.CANCEL.equals(form.lyrSteps().tabPageStep1().ccStep1Find().getSelectedEvent()) 
            || DementiaEventEnumeration.SOE.equals(form.lyrSteps().tabPageStep1().ccStep1Find().getSelectedEvent()))
        {
            open();
        }

    }
项目: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 boolean manageDialog()
{
    PatientDiagnosisEDischargeListVoCollection listComor = domain.listComorbidity(form.getGlobalContext().Core.getEpisodeofCareShort());
    PatientDiagnosisEDischargeListVoCollection listComp = domain.listComplications(form.getGlobalContext().Core.getEpisodeofCareShort());

    StringBuffer sb = new StringBuffer();

    if ( (listComor.size() == 0 && ! form.chkNoComorbidities().getValue())
        || (listComp.size() == 0 && ! form.chkNoComplications().getValue())) 
    {
        sb.append("No ");

        if (listComor.size() == 0 && ! form.chkNoComorbidities().getValue())
        {
            sb.append("Co-Morbidites");
        }

        if (listComor.size() == 0 && ! form.chkNoComorbidities().getValue()
            && listComp.size() == 0 && ! form.chkNoComplications().getValue() )
            sb.append(" or Complications");
        else if (listComp.size() == 0 && ! form.chkNoComplications().getValue() )
            sb.append("Complications");

        sb.append(" recorded for this Patient's episode.");
    }

    if (form.lblTTARequired().getValue().equals("Not Specified"))
        sb.append("\n\n No TTA Required information recorded.");

    StringBuffer sbDementiaWarning = new StringBuffer();
    if(form.getLocalContext().getDementiaStatusIsNotNull()
        && form.getLocalContext().getDementiaStatus().getCurrentWorklistStatusIsNotNull())//wdev-16251
    {
        if ( !form.getLocalContext().getDementiaStatus().getCurrentWorklistStatus().getStatus().equals(DementiaWorklistStatus.COMPLETED)
            && !form.getLocalContext().getDementiaStatus().getCurrentWorklistStatus().getStatus().equals(DementiaWorklistStatus.FOR_REFERRAL)
            && !form.getLocalContext().getDementiaStatus().getCurrentWorklistStatus().getStatus().equals(DementiaWorklistStatus.EXCLUDED)
            && ! ConfigFlag.GEN.DEMENTIA_ALLOW_SAVE_EDISCHARGE_DISCHARGEDETAILS.getValue())
        {

            if( form.getLocalContext().getDementiaStatus().getDischargeDateTime() == null)
                sb.append("\n\nDementia FAIR process is not completed. Please complete the Dementia record so eDischarge can be completed.");
            else
                sbDementiaWarning.append("Dementia FAIR process is not completed, however eDischarge will still be saved as there is a Discharge date on the Dementia record.");
        }
    }
    if (sb.length() > 0)
    {
//      form.htmPreview().setVisible(false);
        engine.showMessage(sb.toString());
        return false;
    }
    else if (sbDementiaWarning.length() > 0)
    {
//      form.htmPreview().setVisible(false);        
        engine.showMessage(sbDementiaWarning.toString());
        return true;
    }

    return true;
}
项目:openMAXIMS    文件:DementiaAssessmentFormImpl.java   
public DementiaVo rieAMTSRecord(DementiaVo voDementia, FormName formName, Integer patientId, Integer contactId, Integer careContextId, String rieMessage) throws DomainInterfaceException, StaleObjectException
{
    //RIE AMTS and its Comment 
    if (voDementia.getStepTwoAssessIsNotNull())
    {
        if (voDementia.getStepTwoAssess().getStepTwoAssessNoteIsNotNull())
            markAsRie(voDementia.getStepTwoAssess().getStepTwoAssessNote(), formName, patientId, contactId, careContextId, rieMessage);

        markAsRie(voDementia.getStepTwoAssess(), formName, patientId, contactId, careContextId, rieMessage);
    }

    //RIE the AMTS record
    if (voDementia.getStepOneFindIsNotNull())
        markAsRie(voDementia.getStepOneFind(), formName, patientId, contactId, careContextId, rieMessage);

    //also need to update dementia with NULL for the AMTSStep2record / replace currentstatus record with one from history / remove most recent history record and NULL AMTS score
    voDementia.setStepOneFind(null);
    voDementia.setStepTwoAssess(null);

    for (int i = 0 ; i< voDementia.getHistoricalWorklistStatus().size() ; i++)
    {
        if (voDementia.getHistoricalWorklistStatus().get(i).getStatusIsNotNull()
            && voDementia.getHistoricalWorklistStatus().get(i).getStatus().equals(DementiaWorklistStatus.STEP_ONE_FIND_OUTSTANDING))
            voDementia.setCurrentWorklistStatus(voDementia.getHistoricalWorklistStatus().get(i));
//      else
//          markAsRie(voDementia.getHistoricalWorklistStatus().get(i), formName, patientId, contactId, careContextId, rieMessage);
    }


    voDementia.setAMTSScore(null);
    voDementia.setDeliriumConfirmed(null);
    voDementia.setDementiaConfirmed(null);
    voDementia.setConfirmedPatientPutOnDementiaPathway(null);
    voDementia.setIsExcludedFromWorklist(null);

    String[] arrErrors = voDementia.validate();
    if( arrErrors != null)
        throw new DomainRuntimeException("Error saving voDementia - not validated correctly");

    DomainFactory factory = getDomainFactory();

    Dementia domainDementia = DementiaVoAssembler.extractDementia(factory, voDementia);
    factory.save(domainDementia);
    return DementiaVoAssembler.create(domainDementia);
}
项目: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   
protected void onCcStep1FindValueChanged() throws PresentationLogicException
    {
        if (DementiaEventEnumeration.SAVE.equals(form.lyrSteps().tabPageStep1().ccStep1Find().getSelectedEvent()))
        {
            form.getLocalContext().setselectedDementia(form.lyrSteps().tabPageStep1().ccStep1Find().getValue());
            if (form.getLocalContext().getselectedDementia().getCurrentWorklistStatusIsNotNull() 
                && DementiaWorklistStatus.STEP_TWO_ASSESS_INVESTIGATE_OUTSTANDING.equals(form.getLocalContext().getselectedDementia().getCurrentWorklistStatus().getStatus()))
            {
                form.lyrSteps().tabPageStep1().ccStep1Find().resetSelectedEvent();
                if (form.getLocalContext().getselectedDementia().getStepTwoAssessIsNotNull())
                {
                    open();
                }
                else
                {
                    form.lyrSteps().tabPageStep1().ccStep1Find().initialize(form.getLocalContext().getselectedDementia(), FormMode.VIEW, engine.isDialog());
                    form.lyrSteps().showtabPageStep2();
                    form.lyrSteps().tabPageStep2().setHeaderVisible(true);
                    form.lyrSteps().tabPageStep2().ccAMTS().initialize(form.getLocalContext().getselectedDementia(), FormMode.EDIT, null);
                    form.setMode(form.lyrSteps().tabPageStep2().ccAMTS().getMode());
                }
            }
            else if (form.getLocalContext().getselectedDementia().getStepTwoAssessIsNotNull() || form.lyrSteps().tabPageFollowUp().isHeaderVisible())
            {
                form.lyrSteps().tabPageStep1().ccStep1Find().resetSelectedEvent();
                open();
            }
            else    
            {
                form.lyrSteps().tabPageStep1().ccStep1Find().resetSelectedEvent();
                engine.close(DialogResult.CANCEL);
            }
        }
        else if (DementiaEventEnumeration.CLOSE.equals(form.lyrSteps().tabPageStep1().ccStep1Find().getSelectedEvent()))
        {
            form.lyrSteps().tabPageStep1().ccStep1Find().resetSelectedEvent();
            engine.close(DialogResult.CANCEL);
        }
        else if (DementiaEventEnumeration.NEW.equals(form.lyrSteps().tabPageStep1().ccStep1Find().getSelectedEvent()))
        {
            form.lyrSteps().tabPageStep1().ccStep1Find().resetSelectedEvent();
//          FormMode step1Mode = form.lyrSteps().tabPageStep1().ccStep1Find().getMode();
//          form.setMode(step1Mode);
            form.setMode(FormMode.EDIT);
        }
        else if (DementiaEventEnumeration.MARK_RIE.equals(form.lyrSteps().tabPageStep1().ccStep1Find().getSelectedEvent()))
        {
            form.lyrSteps().tabPageStep1().ccStep1Find().resetSelectedEvent();
            doRIE();
        }
        //SOE
        else if (DementiaEventEnumeration.CANCEL.equals(form.lyrSteps().tabPageStep1().ccStep1Find().getSelectedEvent()) 
            || DementiaEventEnumeration.SOE.equals(form.lyrSteps().tabPageStep1().ccStep1Find().getSelectedEvent()))
        {
            open();
        }

    }
项目: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 boolean manageDialog()
{
    PatientDiagnosisEDischargeListVoCollection listComor = domain.listComorbidity(form.getGlobalContext().Core.getEpisodeofCareShort());
    PatientDiagnosisEDischargeListVoCollection listComp = domain.listComplications(form.getGlobalContext().Core.getEpisodeofCareShort());

    StringBuffer sb = new StringBuffer();

    if ( (listComor.size() == 0 && ! form.chkNoComorbidities().getValue())
        || (listComp.size() == 0 && ! form.chkNoComplications().getValue())) 
    {
        sb.append("No ");

        if (listComor.size() == 0 && ! form.chkNoComorbidities().getValue())
        {
            sb.append("Co-Morbidites");
        }

        if (listComor.size() == 0 && ! form.chkNoComorbidities().getValue()
            && listComp.size() == 0 && ! form.chkNoComplications().getValue() )
            sb.append(" or Complications");
        else if (listComp.size() == 0 && ! form.chkNoComplications().getValue() )
            sb.append("Complications");

        sb.append(" recorded for this Patient's episode.");
    }

    if (form.lblTTARequired().getValue().equals("Not Specified"))
        sb.append("\n\n No TTA Required information recorded.");

    StringBuffer sbDementiaWarning = new StringBuffer();
    if(form.getLocalContext().getDementiaStatusIsNotNull()
        && form.getLocalContext().getDementiaStatus().getCurrentWorklistStatusIsNotNull())//wdev-16251
    {
        if ( !form.getLocalContext().getDementiaStatus().getCurrentWorklistStatus().getStatus().equals(DementiaWorklistStatus.COMPLETED)
            && !form.getLocalContext().getDementiaStatus().getCurrentWorklistStatus().getStatus().equals(DementiaWorklistStatus.FOR_REFERRAL)
            && !form.getLocalContext().getDementiaStatus().getCurrentWorklistStatus().getStatus().equals(DementiaWorklistStatus.EXCLUDED)
            && ! ConfigFlag.GEN.DEMENTIA_ALLOW_SAVE_EDISCHARGE_DISCHARGEDETAILS.getValue())
        {

            if( form.getLocalContext().getDementiaStatus().getDischargeDateTime() == null)
                sb.append("\n\nDementia FAIR process is not completed. Please complete the Dementia record so eDischarge can be completed.");
            else
                sbDementiaWarning.append("Dementia FAIR process is not completed, however eDischarge will still be saved as there is a Discharge date on the Dementia record.");
        }
    }
    if (sb.length() > 0)
    {
//      form.htmPreview().setVisible(false);
        engine.showMessage(sb.toString());
        return false;
    }
    else if (sbDementiaWarning.length() > 0)
    {
//      form.htmPreview().setVisible(false);        
        engine.showMessage(sbDementiaWarning.toString());
        return true;
    }

    return true;
}
项目:openmaxims-linux    文件:DementiaAssessmentFormImpl.java   
public DementiaVo rieAMTSRecord(DementiaVo voDementia, FormName formName, Integer patientId, Integer contactId, Integer careContextId, String rieMessage) throws DomainInterfaceException, StaleObjectException
{
    //RIE AMTS and its Comment 
    if (voDementia.getStepTwoAssessIsNotNull())
    {
        if (voDementia.getStepTwoAssess().getStepTwoAssessNoteIsNotNull())
            markAsRie(voDementia.getStepTwoAssess().getStepTwoAssessNote(), formName, patientId, contactId, careContextId, rieMessage);

        markAsRie(voDementia.getStepTwoAssess(), formName, patientId, contactId, careContextId, rieMessage);
    }

    //RIE the AMTS record
    if (voDementia.getStepOneFindIsNotNull())
        markAsRie(voDementia.getStepOneFind(), formName, patientId, contactId, careContextId, rieMessage);

    //also need to update dementia with NULL for the AMTSStep2record / replace currentstatus record with one from history / remove most recent history record and NULL AMTS score
    voDementia.setStepOneFind(null);
    voDementia.setStepTwoAssess(null);

    for (int i = 0 ; i< voDementia.getHistoricalWorklistStatus().size() ; i++)
    {
        if (voDementia.getHistoricalWorklistStatus().get(i).getStatusIsNotNull()
            && voDementia.getHistoricalWorklistStatus().get(i).getStatus().equals(DementiaWorklistStatus.STEP_ONE_FIND_OUTSTANDING))
            voDementia.setCurrentWorklistStatus(voDementia.getHistoricalWorklistStatus().get(i));
//      else
//          markAsRie(voDementia.getHistoricalWorklistStatus().get(i), formName, patientId, contactId, careContextId, rieMessage);
    }


    voDementia.setAMTSScore(null);
    voDementia.setDeliriumConfirmed(null);
    voDementia.setDementiaConfirmed(null);
    voDementia.setConfirmedPatientPutOnDementiaPathway(null);
    voDementia.setIsExcludedFromWorklist(null);

    String[] arrErrors = voDementia.validate();
    if( arrErrors != null)
        throw new DomainRuntimeException("Error saving voDementia - not validated correctly");

    DomainFactory factory = getDomainFactory();

    Dementia domainDementia = DementiaVoAssembler.extractDementia(factory, voDementia);
    factory.save(domainDementia);
    return DementiaVoAssembler.create(domainDementia);
}