Java 类ims.core.vo.CareContextVoCollection 实例源码

项目:AvoinApotti    文件:Logic.java   
private void populateCareContextRows(CareContextVoCollection voCollCareContexts, grdPatientsRow episodeOfCareRow)
{
    if (voCollCareContexts != null && episodeOfCareRow != null)
    {
        voCollCareContexts.sort();
        grdPatientsRow careContextRow;
        for (int i = 0; i < voCollCareContexts.size(); i++)
        {
            careContextRow = episodeOfCareRow.getRows().newRow();

            String displayString = voCollCareContexts.get(i).createDisplayString();

            careContextRow.setcolStartDateEndDate(displayString);
            careContextRow.setcolSpeciality(voCollCareContexts.get(i).getContextIsNotNull() ? INDENT + INDENT +  voCollCareContexts.get(i).getContext().getText() : null);
            careContextRow.setCollapsedImage(form.getImages().Core.CareContext);
            careContextRow.setExpandedImage(form.getImages().Core.CareContext);
            careContextRow.setValue(voCollCareContexts.get(i));
            populateClinicalContacts(voCollCareContexts.get(i).getClinicalContacts().sort(), careContextRow);

            if(voCollCareContexts.get(i).getEndDateTime() == null)
                careContextRow.setExpanded(true);
        }
    }
}
项目:AvoinApotti    文件:Patient_SummaryImpl.java   
private EpisodeofCareVoCollection populateCareContexstCollection(EpisodeofCareVoCollection episodeColl, CareContextVoCollection careContextColl)
{
    if (episodeColl == null || careContextColl == null)
        return null;
    for (int i = 0; i < episodeColl.size(); i++)
    {
        for (int k = 0; k < careContextColl.size(); k++)
        {
            if (episodeColl.get(i).getID_EpisodeOfCareIsNotNull() && episodeColl.get(i).getID_EpisodeOfCare().equals(careContextColl.get(k).getEpisodeOfCare().getID_EpisodeOfCare()))
            {
                if (!episodeColl.get(i).getCareContextsIsNotNull())
                    episodeColl.get(i).setCareContexts(new CareContextVoCollection());

                episodeColl.get(i).getCareContexts().add(careContextColl.get(k));
            }
        }
    }
    return episodeColl;
}
项目:AvoinApotti    文件:Patient_SummaryImpl.java   
private EpisodeofCareVo copyFromShortEpisode(EpisodeOfCareWithoutContextsVo episodeVo)
{
    if (episodeVo == null)
        return null;
    EpisodeofCareVo tempVo = new EpisodeofCareVo(episodeVo.getID_EpisodeOfCare(), episodeVo.getVersion_EpisodeOfCare());
    tempVo.setID_EpisodeOfCare(episodeVo.getID_EpisodeOfCare());
    tempVo.setCareSpell(episodeVo.getCareSpell());
    tempVo.setEndDate(episodeVo.getEndDate());
    tempVo.setStartDate(episodeVo.getStartDate());
    tempVo.setIsRIE(episodeVo.getIsRIE());
    tempVo.setSpecialty(episodeVo.getSpecialty());
    tempVo.setRelationship(episodeVo.getRelationship());
    tempVo.setResponsibleHCP(episodeVo.getResponsibleHCP());
    tempVo.setCareContexts(new CareContextVoCollection());
    tempVo.setCurrentStatus(episodeVo.getCurrentStatus());
    tempVo.setCurrentReferral(episodeVo.getCurrentReferral());
    tempVo.setEpisodeOfCareHistory(episodeVo.getEpisodeOfCareHistory());
    tempVo.setLinkedReferrals(episodeVo.getLinkedReferrals());
    tempVo.setRelationship(episodeVo.getRelationship());
    tempVo.setStatusHistory(episodeVo.getStatusHistory());

    return tempVo;

}
项目:AvoinApotti    文件:PatientSummaryImpl.java   
private EpisodeofCareVoCollection populateCareContexstCollection(EpisodeofCareVoCollection episodeColl,CareContextVoCollection careContextColl)
{
    if(episodeColl == null || careContextColl == null)
        return null;
    for(int i = 0; i < episodeColl.size();i++)
    {
        for(int k = 0;k < careContextColl.size();k++)
        {
            if(episodeColl.get(i).getID_EpisodeOfCareIsNotNull() && episodeColl.get(i).getID_EpisodeOfCare().equals(careContextColl.get(k).getEpisodeOfCare().getID_EpisodeOfCare()))
            {
                if(!episodeColl.get(i).getCareContextsIsNotNull())
                    episodeColl.get(i).setCareContexts(new CareContextVoCollection());

                episodeColl.get(i).getCareContexts().add(careContextColl.get(k));
            }
        }
    }
    return episodeColl; 
}
项目:openMAXIMS    文件:Logic.java   
private void populateCareContextRows(CareContextVoCollection voCollCareContexts, grdPatientsRow episodeOfCareRow)
{
    if (voCollCareContexts != null && episodeOfCareRow != null)
    {
        voCollCareContexts.sort();
        grdPatientsRow careContextRow;
        for (int i = 0; i < voCollCareContexts.size(); i++)
        {
            careContextRow = episodeOfCareRow.getRows().newRow();

            String displayString = voCollCareContexts.get(i).createDisplayString();

            careContextRow.setcolStartDateEndDate(displayString);
            careContextRow.setcolSpeciality(voCollCareContexts.get(i).getContextIsNotNull() ? INDENT + INDENT +  voCollCareContexts.get(i).getContext().getText() : null);
            careContextRow.setCollapsedImage(form.getImages().Core.CareContext);
            careContextRow.setExpandedImage(form.getImages().Core.CareContext);
            careContextRow.setValue(voCollCareContexts.get(i));
            populateClinicalContacts(voCollCareContexts.get(i).getClinicalContacts().sort(), careContextRow);

            if(voCollCareContexts.get(i).getEndDateTime() == null)
                careContextRow.setExpanded(true);
        }
    }
}
项目:openMAXIMS    文件:Patient_SummaryImpl.java   
private EpisodeofCareVoCollection populateCareContexstCollection(EpisodeofCareVoCollection episodeColl, CareContextVoCollection careContextColl)
{
    if (episodeColl == null || careContextColl == null)
        return null;
    for (int i = 0; i < episodeColl.size(); i++)
    {
        for (int k = 0; k < careContextColl.size(); k++)
        {
            if (episodeColl.get(i).getID_EpisodeOfCareIsNotNull() && episodeColl.get(i).getID_EpisodeOfCare().equals(careContextColl.get(k).getEpisodeOfCare().getID_EpisodeOfCare()))
            {
                if (!episodeColl.get(i).getCareContextsIsNotNull())
                    episodeColl.get(i).setCareContexts(new CareContextVoCollection());

                episodeColl.get(i).getCareContexts().add(careContextColl.get(k));
            }
        }
    }
    return episodeColl;
}
项目:openMAXIMS    文件:Patient_SummaryImpl.java   
private EpisodeofCareVo copyFromShortEpisode(EpisodeOfCareWithoutContextsVo episodeVo)
{
    if (episodeVo == null)
        return null;
    EpisodeofCareVo tempVo = new EpisodeofCareVo(episodeVo.getID_EpisodeOfCare(), episodeVo.getVersion_EpisodeOfCare());
    tempVo.setID_EpisodeOfCare(episodeVo.getID_EpisodeOfCare());
    tempVo.setCareSpell(episodeVo.getCareSpell());
    tempVo.setEndDate(episodeVo.getEndDate());
    tempVo.setStartDate(episodeVo.getStartDate());
    tempVo.setIsRIE(episodeVo.getIsRIE());
    tempVo.setSpecialty(episodeVo.getSpecialty());
    tempVo.setRelationship(episodeVo.getRelationship());
    tempVo.setResponsibleHCP(episodeVo.getResponsibleHCP());
    tempVo.setCareContexts(new CareContextVoCollection());
    tempVo.setCurrentStatus(episodeVo.getCurrentStatus());
    tempVo.setCurrentReferral(episodeVo.getCurrentReferral());
    tempVo.setEpisodeOfCareHistory(episodeVo.getEpisodeOfCareHistory());
    tempVo.setLinkedReferrals(episodeVo.getLinkedReferrals());
    tempVo.setRelationship(episodeVo.getRelationship());
    tempVo.setStatusHistory(episodeVo.getStatusHistory());

    return tempVo;

}
项目:openMAXIMS    文件:PatientSummaryImpl.java   
private EpisodeofCareVoCollection populateCareContexstCollection(EpisodeofCareVoCollection episodeColl,CareContextVoCollection careContextColl)
{
    if(episodeColl == null || careContextColl == null)
        return null;
    for(int i = 0; i < episodeColl.size();i++)
    {
        for(int k = 0;k < careContextColl.size();k++)
        {
            if(episodeColl.get(i).getID_EpisodeOfCareIsNotNull() && episodeColl.get(i).getID_EpisodeOfCare().equals(careContextColl.get(k).getEpisodeOfCare().getID_EpisodeOfCare()))
            {
                if(!episodeColl.get(i).getCareContextsIsNotNull())
                    episodeColl.get(i).setCareContexts(new CareContextVoCollection());

                episodeColl.get(i).getCareContexts().add(careContextColl.get(k));
            }
        }
    }
    return episodeColl; 
}
项目:openMAXIMS    文件:Logic.java   
private void populateCareContextRows(CareContextVoCollection voCollCareContexts, grdPatientsRow episodeOfCareRow)
{
    if (voCollCareContexts != null && episodeOfCareRow != null)
    {
        voCollCareContexts.sort();
        grdPatientsRow careContextRow;
        for (int i = 0; i < voCollCareContexts.size(); i++)
        {
            careContextRow = episodeOfCareRow.getRows().newRow();

            String displayString = voCollCareContexts.get(i).createDisplayString();

            careContextRow.setcolStartDateEndDate(displayString);
            careContextRow.setcolSpeciality(voCollCareContexts.get(i).getContextIsNotNull() ? INDENT + INDENT +  voCollCareContexts.get(i).getContext().getText() : null);
            careContextRow.setCollapsedImage(form.getImages().Core.CareContext);
            careContextRow.setExpandedImage(form.getImages().Core.CareContext);
            careContextRow.setValue(voCollCareContexts.get(i));
            populateClinicalContacts(voCollCareContexts.get(i).getClinicalContacts().sort(), careContextRow);

            if(voCollCareContexts.get(i).getEndDateTime() == null)
                careContextRow.setExpanded(true);
        }
    }
}
项目:openMAXIMS    文件:Patient_SummaryImpl.java   
private EpisodeofCareVoCollection populateCareContexstCollection(EpisodeofCareVoCollection episodeColl, CareContextVoCollection careContextColl)
{
    if (episodeColl == null || careContextColl == null)
        return null;
    for (int i = 0; i < episodeColl.size(); i++)
    {
        for (int k = 0; k < careContextColl.size(); k++)
        {
            if (episodeColl.get(i).getID_EpisodeOfCareIsNotNull() && episodeColl.get(i).getID_EpisodeOfCare().equals(careContextColl.get(k).getEpisodeOfCare().getID_EpisodeOfCare()))
            {
                if (!episodeColl.get(i).getCareContextsIsNotNull())
                    episodeColl.get(i).setCareContexts(new CareContextVoCollection());

                episodeColl.get(i).getCareContexts().add(careContextColl.get(k));
            }
        }
    }
    return episodeColl;
}
项目:openMAXIMS    文件:Patient_SummaryImpl.java   
private EpisodeofCareVo copyFromShortEpisode(EpisodeOfCareWithoutContextsVo episodeVo)
{
    if (episodeVo == null)
        return null;
    EpisodeofCareVo tempVo = new EpisodeofCareVo(episodeVo.getID_EpisodeOfCare(), episodeVo.getVersion_EpisodeOfCare());
    tempVo.setID_EpisodeOfCare(episodeVo.getID_EpisodeOfCare());
    tempVo.setCareSpell(episodeVo.getCareSpell());
    tempVo.setEndDate(episodeVo.getEndDate());
    tempVo.setStartDate(episodeVo.getStartDate());
    tempVo.setIsRIE(episodeVo.getIsRIE());
    tempVo.setSpecialty(episodeVo.getSpecialty());
    tempVo.setRelationship(episodeVo.getRelationship());
    tempVo.setResponsibleHCP(episodeVo.getResponsibleHCP());
    tempVo.setCareContexts(new CareContextVoCollection());
    tempVo.setCurrentStatus(episodeVo.getCurrentStatus());
    tempVo.setCurrentReferral(episodeVo.getCurrentReferral());
    tempVo.setEpisodeOfCareHistory(episodeVo.getEpisodeOfCareHistory());
    tempVo.setLinkedReferrals(episodeVo.getLinkedReferrals());
    tempVo.setRelationship(episodeVo.getRelationship());
    tempVo.setStatusHistory(episodeVo.getStatusHistory());

    return tempVo;

}
项目:openMAXIMS    文件:PatientSummaryImpl.java   
private EpisodeofCareVoCollection populateCareContexstCollection(EpisodeofCareVoCollection episodeColl,CareContextVoCollection careContextColl)
{
    if(episodeColl == null || careContextColl == null)
        return null;
    for(int i = 0; i < episodeColl.size();i++)
    {
        for(int k = 0;k < careContextColl.size();k++)
        {
            if(episodeColl.get(i).getID_EpisodeOfCareIsNotNull() && episodeColl.get(i).getID_EpisodeOfCare().equals(careContextColl.get(k).getEpisodeOfCare().getID_EpisodeOfCare()))
            {
                if(!episodeColl.get(i).getCareContextsIsNotNull())
                    episodeColl.get(i).setCareContexts(new CareContextVoCollection());

                episodeColl.get(i).getCareContexts().add(careContextColl.get(k));
            }
        }
    }
    return episodeColl; 
}
项目:openmaxims-linux    文件:Logic.java   
private void populateCareContextRows(CareContextVoCollection voCollCareContexts, grdPatientsRow episodeOfCareRow)
{
    if (voCollCareContexts != null && episodeOfCareRow != null)
    {
        voCollCareContexts.sort();
        grdPatientsRow careContextRow;
        for (int i = 0; i < voCollCareContexts.size(); i++)
        {
            careContextRow = episodeOfCareRow.getRows().newRow();

            String displayString = voCollCareContexts.get(i).createDisplayString();

            careContextRow.setcolStartDateEndDate(displayString);
            careContextRow.setcolSpeciality(voCollCareContexts.get(i).getContextIsNotNull() ? INDENT + INDENT +  voCollCareContexts.get(i).getContext().getText() : null);
            careContextRow.setCollapsedImage(form.getImages().Core.CareContext);
            careContextRow.setExpandedImage(form.getImages().Core.CareContext);
            careContextRow.setValue(voCollCareContexts.get(i));
            populateClinicalContacts(voCollCareContexts.get(i).getClinicalContacts().sort(), careContextRow);

            if(voCollCareContexts.get(i).getEndDateTime() == null)
                careContextRow.setExpanded(true);
        }
    }
}
项目:openmaxims-linux    文件:Patient_SummaryImpl.java   
private EpisodeofCareVoCollection populateCareContexstCollection(EpisodeofCareVoCollection episodeColl, CareContextVoCollection careContextColl)
{
    if (episodeColl == null || careContextColl == null)
        return null;
    for (int i = 0; i < episodeColl.size(); i++)
    {
        for (int k = 0; k < careContextColl.size(); k++)
        {
            if (episodeColl.get(i).getID_EpisodeOfCareIsNotNull() && episodeColl.get(i).getID_EpisodeOfCare().equals(careContextColl.get(k).getEpisodeOfCare().getID_EpisodeOfCare()))
            {
                if (!episodeColl.get(i).getCareContextsIsNotNull())
                    episodeColl.get(i).setCareContexts(new CareContextVoCollection());

                episodeColl.get(i).getCareContexts().add(careContextColl.get(k));
            }
        }
    }
    return episodeColl;
}
项目:openmaxims-linux    文件:Patient_SummaryImpl.java   
private EpisodeofCareVo copyFromShortEpisode(EpisodeOfCareWithoutContextsVo episodeVo)
{
    if (episodeVo == null)
        return null;
    EpisodeofCareVo tempVo = new EpisodeofCareVo(episodeVo.getID_EpisodeOfCare(), episodeVo.getVersion_EpisodeOfCare());
    tempVo.setID_EpisodeOfCare(episodeVo.getID_EpisodeOfCare());
    tempVo.setCareSpell(episodeVo.getCareSpell());
    tempVo.setEndDate(episodeVo.getEndDate());
    tempVo.setStartDate(episodeVo.getStartDate());
    tempVo.setIsRIE(episodeVo.getIsRIE());
    tempVo.setSpecialty(episodeVo.getSpecialty());
    tempVo.setRelationship(episodeVo.getRelationship());
    tempVo.setResponsibleHCP(episodeVo.getResponsibleHCP());
    tempVo.setCareContexts(new CareContextVoCollection());
    tempVo.setCurrentStatus(episodeVo.getCurrentStatus());
    tempVo.setCurrentReferral(episodeVo.getCurrentReferral());
    tempVo.setEpisodeOfCareHistory(episodeVo.getEpisodeOfCareHistory());
    tempVo.setLinkedReferrals(episodeVo.getLinkedReferrals());
    tempVo.setRelationship(episodeVo.getRelationship());
    tempVo.setStatusHistory(episodeVo.getStatusHistory());

    return tempVo;

}
项目:openmaxims-linux    文件:PatientSummaryImpl.java   
private EpisodeofCareVoCollection populateCareContexstCollection(EpisodeofCareVoCollection episodeColl,CareContextVoCollection careContextColl)
{
    if(episodeColl == null || careContextColl == null)
        return null;
    for(int i = 0; i < episodeColl.size();i++)
    {
        for(int k = 0;k < careContextColl.size();k++)
        {
            if(episodeColl.get(i).getID_EpisodeOfCareIsNotNull() && episodeColl.get(i).getID_EpisodeOfCare().equals(careContextColl.get(k).getEpisodeOfCare().getID_EpisodeOfCare()))
            {
                if(!episodeColl.get(i).getCareContextsIsNotNull())
                    episodeColl.get(i).setCareContexts(new CareContextVoCollection());

                episodeColl.get(i).getCareContexts().add(careContextColl.get(k));
            }
        }
    }
    return episodeColl; 
}
项目:AvoinApotti    文件:Logic.java   
private CareSpellVoCollection patientIsCurrentInpatient()
    {
        CareSpellVoCollection inpatientCare = new CareSpellVoCollection();
        CareSpellVoCollection inpatientCareList = new CareSpellVoCollection();
//      CareSpellVo inpatCare = new CareSpellVo();
        CareSpellVoCollection careList = domain.listCareSpellsByPatient(form.getGlobalContext().Core.getPatientShort(), null);

        if (careList != null)
        {
            for (int index = 0; index < careList.size(); index++)
            {
                EpisodeofCareVoCollection episodeList = careList.get(index).getEpisodes();
                for (int i = 0; i < episodeList.size(); i++)
                {
                    CareContextVoCollection careContextList = episodeList.get(i).getCareContexts();
                    for (int j = 0; j < careContextList.size(); j++)
                    {

                        if (careContextList.get(j).getContext().equals(ContextType.INPATIENT) == true /*&& careContextList.get(j).getEndDateTime() == null*/)
                        {
                            inpatientCareList.add(careList.get(index));
                        }
                    }
                }
            }
        }
        if (inpatientCareList.size() > 0)
        {
            inpatientCare.add(inpatientCareList.get(0));
            return inpatientCare;

        }

        return inpatientCareList;

    }
