Java 类ims.clinical.vo.lookups.EDischargeSummarySection 实例源码

项目:AvoinApotti    文件:Logic.java   
private boolean diagnosisCompleted(boolean hasDiagnosis) {

        if((!form.chkNoDiagnosis().getValue() && !hasDiagnosis))
            return false;
        if (!form.chkComplete().getValue())//WDEV-12784
        {   
            //If currently Check Complete is unticked but we previously had a Clinical Info complete, also change the status of diagnosis
            return !domain.isSectionComplete(form.getLocalContext().getSTHKSummary(), EDischargeSummarySection.CLINICALINFO);
        }

        //WDEV-11817if(!form.chkNoCoMorbidity().getValue() && !domain.hasComorbidity(form.getGlobalContext().Core.getEpisodeofCareShort()))
        //WDEV-11817    return false;
        //WDEV-11817if(!form.chkNoComplications().getValue() && !domain.hasComplications(form.getGlobalContext().Core.getEpisodeofCareShort()))
        //WDEV-11817    return false;

        return true;
    }
项目:AvoinApotti    文件:Logic.java   
private EDischargeSummarySectionStatus getProcStatus(EDischargeSTHKSummaryForProcComponentVo summary) 
{
    if(summary == null || summary.getSummaryDetails() == null)
        return null;

    for(int i=0; i< summary.getSummaryDetails().size(); i++)
    {
        EDischargeSTHKSummaryDetailVo summaryDetails = summary.getSummaryDetails().get(i);

        if(summaryDetails == null)
            continue;

        if(EDischargeSummarySection.OPERATIONS_AND_PROCS.equals(summaryDetails.getSection()))
        {
            return summaryDetails.getProgressStatus();
        }
    }

    return null;
}
项目:AvoinApotti    文件:Logic.java   
private EDischargeSTHKSummaryForProcComponentVo populateEDischargeSummary() 
{
    EDischargeSTHKSummaryForProcComponentVo summary = form.getLocalContext().getSTHKSummaryVo();

    if(summary != null && summary.getSummaryDetails() != null)
    {
        for(int i=0; i<summary.getSummaryDetails().size(); i++)
        {
            EDischargeSTHKSummaryDetailVo summaryDetails = summary.getSummaryDetails().get(i);

            if(summaryDetails == null)
                continue;

            if(EDischargeSummarySection.OPERATIONS_AND_PROCS.equals(summaryDetails.getSection()))
            {
                summaryDetails.setProgressStatus(form.chkComplete().getValue() ? EDischargeSummarySectionStatus.COMPLETED : EDischargeSummarySectionStatus.IN_PROGRESS);
            }
        }
    }

    if(summary != null)     //wdev-13375
        summary.validate();

    return summary;
}
项目:openMAXIMS    文件:Logic.java   
private boolean diagnosisCompleted(boolean hasDiagnosis) {

        if((!form.chkNoDiagnosis().getValue() && !hasDiagnosis))
            return false;
        if (!form.chkComplete().getValue())//WDEV-12784
        {   
            //If currently Check Complete is unticked but we previously had a Clinical Info complete, also change the status of diagnosis
            return !domain.isSectionComplete(form.getLocalContext().getSTHKSummary(), EDischargeSummarySection.CLINICALINFO);
        }

        //WDEV-11817if(!form.chkNoCoMorbidity().getValue() && !domain.hasComorbidity(form.getGlobalContext().Core.getEpisodeofCareShort()))
        //WDEV-11817    return false;
        //WDEV-11817if(!form.chkNoComplications().getValue() && !domain.hasComplications(form.getGlobalContext().Core.getEpisodeofCareShort()))
        //WDEV-11817    return false;

        return true;
    }
项目:openMAXIMS    文件:Logic.java   
private EDischargeSummarySectionStatus getProcStatus(EDischargeSTHKSummaryForProcComponentVo summary) 
{
    if(summary == null || summary.getSummaryDetails() == null)
        return null;

    for(int i=0; i< summary.getSummaryDetails().size(); i++)
    {
        EDischargeSTHKSummaryDetailVo summaryDetails = summary.getSummaryDetails().get(i);

        if(summaryDetails == null)
            continue;

        if(EDischargeSummarySection.OPERATIONS_AND_PROCS.equals(summaryDetails.getSection()))
        {
            return summaryDetails.getProgressStatus();
        }
    }

    return null;
}
项目:openMAXIMS    文件:Logic.java   
private EDischargeSTHKSummaryForProcComponentVo populateEDischargeSummary() 
{
    EDischargeSTHKSummaryForProcComponentVo summary = form.getLocalContext().getSTHKSummaryVo();

    if(summary != null && summary.getSummaryDetails() != null)
    {
        for(int i=0; i<summary.getSummaryDetails().size(); i++)
        {
            EDischargeSTHKSummaryDetailVo summaryDetails = summary.getSummaryDetails().get(i);

            if(summaryDetails == null)
                continue;

            if(EDischargeSummarySection.OPERATIONS_AND_PROCS.equals(summaryDetails.getSection()))
            {
                summaryDetails.setProgressStatus(form.chkComplete().getValue() ? EDischargeSummarySectionStatus.COMPLETED : EDischargeSummarySectionStatus.IN_PROGRESS);
            }
        }
    }

    if(summary != null)     //wdev-13375
        summary.validate();

    return summary;
}
项目:openMAXIMS    文件:Logic.java   
private boolean diagnosisCompleted(boolean hasDiagnosis) {

        if((!form.chkNoDiagnosis().getValue() && !hasDiagnosis))
            return false;
        if (!form.chkComplete().getValue())//WDEV-12784
        {   
            //If currently Check Complete is unticked but we previously had a Clinical Info complete, also change the status of diagnosis
            return !domain.isSectionComplete(form.getLocalContext().getSTHKSummary(), EDischargeSummarySection.CLINICALINFO);
        }

        //WDEV-11817if(!form.chkNoCoMorbidity().getValue() && !domain.hasComorbidity(form.getGlobalContext().Core.getEpisodeofCareShort()))
        //WDEV-11817    return false;
        //WDEV-11817if(!form.chkNoComplications().getValue() && !domain.hasComplications(form.getGlobalContext().Core.getEpisodeofCareShort()))
        //WDEV-11817    return false;

        return true;
    }
