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

项目:AvoinApotti    文件:Logic.java   
@SuppressWarnings("unchecked")
private void setTooltip(ClinicalCorrespondenceVo vo)
{
    if (vo != null &&
            vo.getStatusHistoryIsNotNull() &&
                vo.getStatusHistory().size() > 0)
    {
        CorrespondenceStatusVoCollection collVo = vo.getStatusHistory();

        if(collVo != null)
        {
            ArrayList collActions = getArrayList(collVo);
            Collections.sort(collActions, new ActionsComparator());
            copyArrayListIntoColl(collVo, collActions);

            StringBuffer tooltip = new StringBuffer();

            for (int i = 0; i < collVo.size(); i++)
            {
                tooltip.append(new Textile().process("**"+(i+1)+". "+
                        collVo.get(i).getCorrespondenceStatus().getText() +"**"+"\n"+
                            collVo.get(i).getAuthoringInformation().getCreationUser()+"&nbsp;&nbsp;&nbsp;"+
                                collVo.get(i).getAuthoringInformation().getCreationDateTime()));    
            }

            form.lyrDetails().tabRecipents().imbStatus().setTooltip(tooltip.toString());
        }
    }
    else
        form.lyrDetails().tabRecipents().imbStatus().setTooltip(null);
}
项目:AvoinApotti    文件:DocumentGenerationImpl.java   
/**
* saveClinicalCorrespondence
*/
public ims.clinical.vo.ClinicalCorrespondenceVo saveClinicalCorrespondence(ims.clinical.vo.ClinicalCorrespondenceVo clinicalCorrespondence) throws ims.domain.exceptions.StaleObjectException, ims.domain.exceptions.UniqueKeyViolationException
{
    if(clinicalCorrespondence == null)
        throw new CodingRuntimeException("null clinicalCorrespondence passed to saveClinicalCorrespondence() !");

    if(!clinicalCorrespondence.isValidated())
        throw new CodingRuntimeException("clinicalCorrespondence not validated !");

    DomainFactory factory = getDomainFactory();
    ClinicalCorrespondence boClinicalCorrespondence = ClinicalCorrespondenceVoAssembler.extractClinicalCorrespondence(factory, clinicalCorrespondence);     
    InpatientDischargeNoteFollowup idsBo = boClinicalCorrespondence.getInpatientDischargeSummary();
    OutpatientNotesOutcome opdBo = boClinicalCorrespondence.getOPDNotes();

    if(idsBo != null)
    {
        factory.save(idsBo);
        boClinicalCorrespondence.setInpatientDischargeSummary(idsBo);
    }

    if(opdBo != null)
    {
        factory.save(opdBo);
        boClinicalCorrespondence.setOPDNotes(opdBo);
    }

    factory.save(boClinicalCorrespondence);

    return ClinicalCorrespondenceVoAssembler.create(boClinicalCorrespondence);
}
项目:openMAXIMS    文件:Logic.java   
@SuppressWarnings("unchecked")
private void setTooltip(ClinicalCorrespondenceVo vo)
{
    if (vo != null &&
            vo.getStatusHistoryIsNotNull() &&
                vo.getStatusHistory().size() > 0)
    {
        CorrespondenceStatusVoCollection collVo = vo.getStatusHistory();

        if(collVo != null)
        {
            ArrayList collActions = getArrayList(collVo);
            Collections.sort(collActions, new ActionsComparator());
            copyArrayListIntoColl(collVo, collActions);

            StringBuffer tooltip = new StringBuffer();

            for (int i = 0; i < collVo.size(); i++)
            {
                tooltip.append(new Textile().process("**"+(i+1)+". "+
                        collVo.get(i).getCorrespondenceStatus().getText() +"**"+"\n"+
                            collVo.get(i).getAuthoringInformation().getCreationUser()+"&nbsp;&nbsp;&nbsp;"+
                                collVo.get(i).getAuthoringInformation().getCreationDateTime()));    
            }

            form.lyrDetails().tabRecipents().imbStatus().setTooltip(tooltip.toString());
        }
    }
    else
        form.lyrDetails().tabRecipents().imbStatus().setTooltip(null);
}
项目:openMAXIMS    文件:DocumentGenerationImpl.java   
/**
* saveClinicalCorrespondence
*/
public ims.clinical.vo.ClinicalCorrespondenceVo saveClinicalCorrespondence(ims.clinical.vo.ClinicalCorrespondenceVo clinicalCorrespondence) throws ims.domain.exceptions.StaleObjectException, ims.domain.exceptions.UniqueKeyViolationException
{
    if(clinicalCorrespondence == null)
        throw new CodingRuntimeException("null clinicalCorrespondence passed to saveClinicalCorrespondence() !");

    if(!clinicalCorrespondence.isValidated())
        throw new CodingRuntimeException("clinicalCorrespondence not validated !");

    DomainFactory factory = getDomainFactory();
    ClinicalCorrespondence boClinicalCorrespondence = ClinicalCorrespondenceVoAssembler.extractClinicalCorrespondence(factory, clinicalCorrespondence);     
    InpatientDischargeNoteFollowup idsBo = boClinicalCorrespondence.getInpatientDischargeSummary();
    OutpatientNotesOutcome opdBo = boClinicalCorrespondence.getOPDNotes();

    if(idsBo != null)
    {
        factory.save(idsBo);
        boClinicalCorrespondence.setInpatientDischargeSummary(idsBo);
    }

    if(opdBo != null)
    {
        factory.save(opdBo);
        boClinicalCorrespondence.setOPDNotes(opdBo);
    }

    factory.save(boClinicalCorrespondence);

    return ClinicalCorrespondenceVoAssembler.create(boClinicalCorrespondence);
}
项目:openMAXIMS    文件:Logic.java   
@SuppressWarnings("unchecked")
private void setTooltip(ClinicalCorrespondenceVo vo)
{
    if (vo != null &&
            vo.getStatusHistoryIsNotNull() &&
                vo.getStatusHistory().size() > 0)
    {
        CorrespondenceStatusVoCollection collVo = vo.getStatusHistory();

        if(collVo != null)
        {
            ArrayList collActions = getArrayList(collVo);
            Collections.sort(collActions, new ActionsComparator());
            copyArrayListIntoColl(collVo, collActions);

            StringBuffer tooltip = new StringBuffer();

            for (int i = 0; i < collVo.size(); i++)
            {
                tooltip.append(new Textile().process("**"+(i+1)+". "+
                        collVo.get(i).getCorrespondenceStatus().getText() +"**"+"\n"+
                            collVo.get(i).getAuthoringInformation().getCreationUser()+"&nbsp;&nbsp;&nbsp;"+
                                collVo.get(i).getAuthoringInformation().getCreationDateTime()));    
            }

            form.lyrDetails().tabRecipents().imbStatus().setTooltip(tooltip.toString());
        }
    }
    else
        form.lyrDetails().tabRecipents().imbStatus().setTooltip(null);
}
项目:openMAXIMS    文件:DocumentGenerationImpl.java   
/**
* saveClinicalCorrespondence
*/
public ims.clinical.vo.ClinicalCorrespondenceVo saveClinicalCorrespondence(ims.clinical.vo.ClinicalCorrespondenceVo clinicalCorrespondence) throws ims.domain.exceptions.StaleObjectException, ims.domain.exceptions.UniqueKeyViolationException
{
    if(clinicalCorrespondence == null)
        throw new CodingRuntimeException("null clinicalCorrespondence passed to saveClinicalCorrespondence() !");

    if(!clinicalCorrespondence.isValidated())
        throw new CodingRuntimeException("clinicalCorrespondence not validated !");

    DomainFactory factory = getDomainFactory();
    ClinicalCorrespondence boClinicalCorrespondence = ClinicalCorrespondenceVoAssembler.extractClinicalCorrespondence(factory, clinicalCorrespondence);     
    InpatientDischargeNoteFollowup idsBo = boClinicalCorrespondence.getInpatientDischargeSummary();
    OutpatientNotesOutcome opdBo = boClinicalCorrespondence.getOPDNotes();

    if(idsBo != null)
    {
        factory.save(idsBo);
        boClinicalCorrespondence.setInpatientDischargeSummary(idsBo);
    }

    if(opdBo != null)
    {
        factory.save(opdBo);
        boClinicalCorrespondence.setOPDNotes(opdBo);
    }

    factory.save(boClinicalCorrespondence);

    return ClinicalCorrespondenceVoAssembler.create(boClinicalCorrespondence);
}
项目:openmaxims-linux    文件:Logic.java   
@SuppressWarnings("unchecked")
private void setTooltip(ClinicalCorrespondenceVo vo)
{
    if (vo != null &&
            vo.getStatusHistoryIsNotNull() &&
                vo.getStatusHistory().size() > 0)
    {
        CorrespondenceStatusVoCollection collVo = vo.getStatusHistory();

        if(collVo != null)
        {
            ArrayList collActions = getArrayList(collVo);
            Collections.sort(collActions, new ActionsComparator());
            copyArrayListIntoColl(collVo, collActions);

            StringBuffer tooltip = new StringBuffer();

            for (int i = 0; i < collVo.size(); i++)
            {
                tooltip.append(new Textile().process("**"+(i+1)+". "+
                        collVo.get(i).getCorrespondenceStatus().getText() +"**"+"\n"+
                            collVo.get(i).getAuthoringInformation().getCreationUser()+"&nbsp;&nbsp;&nbsp;"+
                                collVo.get(i).getAuthoringInformation().getCreationDateTime()));    
            }

            form.lyrDetails().tabRecipents().imbStatus().setTooltip(tooltip.toString());
        }
    }
    else
        form.lyrDetails().tabRecipents().imbStatus().setTooltip(null);
}
项目:openmaxims-linux    文件:DocumentGenerationImpl.java   
/**
* saveClinicalCorrespondence
*/
public ims.clinical.vo.ClinicalCorrespondenceVo saveClinicalCorrespondence(ims.clinical.vo.ClinicalCorrespondenceVo clinicalCorrespondence) throws ims.domain.exceptions.StaleObjectException, ims.domain.exceptions.UniqueKeyViolationException
{
    if(clinicalCorrespondence == null)
        throw new CodingRuntimeException("null clinicalCorrespondence passed to saveClinicalCorrespondence() !");

    if(!clinicalCorrespondence.isValidated())
        throw new CodingRuntimeException("clinicalCorrespondence not validated !");

    DomainFactory factory = getDomainFactory();
    ClinicalCorrespondence boClinicalCorrespondence = ClinicalCorrespondenceVoAssembler.extractClinicalCorrespondence(factory, clinicalCorrespondence);     
    InpatientDischargeNoteFollowup idsBo = boClinicalCorrespondence.getInpatientDischargeSummary();
    OutpatientNotesOutcome opdBo = boClinicalCorrespondence.getOPDNotes();

    if(idsBo != null)
    {
        factory.save(idsBo);
        boClinicalCorrespondence.setInpatientDischargeSummary(idsBo);
    }

    if(opdBo != null)
    {
        factory.save(opdBo);
        boClinicalCorrespondence.setOPDNotes(opdBo);
    }

    factory.save(boClinicalCorrespondence);

    return ClinicalCorrespondenceVoAssembler.create(boClinicalCorrespondence);
}
项目:AvoinApotti    文件:Logic.java   
private boolean verifyStatusHistory()
{
    if (form.lyrDetails().tabRecipents().cmbStatus().getValue() != null)
    {
        if (form.lyrDetails().tabRecipents().cmbStatus().getValue().equals(CorrespondenceStatus.VERIFIED))
        {

            ClinicalCorrespondenceVo voClinicalCorrespondence = null;

            CareContextShortVo careContext = form.getGlobalContext().Core.getCurrentCareContext();

            if(ContextType.OUTPATIENT.equals(careContext.getContext()))
            {
                voClinicalCorrespondence = domain.getLastClinicalCorrespondence
                    (form.getGlobalContext().Core.getCurrentCareContext(), 
                        ClinicalCorrespondenceType.MEDICALOUTPATIENTLETTER, 
                            form.getGlobalContext().Core.getCurrentClinicalContact());
            }
            else
            {
                voClinicalCorrespondence = domain.getLastClinicalCorrespondence
                    (form.getGlobalContext().Core.getCurrentCareContext(), 
                        ClinicalCorrespondenceType.MEDICALINPATIENTDISCHARGE, 
                            form.getGlobalContext().Core.getCurrentClinicalContact());
            }

            if (voClinicalCorrespondence != null &&
                    voClinicalCorrespondence.getStatusHistoryIsNotNull())
            {
                for (int i = 0; i < voClinicalCorrespondence.getStatusHistory().size(); i++)
                {
                    if (voClinicalCorrespondence.getStatusHistory().get(i).getCorrespondenceStatus().equals(CorrespondenceStatus.VERIFIED))
                    {
                        if (voClinicalCorrespondence.getVerifyingHCPIsNotNull() &&
                                voClinicalCorrespondence.getVerifyingDateTimeIsNotNull())
                        {
                            form.lyrDetails().tabRecipents().qmbVerifyingHCP().newRow(voClinicalCorrespondence.getVerifyingHCP(), voClinicalCorrespondence.getVerifyingHCP().toString());
                            form.lyrDetails().tabRecipents().qmbVerifyingHCP().setValue(voClinicalCorrespondence.getVerifyingHCP());
                            form.lyrDetails().tabRecipents().dtimVerifying().setValue(voClinicalCorrespondence.getVerifyingDateTime());
                            return true;
                        }
                    }
                }
            }
        }
    }
    return false;
}
项目:AvoinApotti    文件:Logic.java   
private void open()
{
    clearScreen();
    setCurrentClinicalNote();

    ClinicalCorrespondenceVo voClinicalCorrespondence = null;

    /*
    if(form.getGlobalContext().Clinical.getReturnToFormNameIsNotNull() && 
            form.getGlobalContext().Clinical.getReturnToFormName().equals(form.getForms().Clinical.OutPatientsTreatmentPlan))
            */
    CareContextShortVo careContext = form.getGlobalContext().Core.getCurrentCareContext();
    if(ContextType.OUTPATIENT.equals(careContext.getContext()))
    {
        voClinicalCorrespondence = domain.getLastClinicalCorrespondence
        (null, 
            ClinicalCorrespondenceType.MEDICALOUTPATIENTLETTER, 
                form.getGlobalContext().Core.getCurrentClinicalContact());
    }
    else
    {
        voClinicalCorrespondence = domain.getLastClinicalCorrespondence
            (form.getGlobalContext().Core.getCurrentCareContext(), 
                ClinicalCorrespondenceType.MEDICALINPATIENTDISCHARGE, 
                    null);
    }

    form.getLocalContext().setSelectedItem(voClinicalCorrespondence);
    //WDEV-2536
    setTooltip(voClinicalCorrespondence);

        verifyStatusHistory();

    form.setMode(FormMode.VIEW);

    if(voClinicalCorrespondence == null)
    {
        form.btnNew().setVisible(true);
        form.btnUpdate().setVisible(false);
        form.getLocalContext().setOutpatientSummaryChanged(Boolean.TRUE);
    }
    else
    {
        form.btnNew().setVisible(false);
        form.btnUpdate().setVisible(true);

        displayRecord(voClinicalCorrespondence);
        form.getLocalContext().setReportChanged(Boolean.TRUE);

    }

    updateContextMenu();
}
项目:AvoinApotti    文件:Logic.java   
protected void onFormModeChanged()
{
    boolean viewMode = form.getMode().equals(FormMode.VIEW);
    form.btnClose().setVisible(viewMode && engine.isDialog());  

    if(!viewMode)
    {
        boolean dataSaved = isNewData();
        ClinicalCorrespondenceVo voClinicalCorrespondence = form.getLocalContext().getSelectedItem();

        if(dataSaved)
        {
            form.lyrDetails().tabRecipents().customControlAuthoringInfo().setEnabledAuthoringHCP(Boolean.TRUE);
            form.lyrDetails().tabRecipents().customControlAuthoringInfo().setEnabledDateTime(Boolean.TRUE);
        }
        else
        {
            form.lyrDetails().tabRecipents().customControlAuthoringInfo().setEnabledAuthoringHCP(Boolean.FALSE);
            form.lyrDetails().tabRecipents().customControlAuthoringInfo().setEnabledDateTime(Boolean.FALSE);
        }

        if(voClinicalCorrespondence != null)
        {
            //wdev-1800
            boolean bFound = true;
            if (voClinicalCorrespondence.getCurrentStatusIsNotNull() && voClinicalCorrespondence.getCurrentStatus().getCorrespondenceStatus().equals(CorrespondenceStatus.VERIFIED))
                bFound = false;

            if (voClinicalCorrespondence.getStatusHistoryIsNotNull() && voClinicalCorrespondence.getStatusHistory().size() > 0)
            {
                for (int i = 0 ; i < voClinicalCorrespondence.getStatusHistory().size() ; i ++)
                {
                    if (voClinicalCorrespondence.getStatusHistory().get(i).getCorrespondenceStatus().equals(CorrespondenceStatus.VERIFIED))
                    {
                        bFound = false;

                        break;
                    }
                }
            }
            enableVerified(bFound);
        }
        else
            enableVerified(true);
    }

    //WDEV-1039 - 4) Disable the preview until the ClinicalCorrespondenceBo has been saved and in Edit Mode   
    form.lyrDetails().tabPreview().setHeaderEnabled(viewMode && !isNewData());
}
项目:AvoinApotti    文件:Logic.java   
private boolean isNewData()
{
    ClinicalCorrespondenceVo voClinicalCorrespondence = form.getLocalContext().getSelectedItem();
    return !(voClinicalCorrespondence != null && voClinicalCorrespondence.getID_ClinicalCorrespondenceIsNotNull());
}
项目:AvoinApotti    文件:DocumentGenerationImpl.java   
/**
* getLastClinicalCorrespondence
*/
public ClinicalCorrespondenceVo getLastClinicalCorrespondence(CareContextRefVo careContext, ClinicalCorrespondenceType type, ClinicalContactRefVo clinicalContact)
{
    /*
    if(careContext == null)
        throw new CodingRuntimeException("null careContext passed to getLastClinicalCorrespondence() !");
    */
    ArrayList names = new ArrayList();
    ArrayList values = new ArrayList();

    if(type == null)
        throw new CodingRuntimeException("null type passed to getLastClinicalCorrespondence() !");

    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("from ClinicalCorrespondence as c1_1 ");
    hql.append(" where c1_1.type.id = :TYPEID");
    names.add("TYPEID");
    values.add(new Integer(type.getId()));

    if (careContext != null)
    {
        hql.append (" and c1_1.careContext.id = :CONTEXTID");
        names.add("CONTEXTID");
        values.add(careContext.getID_CareContext());    
    }

    if (clinicalContact != null)
    {
        hql.append (" and c1_1.clinicalContact.id = :CONTACTID");
        names.add("CONTACTID");
        values.add(clinicalContact.getID_ClinicalContact());    
    }

    List list = factory.find(hql.toString(), names, values);

    if(list.size() == 0)
        return null;

    ClinicalCorrespondenceVo voClinicalCorrespondence = ClinicalCorrespondenceVoAssembler.create((ClinicalCorrespondence)list.get(0));

    if (type.equals(ClinicalCorrespondenceType.MEDICALOUTPATIENTLETTER))
    {
        if(voClinicalCorrespondence.getOPDNotes() == null && clinicalContact != null && clinicalContact.getID_ClinicalContactIsNotNull())
            voClinicalCorrespondence.setOPDNotes(getOPDSummary(clinicalContact));
    }

    return voClinicalCorrespondence;
}
项目:openMAXIMS    文件:Logic.java   
private boolean verifyStatusHistory()
{
    if (form.lyrDetails().tabRecipents().cmbStatus().getValue() != null)
    {
        if (form.lyrDetails().tabRecipents().cmbStatus().getValue().equals(CorrespondenceStatus.VERIFIED))
        {

            ClinicalCorrespondenceVo voClinicalCorrespondence = null;

            CareContextShortVo careContext = form.getGlobalContext().Core.getCurrentCareContext();

            if(ContextType.OUTPATIENT.equals(careContext.getContext()))
            {
                voClinicalCorrespondence = domain.getLastClinicalCorrespondence
                    (form.getGlobalContext().Core.getCurrentCareContext(), 
                        ClinicalCorrespondenceType.MEDICALOUTPATIENTLETTER, 
                            form.getGlobalContext().Core.getCurrentClinicalContact());
            }
            else
            {
                voClinicalCorrespondence = domain.getLastClinicalCorrespondence
                    (form.getGlobalContext().Core.getCurrentCareContext(), 
                        ClinicalCorrespondenceType.MEDICALINPATIENTDISCHARGE, 
                            form.getGlobalContext().Core.getCurrentClinicalContact());
            }

            if (voClinicalCorrespondence != null &&
                    voClinicalCorrespondence.getStatusHistoryIsNotNull())
            {
                for (int i = 0; i < voClinicalCorrespondence.getStatusHistory().size(); i++)
                {
                    if (voClinicalCorrespondence.getStatusHistory().get(i).getCorrespondenceStatus().equals(CorrespondenceStatus.VERIFIED))
                    {
                        if (voClinicalCorrespondence.getVerifyingHCPIsNotNull() &&
                                voClinicalCorrespondence.getVerifyingDateTimeIsNotNull())
                        {
                            form.lyrDetails().tabRecipents().qmbVerifyingHCP().newRow(voClinicalCorrespondence.getVerifyingHCP(), voClinicalCorrespondence.getVerifyingHCP().toString());
                            form.lyrDetails().tabRecipents().qmbVerifyingHCP().setValue(voClinicalCorrespondence.getVerifyingHCP());
                            form.lyrDetails().tabRecipents().dtimVerifying().setValue(voClinicalCorrespondence.getVerifyingDateTime());
                            return true;
                        }
                    }
                }
            }
        }
    }
    return false;
}
项目:openMAXIMS    文件:Logic.java   
private void open()
{
    clearScreen();
    setCurrentClinicalNote();

    ClinicalCorrespondenceVo voClinicalCorrespondence = null;

    /*
    if(form.getGlobalContext().Clinical.getReturnToFormNameIsNotNull() && 
            form.getGlobalContext().Clinical.getReturnToFormName().equals(form.getForms().Clinical.OutPatientsTreatmentPlan))
            */
    CareContextShortVo careContext = form.getGlobalContext().Core.getCurrentCareContext();
    if(ContextType.OUTPATIENT.equals(careContext.getContext()))
    {
        voClinicalCorrespondence = domain.getLastClinicalCorrespondence
        (null, 
            ClinicalCorrespondenceType.MEDICALOUTPATIENTLETTER, 
                form.getGlobalContext().Core.getCurrentClinicalContact());
    }
    else
    {
        voClinicalCorrespondence = domain.getLastClinicalCorrespondence
            (form.getGlobalContext().Core.getCurrentCareContext(), 
                ClinicalCorrespondenceType.MEDICALINPATIENTDISCHARGE, 
                    null);
    }

    form.getLocalContext().setSelectedItem(voClinicalCorrespondence);
    //WDEV-2536
    setTooltip(voClinicalCorrespondence);

        verifyStatusHistory();

    form.setMode(FormMode.VIEW);

    if(voClinicalCorrespondence == null)
    {
        form.btnNew().setVisible(true);
        form.btnUpdate().setVisible(false);
        form.getLocalContext().setOutpatientSummaryChanged(Boolean.TRUE);
    }
    else
    {
        form.btnNew().setVisible(false);
        form.btnUpdate().setVisible(true);

        displayRecord(voClinicalCorrespondence);
        form.getLocalContext().setReportChanged(Boolean.TRUE);

    }

    updateContextMenu();
}
项目:openMAXIMS    文件:Logic.java   
protected void onFormModeChanged()
{
    boolean viewMode = form.getMode().equals(FormMode.VIEW);
    form.btnClose().setVisible(viewMode && engine.isDialog());  

    if(!viewMode)
    {
        boolean dataSaved = isNewData();
        ClinicalCorrespondenceVo voClinicalCorrespondence = form.getLocalContext().getSelectedItem();

        if(dataSaved)
        {
            form.lyrDetails().tabRecipents().customControlAuthoringInfo().setEnabledAuthoringHCP(Boolean.TRUE);
            form.lyrDetails().tabRecipents().customControlAuthoringInfo().setEnabledDateTime(Boolean.TRUE);
        }
        else
        {
            form.lyrDetails().tabRecipents().customControlAuthoringInfo().setEnabledAuthoringHCP(Boolean.FALSE);
            form.lyrDetails().tabRecipents().customControlAuthoringInfo().setEnabledDateTime(Boolean.FALSE);
        }

        if(voClinicalCorrespondence != null)
        {
            //wdev-1800
            boolean bFound = true;
            if (voClinicalCorrespondence.getCurrentStatusIsNotNull() && voClinicalCorrespondence.getCurrentStatus().getCorrespondenceStatus().equals(CorrespondenceStatus.VERIFIED))
                bFound = false;

            if (voClinicalCorrespondence.getStatusHistoryIsNotNull() && voClinicalCorrespondence.getStatusHistory().size() > 0)
            {
                for (int i = 0 ; i < voClinicalCorrespondence.getStatusHistory().size() ; i ++)
                {
                    if (voClinicalCorrespondence.getStatusHistory().get(i).getCorrespondenceStatus().equals(CorrespondenceStatus.VERIFIED))
                    {
                        bFound = false;

                        break;
                    }
                }
            }
            enableVerified(bFound);
        }
        else
            enableVerified(true);
    }

    //WDEV-1039 - 4) Disable the preview until the ClinicalCorrespondenceBo has been saved and in Edit Mode   
    form.lyrDetails().tabPreview().setHeaderEnabled(viewMode && !isNewData());
}
项目:openMAXIMS    文件:Logic.java   
private boolean isNewData()
{
    ClinicalCorrespondenceVo voClinicalCorrespondence = form.getLocalContext().getSelectedItem();
    return !(voClinicalCorrespondence != null && voClinicalCorrespondence.getID_ClinicalCorrespondenceIsNotNull());
}
项目:openMAXIMS    文件:DocumentGenerationImpl.java   
/**
* getLastClinicalCorrespondence
*/
public ClinicalCorrespondenceVo getLastClinicalCorrespondence(CareContextRefVo careContext, ClinicalCorrespondenceType type, ClinicalContactRefVo clinicalContact)
{
    /*
    if(careContext == null)
        throw new CodingRuntimeException("null careContext passed to getLastClinicalCorrespondence() !");
    */
    ArrayList names = new ArrayList();
    ArrayList values = new ArrayList();

    if(type == null)
        throw new CodingRuntimeException("null type passed to getLastClinicalCorrespondence() !");

    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("from ClinicalCorrespondence as c1_1 ");
    hql.append(" where c1_1.type.id = :TYPEID");
    names.add("TYPEID");
    values.add(new Integer(type.getId()));

    if (careContext != null)
    {
        hql.append (" and c1_1.careContext.id = :CONTEXTID");
        names.add("CONTEXTID");
        values.add(careContext.getID_CareContext());    
    }

    if (clinicalContact != null)
    {
        hql.append (" and c1_1.clinicalContact.id = :CONTACTID");
        names.add("CONTACTID");
        values.add(clinicalContact.getID_ClinicalContact());    
    }

    List list = factory.find(hql.toString(), names, values);

    if(list.size() == 0)
        return null;

    ClinicalCorrespondenceVo voClinicalCorrespondence = ClinicalCorrespondenceVoAssembler.create((ClinicalCorrespondence)list.get(0));

    if (type.equals(ClinicalCorrespondenceType.MEDICALOUTPATIENTLETTER))
    {
        if(voClinicalCorrespondence.getOPDNotes() == null && clinicalContact != null && clinicalContact.getID_ClinicalContactIsNotNull())
            voClinicalCorrespondence.setOPDNotes(getOPDSummary(clinicalContact));
    }

    return voClinicalCorrespondence;
}
项目:openMAXIMS    文件:Logic.java   
private boolean verifyStatusHistory()
{
    if (form.lyrDetails().tabRecipents().cmbStatus().getValue() != null)
    {
        if (form.lyrDetails().tabRecipents().cmbStatus().getValue().equals(CorrespondenceStatus.VERIFIED))
        {

            ClinicalCorrespondenceVo voClinicalCorrespondence = null;

            CareContextShortVo careContext = form.getGlobalContext().Core.getCurrentCareContext();

            if(ContextType.OUTPATIENT.equals(careContext.getContext()))
            {
                voClinicalCorrespondence = domain.getLastClinicalCorrespondence
                    (form.getGlobalContext().Core.getCurrentCareContext(), 
                        ClinicalCorrespondenceType.MEDICALOUTPATIENTLETTER, 
                            form.getGlobalContext().Core.getCurrentClinicalContact());
            }
            else
            {
                voClinicalCorrespondence = domain.getLastClinicalCorrespondence
                    (form.getGlobalContext().Core.getCurrentCareContext(), 
                        ClinicalCorrespondenceType.MEDICALINPATIENTDISCHARGE, 
                            form.getGlobalContext().Core.getCurrentClinicalContact());
            }

            if (voClinicalCorrespondence != null &&
                    voClinicalCorrespondence.getStatusHistoryIsNotNull())
            {
                for (int i = 0; i < voClinicalCorrespondence.getStatusHistory().size(); i++)
                {
                    if (voClinicalCorrespondence.getStatusHistory().get(i).getCorrespondenceStatus().equals(CorrespondenceStatus.VERIFIED))
                    {
                        if (voClinicalCorrespondence.getVerifyingHCPIsNotNull() &&
                                voClinicalCorrespondence.getVerifyingDateTimeIsNotNull())
                        {
                            form.lyrDetails().tabRecipents().qmbVerifyingHCP().newRow(voClinicalCorrespondence.getVerifyingHCP(), voClinicalCorrespondence.getVerifyingHCP().toString());
                            form.lyrDetails().tabRecipents().qmbVerifyingHCP().setValue(voClinicalCorrespondence.getVerifyingHCP());
                            form.lyrDetails().tabRecipents().dtimVerifying().setValue(voClinicalCorrespondence.getVerifyingDateTime());
                            return true;
                        }
                    }
                }
            }
        }
    }
    return false;
}
项目:openMAXIMS    文件:Logic.java   
private void open()
{
    clearScreen();
    setCurrentClinicalNote();

    ClinicalCorrespondenceVo voClinicalCorrespondence = null;

    /*
    if(form.getGlobalContext().Clinical.getReturnToFormNameIsNotNull() && 
            form.getGlobalContext().Clinical.getReturnToFormName().equals(form.getForms().Clinical.OutPatientsTreatmentPlan))
            */
    CareContextShortVo careContext = form.getGlobalContext().Core.getCurrentCareContext();
    if(ContextType.OUTPATIENT.equals(careContext.getContext()))
    {
        voClinicalCorrespondence = domain.getLastClinicalCorrespondence
        (null, 
            ClinicalCorrespondenceType.MEDICALOUTPATIENTLETTER, 
                form.getGlobalContext().Core.getCurrentClinicalContact());
    }
    else
    {
        voClinicalCorrespondence = domain.getLastClinicalCorrespondence
            (form.getGlobalContext().Core.getCurrentCareContext(), 
                ClinicalCorrespondenceType.MEDICALINPATIENTDISCHARGE, 
                    null);
    }

    form.getLocalContext().setSelectedItem(voClinicalCorrespondence);
    //WDEV-2536
    setTooltip(voClinicalCorrespondence);

        verifyStatusHistory();

    form.setMode(FormMode.VIEW);

    if(voClinicalCorrespondence == null)
    {
        form.btnNew().setVisible(true);
        form.btnUpdate().setVisible(false);
        form.getLocalContext().setOutpatientSummaryChanged(Boolean.TRUE);
    }
    else
    {
        form.btnNew().setVisible(false);
        form.btnUpdate().setVisible(true);

        displayRecord(voClinicalCorrespondence);
        form.getLocalContext().setReportChanged(Boolean.TRUE);

    }

    updateContextMenu();
}
项目:openMAXIMS    文件:Logic.java   
protected void onFormModeChanged()
{
    boolean viewMode = form.getMode().equals(FormMode.VIEW);
    form.btnClose().setVisible(viewMode && engine.isDialog());  

    if(!viewMode)
    {
        boolean dataSaved = isNewData();
        ClinicalCorrespondenceVo voClinicalCorrespondence = form.getLocalContext().getSelectedItem();

        if(dataSaved)
        {
            form.lyrDetails().tabRecipents().customControlAuthoringInfo().setEnabledAuthoringHCP(Boolean.TRUE);
            form.lyrDetails().tabRecipents().customControlAuthoringInfo().setEnabledDateTime(Boolean.TRUE);
        }
        else
        {
            form.lyrDetails().tabRecipents().customControlAuthoringInfo().setEnabledAuthoringHCP(Boolean.FALSE);
            form.lyrDetails().tabRecipents().customControlAuthoringInfo().setEnabledDateTime(Boolean.FALSE);
        }

        if(voClinicalCorrespondence != null)
        {
            //wdev-1800
            boolean bFound = true;
            if (voClinicalCorrespondence.getCurrentStatusIsNotNull() && voClinicalCorrespondence.getCurrentStatus().getCorrespondenceStatus().equals(CorrespondenceStatus.VERIFIED))
                bFound = false;

            if (voClinicalCorrespondence.getStatusHistoryIsNotNull() && voClinicalCorrespondence.getStatusHistory().size() > 0)
            {
                for (int i = 0 ; i < voClinicalCorrespondence.getStatusHistory().size() ; i ++)
                {
                    if (voClinicalCorrespondence.getStatusHistory().get(i).getCorrespondenceStatus().equals(CorrespondenceStatus.VERIFIED))
                    {
                        bFound = false;

                        break;
                    }
                }
            }
            enableVerified(bFound);
        }
        else
            enableVerified(true);
    }

    //WDEV-1039 - 4) Disable the preview until the ClinicalCorrespondenceBo has been saved and in Edit Mode   
    form.lyrDetails().tabPreview().setHeaderEnabled(viewMode && !isNewData());
}
项目:openMAXIMS    文件:Logic.java   
private boolean isNewData()
{
    ClinicalCorrespondenceVo voClinicalCorrespondence = form.getLocalContext().getSelectedItem();
    return !(voClinicalCorrespondence != null && voClinicalCorrespondence.getID_ClinicalCorrespondenceIsNotNull());
}
项目:openMAXIMS    文件:DocumentGenerationImpl.java   
/**
* getLastClinicalCorrespondence
*/
public ClinicalCorrespondenceVo getLastClinicalCorrespondence(CareContextRefVo careContext, ClinicalCorrespondenceType type, ClinicalContactRefVo clinicalContact)
{
    /*
    if(careContext == null)
        throw new CodingRuntimeException("null careContext passed to getLastClinicalCorrespondence() !");
    */
    ArrayList names = new ArrayList();
    ArrayList values = new ArrayList();

    if(type == null)
        throw new CodingRuntimeException("null type passed to getLastClinicalCorrespondence() !");

    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("from ClinicalCorrespondence as c1_1 ");
    hql.append(" where c1_1.type.id = :TYPEID");
    names.add("TYPEID");
    values.add(new Integer(type.getId()));

    if (careContext != null)
    {
        hql.append (" and c1_1.careContext.id = :CONTEXTID");
        names.add("CONTEXTID");
        values.add(careContext.getID_CareContext());    
    }

    if (clinicalContact != null)
    {
        hql.append (" and c1_1.clinicalContact.id = :CONTACTID");
        names.add("CONTACTID");
        values.add(clinicalContact.getID_ClinicalContact());    
    }

    List list = factory.find(hql.toString(), names, values);

    if(list.size() == 0)
        return null;

    ClinicalCorrespondenceVo voClinicalCorrespondence = ClinicalCorrespondenceVoAssembler.create((ClinicalCorrespondence)list.get(0));

    if (type.equals(ClinicalCorrespondenceType.MEDICALOUTPATIENTLETTER))
    {
        if(voClinicalCorrespondence.getOPDNotes() == null && clinicalContact != null && clinicalContact.getID_ClinicalContactIsNotNull())
            voClinicalCorrespondence.setOPDNotes(getOPDSummary(clinicalContact));
    }

    return voClinicalCorrespondence;
}
项目:openmaxims-linux    文件:Logic.java   
private boolean verifyStatusHistory()
{
    if (form.lyrDetails().tabRecipents().cmbStatus().getValue() != null)
    {
        if (form.lyrDetails().tabRecipents().cmbStatus().getValue().equals(CorrespondenceStatus.VERIFIED))
        {

            ClinicalCorrespondenceVo voClinicalCorrespondence = null;

            CareContextShortVo careContext = form.getGlobalContext().Core.getCurrentCareContext();

            if(ContextType.OUTPATIENT.equals(careContext.getContext()))
            {
                voClinicalCorrespondence = domain.getLastClinicalCorrespondence
                    (form.getGlobalContext().Core.getCurrentCareContext(), 
                        ClinicalCorrespondenceType.MEDICALOUTPATIENTLETTER, 
                            form.getGlobalContext().Core.getCurrentClinicalContact());
            }
            else
            {
                voClinicalCorrespondence = domain.getLastClinicalCorrespondence
                    (form.getGlobalContext().Core.getCurrentCareContext(), 
                        ClinicalCorrespondenceType.MEDICALINPATIENTDISCHARGE, 
                            form.getGlobalContext().Core.getCurrentClinicalContact());
            }

            if (voClinicalCorrespondence != null &&
                    voClinicalCorrespondence.getStatusHistoryIsNotNull())
            {
                for (int i = 0; i < voClinicalCorrespondence.getStatusHistory().size(); i++)
                {
                    if (voClinicalCorrespondence.getStatusHistory().get(i).getCorrespondenceStatus().equals(CorrespondenceStatus.VERIFIED))
                    {
                        if (voClinicalCorrespondence.getVerifyingHCPIsNotNull() &&
                                voClinicalCorrespondence.getVerifyingDateTimeIsNotNull())
                        {
                            form.lyrDetails().tabRecipents().qmbVerifyingHCP().newRow(voClinicalCorrespondence.getVerifyingHCP(), voClinicalCorrespondence.getVerifyingHCP().toString());
                            form.lyrDetails().tabRecipents().qmbVerifyingHCP().setValue(voClinicalCorrespondence.getVerifyingHCP());
                            form.lyrDetails().tabRecipents().dtimVerifying().setValue(voClinicalCorrespondence.getVerifyingDateTime());
                            return true;
                        }
                    }
                }
            }
        }
    }
    return false;
}
项目:openmaxims-linux    文件:Logic.java   
private void open()
{
    clearScreen();
    setCurrentClinicalNote();

    ClinicalCorrespondenceVo voClinicalCorrespondence = null;

    /*
    if(form.getGlobalContext().Clinical.getReturnToFormNameIsNotNull() && 
            form.getGlobalContext().Clinical.getReturnToFormName().equals(form.getForms().Clinical.OutPatientsTreatmentPlan))
            */
    CareContextShortVo careContext = form.getGlobalContext().Core.getCurrentCareContext();
    if(ContextType.OUTPATIENT.equals(careContext.getContext()))
    {
        voClinicalCorrespondence = domain.getLastClinicalCorrespondence
        (null, 
            ClinicalCorrespondenceType.MEDICALOUTPATIENTLETTER, 
                form.getGlobalContext().Core.getCurrentClinicalContact());
    }
    else
    {
        voClinicalCorrespondence = domain.getLastClinicalCorrespondence
            (form.getGlobalContext().Core.getCurrentCareContext(), 
                ClinicalCorrespondenceType.MEDICALINPATIENTDISCHARGE, 
                    null);
    }

    form.getLocalContext().setSelectedItem(voClinicalCorrespondence);
    //WDEV-2536
    setTooltip(voClinicalCorrespondence);

        verifyStatusHistory();

    form.setMode(FormMode.VIEW);

    if(voClinicalCorrespondence == null)
    {
        form.btnNew().setVisible(true);
        form.btnUpdate().setVisible(false);
        form.getLocalContext().setOutpatientSummaryChanged(Boolean.TRUE);
    }
    else
    {
        form.btnNew().setVisible(false);
        form.btnUpdate().setVisible(true);

        displayRecord(voClinicalCorrespondence);
        form.getLocalContext().setReportChanged(Boolean.TRUE);

    }

    updateContextMenu();
}
项目:openmaxims-linux    文件:Logic.java   
protected void onFormModeChanged()
{
    boolean viewMode = form.getMode().equals(FormMode.VIEW);
    form.btnClose().setVisible(viewMode && engine.isDialog());  

    if(!viewMode)
    {
        boolean dataSaved = isNewData();
        ClinicalCorrespondenceVo voClinicalCorrespondence = form.getLocalContext().getSelectedItem();

        if(dataSaved)
        {
            form.lyrDetails().tabRecipents().customControlAuthoringInfo().setEnabledAuthoringHCP(Boolean.TRUE);
            form.lyrDetails().tabRecipents().customControlAuthoringInfo().setEnabledDateTime(Boolean.TRUE);
        }
        else
        {
            form.lyrDetails().tabRecipents().customControlAuthoringInfo().setEnabledAuthoringHCP(Boolean.FALSE);
            form.lyrDetails().tabRecipents().customControlAuthoringInfo().setEnabledDateTime(Boolean.FALSE);
        }

        if(voClinicalCorrespondence != null)
        {
            //wdev-1800
            boolean bFound = true;
            if (voClinicalCorrespondence.getCurrentStatusIsNotNull() && voClinicalCorrespondence.getCurrentStatus().getCorrespondenceStatus().equals(CorrespondenceStatus.VERIFIED))
                bFound = false;

            if (voClinicalCorrespondence.getStatusHistoryIsNotNull() && voClinicalCorrespondence.getStatusHistory().size() > 0)
            {
                for (int i = 0 ; i < voClinicalCorrespondence.getStatusHistory().size() ; i ++)
                {
                    if (voClinicalCorrespondence.getStatusHistory().get(i).getCorrespondenceStatus().equals(CorrespondenceStatus.VERIFIED))
                    {
                        bFound = false;

                        break;
                    }
                }
            }
            enableVerified(bFound);
        }
        else
            enableVerified(true);
    }

    //WDEV-1039 - 4) Disable the preview until the ClinicalCorrespondenceBo has been saved and in Edit Mode   
    form.lyrDetails().tabPreview().setHeaderEnabled(viewMode && !isNewData());
}
项目:openmaxims-linux    文件:Logic.java   
private boolean isNewData()
{
    ClinicalCorrespondenceVo voClinicalCorrespondence = form.getLocalContext().getSelectedItem();
    return !(voClinicalCorrespondence != null && voClinicalCorrespondence.getID_ClinicalCorrespondenceIsNotNull());
}
项目:openmaxims-linux    文件:DocumentGenerationImpl.java   
/**
* getLastClinicalCorrespondence
*/
public ClinicalCorrespondenceVo getLastClinicalCorrespondence(CareContextRefVo careContext, ClinicalCorrespondenceType type, ClinicalContactRefVo clinicalContact)
{
    /*
    if(careContext == null)
        throw new CodingRuntimeException("null careContext passed to getLastClinicalCorrespondence() !");
    */
    ArrayList names = new ArrayList();
    ArrayList values = new ArrayList();

    if(type == null)
        throw new CodingRuntimeException("null type passed to getLastClinicalCorrespondence() !");

    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("from ClinicalCorrespondence as c1_1 ");
    hql.append(" where c1_1.type.id = :TYPEID");
    names.add("TYPEID");
    values.add(new Integer(type.getId()));

    if (careContext != null)
    {
        hql.append (" and c1_1.careContext.id = :CONTEXTID");
        names.add("CONTEXTID");
        values.add(careContext.getID_CareContext());    
    }

    if (clinicalContact != null)
    {
        hql.append (" and c1_1.clinicalContact.id = :CONTACTID");
        names.add("CONTACTID");
        values.add(clinicalContact.getID_ClinicalContact());    
    }

    List list = factory.find(hql.toString(), names, values);

    if(list.size() == 0)
        return null;

    ClinicalCorrespondenceVo voClinicalCorrespondence = ClinicalCorrespondenceVoAssembler.create((ClinicalCorrespondence)list.get(0));

    if (type.equals(ClinicalCorrespondenceType.MEDICALOUTPATIENTLETTER))
    {
        if(voClinicalCorrespondence.getOPDNotes() == null && clinicalContact != null && clinicalContact.getID_ClinicalContactIsNotNull())
            voClinicalCorrespondence.setOPDNotes(getOPDSummary(clinicalContact));
    }

    return voClinicalCorrespondence;
}