项目:AvoinApotti    文件:Logic.java   
private CareContextVoCollection createNewCareContext(EpisodeofCareVo voEpisodeOfCare)
{
    CareContextVoCollection voCollCareContext = new CareContextVoCollection();
    CareContextVo voCareContext = new CareContextVo();

    voCareContext.setContext(ContextType.EMERGENCY_FIRST_VISIT);
    voCareContext.setStartDateTime(form.dtimArrival().getValue());
    voCareContext.setEpisodeOfCare(voEpisodeOfCare);
    voCollCareContext.add(voCareContext);

    form.getLocalContext().setcareContextToSave(voCareContext);

    return voCollCareContext;
}
项目:AvoinApotti    文件:Logic.java   
private CareContextVo populateCareContext(EpisodeofCareVo voEpisodeOfCare)
{
    CareContextVo voCareContext = new CareContextVo();
    populateCareContextInstanceData(voCareContext);
    voCareContext.setEpisodeOfCare(voEpisodeOfCare);
    if(voEpisodeOfCare.getCareContexts() == null)
        voEpisodeOfCare.setCareContexts(new CareContextVoCollection());

    voEpisodeOfCare.getCareContexts().add(voCareContext);

    return voCareContext;
}
项目:AvoinApotti    文件:PatientSummaryImpl.java   
private EpisodeofCareVo copyFromShortEpisode(EpisodeOfCareWithoutContextsVo episodeVo) 
{
    if(episodeVo == null)
        return null;
    EpisodeofCareVo tempVo = new EpisodeofCareVo(episodeVo.getID_EpisodeOfCare(),episodeVo.getVersion_EpisodeOfCare());
    tempVo.setID_EpisodeOfCare(episodeVo.getID_EpisodeOfCare());
    tempVo.setCareSpell(episodeVo.getCareSpell());
    tempVo.setEndDate(episodeVo.getEndDate());
    tempVo.setStartDate(episodeVo.getStartDate());
    tempVo.setIsRIE(episodeVo.getIsRIE());
    tempVo.setSpecialty(episodeVo.getSpecialty());
    tempVo.setRelationship(episodeVo.getRelationship());
    tempVo.setResponsibleHCP(episodeVo.getResponsibleHCP());
    tempVo.setCareContexts(new CareContextVoCollection());
    tempVo.setCurrentStatus(episodeVo.getCurrentStatus());  
    tempVo.setCurrentReferral(episodeVo.getCurrentReferral());
    tempVo.setEpisodeOfCareHistory(episodeVo.getEpisodeOfCareHistory());
    tempVo.setLinkedReferrals(episodeVo.getLinkedReferrals());
    tempVo.setRelationship(episodeVo.getRelationship());
    tempVo.setStatusHistory(episodeVo.getStatusHistory());



    return tempVo;


}
项目:openMAXIMS    文件:Logic.java   
private CareSpellVoCollection patientIsCurrentInpatient()
    {
        CareSpellVoCollection inpatientCare = new CareSpellVoCollection();
        CareSpellVoCollection inpatientCareList = new CareSpellVoCollection();
//      CareSpellVo inpatCare = new CareSpellVo();
        CareSpellVoCollection careList = domain.listCareSpellsByPatient(form.getGlobalContext().Core.getPatientShort(), null);

        if (careList != null)
        {
            for (int index = 0; index < careList.size(); index++)
            {
                EpisodeofCareVoCollection episodeList = careList.get(index).getEpisodes();
                for (int i = 0; i < episodeList.size(); i++)
                {
                    CareContextVoCollection careContextList = episodeList.get(i).getCareContexts();
                    for (int j = 0; j < careContextList.size(); j++)
                    {

                        if (careContextList.get(j).getContext().equals(ContextType.INPATIENT) == true /*&& careContextList.get(j).getEndDateTime() == null*/)
                        {
                            inpatientCareList.add(careList.get(index));
                        }
                    }
                }
            }
        }
        if (inpatientCareList.size() > 0)
        {
            inpatientCare.add(inpatientCareList.get(0));
            return inpatientCare;

        }

        return inpatientCareList;

    }