项目:openMAXIMS    文件:Logic.java   
private EDischargeSummarySectionStatus getProcStatus(EDischargeSTHKSummaryForProcComponentVo summary) 
{
    if(summary == null || summary.getSummaryDetails() == null)
        return null;

    for(int i=0; i< summary.getSummaryDetails().size(); i++)
    {
        EDischargeSTHKSummaryDetailVo summaryDetails = summary.getSummaryDetails().get(i);

        if(summaryDetails == null)
            continue;

        if(EDischargeSummarySection.OPERATIONS_AND_PROCS.equals(summaryDetails.getSection()))
        {
            return summaryDetails.getProgressStatus();
        }
    }

    return null;
}
项目:openMAXIMS    文件:Logic.java   
private EDischargeSTHKSummaryForProcComponentVo populateEDischargeSummary() 
{
    EDischargeSTHKSummaryForProcComponentVo summary = form.getLocalContext().getSTHKSummaryVo();

    if(summary != null && summary.getSummaryDetails() != null)
    {
        for(int i=0; i<summary.getSummaryDetails().size(); i++)
        {
            EDischargeSTHKSummaryDetailVo summaryDetails = summary.getSummaryDetails().get(i);

            if(summaryDetails == null)
                continue;

            if(EDischargeSummarySection.OPERATIONS_AND_PROCS.equals(summaryDetails.getSection()))
            {
                summaryDetails.setProgressStatus(form.chkComplete().getValue() ? EDischargeSummarySectionStatus.COMPLETED : EDischargeSummarySectionStatus.IN_PROGRESS);
            }
        }
    }

    if(summary != null)     //wdev-13375
        summary.validate();

    return summary;
}
项目:openmaxims-linux    文件:Logic.java   
private boolean diagnosisCompleted(boolean hasDiagnosis) {

        if((!form.chkNoDiagnosis().getValue() && !hasDiagnosis))
            return false;
        if (!form.chkComplete().getValue())//WDEV-12784
        {   
            //If currently Check Complete is unticked but we previously had a Clinical Info complete, also change the status of diagnosis
            return !domain.isSectionComplete(form.getLocalContext().getSTHKSummary(), EDischargeSummarySection.CLINICALINFO);
        }

        //WDEV-11817if(!form.chkNoCoMorbidity().getValue() && !domain.hasComorbidity(form.getGlobalContext().Core.getEpisodeofCareShort()))
        //WDEV-11817    return false;
        //WDEV-11817if(!form.chkNoComplications().getValue() && !domain.hasComplications(form.getGlobalContext().Core.getEpisodeofCareShort()))
        //WDEV-11817    return false;

        return true;
    }