项目:openMAXIMS    文件:Logic.java   
private EpisodeofCareVo createEpisodeOfCare(CareSpellVo careSpell)
{
    EpisodeofCareVo episodeOfCare = new EpisodeofCareVo();

    episodeOfCare.setCareSpell(careSpell);
    episodeOfCare.setStartDate(form.dtimAdmissionDateTime().getValue()!=null ? form.dtimAdmissionDateTime().getValue().getDate():null);

    HcpLiteVo tempRespHcp = null;

    if (form.ccAdmittingConsultant().getValue()!=null)
        tempRespHcp=(HcpLiteVo) domain.getHcp(form.ccAdmittingConsultant().getValue().getIMosHcpId());

    episodeOfCare.setResponsibleHCP(tempRespHcp);

    if (form.ccAdmittingConsultant().getValue() != null && domain.getSpecialtyForConsultant(form.ccAdmittingConsultant().getValue().getIMosId())!=null)
    {
        episodeOfCare.setSpecialty(form.ccAdmittingConsultant().getValue() != null ? domain.getSpecialtyForConsultant(form.ccAdmittingConsultant().getValue().getIMosId()) : null);
    }
    else
    {
        episodeOfCare.setSpecialty(form.cmbSpecialty().getValue());
    }

    CareContextVoCollection voCollCareContext = new CareContextVoCollection();
    voCollCareContext.add(createOrUpdateCareContext(episodeOfCare, null));
    episodeOfCare.setCareContexts(voCollCareContext);

    // form.getLocalContext().setEpisodeOfCare(episodeOfCare);

    return episodeOfCare;

}
项目:openMAXIMS    文件:Logic.java   
private CareContextVoCollection createNewCareContext(EpisodeofCareVo voEpisodeOfCare)
{
    CareContextVoCollection voCollCareContext = new CareContextVoCollection();
    CareContextVo voCareContext = new CareContextVo();

    voCareContext.setContext(ContextType.EMERGENCY_FIRST_VISIT);
    voCareContext.setStartDateTime(form.dtimArrival().getValue());
    voCareContext.setEpisodeOfCare(voEpisodeOfCare);
    voCollCareContext.add(voCareContext);

    form.getLocalContext().setcareContextToSave(voCareContext);

    return voCollCareContext;
}
项目:openMAXIMS    文件:Logic.java   
private CareContextVo populateCareContext(EpisodeofCareVo voEpisodeOfCare, HcpLiteVo voHCPLite)
{
    CareContextVo voCareContext = new CareContextVo();
    populateCareContextInstanceData(voCareContext,voHCPLite);
    voCareContext.setEpisodeOfCare(voEpisodeOfCare);
    if(voEpisodeOfCare.getCareContexts() == null)
        voEpisodeOfCare.setCareContexts(new CareContextVoCollection());

    voEpisodeOfCare.getCareContexts().add(voCareContext);

    return voCareContext;
}
项目:openMAXIMS    文件:PatientSummaryImpl.java   
private EpisodeofCareVo copyFromShortEpisode(EpisodeOfCareWithoutContextsVo episodeVo) 
{
    if(episodeVo == null)
        return null;
    EpisodeofCareVo tempVo = new EpisodeofCareVo(episodeVo.getID_EpisodeOfCare(),episodeVo.getVersion_EpisodeOfCare());
    tempVo.setID_EpisodeOfCare(episodeVo.getID_EpisodeOfCare());
    tempVo.setCareSpell(episodeVo.getCareSpell());
    tempVo.setEndDate(episodeVo.getEndDate());
    tempVo.setStartDate(episodeVo.getStartDate());
    tempVo.setIsRIE(episodeVo.getIsRIE());
    tempVo.setSpecialty(episodeVo.getSpecialty());
    tempVo.setRelationship(episodeVo.getRelationship());
    tempVo.setResponsibleHCP(episodeVo.getResponsibleHCP());
    tempVo.setCareContexts(new CareContextVoCollection());
    tempVo.setCurrentStatus(episodeVo.getCurrentStatus());  
    tempVo.setCurrentReferral(episodeVo.getCurrentReferral());
    tempVo.setEpisodeOfCareHistory(episodeVo.getEpisodeOfCareHistory());
    tempVo.setLinkedReferrals(episodeVo.getLinkedReferrals());
    tempVo.setRelationship(episodeVo.getRelationship());
    tempVo.setStatusHistory(episodeVo.getStatusHistory());



    return tempVo;


}
项目:openMAXIMS    文件:Logic.java   
private CareSpellVoCollection patientIsCurrentInpatient()
    {
        CareSpellVoCollection inpatientCare = new CareSpellVoCollection();
        CareSpellVoCollection inpatientCareList = new CareSpellVoCollection();
//      CareSpellVo inpatCare = new CareSpellVo();
        CareSpellVoCollection careList = domain.listCareSpellsByPatient(form.getGlobalContext().Core.getPatientShort(), null);

        if (careList != null)
        {
            for (int index = 0; index < careList.size(); index++)
            {
                EpisodeofCareVoCollection episodeList = careList.get(index).getEpisodes();
                for (int i = 0; i < episodeList.size(); i++)
                {
                    CareContextVoCollection careContextList = episodeList.get(i).getCareContexts();
                    for (int j = 0; j < careContextList.size(); j++)
                    {

                        if (careContextList.get(j).getContext().equals(ContextType.INPATIENT) == true /*&& careContextList.get(j).getEndDateTime() == null*/)
                        {
                            inpatientCareList.add(careList.get(index));
                        }
                    }
                }
            }
        }
        if (inpatientCareList.size() > 0)
        {
            inpatientCare.add(inpatientCareList.get(0));
            return inpatientCare;

        }

        return inpatientCareList;

    }
项目:openMAXIMS    文件:Logic.java   
private EpisodeofCareVo createEpisodeOfCare(CareSpellVo careSpell)
{
    EpisodeofCareVo episodeOfCare = new EpisodeofCareVo();

    episodeOfCare.setCareSpell(careSpell);
    episodeOfCare.setStartDate(form.dtimAdmissionDateTime().getValue()!=null ? form.dtimAdmissionDateTime().getValue().getDate():null);

    HcpLiteVo tempRespHcp = null;

    if (form.ccAdmittingConsultant().getValue()!=null)
        tempRespHcp=(HcpLiteVo) domain.getHcp(form.ccAdmittingConsultant().getValue().getIMosHcpId());

    episodeOfCare.setResponsibleHCP(tempRespHcp);

    if (form.ccAdmittingConsultant().getValue() != null && domain.getSpecialtyForConsultant(form.ccAdmittingConsultant().getValue().getIMosId())!=null)
    {
        episodeOfCare.setSpecialty(form.ccAdmittingConsultant().getValue() != null ? domain.getSpecialtyForConsultant(form.ccAdmittingConsultant().getValue().getIMosId()) : null);
    }
    else
    {
        episodeOfCare.setSpecialty(form.cmbSpecialty().getValue());
    }

    CareContextVoCollection voCollCareContext = new CareContextVoCollection();
    voCollCareContext.add(createOrUpdateCareContext(episodeOfCare, null));
    episodeOfCare.setCareContexts(voCollCareContext);

    // form.getLocalContext().setEpisodeOfCare(episodeOfCare);

    return episodeOfCare;

}
项目:openMAXIMS    文件:Logic.java   
private CareContextVoCollection createNewCareContext(EpisodeofCareVo voEpisodeOfCare)
{
    CareContextVoCollection voCollCareContext = new CareContextVoCollection();
    CareContextVo voCareContext = new CareContextVo();

    voCareContext.setContext(ContextType.EMERGENCY_FIRST_VISIT);
    voCareContext.setStartDateTime(form.dtimArrival().getValue());
    voCareContext.setEpisodeOfCare(voEpisodeOfCare);
    voCollCareContext.add(voCareContext);

    form.getLocalContext().setcareContextToSave(voCareContext);

    return voCollCareContext;
}
项目:openMAXIMS    文件:Logic.java   
private CareContextVo populateCareContext(EpisodeofCareVo voEpisodeOfCare)
{
    CareContextVo voCareContext = new CareContextVo();
    populateCareContextInstanceData(voCareContext);
    voCareContext.setEpisodeOfCare(voEpisodeOfCare);
    if(voEpisodeOfCare.getCareContexts() == null)
        voEpisodeOfCare.setCareContexts(new CareContextVoCollection());

    voEpisodeOfCare.getCareContexts().add(voCareContext);

    return voCareContext;
}
项目:openMAXIMS    文件:PatientSummaryImpl.java   
private EpisodeofCareVo copyFromShortEpisode(EpisodeOfCareWithoutContextsVo episodeVo) 
{
    if(episodeVo == null)
        return null;
    EpisodeofCareVo tempVo = new EpisodeofCareVo(episodeVo.getID_EpisodeOfCare(),episodeVo.getVersion_EpisodeOfCare());
    tempVo.setID_EpisodeOfCare(episodeVo.getID_EpisodeOfCare());
    tempVo.setCareSpell(episodeVo.getCareSpell());
    tempVo.setEndDate(episodeVo.getEndDate());
    tempVo.setStartDate(episodeVo.getStartDate());
    tempVo.setIsRIE(episodeVo.getIsRIE());
    tempVo.setSpecialty(episodeVo.getSpecialty());
    tempVo.setRelationship(episodeVo.getRelationship());
    tempVo.setResponsibleHCP(episodeVo.getResponsibleHCP());
    tempVo.setCareContexts(new CareContextVoCollection());
    tempVo.setCurrentStatus(episodeVo.getCurrentStatus());  
    tempVo.setCurrentReferral(episodeVo.getCurrentReferral());
    tempVo.setEpisodeOfCareHistory(episodeVo.getEpisodeOfCareHistory());
    tempVo.setLinkedReferrals(episodeVo.getLinkedReferrals());
    tempVo.setRelationship(episodeVo.getRelationship());
    tempVo.setStatusHistory(episodeVo.getStatusHistory());



    return tempVo;


}
项目:openmaxims-linux    文件:Logic.java   
private CareSpellVoCollection patientIsCurrentInpatient()
    {
        CareSpellVoCollection inpatientCare = new CareSpellVoCollection();
        CareSpellVoCollection inpatientCareList = new CareSpellVoCollection();
//      CareSpellVo inpatCare = new CareSpellVo();
        CareSpellVoCollection careList = domain.listCareSpellsByPatient(form.getGlobalContext().Core.getPatientShort(), null);

        if (careList != null)
        {
            for (int index = 0; index < careList.size(); index++)
            {
                EpisodeofCareVoCollection episodeList = careList.get(index).getEpisodes();
                for (int i = 0; i < episodeList.size(); i++)
                {
                    CareContextVoCollection careContextList = episodeList.get(i).getCareContexts();
                    for (int j = 0; j < careContextList.size(); j++)
                    {

                        if (careContextList.get(j).getContext().equals(ContextType.INPATIENT) == true /*&& careContextList.get(j).getEndDateTime() == null*/)
                        {
                            inpatientCareList.add(careList.get(index));
                        }
                    }
                }
            }
        }
        if (inpatientCareList.size() > 0)
        {
            inpatientCare.add(inpatientCareList.get(0));
            return inpatientCare;

        }

        return inpatientCareList;

    }