项目:openmaxims-linux    文件:Logic.java   
private EDischargeSummarySectionStatus getProcStatus(EDischargeSTHKSummaryForProcComponentVo summary) 
{
    if(summary == null || summary.getSummaryDetails() == null)
        return null;

    for(int i=0; i< summary.getSummaryDetails().size(); i++)
    {
        EDischargeSTHKSummaryDetailVo summaryDetails = summary.getSummaryDetails().get(i);

        if(summaryDetails == null)
            continue;

        if(EDischargeSummarySection.OPERATIONS_AND_PROCS.equals(summaryDetails.getSection()))
        {
            return summaryDetails.getProgressStatus();
        }
    }

    return null;
}
项目:openmaxims-linux    文件:Logic.java   
private EDischargeSTHKSummaryForProcComponentVo populateEDischargeSummary() 
{
    EDischargeSTHKSummaryForProcComponentVo summary = form.getLocalContext().getSTHKSummaryVo();

    if(summary != null && summary.getSummaryDetails() != null)
    {
        for(int i=0; i<summary.getSummaryDetails().size(); i++)
        {
            EDischargeSTHKSummaryDetailVo summaryDetails = summary.getSummaryDetails().get(i);

            if(summaryDetails == null)
                continue;

            if(EDischargeSummarySection.OPERATIONS_AND_PROCS.equals(summaryDetails.getSection()))
            {
                summaryDetails.setProgressStatus(form.chkComplete().getValue() ? EDischargeSummarySectionStatus.COMPLETED : EDischargeSummarySectionStatus.IN_PROGRESS);
            }
        }
    }

    if(summary != null)     //wdev-13375
        summary.validate();

    return summary;
}
项目:AvoinApotti    文件:Logic.java   
private EDischargeSTHKSummaryDetailVo getDetailRecord(EDischargeSTHKSummaryDetailVoCollection summaryDetails, EDischargeSummarySection section)
{
    if(summaryDetails != null)
    {
        for(EDischargeSTHKSummaryDetailVo voDetail : summaryDetails)
        {
            if(voDetail.getSection().equals(section))
                return voDetail;
        }
    }

    return null;
}
项目:AvoinApotti    文件:EDischargeHelper.java   
private int findDetailRecordForType(List summaryDetails, EDischargeSummarySection section) throws StaleObjectException
{
    for(int i=0; i<summaryDetails.size(); i++)
    {
        SummaryDetail doSummDetail = (SummaryDetail) summaryDetails.get(i);
        if(doSummDetail.getSection().equals(getDomLookup(section)))
            return i;
    }

    //Actually this is a stale. Meaning that somebody else removed that type from additional info
    //throw new CodingRuntimeException("Summary Detail record not instantiated for " + section.getText());
    throw new StaleObjectException(null);
}
项目:AvoinApotti    文件:EDischargeClinicalInfoSTHKComponentImpl.java   
public Boolean isSectionComplete(SummaryRefVo summary, EDischargeSummarySection section)
{
    final String hql = "select count(summ.id) from Summary as summ left join summ.summaryDetails " +
            "as sd left join sd.section as sec left join sd.progressStatus as prgress where " +
            "(summ.id = :summary and prgress.id = :progress and sec.id = :section and summ.isRIE is null)";

    long count = getDomainFactory().countWithHQL(hql, new String[]{"summary","progress","section"}, new Object[]{summary.getID_Summary(),EDischargeSummarySectionStatus.COMPLETED.getID(),section.getID()});
    return count > 0;
}
项目:openMAXIMS    文件:Logic.java   
private EDischargeSTHKSummaryDetailVo getDetailRecord(EDischargeSTHKSummaryDetailVoCollection summaryDetails, EDischargeSummarySection section)
{
    if(summaryDetails != null)
    {
        for(EDischargeSTHKSummaryDetailVo voDetail : summaryDetails)
        {
            if(voDetail.getSection().equals(section))
                return voDetail;
        }
    }

    return null;
}
项目:openMAXIMS    文件:EDischargeHelper.java   
private int findDetailRecordForType(List summaryDetails, EDischargeSummarySection section) throws StaleObjectException
{
    for(int i=0; i<summaryDetails.size(); i++)
    {
        SummaryDetail doSummDetail = (SummaryDetail) summaryDetails.get(i);
        if(doSummDetail.getSection().equals(getDomLookup(section)))
            return i;
    }

    //Actually this is a stale. Meaning that somebody else removed that type from additional info
    //throw new CodingRuntimeException("Summary Detail record not instantiated for " + section.getText());
    throw new StaleObjectException(null);
}
项目:openMAXIMS    文件:EDischargeClinicalInfoSTHKComponentImpl.java   
public Boolean isSectionComplete(SummaryRefVo summary, EDischargeSummarySection section)
{
    final String hql = "select count(summ.id) from Summary as summ left join summ.summaryDetails " +
            "as sd left join sd.section as sec left join sd.progressStatus as prgress where " +
            "(summ.id = :summary and prgress.id = :progress and sec.id = :section and summ.isRIE is null)";

    long count = getDomainFactory().countWithHQL(hql, new String[]{"summary","progress","section"}, new Object[]{summary.getID_Summary(),EDischargeSummarySectionStatus.COMPLETED.getID(),section.getID()});
    return count > 0;
}
项目:openMAXIMS    文件:Logic.java   
private EDischargeSTHKSummaryDetailVo getDetailRecord(EDischargeSTHKSummaryDetailVoCollection summaryDetails, EDischargeSummarySection section)
{
    if(summaryDetails != null)
    {
        for(EDischargeSTHKSummaryDetailVo voDetail : summaryDetails)
        {
            if(voDetail.getSection().equals(section))
                return voDetail;
        }
    }

    return null;
}
项目:openMAXIMS    文件:EDischargeHelper.java   
private int findDetailRecordForType(List summaryDetails, EDischargeSummarySection section) throws StaleObjectException
{
    for(int i=0; i<summaryDetails.size(); i++)
    {
        SummaryDetail doSummDetail = (SummaryDetail) summaryDetails.get(i);
        if(doSummDetail.getSection().equals(getDomLookup(section)))
            return i;
    }

    //Actually this is a stale. Meaning that somebody else removed that type from additional info
    //throw new CodingRuntimeException("Summary Detail record not instantiated for " + section.getText());
    throw new StaleObjectException(null);
}
项目:openMAXIMS    文件:EDischargeClinicalInfoSTHKComponentImpl.java   
public Boolean isSectionComplete(SummaryRefVo summary, EDischargeSummarySection section)
{
    final String hql = "select count(summ.id) from Summary as summ left join summ.summaryDetails " +
            "as sd left join sd.section as sec left join sd.progressStatus as prgress where " +
            "(summ.id = :summary and prgress.id = :progress and sec.id = :section and summ.isRIE is null)";

    long count = getDomainFactory().countWithHQL(hql, new String[]{"summary","progress","section"}, new Object[]{summary.getID_Summary(),EDischargeSummarySectionStatus.COMPLETED.getID(),section.getID()});
    return count > 0;
}
项目:openmaxims-linux    文件:Logic.java   
private EDischargeSTHKSummaryDetailVo getDetailRecord(EDischargeSTHKSummaryDetailVoCollection summaryDetails, EDischargeSummarySection section)
{
    if(summaryDetails != null)
    {
        for(EDischargeSTHKSummaryDetailVo voDetail : summaryDetails)
        {
            if(voDetail.getSection().equals(section))
                return voDetail;
        }
    }

    return null;
}
项目:openmaxims-linux    文件:EDischargeHelper.java   
private int findDetailRecordForType(List summaryDetails, EDischargeSummarySection section) throws StaleObjectException
{
    for(int i=0; i<summaryDetails.size(); i++)
    {
        SummaryDetail doSummDetail = (SummaryDetail) summaryDetails.get(i);
        if(doSummDetail.getSection().equals(getDomLookup(section)))
            return i;
    }

    //Actually this is a stale. Meaning that somebody else removed that type from additional info
    //throw new CodingRuntimeException("Summary Detail record not instantiated for " + section.getText());
    throw new StaleObjectException(null);
}
项目:openmaxims-linux    文件:EDischargeClinicalInfoSTHKComponentImpl.java   
public Boolean isSectionComplete(SummaryRefVo summary, EDischargeSummarySection section)
{
    final String hql = "select count(summ.id) from Summary as summ left join summ.summaryDetails " +
            "as sd left join sd.section as sec left join sd.progressStatus as prgress where " +
            "(summ.id = :summary and prgress.id = :progress and sec.id = :section and summ.isRIE is null)";

    long count = getDomainFactory().countWithHQL(hql, new String[]{"summary","progress","section"}, new Object[]{summary.getID_Summary(),EDischargeSummarySectionStatus.COMPLETED.getID(),section.getID()});
    return count > 0;
}
项目:AvoinApotti    文件:Logic.java   
public boolean save() throws PresentationLogicException 
{
    ArrayList<String> screenErrors = new ArrayList<String>();

    if (form.txtSummaryofInpatientEpisode().getValue() == null)
        screenErrors.add("Summary of Inpatient Episode is a mandatory item.");
    if (form.txtRelevantTreatmentsETC().getValue() == null)
        screenErrors.add("Relevant Treatments and Changes Made to Treatments is a mandatory item.");

    DischargeClinicalInformationSTHKVo voClinInfo = populateDataFromScreen();

    boolean hasDiagnosis = domain.hasDiagnosis(form.getGlobalContext().Core.getEpisodeofCareShort());
    boolean diagnosisCompleted = diagnosisCompleted(hasDiagnosis);
    if(voClinInfo.getIsCompleteIsNotNull() && voClinInfo.getIsComplete() && !diagnosisCompleted)
        screenErrors.add("Diagnosis must be completed before marking Clinical Info as completed.");

    String[] arrErrors = voClinInfo.validate();
    String[] arrScreenAndVoErrors = addScreenErrorsToVOErrors(screenErrors, arrErrors);


    if (arrScreenAndVoErrors.length == 0)
    {
        //WDEV-11817 - Start

        if (voClinInfo.getIsCompleteIsNotNull() && voClinInfo.getIsComplete() && !domain.isSectionComplete(form.getLocalContext().getSTHKSummary(), EDischargeSummarySection.DIAGNOSIS) && !hasComplicationsComorbidityInfo() && !isDiagnosisConfirmed())
        {
            form.getLocalContext().setDiagnosisConfirmMsgBoxId(engine.showMessage("Please confirm that diagnosis is complete", "Confirmation", MessageButtons.YESNO, MessageIcon.QUESTION));
            return false;
        }   
        //WDEV-11817 - End

        try
        {
            voClinInfo = domain.saveClinicalInfo(voClinInfo, form.getLocalContext().getSTHKSummary());
        }
        catch (StaleObjectException e)
        {
            engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());

            form.setMode(FormMode.VIEW);
            open();

            form.getGlobalContext().Clinical.seteDischargeDisableTabs(false);

            form.getLocalContext().setLastEvent(EDischargeLastEvent.EDISCHARGE_SAVE);
            form.fireCustomControlValueChanged();

            return false;
        }
    }
    else
    {
        engine.showErrors("Error", arrScreenAndVoErrors);
        return false;
    }

    saveDiagnosisDetails(); //WDEV-12847

    form.setMode(FormMode.VIEW);            
    form.getLocalContext().setSelectedRecord(voClinInfo);

    form.getGlobalContext().Clinical.seteDischargeDisableTabs(false);
    form.getLocalContext().setLastEvent(EDischargeLastEvent.EDISCHARGE_SAVE);
    form.fireCustomControlValueChanged();

    return true;
}
项目:AvoinApotti    文件:Logic.java   
private void updateControlState()
{
    form.btnAdditional().setVisible(false);
    form.getLocalContext().setAllowChangeOpsProcs(false);
    form.getLocalContext().setAllowChangeNeoNatalPlastics(false);
    //if a section of neonatal or plastics is present and not started
    //or ops procs is not started
    if(form.getLocalContext().getSelectedInstanceIsNotNull() && form.getLocalContext().getSelectedInstance().getID_Summary() != null)
    {
        EDischargeSTHKSummaryVo voSummary = form.getLocalContext().getSelectedInstance();
        EDischargeSTHKSummaryDetailVoCollection voCollDetails = voSummary.getSummaryDetails();
        boolean canChangeOpsProcs = true;
        boolean canChangePlasticsOrNeonatal = true;
        if(voCollDetails != null)
        {
            for(int i=0; i<voCollDetails.size(); i++)
            {
                if(voCollDetails.get(i).getSectionIsNotNull() && (voCollDetails.get(i).getSection().equals(EDischargeSummarySection.NEONATAL) || voCollDetails.get(i).getSection().equals(EDischargeSummarySection.PLASTICS)))
                {                           
                    if(voCollDetails.get(i).getSectionIsNotNull() && (voCollDetails.get(i).getSection().equals(EDischargeSummarySection.NEONATAL) || voCollDetails.get(i).getSection().equals(EDischargeSummarySection.PLASTICS)) && voCollDetails.get(i).getProgressStatusIsNotNull() && (voCollDetails.get(i).getProgressStatus().equals(EDischargeSummarySectionStatus.COMPLETED) || voCollDetails.get(i).getProgressStatus().equals(EDischargeSummarySectionStatus.IN_PROGRESS)))
                    {
                        canChangePlasticsOrNeonatal = false;
                    }
                }
                if(voCollDetails.get(i).getSectionIsNotNull() && voCollDetails.get(i).getSection().equals(EDischargeSummarySection.OPERATIONS_AND_PROCS))
                {
                    if(voCollDetails.get(i).getProgressStatusIsNotNull() && (voCollDetails.get(i).getProgressStatus().equals(EDischargeSummarySectionStatus.COMPLETED) || voCollDetails.get(i).getProgressStatus().equals(EDischargeSummarySectionStatus.IN_PROGRESS)))
                    {
                        canChangeOpsProcs = false;
                    }
                }
            }
        }
        if(canChangeOpsProcs || canChangePlasticsOrNeonatal)
        {
            form.btnAdditional().setVisible(true);
            form.getLocalContext().setAllowChangeOpsProcs(canChangeOpsProcs);
            form.getLocalContext().setAllowChangeNeoNatalPlastics(canChangePlasticsOrNeonatal);
        }
    }
}
项目:openMAXIMS    文件:Logic.java   
public boolean save() throws PresentationLogicException 
{
    ArrayList<String> screenErrors = new ArrayList<String>();

    if (form.txtSummaryofInpatientEpisode().getValue() == null)
        screenErrors.add("Summary of Inpatient Episode is a mandatory item.");
    if (form.txtRelevantTreatmentsETC().getValue() == null)
        screenErrors.add("Relevant Treatments and Changes Made to Treatments is a mandatory item.");

    DischargeClinicalInformationSTHKVo voClinInfo = populateDataFromScreen();

    boolean hasDiagnosis = domain.hasDiagnosis(form.getGlobalContext().Core.getEpisodeofCareShort());
    boolean diagnosisCompleted = diagnosisCompleted(hasDiagnosis);
    if(voClinInfo.getIsCompleteIsNotNull() && voClinInfo.getIsComplete() && !diagnosisCompleted)
        screenErrors.add("Diagnosis must be completed before marking Clinical Info as completed.");

    String[] arrErrors = voClinInfo.validate();
    String[] arrScreenAndVoErrors = addScreenErrorsToVOErrors(screenErrors, arrErrors);


    if (arrScreenAndVoErrors.length == 0)
    {
        //WDEV-11817 - Start

        if (voClinInfo.getIsCompleteIsNotNull() && voClinInfo.getIsComplete() && !domain.isSectionComplete(form.getLocalContext().getSTHKSummary(), EDischargeSummarySection.DIAGNOSIS) && !hasComplicationsComorbidityInfo() && !isDiagnosisConfirmed())
        {
            form.getLocalContext().setDiagnosisConfirmMsgBoxId(engine.showMessage("Please confirm that diagnosis is complete", "Confirmation", MessageButtons.YESNO, MessageIcon.QUESTION));
            return false;
        }   
        //WDEV-11817 - End

        try
        {
            voClinInfo = domain.saveClinicalInfo(voClinInfo, form.getLocalContext().getSTHKSummary());
        }
        catch (StaleObjectException e)
        {
            engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());

            form.setMode(FormMode.VIEW);
            open();

            form.getGlobalContext().Clinical.seteDischargeDisableTabs(false);

            form.getLocalContext().setLastEvent(EDischargeLastEvent.EDISCHARGE_SAVE);
            form.fireCustomControlValueChanged();

            return false;
        }
    }
    else
    {
        engine.showErrors("Error", arrScreenAndVoErrors);
        return false;
    }

    saveDiagnosisDetails(); //WDEV-12847

    form.setMode(FormMode.VIEW);            
    form.getLocalContext().setSelectedRecord(voClinInfo);

    form.getGlobalContext().Clinical.seteDischargeDisableTabs(false);
    form.getLocalContext().setLastEvent(EDischargeLastEvent.EDISCHARGE_SAVE);
    form.fireCustomControlValueChanged();

    return true;
}
项目:openMAXIMS    文件:Logic.java   
private void updateControlState()
{
    form.btnAdditional().setVisible(false);
    form.getLocalContext().setAllowChangeOpsProcs(false);
    form.getLocalContext().setAllowChangeNeoNatalPlastics(false);
    //if a section of neonatal or plastics is present and not started
    //or ops procs is not started
    if(form.getLocalContext().getSelectedInstanceIsNotNull() && form.getLocalContext().getSelectedInstance().getID_Summary() != null)
    {
        EDischargeSTHKSummaryVo voSummary = form.getLocalContext().getSelectedInstance();
        EDischargeSTHKSummaryDetailVoCollection voCollDetails = voSummary.getSummaryDetails();
        boolean canChangeOpsProcs = true;
        boolean canChangePlasticsOrNeonatal = true;
        if(voCollDetails != null)
        {
            for(int i=0; i<voCollDetails.size(); i++)
            {
                if(voCollDetails.get(i).getSectionIsNotNull() && (voCollDetails.get(i).getSection().equals(EDischargeSummarySection.NEONATAL) || voCollDetails.get(i).getSection().equals(EDischargeSummarySection.PLASTICS)))
                {                           
                    if(voCollDetails.get(i).getSectionIsNotNull() && (voCollDetails.get(i).getSection().equals(EDischargeSummarySection.NEONATAL) || voCollDetails.get(i).getSection().equals(EDischargeSummarySection.PLASTICS)) && voCollDetails.get(i).getProgressStatusIsNotNull() && (voCollDetails.get(i).getProgressStatus().equals(EDischargeSummarySectionStatus.COMPLETED) || voCollDetails.get(i).getProgressStatus().equals(EDischargeSummarySectionStatus.IN_PROGRESS)))
                    {
                        canChangePlasticsOrNeonatal = false;
                    }
                }
                if(voCollDetails.get(i).getSectionIsNotNull() && voCollDetails.get(i).getSection().equals(EDischargeSummarySection.OPERATIONS_AND_PROCS))
                {
                    if(voCollDetails.get(i).getProgressStatusIsNotNull() && (voCollDetails.get(i).getProgressStatus().equals(EDischargeSummarySectionStatus.COMPLETED) || voCollDetails.get(i).getProgressStatus().equals(EDischargeSummarySectionStatus.IN_PROGRESS)))
                    {
                        canChangeOpsProcs = false;
                    }
                }
            }
        }
        if(canChangeOpsProcs || canChangePlasticsOrNeonatal)
        {
            form.btnAdditional().setVisible(true);
            form.getLocalContext().setAllowChangeOpsProcs(canChangeOpsProcs);
            form.getLocalContext().setAllowChangeNeoNatalPlastics(canChangePlasticsOrNeonatal);
        }
    }
}
项目:openMAXIMS    文件:Logic.java   
public boolean save() throws PresentationLogicException 
{
    ArrayList<String> screenErrors = new ArrayList<String>();

    if (form.txtSummaryofInpatientEpisode().getValue() == null)
        screenErrors.add("Summary of Inpatient Episode is a mandatory item.");
    if (form.txtRelevantTreatmentsETC().getValue() == null)
        screenErrors.add("Relevant Treatments and Changes Made to Treatments is a mandatory item.");

    DischargeClinicalInformationSTHKVo voClinInfo = populateDataFromScreen();

    boolean hasDiagnosis = domain.hasDiagnosis(form.getGlobalContext().Core.getEpisodeofCareShort());
    boolean diagnosisCompleted = diagnosisCompleted(hasDiagnosis);
    if(voClinInfo.getIsCompleteIsNotNull() && voClinInfo.getIsComplete() && !diagnosisCompleted)
        screenErrors.add("Diagnosis must be completed before marking Clinical Info as completed.");

    String[] arrErrors = voClinInfo.validate();
    String[] arrScreenAndVoErrors = addScreenErrorsToVOErrors(screenErrors, arrErrors);


    if (arrScreenAndVoErrors.length == 0)
    {
        //WDEV-11817 - Start

        if (voClinInfo.getIsCompleteIsNotNull() && voClinInfo.getIsComplete() && !domain.isSectionComplete(form.getLocalContext().getSTHKSummary(), EDischargeSummarySection.DIAGNOSIS) && !hasComplicationsComorbidityInfo() && !isDiagnosisConfirmed())
        {
            form.getLocalContext().setDiagnosisConfirmMsgBoxId(engine.showMessage("Please confirm that diagnosis is complete", "Confirmation", MessageButtons.YESNO, MessageIcon.QUESTION));
            return false;
        }   
        //WDEV-11817 - End

        try
        {
            voClinInfo = domain.saveClinicalInfo(voClinInfo, form.getLocalContext().getSTHKSummary());
        }
        catch (StaleObjectException e)
        {
            engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());

            form.setMode(FormMode.VIEW);
            open();

            form.getGlobalContext().Clinical.seteDischargeDisableTabs(false);

            form.getLocalContext().setLastEvent(EDischargeLastEvent.EDISCHARGE_SAVE);
            form.fireCustomControlValueChanged();

            return false;
        }
    }
    else
    {
        engine.showErrors("Error", arrScreenAndVoErrors);
        return false;
    }

    saveDiagnosisDetails(); //WDEV-12847

    form.setMode(FormMode.VIEW);            
    form.getLocalContext().setSelectedRecord(voClinInfo);

    form.getGlobalContext().Clinical.seteDischargeDisableTabs(false);
    form.getLocalContext().setLastEvent(EDischargeLastEvent.EDISCHARGE_SAVE);
    form.fireCustomControlValueChanged();

    return true;
}
项目:openMAXIMS    文件:Logic.java   
private void updateControlState()
{
    form.btnAdditional().setVisible(false);
    form.getLocalContext().setAllowChangeOpsProcs(false);
    form.getLocalContext().setAllowChangeNeoNatalPlastics(false);
    //if a section of neonatal or plastics is present and not started
    //or ops procs is not started
    if(form.getLocalContext().getSelectedInstanceIsNotNull() && form.getLocalContext().getSelectedInstance().getID_Summary() != null)
    {
        EDischargeSTHKSummaryVo voSummary = form.getLocalContext().getSelectedInstance();
        EDischargeSTHKSummaryDetailVoCollection voCollDetails = voSummary.getSummaryDetails();
        boolean canChangeOpsProcs = true;
        boolean canChangePlasticsOrNeonatal = true;
        if(voCollDetails != null)
        {
            for(int i=0; i<voCollDetails.size(); i++)
            {
                if(voCollDetails.get(i).getSectionIsNotNull() && (voCollDetails.get(i).getSection().equals(EDischargeSummarySection.NEONATAL) || voCollDetails.get(i).getSection().equals(EDischargeSummarySection.PLASTICS)))
                {                           
                    if(voCollDetails.get(i).getSectionIsNotNull() && (voCollDetails.get(i).getSection().equals(EDischargeSummarySection.NEONATAL) || voCollDetails.get(i).getSection().equals(EDischargeSummarySection.PLASTICS)) && voCollDetails.get(i).getProgressStatusIsNotNull() && (voCollDetails.get(i).getProgressStatus().equals(EDischargeSummarySectionStatus.COMPLETED) || voCollDetails.get(i).getProgressStatus().equals(EDischargeSummarySectionStatus.IN_PROGRESS)))
                    {
                        canChangePlasticsOrNeonatal = false;
                    }
                }
                if(voCollDetails.get(i).getSectionIsNotNull() && voCollDetails.get(i).getSection().equals(EDischargeSummarySection.OPERATIONS_AND_PROCS))
                {
                    if(voCollDetails.get(i).getProgressStatusIsNotNull() && (voCollDetails.get(i).getProgressStatus().equals(EDischargeSummarySectionStatus.COMPLETED) || voCollDetails.get(i).getProgressStatus().equals(EDischargeSummarySectionStatus.IN_PROGRESS)))
                    {
                        canChangeOpsProcs = false;
                    }
                }
            }
        }
        if(canChangeOpsProcs || canChangePlasticsOrNeonatal)
        {
            form.btnAdditional().setVisible(true);
            form.getLocalContext().setAllowChangeOpsProcs(canChangeOpsProcs);
            form.getLocalContext().setAllowChangeNeoNatalPlastics(canChangePlasticsOrNeonatal);
        }
    }
}
项目:openmaxims-linux    文件:Logic.java   
public boolean save() throws PresentationLogicException 
{
    ArrayList<String> screenErrors = new ArrayList<String>();

    if (form.txtSummaryofInpatientEpisode().getValue() == null)
        screenErrors.add("Summary of Inpatient Episode is a mandatory item.");
    if (form.txtRelevantTreatmentsETC().getValue() == null)
        screenErrors.add("Relevant Treatments and Changes Made to Treatments is a mandatory item.");

    DischargeClinicalInformationSTHKVo voClinInfo = populateDataFromScreen();

    boolean hasDiagnosis = domain.hasDiagnosis(form.getGlobalContext().Core.getEpisodeofCareShort());
    boolean diagnosisCompleted = diagnosisCompleted(hasDiagnosis);
    if(voClinInfo.getIsCompleteIsNotNull() && voClinInfo.getIsComplete() && !diagnosisCompleted)
        screenErrors.add("Diagnosis must be completed before marking Clinical Info as completed.");

    String[] arrErrors = voClinInfo.validate();
    String[] arrScreenAndVoErrors = addScreenErrorsToVOErrors(screenErrors, arrErrors);


    if (arrScreenAndVoErrors.length == 0)
    {
        //WDEV-11817 - Start

        if (voClinInfo.getIsCompleteIsNotNull() && voClinInfo.getIsComplete() && !domain.isSectionComplete(form.getLocalContext().getSTHKSummary(), EDischargeSummarySection.DIAGNOSIS) && !hasComplicationsComorbidityInfo() && !isDiagnosisConfirmed())
        {
            form.getLocalContext().setDiagnosisConfirmMsgBoxId(engine.showMessage("Please confirm that diagnosis is complete", "Confirmation", MessageButtons.YESNO, MessageIcon.QUESTION));
            return false;
        }   
        //WDEV-11817 - End

        try
        {
            voClinInfo = domain.saveClinicalInfo(voClinInfo, form.getLocalContext().getSTHKSummary());
        }
        catch (StaleObjectException e)
        {
            engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());

            form.setMode(FormMode.VIEW);
            open();

            form.getGlobalContext().Clinical.seteDischargeDisableTabs(false);

            form.getLocalContext().setLastEvent(EDischargeLastEvent.EDISCHARGE_SAVE);
            form.fireCustomControlValueChanged();

            return false;
        }
    }
    else
    {
        engine.showErrors("Error", arrScreenAndVoErrors);
        return false;
    }

    saveDiagnosisDetails(); //WDEV-12847

    form.setMode(FormMode.VIEW);            
    form.getLocalContext().setSelectedRecord(voClinInfo);

    form.getGlobalContext().Clinical.seteDischargeDisableTabs(false);
    form.getLocalContext().setLastEvent(EDischargeLastEvent.EDISCHARGE_SAVE);
    form.fireCustomControlValueChanged();

    return true;
}
项目:openmaxims-linux    文件:Logic.java   
private void updateControlState()
{
    form.btnAdditional().setVisible(false);
    form.getLocalContext().setAllowChangeOpsProcs(false);
    form.getLocalContext().setAllowChangeNeoNatalPlastics(false);
    //if a section of neonatal or plastics is present and not started
    //or ops procs is not started
    if(form.getLocalContext().getSelectedInstanceIsNotNull() && form.getLocalContext().getSelectedInstance().getID_Summary() != null)
    {
        EDischargeSTHKSummaryVo voSummary = form.getLocalContext().getSelectedInstance();
        EDischargeSTHKSummaryDetailVoCollection voCollDetails = voSummary.getSummaryDetails();
        boolean canChangeOpsProcs = true;
        boolean canChangePlasticsOrNeonatal = true;
        if(voCollDetails != null)
        {
            for(int i=0; i<voCollDetails.size(); i++)
            {
                if(voCollDetails.get(i).getSectionIsNotNull() && (voCollDetails.get(i).getSection().equals(EDischargeSummarySection.NEONATAL) || voCollDetails.get(i).getSection().equals(EDischargeSummarySection.PLASTICS)))
                {                           
                    if(voCollDetails.get(i).getSectionIsNotNull() && (voCollDetails.get(i).getSection().equals(EDischargeSummarySection.NEONATAL) || voCollDetails.get(i).getSection().equals(EDischargeSummarySection.PLASTICS)) && voCollDetails.get(i).getProgressStatusIsNotNull() && (voCollDetails.get(i).getProgressStatus().equals(EDischargeSummarySectionStatus.COMPLETED) || voCollDetails.get(i).getProgressStatus().equals(EDischargeSummarySectionStatus.IN_PROGRESS)))
                    {
                        canChangePlasticsOrNeonatal = false;
                    }
                }
                if(voCollDetails.get(i).getSectionIsNotNull() && voCollDetails.get(i).getSection().equals(EDischargeSummarySection.OPERATIONS_AND_PROCS))
                {
                    if(voCollDetails.get(i).getProgressStatusIsNotNull() && (voCollDetails.get(i).getProgressStatus().equals(EDischargeSummarySectionStatus.COMPLETED) || voCollDetails.get(i).getProgressStatus().equals(EDischargeSummarySectionStatus.IN_PROGRESS)))
                    {
                        canChangeOpsProcs = false;
                    }
                }
            }
        }
        if(canChangeOpsProcs || canChangePlasticsOrNeonatal)
        {
            form.btnAdditional().setVisible(true);
            form.getLocalContext().setAllowChangeOpsProcs(canChangeOpsProcs);
            form.getLocalContext().setAllowChangeNeoNatalPlastics(canChangePlasticsOrNeonatal);
        }
    }
}