项目:openmaxims-linux    文件:Logic.java   
private EpisodeofCareVo createEpisodeOfCare(CareSpellVo careSpell)
{
    EpisodeofCareVo episodeOfCare = new EpisodeofCareVo();

    episodeOfCare.setCareSpell(careSpell);
    episodeOfCare.setStartDate(form.dtimAdmissionDateTime().getValue()!=null ? form.dtimAdmissionDateTime().getValue().getDate():null);

    HcpLiteVo tempRespHcp = null;

    if (form.ccAdmittingConsultant().getValue()!=null)
        tempRespHcp=(HcpLiteVo) domain.getHcp(form.ccAdmittingConsultant().getValue().getIMosHcpId());

    episodeOfCare.setResponsibleHCP(tempRespHcp);

    if (form.ccAdmittingConsultant().getValue() != null && domain.getSpecialtyForConsultant(form.ccAdmittingConsultant().getValue().getIMosId())!=null)
    {
        episodeOfCare.setSpecialty(form.ccAdmittingConsultant().getValue() != null ? domain.getSpecialtyForConsultant(form.ccAdmittingConsultant().getValue().getIMosId()) : null);
    }
    else
    {
        episodeOfCare.setSpecialty(form.cmbSpecialty().getValue());
    }

    CareContextVoCollection voCollCareContext = new CareContextVoCollection();
    voCollCareContext.add(createOrUpdateCareContext(episodeOfCare, null));
    episodeOfCare.setCareContexts(voCollCareContext);

    // form.getLocalContext().setEpisodeOfCare(episodeOfCare);

    return episodeOfCare;

}
项目:openmaxims-linux    文件:Logic.java   
private CareContextVoCollection createNewCareContext(EpisodeofCareVo voEpisodeOfCare)
{
    CareContextVoCollection voCollCareContext = new CareContextVoCollection();
    CareContextVo voCareContext = new CareContextVo();

    voCareContext.setContext(ContextType.EMERGENCY_FIRST_VISIT);
    voCareContext.setStartDateTime(form.dtimArrival().getValue());
    voCareContext.setEpisodeOfCare(voEpisodeOfCare);
    voCollCareContext.add(voCareContext);

    form.getLocalContext().setcareContextToSave(voCareContext);

    return voCollCareContext;
}
项目:openmaxims-linux    文件:PatientSummaryImpl.java   
private EpisodeofCareVo copyFromShortEpisode(EpisodeOfCareWithoutContextsVo episodeVo) 
{
    if(episodeVo == null)
        return null;
    EpisodeofCareVo tempVo = new EpisodeofCareVo(episodeVo.getID_EpisodeOfCare(),episodeVo.getVersion_EpisodeOfCare());
    tempVo.setID_EpisodeOfCare(episodeVo.getID_EpisodeOfCare());
    tempVo.setCareSpell(episodeVo.getCareSpell());
    tempVo.setEndDate(episodeVo.getEndDate());
    tempVo.setStartDate(episodeVo.getStartDate());
    tempVo.setIsRIE(episodeVo.getIsRIE());
    tempVo.setSpecialty(episodeVo.getSpecialty());
    tempVo.setRelationship(episodeVo.getRelationship());
    tempVo.setResponsibleHCP(episodeVo.getResponsibleHCP());
    tempVo.setCareContexts(new CareContextVoCollection());
    tempVo.setCurrentStatus(episodeVo.getCurrentStatus());  
    tempVo.setCurrentReferral(episodeVo.getCurrentReferral());
    tempVo.setEpisodeOfCareHistory(episodeVo.getEpisodeOfCareHistory());
    tempVo.setLinkedReferrals(episodeVo.getLinkedReferrals());
    tempVo.setRelationship(episodeVo.getRelationship());
    tempVo.setStatusHistory(episodeVo.getStatusHistory());



    return tempVo;


}
项目:AvoinApotti    文件:Logic.java   
private void populateCareContextRows(CareContextVoCollection voCollCareContexts, grdListRow episodeOfCareRow)
    {
        if (voCollCareContexts != null && episodeOfCareRow != null)
        {
            voCollCareContexts.sort();
            grdListRow careContextRow;
            for (int i = 0; i < voCollCareContexts.size(); i++)
            {
                if (isCareContextOutsideRange(voCollCareContexts.get(i).getStartDateTime()) && !(voCollCareContexts.get(i).getContext().equals(ContextType.INPATIENT)))
                    continue;

                careContextRow = episodeOfCareRow.getRows().newRow();

                String text = voCollCareContexts.get(i).createDisplayString() + " " + getPasEpisodeId(voCollCareContexts.get(i));
                careContextRow.setcolStartDateEndDate(text);
                careContextRow.setTooltip(text);

                String ward = (voCollCareContexts.get(i) != null && voCollCareContexts.get(i).getPasEventIsNotNull() && voCollCareContexts.get(i).getPasEvent().getLocationIsNotNull()) ? voCollCareContexts.get(i).getPasEvent().getLocation().getName() : null;

                careContextRow.setcolSpeciality(voCollCareContexts.get(i).getContextIsNotNull() ? INDENT + INDENT + voCollCareContexts.get(i).getContext().getText() + (ward != null ? " - " + ward : "") : null);
                careContextRow.setCollapsedImage(form.getImages().Core.CareContext);
                careContextRow.setExpandedImage(form.getImages().Core.CareContext);
                careContextRow.setValue(voCollCareContexts.get(i));
                careContextRow.setBold(true);

                //WDEV-10166
                if(voCollCareContexts.get(i).getResponsibleHCPIsNotNull())
                    careContextRow.setcolRMO(voCollCareContexts.get(i).getResponsibleHCP().getIHcpName());

                // populateClinicalContacts(voCollCareContexts.get(i).getClinicalContacts().sort(), careContextRow);

/*              if (voCollCareContexts.get(i).getEndDateTime() == null) */
                    careContextRow.setExpanded(true);

                if (getPasEpisodeId(voCollCareContexts.get(i)).equals("") || isParentEnded((EpisodeofCareVo) episodeOfCareRow.getValue()))
                    careContextRow.setSelectable(false);

                //WDEV-10166
                if(careContextIsCancelled(voCollCareContexts.get(i)))  
                    careContextRow.setSelectable(false);
            }
        }
    }
项目:AvoinApotti    文件:Logic.java   
private CareSpellVo createCareSpellEpisodeCareContext(PatientShort patient, AdmissionDetailVo  admission)
{
    HcpLiteVo hcp = domain.getHcpFromIMos(form.ccConsultant().getValue());
    BedSpaceStateLiteVo bedState = form.getGlobalContext().Core.getSelectedBedSpaceState();

    CareSpellVo careSpell = new CareSpellVo();
    careSpell.setStartDate(new Date());
    careSpell.setEndDate(null);
    careSpell.setPatient(patient);

        EpisodeofCareVo episode = new EpisodeofCareVo();
        episode.setCareSpell(careSpell);
        episode.setResponsibleHCP(hcp);
        episode.setSpecialty(form.cmbSpecialty().getValue());
        episode.setRelationship(CareSpelltoEpisodeRelationship.PRIMARY);
        episode.setStartDate(new Date());
        episode.setEndDate(null);

            CareContextVo careContext = new CareContextVo();
            careContext.setPasEvent(null);
            careContext.setContext(ContextType.EMERGENCY_UNSCHEDULED);
            careContext.setEpisodeOfCare(episode);
            careContext.setOrderingHospital(null);
            careContext.setEstimatedDischargeDate(form.dteEstDischarge().getValue());
            careContext.setStartDateTime(new DateTime());
            careContext.setEndDateTime(null);
            careContext.setLocationType(null);
            careContext.setResponsibleHCP(hcp);
            careContext.setBedNumber((bedState != null && bedState.getBedSpace() != null) ? bedState.getBedSpace().getBedNumber() : null);
            careContext.setDischargeReason(null);
            careContext.setCareContextHistory(null);

            CareContextStatusHistoryVo contextStatus = new CareContextStatusHistoryVo();
            contextStatus.setStatus(CareContextStatus.OPEN);
            contextStatus.setStatusDateTime(new DateTime());
            careContext.setCurrentStatus(contextStatus);
            careContext.setStatusHistory(new CareContextStatusHistoryVoCollection());
            careContext.getStatusHistory().add(contextStatus);

        episode.setCareContexts(new CareContextVoCollection());
        episode.getCareContexts().add(careContext);

        episode.setLinkedReferrals(null);
        episode.setLinkedReferralsHistory(null);
        episode.setCurrentReferral(null);
        episode.setEpisodeOfCareHistory(null);

        EpisodeOfCareStatusHistoryVo episodeStatus = new EpisodeOfCareStatusHistoryVo();
        episodeStatus.setStatus(EpisodeOfCareStatus.OPEN);
        episodeStatus.setStatusDateTime(new DateTime());
        episode.setCurrentStatus(episodeStatus);
        episode.setStatusHistory(new EpisodeOfCareStatusHistoryVoCollection());
        episode.getStatusHistory().add(episodeStatus);

        careSpell.setEpisodes(new EpisodeofCareVoCollection());
    careSpell.getEpisodes().add(episode);

    CareSpellStatusHistoryVo careSpellStatus = new CareSpellStatusHistoryVo();
    careSpellStatus.setStatus(ProblemGroupStatus.OPEN);
    careSpellStatus.setStatusDateTime(new DateTime());
    careSpell.setCurrentStatus(careSpellStatus);
    careSpell.setStatusHistory(new CareSpellStatusHistoryVoCollection());
    careSpell.getStatusHistory().add(careSpellStatus);

    return careSpell;
}
项目:AvoinApotti    文件:VoMapper.java   
public CareSpellVo createCareSpellVo(PasEventVo pas, PV1 pv)throws HL7Exception
{
    CareSpellVo careSpell=new CareSpellVo();
    if(pas!=null && pas.getEventDateTime()!=null)
        careSpell.setStartDate( pas.getEventDateTime().getDate());
    else
        throw new HL7Exception("Validation of PasEvent failed. Set the Event Date Time in PV1-44");

    careSpell.setPatient(pas.getPatient());
    EpisodeofCareVo episode=new EpisodeofCareVo();
    episode.setCareSpell(careSpell);
    episode.setResponsibleHCP(hcpAdmin.getHcpLiteByExternalCode(TaxonomyType.NAT_CONS_CODE, pv.getConsultingDoctor(0).getIDNumber().getValue()));

    // wdev-4883 Check for PAS code mapping if national consultant code not found
    if (!episode.getResponsibleHCPIsNotNull())
    {
        episode.setResponsibleHCP(hcpAdmin.getHcpLiteByExternalCode(TaxonomyType.PAS, pv.getConsultingDoctor(1).getIDNumber().getValue()));
    }

    episode.setRelationship(CareSpelltoEpisodeRelationship.PRIMARY);
    episode.setSpecialty(pas.getSpecialty());
    episode.setStartDate( pas.getEventDateTime().getDate());
    EpisodeofCareVoCollection episodes=new EpisodeofCareVoCollection();
    episodes.add(episode);
    CareContextVo careContext=new CareContextVo();
    careContext.setEpisodeOfCare(episode);
    ContextType context=new ContextType();
    if (pv.getPatientClass().getValue().equals("I"))
    {
        context = ContextType.INPATIENT;
        pas.setEventType(ims.core.vo.lookups.PasEventType.INPATIENT);
    }
    else if (pv.getPatientClass().getValue().equals("O"))
    {
        context = ContextType.OUTPATIENT;
        pas.setEventType(ims.core.vo.lookups.PasEventType.OUTPATIENT);
    }
    else if (pv.getPatientClass().getValue().equals("P"))
    {
        context = ContextType.TCI;
        pas.setEventType(ims.core.vo.lookups.PasEventType.TCI);
    }
    else
    {
        context = ContextType.GHGSURGERY;
    }
    careContext.setContext(context);
    careContext.setStartDateTime(pas.getEventDateTime());
    careContext.setPasEvent(pas);
    careContext.setResponsibleHCP(episode.getResponsibleHCP());

    //WDEV-10231
    careContext.setCurrentStatus(new CareContextStatusHistoryVo());
    careContext.getCurrentStatus().setStatus(CareContextStatus.OPEN);
    careContext.getCurrentStatus().setStatusDateTime(pas.getEventDateTime());

    LocSiteShortVo loc = orgLoc.getLocSiteShortByTaxonomyType(pv.getAssignedPatientLocation().getBuilding().getValue(), TaxonomyType.PAS);
    LocSiteRefVo orderingHospRef = new LocSiteRefVo();
    if (loc!=null)
    {
        orderingHospRef.setID_Location(loc.getBoId());
        careContext.setOrderingHospital(orderingHospRef);
    }


    CareContextVoCollection careContexts=new CareContextVoCollection();
    careContexts.add(careContext);
    episode.setCareContexts(careContexts);
    careSpell.setEpisodes(episodes);

    return careSpell;


}
项目:openMAXIMS    文件:Logic.java   
private void populateCareContextRows(CareContextVoCollection voCollCareContexts, grdListRow episodeOfCareRow)
    {
        if (voCollCareContexts != null && episodeOfCareRow != null)
        {
            voCollCareContexts.sort();
            grdListRow careContextRow;
            for (int i = 0; i < voCollCareContexts.size(); i++)
            {
                if (isCareContextOutsideRange(voCollCareContexts.get(i).getStartDateTime()) && !(voCollCareContexts.get(i).getContext().equals(ContextType.INPATIENT)))
                    continue;

                careContextRow = episodeOfCareRow.getRows().newRow();

                String text = voCollCareContexts.get(i).createDisplayString() + " " + getPasEpisodeId(voCollCareContexts.get(i));
                careContextRow.setcolStartDateEndDate(text);
                careContextRow.setTooltip(text);

                String ward = (voCollCareContexts.get(i) != null && voCollCareContexts.get(i).getPasEventIsNotNull() && voCollCareContexts.get(i).getPasEvent().getLocationIsNotNull()) ? voCollCareContexts.get(i).getPasEvent().getLocation().getName() : null;

                careContextRow.setcolSpeciality(voCollCareContexts.get(i).getContextIsNotNull() ? INDENT + INDENT + voCollCareContexts.get(i).getContext().getText() + (ward != null ? " - " + ward : "") : null);
                careContextRow.setCollapsedImage(form.getImages().Core.CareContext);
                careContextRow.setExpandedImage(form.getImages().Core.CareContext);
                careContextRow.setValue(voCollCareContexts.get(i));
                careContextRow.setBold(true);

                //WDEV-10166
                if(voCollCareContexts.get(i).getResponsibleHCPIsNotNull())
                    careContextRow.setcolRMO(voCollCareContexts.get(i).getResponsibleHCP().getIHcpName());

                // populateClinicalContacts(voCollCareContexts.get(i).getClinicalContacts().sort(), careContextRow);

/*              if (voCollCareContexts.get(i).getEndDateTime() == null) */
                    careContextRow.setExpanded(true);

                if (getPasEpisodeId(voCollCareContexts.get(i)).equals("") || isParentEnded((EpisodeofCareVo) episodeOfCareRow.getValue()))
                    careContextRow.setSelectable(false);

                //WDEV-10166
                if(careContextIsCancelled(voCollCareContexts.get(i)))  
                    careContextRow.setSelectable(false);
            }
        }
    }
项目:openMAXIMS    文件:VoMapper.java   
public CareSpellVo createCareSpellVo(PasEventVo pas, PV1 pv, ProviderSystemVo providerSystem)throws HL7Exception //WDEV-20278
    {
        CareSpellVo careSpell=new CareSpellVo();
        if(pas!=null && pas.getEventDateTime()!=null)
            careSpell.setStartDate( pas.getEventDateTime().getDate());
        else
            throw new HL7Exception("Validation of PasEvent failed. Set the Event Date Time in PV1-44");

        careSpell.setPatient(pas.getPatient());
        EpisodeofCareVo episode=new EpisodeofCareVo();
        episode.setCareSpell(careSpell);
        episode.setResponsibleHCP(hcpAdmin.getHcpLiteByExternalCode(TaxonomyType.NAT_CONS_CODE, pv.getConsultingDoctor(0).getIDNumber().getValue()));

        // wdev-4883 Check for PAS code mapping if national consultant code not found
        if (!episode.getResponsibleHCPIsNotNull())
        {
            episode.setResponsibleHCP(hcpAdmin.getHcpLiteByExternalCode(TaxonomyType.PAS, pv.getConsultingDoctor(1).getIDNumber().getValue()));
        }

        episode.setRelationship(CareSpelltoEpisodeRelationship.PRIMARY);
        episode.setSpecialty(pas.getSpecialty());
        episode.setStartDate( pas.getEventDateTime().getDate());
        EpisodeofCareVoCollection episodes=new EpisodeofCareVoCollection();
        episodes.add(episode);
        CareContextVo careContext=new CareContextVo();
        careContext.setEpisodeOfCare(episode);
        ContextType context=new ContextType();
        if (pv.getPatientClass().getValue().equals("I"))
        {
            context = ContextType.INPATIENT;
            pas.setEventType(ims.core.vo.lookups.PasEventType.INPATIENT);
        }
        else if (pv.getPatientClass().getValue().equals("O"))
        {
            context = ContextType.OUTPATIENT;
            pas.setEventType(ims.core.vo.lookups.PasEventType.OUTPATIENT);
        }
        else if (pv.getPatientClass().getValue().equals("P"))
        {
            context = ContextType.TCI;
            pas.setEventType(ims.core.vo.lookups.PasEventType.TCI);
        }
        else
        {
            context = ContextType.GHGSURGERY;
        }
        careContext.setContext(context);
        careContext.setStartDateTime(pas.getEventDateTime());
        careContext.setPasEvent(pas);
        careContext.setResponsibleHCP(episode.getResponsibleHCP());

        //WDEV-10231
        careContext.setCurrentStatus(new CareContextStatusHistoryVo());
        careContext.getCurrentStatus().setStatus(CareContextStatus.OPEN);
        careContext.getCurrentStatus().setStatusDateTime(pas.getEventDateTime());

        //WDEV-20278
//      LocSiteShortVo loc = orgLoc.getLocSiteShortByTaxonomyType(pv.getAssignedPatientLocation().getBuilding().getValue(), TaxonomyType.PAS);
        LocSiteShortVo loc = orgLoc.getLocSiteShortByTaxonomyType(pv.getAssignedPatientLocation().getBuilding().getValue(), providerSystem.getCodeSystem()); //WDEV-20278
        LocSiteRefVo orderingHospRef = new LocSiteRefVo();
        if (loc!=null)
        {
            orderingHospRef.setID_Location(loc.getBoId());
            careContext.setOrderingHospital(orderingHospRef);
        }


        CareContextVoCollection careContexts=new CareContextVoCollection();
        careContexts.add(careContext);
        episode.setCareContexts(careContexts);
        careSpell.setEpisodes(episodes);

        return careSpell;

    }
项目:openMAXIMS    文件:Logic.java   
private void populateCareContextRows(CareContextVoCollection voCollCareContexts, grdListRow episodeOfCareRow)
    {
        if (voCollCareContexts != null && episodeOfCareRow != null)
        {
            voCollCareContexts.sort();
            grdListRow careContextRow;
            for (int i = 0; i < voCollCareContexts.size(); i++)
            {
                if (isCareContextOutsideRange(voCollCareContexts.get(i).getStartDateTime()) && !(voCollCareContexts.get(i).getContext().equals(ContextType.INPATIENT)))
                    continue;

                careContextRow = episodeOfCareRow.getRows().newRow();

                String text = voCollCareContexts.get(i).createDisplayString() + " " + getPasEpisodeId(voCollCareContexts.get(i));
                careContextRow.setcolStartDateEndDate(text);
                careContextRow.setTooltip(text);

                String ward = (voCollCareContexts.get(i) != null && voCollCareContexts.get(i).getPasEventIsNotNull() && voCollCareContexts.get(i).getPasEvent().getLocationIsNotNull()) ? voCollCareContexts.get(i).getPasEvent().getLocation().getName() : null;

                careContextRow.setcolSpeciality(voCollCareContexts.get(i).getContextIsNotNull() ? INDENT + INDENT + voCollCareContexts.get(i).getContext().getText() + (ward != null ? " - " + ward : "") : null);
                careContextRow.setCollapsedImage(form.getImages().Core.CareContext);
                careContextRow.setExpandedImage(form.getImages().Core.CareContext);
                careContextRow.setValue(voCollCareContexts.get(i));
                careContextRow.setBold(true);

                //WDEV-10166
                if(voCollCareContexts.get(i).getResponsibleHCPIsNotNull())
                    careContextRow.setcolRMO(voCollCareContexts.get(i).getResponsibleHCP().getIHcpName());

                // populateClinicalContacts(voCollCareContexts.get(i).getClinicalContacts().sort(), careContextRow);

/*              if (voCollCareContexts.get(i).getEndDateTime() == null) */
                    careContextRow.setExpanded(true);

                if (getPasEpisodeId(voCollCareContexts.get(i)).equals("") || isParentEnded((EpisodeofCareVo) episodeOfCareRow.getValue()))
                    careContextRow.setSelectable(false);

                //WDEV-10166
                if(careContextIsCancelled(voCollCareContexts.get(i)))  
                    careContextRow.setSelectable(false);
            }
        }
    }