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

项目:AvoinApotti    文件:Patient_SummaryImpl.java   
public CSPrimaryDiagnosisAndPoceduresVo listPrimaryDiagnosisAndProblems(CareSpellRefVo careSpellRefVo)
{
    if (careSpellRefVo == null)
        throw new CodingRuntimeException("Cannot list Primary Diagnosis/Problems for null CareSpellRefVo");

    DomainFactory factory = getDomainFactory();

    StringBuffer diagnosisQuery = new StringBuffer();
    diagnosisQuery.append("select c1_1.diagnosis.id, c1_1.diagnosis.diagnosisDescription");
    diagnosisQuery.append(" from CsPrimaryDiagnosis as c1_1");
    diagnosisQuery.append(" where ");
    diagnosisQuery.append(" (c1_1.isActive = :ACTIVE and c1_1.episodeOfCare.careSpell.id = :CARESPELL_ID)");
    diagnosisQuery.append(" and c1_1.isRIE is null and c1_1.diagnosis.isRIE is null");

    StringBuffer problemsQuery = new StringBuffer();
    problemsQuery.append("select  c1_1.patientProblem.id, c1_1.patientProblem.patientProblem");
    problemsQuery.append(" from CsPrimaryProblem as c1_1");
    problemsQuery.append(" where");
    problemsQuery.append(" (c1_1.isActive = :ACTIVE and c1_1.careContext.episodeOfCare.careSpell.id = :CARESPELL_ID)");
    problemsQuery.append(" and c1_1.isRIE is null and c1_1.patientProblem.isRIE is null");

    ArrayList params = new ArrayList();
    params.add("ACTIVE");
    params.add("CARESPELL_ID");

    ArrayList values = new ArrayList();
    values.add(Boolean.TRUE);
    values.add(careSpellRefVo.getID_CareSpell());

    List diagnosisList = factory.find(diagnosisQuery.toString(), params, values);
    List problemsList = factory.find(problemsQuery.toString(), params, values);

    CSPrimaryDiagnosisAndPoceduresVo voPrimary = new CSPrimaryDiagnosisAndPoceduresVo();
    voPrimary.setPrimaryDiagnosis(new CSPatientSummaryDiagnosisVoCollection());
    voPrimary.setPrimaryProcedures(new CSPatientSummaryProcedureVoCollection());

    for (int i = 0; diagnosisList != null && i < diagnosisList.size(); i++)
    {
        Object[] diagObjects = (Object[]) diagnosisList.get(i);
        if (diagObjects != null)
        {
            CSPatientSummaryDiagnosisVo voCSPatientSummaryDiagnosis = new CSPatientSummaryDiagnosisVo();
            if (diagObjects[0] instanceof Integer)
            {
                voCSPatientSummaryDiagnosis.setID_CSPatientSummaryDiagnosis((Integer) diagObjects[0]);
            }

            if (diagObjects[1] instanceof String)
            {
                voCSPatientSummaryDiagnosis.setDiagnosisName((String) diagObjects[1]);
            }
            voPrimary.getPrimaryDiagnosis().add(voCSPatientSummaryDiagnosis);
        }
    }

    for (int i = 0; i < problemsList.size(); i++)
    {
        Object[] procObjects = (Object[]) problemsList.get(i);
        if (procObjects != null)
        {
            CSPatientSummaryProcedureVo voCSPatientSummaryProcedure = new CSPatientSummaryProcedureVo();
            if (procObjects[0] instanceof Integer)
            {
                voCSPatientSummaryProcedure.setID_CSPatientSummaryProcedure((Integer) procObjects[0]);
            }

            if (procObjects[1] instanceof String)
            {
                voCSPatientSummaryProcedure.setProcedureName((String) procObjects[1]);
            }
            voPrimary.getPrimaryProcedures().add(voCSPatientSummaryProcedure);
        }
    }

    return voPrimary;
}
项目:AvoinApotti    文件:PatientSummaryImpl.java   
public CSPrimaryDiagnosisAndPoceduresVo listPrimaryDiagnosisAndProblems(CareSpellRefVo careSpellRefVo)
{
    if(careSpellRefVo == null)
        throw new CodingRuntimeException("Cannot list Primary Diagnosis/Problems for null CareSpellRefVo");

    DomainFactory factory = getDomainFactory();

    StringBuffer diagnosisQuery = new StringBuffer();
    diagnosisQuery.append("select c1_1.diagnosis.id, c1_1.diagnosis.diagnosisDescription");
    diagnosisQuery.append(" from CsPrimaryDiagnosis as c1_1");
    diagnosisQuery.append(" where ");
    diagnosisQuery.append(" (c1_1.isActive = :ACTIVE and c1_1.episodeOfCare.careSpell.id = :CARESPELL_ID)");
    diagnosisQuery.append(" and c1_1.isRIE is null and c1_1.diagnosis.isRIE is null");

    StringBuffer problemsQuery = new StringBuffer();
    problemsQuery.append("select  c1_1.patientProblem.id, c1_1.patientProblem.patientProblem");
    problemsQuery.append(" from CsPrimaryProblem as c1_1");
    problemsQuery.append(" where");
    problemsQuery.append(" (c1_1.isActive = :ACTIVE and c1_1.careContext.episodeOfCare.careSpell.id = :CARESPELL_ID)");
    problemsQuery.append(" and c1_1.isRIE is null and c1_1.patientProblem.isRIE is null");

    ArrayList params = new ArrayList();
    params.add("ACTIVE");
    params.add("CARESPELL_ID");

    ArrayList values = new ArrayList();
    values.add(Boolean.TRUE);
    values.add(careSpellRefVo.getID_CareSpell());

    List diagnosisList = factory.find(diagnosisQuery.toString(), params, values);
    List problemsList = factory.find(problemsQuery.toString(), params, values);

    CSPrimaryDiagnosisAndPoceduresVo voPrimary = new CSPrimaryDiagnosisAndPoceduresVo();
    voPrimary.setPrimaryDiagnosis(new CSPatientSummaryDiagnosisVoCollection());
    voPrimary.setPrimaryProcedures(new CSPatientSummaryProcedureVoCollection());

    for (int i = 0; diagnosisList != null && i < diagnosisList.size(); i++)
    {
        Object[] diagObjects = (Object[]) diagnosisList.get(i);
        if(diagObjects != null)
        {
            CSPatientSummaryDiagnosisVo voCSPatientSummaryDiagnosis = new CSPatientSummaryDiagnosisVo();
            if(diagObjects[0] instanceof Integer)
            {
                voCSPatientSummaryDiagnosis.setID_CSPatientSummaryDiagnosis((Integer)diagObjects[0]);
            }

            if(diagObjects[1] instanceof String)
            {
                voCSPatientSummaryDiagnosis.setDiagnosisName((String)diagObjects[1]);
            }
            voPrimary.getPrimaryDiagnosis().add(voCSPatientSummaryDiagnosis);
        }
    }

    for (int i = 0; i < problemsList.size(); i++)
    {
        Object[] procObjects = (Object[]) problemsList.get(i);
        if(procObjects != null)
        {
            CSPatientSummaryProcedureVo voCSPatientSummaryProcedure = new CSPatientSummaryProcedureVo();
            if(procObjects[0] instanceof Integer)
            {
                voCSPatientSummaryProcedure.setID_CSPatientSummaryProcedure((Integer)procObjects[0]);
            }

            if(procObjects[1] instanceof String)
            {
                voCSPatientSummaryProcedure.setProcedureName((String)procObjects[1]);
            }
            voPrimary.getPrimaryProcedures().add(voCSPatientSummaryProcedure);
        }
    }

    return voPrimary;
}
项目:openMAXIMS    文件:Patient_SummaryImpl.java   
public CSPrimaryDiagnosisAndPoceduresVo listPrimaryDiagnosisAndProblems(CareSpellRefVo careSpellRefVo)
{
    if (careSpellRefVo == null)
        throw new CodingRuntimeException("Cannot list Primary Diagnosis/Problems for null CareSpellRefVo");

    DomainFactory factory = getDomainFactory();

    StringBuffer diagnosisQuery = new StringBuffer();
    diagnosisQuery.append("select c1_1.diagnosis.id, c1_1.diagnosis.diagnosisDescription");
    diagnosisQuery.append(" from CsPrimaryDiagnosis as c1_1");
    diagnosisQuery.append(" where ");
    diagnosisQuery.append(" (c1_1.isActive = :ACTIVE and c1_1.episodeOfCare.careSpell.id = :CARESPELL_ID)");
    diagnosisQuery.append(" and c1_1.isRIE is null and c1_1.diagnosis.isRIE is null");

    StringBuffer problemsQuery = new StringBuffer();
    problemsQuery.append("select  c1_1.patientProblem.id, c1_1.patientProblem.patientProblem");
    problemsQuery.append(" from CsPrimaryProblem as c1_1");
    problemsQuery.append(" where");
    problemsQuery.append(" (c1_1.isActive = :ACTIVE and c1_1.careContext.episodeOfCare.careSpell.id = :CARESPELL_ID)");
    problemsQuery.append(" and c1_1.isRIE is null and c1_1.patientProblem.isRIE is null");

    ArrayList params = new ArrayList();
    params.add("ACTIVE");
    params.add("CARESPELL_ID");

    ArrayList values = new ArrayList();
    values.add(Boolean.TRUE);
    values.add(careSpellRefVo.getID_CareSpell());

    List diagnosisList = factory.find(diagnosisQuery.toString(), params, values);
    List problemsList = factory.find(problemsQuery.toString(), params, values);

    CSPrimaryDiagnosisAndPoceduresVo voPrimary = new CSPrimaryDiagnosisAndPoceduresVo();
    voPrimary.setPrimaryDiagnosis(new CSPatientSummaryDiagnosisVoCollection());
    voPrimary.setPrimaryProcedures(new CSPatientSummaryProcedureVoCollection());

    for (int i = 0; diagnosisList != null && i < diagnosisList.size(); i++)
    {
        Object[] diagObjects = (Object[]) diagnosisList.get(i);
        if (diagObjects != null)
        {
            CSPatientSummaryDiagnosisVo voCSPatientSummaryDiagnosis = new CSPatientSummaryDiagnosisVo();
            if (diagObjects[0] instanceof Integer)
            {
                voCSPatientSummaryDiagnosis.setID_CSPatientSummaryDiagnosis((Integer) diagObjects[0]);
            }

            if (diagObjects[1] instanceof String)
            {
                voCSPatientSummaryDiagnosis.setDiagnosisName((String) diagObjects[1]);
            }
            voPrimary.getPrimaryDiagnosis().add(voCSPatientSummaryDiagnosis);
        }
    }

    for (int i = 0; i < problemsList.size(); i++)
    {
        Object[] procObjects = (Object[]) problemsList.get(i);
        if (procObjects != null)
        {
            CSPatientSummaryProcedureVo voCSPatientSummaryProcedure = new CSPatientSummaryProcedureVo();
            if (procObjects[0] instanceof Integer)
            {
                voCSPatientSummaryProcedure.setID_CSPatientSummaryProcedure((Integer) procObjects[0]);
            }

            if (procObjects[1] instanceof String)
            {
                voCSPatientSummaryProcedure.setProcedureName((String) procObjects[1]);
            }
            voPrimary.getPrimaryProcedures().add(voCSPatientSummaryProcedure);
        }
    }

    return voPrimary;
}
项目:openMAXIMS    文件:PatientSummaryImpl.java   
public CSPrimaryDiagnosisAndPoceduresVo listPrimaryDiagnosisAndProblems(CareSpellRefVo careSpellRefVo)
{
    if(careSpellRefVo == null)
        throw new CodingRuntimeException("Cannot list Primary Diagnosis/Problems for null CareSpellRefVo");

    DomainFactory factory = getDomainFactory();

    StringBuffer diagnosisQuery = new StringBuffer();
    diagnosisQuery.append("select c1_1.diagnosis.id, c1_1.diagnosis.diagnosisDescription");
    diagnosisQuery.append(" from CsPrimaryDiagnosis as c1_1");
    diagnosisQuery.append(" where ");
    diagnosisQuery.append(" (c1_1.isActive = :ACTIVE and c1_1.episodeOfCare.careSpell.id = :CARESPELL_ID)");
    diagnosisQuery.append(" and c1_1.isRIE is null and c1_1.diagnosis.isRIE is null");

    StringBuffer problemsQuery = new StringBuffer();
    problemsQuery.append("select  c1_1.patientProblem.id, c1_1.patientProblem.patientProblem");
    problemsQuery.append(" from CsPrimaryProblem as c1_1");
    problemsQuery.append(" where");
    problemsQuery.append(" (c1_1.isActive = :ACTIVE and c1_1.careContext.episodeOfCare.careSpell.id = :CARESPELL_ID)");
    problemsQuery.append(" and c1_1.isRIE is null and c1_1.patientProblem.isRIE is null");

    ArrayList params = new ArrayList();
    params.add("ACTIVE");
    params.add("CARESPELL_ID");

    ArrayList values = new ArrayList();
    values.add(Boolean.TRUE);
    values.add(careSpellRefVo.getID_CareSpell());

    List diagnosisList = factory.find(diagnosisQuery.toString(), params, values);
    List problemsList = factory.find(problemsQuery.toString(), params, values);

    CSPrimaryDiagnosisAndPoceduresVo voPrimary = new CSPrimaryDiagnosisAndPoceduresVo();
    voPrimary.setPrimaryDiagnosis(new CSPatientSummaryDiagnosisVoCollection());
    voPrimary.setPrimaryProcedures(new CSPatientSummaryProcedureVoCollection());

    for (int i = 0; diagnosisList != null && i < diagnosisList.size(); i++)
    {
        Object[] diagObjects = (Object[]) diagnosisList.get(i);
        if(diagObjects != null)
        {
            CSPatientSummaryDiagnosisVo voCSPatientSummaryDiagnosis = new CSPatientSummaryDiagnosisVo();
            if(diagObjects[0] instanceof Integer)
            {
                voCSPatientSummaryDiagnosis.setID_CSPatientSummaryDiagnosis((Integer)diagObjects[0]);
            }

            if(diagObjects[1] instanceof String)
            {
                voCSPatientSummaryDiagnosis.setDiagnosisName((String)diagObjects[1]);
            }
            voPrimary.getPrimaryDiagnosis().add(voCSPatientSummaryDiagnosis);
        }
    }

    for (int i = 0; i < problemsList.size(); i++)
    {
        Object[] procObjects = (Object[]) problemsList.get(i);
        if(procObjects != null)
        {
            CSPatientSummaryProcedureVo voCSPatientSummaryProcedure = new CSPatientSummaryProcedureVo();
            if(procObjects[0] instanceof Integer)
            {
                voCSPatientSummaryProcedure.setID_CSPatientSummaryProcedure((Integer)procObjects[0]);
            }

            if(procObjects[1] instanceof String)
            {
                voCSPatientSummaryProcedure.setProcedureName((String)procObjects[1]);
            }
            voPrimary.getPrimaryProcedures().add(voCSPatientSummaryProcedure);
        }
    }

    return voPrimary;
}
项目:openMAXIMS    文件:Patient_SummaryImpl.java   
public CSPrimaryDiagnosisAndPoceduresVo listPrimaryDiagnosisAndProblems(CareSpellRefVo careSpellRefVo)
{
    if (careSpellRefVo == null)
        throw new CodingRuntimeException("Cannot list Primary Diagnosis/Problems for null CareSpellRefVo");

    DomainFactory factory = getDomainFactory();

    StringBuffer diagnosisQuery = new StringBuffer();
    diagnosisQuery.append("select c1_1.diagnosis.id, c1_1.diagnosis.diagnosisDescription");
    diagnosisQuery.append(" from CsPrimaryDiagnosis as c1_1");
    diagnosisQuery.append(" where ");
    diagnosisQuery.append(" (c1_1.isActive = :ACTIVE and c1_1.episodeOfCare.careSpell.id = :CARESPELL_ID)");
    diagnosisQuery.append(" and c1_1.isRIE is null and c1_1.diagnosis.isRIE is null");

    StringBuffer problemsQuery = new StringBuffer();
    problemsQuery.append("select  c1_1.patientProblem.id, c1_1.patientProblem.patientProblem");
    problemsQuery.append(" from CsPrimaryProblem as c1_1");
    problemsQuery.append(" where");
    problemsQuery.append(" (c1_1.isActive = :ACTIVE and c1_1.careContext.episodeOfCare.careSpell.id = :CARESPELL_ID)");
    problemsQuery.append(" and c1_1.isRIE is null and c1_1.patientProblem.isRIE is null");

    ArrayList params = new ArrayList();
    params.add("ACTIVE");
    params.add("CARESPELL_ID");

    ArrayList values = new ArrayList();
    values.add(Boolean.TRUE);
    values.add(careSpellRefVo.getID_CareSpell());

    List diagnosisList = factory.find(diagnosisQuery.toString(), params, values);
    List problemsList = factory.find(problemsQuery.toString(), params, values);

    CSPrimaryDiagnosisAndPoceduresVo voPrimary = new CSPrimaryDiagnosisAndPoceduresVo();
    voPrimary.setPrimaryDiagnosis(new CSPatientSummaryDiagnosisVoCollection());
    voPrimary.setPrimaryProcedures(new CSPatientSummaryProcedureVoCollection());

    for (int i = 0; diagnosisList != null && i < diagnosisList.size(); i++)
    {
        Object[] diagObjects = (Object[]) diagnosisList.get(i);
        if (diagObjects != null)
        {
            CSPatientSummaryDiagnosisVo voCSPatientSummaryDiagnosis = new CSPatientSummaryDiagnosisVo();
            if (diagObjects[0] instanceof Integer)
            {
                voCSPatientSummaryDiagnosis.setID_CSPatientSummaryDiagnosis((Integer) diagObjects[0]);
            }

            if (diagObjects[1] instanceof String)
            {
                voCSPatientSummaryDiagnosis.setDiagnosisName((String) diagObjects[1]);
            }
            voPrimary.getPrimaryDiagnosis().add(voCSPatientSummaryDiagnosis);
        }
    }

    for (int i = 0; i < problemsList.size(); i++)
    {
        Object[] procObjects = (Object[]) problemsList.get(i);
        if (procObjects != null)
        {
            CSPatientSummaryProcedureVo voCSPatientSummaryProcedure = new CSPatientSummaryProcedureVo();
            if (procObjects[0] instanceof Integer)
            {
                voCSPatientSummaryProcedure.setID_CSPatientSummaryProcedure((Integer) procObjects[0]);
            }

            if (procObjects[1] instanceof String)
            {
                voCSPatientSummaryProcedure.setProcedureName((String) procObjects[1]);
            }
            voPrimary.getPrimaryProcedures().add(voCSPatientSummaryProcedure);
        }
    }

    return voPrimary;
}
项目:openMAXIMS    文件:PatientSummaryImpl.java   
public CSPrimaryDiagnosisAndPoceduresVo listPrimaryDiagnosisAndProblems(CareSpellRefVo careSpellRefVo)
{
    if(careSpellRefVo == null)
        throw new CodingRuntimeException("Cannot list Primary Diagnosis/Problems for null CareSpellRefVo");

    DomainFactory factory = getDomainFactory();

    StringBuffer diagnosisQuery = new StringBuffer();
    diagnosisQuery.append("select c1_1.diagnosis.id, c1_1.diagnosis.diagnosisDescription");
    diagnosisQuery.append(" from CsPrimaryDiagnosis as c1_1");
    diagnosisQuery.append(" where ");
    diagnosisQuery.append(" (c1_1.isActive = :ACTIVE and c1_1.episodeOfCare.careSpell.id = :CARESPELL_ID)");
    diagnosisQuery.append(" and c1_1.isRIE is null and c1_1.diagnosis.isRIE is null");

    StringBuffer problemsQuery = new StringBuffer();
    problemsQuery.append("select  c1_1.patientProblem.id, c1_1.patientProblem.patientProblem");
    problemsQuery.append(" from CsPrimaryProblem as c1_1");
    problemsQuery.append(" where");
    problemsQuery.append(" (c1_1.isActive = :ACTIVE and c1_1.careContext.episodeOfCare.careSpell.id = :CARESPELL_ID)");
    problemsQuery.append(" and c1_1.isRIE is null and c1_1.patientProblem.isRIE is null");

    ArrayList params = new ArrayList();
    params.add("ACTIVE");
    params.add("CARESPELL_ID");

    ArrayList values = new ArrayList();
    values.add(Boolean.TRUE);
    values.add(careSpellRefVo.getID_CareSpell());

    List diagnosisList = factory.find(diagnosisQuery.toString(), params, values);
    List problemsList = factory.find(problemsQuery.toString(), params, values);

    CSPrimaryDiagnosisAndPoceduresVo voPrimary = new CSPrimaryDiagnosisAndPoceduresVo();
    voPrimary.setPrimaryDiagnosis(new CSPatientSummaryDiagnosisVoCollection());
    voPrimary.setPrimaryProcedures(new CSPatientSummaryProcedureVoCollection());

    for (int i = 0; diagnosisList != null && i < diagnosisList.size(); i++)
    {
        Object[] diagObjects = (Object[]) diagnosisList.get(i);
        if(diagObjects != null)
        {
            CSPatientSummaryDiagnosisVo voCSPatientSummaryDiagnosis = new CSPatientSummaryDiagnosisVo();
            if(diagObjects[0] instanceof Integer)
            {
                voCSPatientSummaryDiagnosis.setID_CSPatientSummaryDiagnosis((Integer)diagObjects[0]);
            }

            if(diagObjects[1] instanceof String)
            {
                voCSPatientSummaryDiagnosis.setDiagnosisName((String)diagObjects[1]);
            }
            voPrimary.getPrimaryDiagnosis().add(voCSPatientSummaryDiagnosis);
        }
    }

    for (int i = 0; i < problemsList.size(); i++)
    {
        Object[] procObjects = (Object[]) problemsList.get(i);
        if(procObjects != null)
        {
            CSPatientSummaryProcedureVo voCSPatientSummaryProcedure = new CSPatientSummaryProcedureVo();
            if(procObjects[0] instanceof Integer)
            {
                voCSPatientSummaryProcedure.setID_CSPatientSummaryProcedure((Integer)procObjects[0]);
            }

            if(procObjects[1] instanceof String)
            {
                voCSPatientSummaryProcedure.setProcedureName((String)procObjects[1]);
            }
            voPrimary.getPrimaryProcedures().add(voCSPatientSummaryProcedure);
        }
    }

    return voPrimary;
}
项目:openmaxims-linux    文件:Patient_SummaryImpl.java   
public CSPrimaryDiagnosisAndPoceduresVo listPrimaryDiagnosisAndProblems(CareSpellRefVo careSpellRefVo)
{
    if (careSpellRefVo == null)
        throw new CodingRuntimeException("Cannot list Primary Diagnosis/Problems for null CareSpellRefVo");

    DomainFactory factory = getDomainFactory();

    StringBuffer diagnosisQuery = new StringBuffer();
    diagnosisQuery.append("select c1_1.diagnosis.id, c1_1.diagnosis.diagnosisDescription");
    diagnosisQuery.append(" from CsPrimaryDiagnosis as c1_1");
    diagnosisQuery.append(" where ");
    diagnosisQuery.append(" (c1_1.isActive = :ACTIVE and c1_1.episodeOfCare.careSpell.id = :CARESPELL_ID)");
    diagnosisQuery.append(" and c1_1.isRIE is null and c1_1.diagnosis.isRIE is null");

    StringBuffer problemsQuery = new StringBuffer();
    problemsQuery.append("select  c1_1.patientProblem.id, c1_1.patientProblem.patientProblem");
    problemsQuery.append(" from CsPrimaryProblem as c1_1");
    problemsQuery.append(" where");
    problemsQuery.append(" (c1_1.isActive = :ACTIVE and c1_1.careContext.episodeOfCare.careSpell.id = :CARESPELL_ID)");
    problemsQuery.append(" and c1_1.isRIE is null and c1_1.patientProblem.isRIE is null");

    ArrayList params = new ArrayList();
    params.add("ACTIVE");
    params.add("CARESPELL_ID");

    ArrayList values = new ArrayList();
    values.add(Boolean.TRUE);
    values.add(careSpellRefVo.getID_CareSpell());

    List diagnosisList = factory.find(diagnosisQuery.toString(), params, values);
    List problemsList = factory.find(problemsQuery.toString(), params, values);

    CSPrimaryDiagnosisAndPoceduresVo voPrimary = new CSPrimaryDiagnosisAndPoceduresVo();
    voPrimary.setPrimaryDiagnosis(new CSPatientSummaryDiagnosisVoCollection());
    voPrimary.setPrimaryProcedures(new CSPatientSummaryProcedureVoCollection());

    for (int i = 0; diagnosisList != null && i < diagnosisList.size(); i++)
    {
        Object[] diagObjects = (Object[]) diagnosisList.get(i);
        if (diagObjects != null)
        {
            CSPatientSummaryDiagnosisVo voCSPatientSummaryDiagnosis = new CSPatientSummaryDiagnosisVo();
            if (diagObjects[0] instanceof Integer)
            {
                voCSPatientSummaryDiagnosis.setID_CSPatientSummaryDiagnosis((Integer) diagObjects[0]);
            }

            if (diagObjects[1] instanceof String)
            {
                voCSPatientSummaryDiagnosis.setDiagnosisName((String) diagObjects[1]);
            }
            voPrimary.getPrimaryDiagnosis().add(voCSPatientSummaryDiagnosis);
        }
    }

    for (int i = 0; i < problemsList.size(); i++)
    {
        Object[] procObjects = (Object[]) problemsList.get(i);
        if (procObjects != null)
        {
            CSPatientSummaryProcedureVo voCSPatientSummaryProcedure = new CSPatientSummaryProcedureVo();
            if (procObjects[0] instanceof Integer)
            {
                voCSPatientSummaryProcedure.setID_CSPatientSummaryProcedure((Integer) procObjects[0]);
            }

            if (procObjects[1] instanceof String)
            {
                voCSPatientSummaryProcedure.setProcedureName((String) procObjects[1]);
            }
            voPrimary.getPrimaryProcedures().add(voCSPatientSummaryProcedure);
        }
    }

    return voPrimary;
}
项目:openmaxims-linux    文件:PatientSummaryImpl.java   
public CSPrimaryDiagnosisAndPoceduresVo listPrimaryDiagnosisAndProblems(CareSpellRefVo careSpellRefVo)
{
    if(careSpellRefVo == null)
        throw new CodingRuntimeException("Cannot list Primary Diagnosis/Problems for null CareSpellRefVo");

    DomainFactory factory = getDomainFactory();

    StringBuffer diagnosisQuery = new StringBuffer();
    diagnosisQuery.append("select c1_1.diagnosis.id, c1_1.diagnosis.diagnosisDescription");
    diagnosisQuery.append(" from CsPrimaryDiagnosis as c1_1");
    diagnosisQuery.append(" where ");
    diagnosisQuery.append(" (c1_1.isActive = :ACTIVE and c1_1.episodeOfCare.careSpell.id = :CARESPELL_ID)");
    diagnosisQuery.append(" and c1_1.isRIE is null and c1_1.diagnosis.isRIE is null");

    StringBuffer problemsQuery = new StringBuffer();
    problemsQuery.append("select  c1_1.patientProblem.id, c1_1.patientProblem.patientProblem");
    problemsQuery.append(" from CsPrimaryProblem as c1_1");
    problemsQuery.append(" where");
    problemsQuery.append(" (c1_1.isActive = :ACTIVE and c1_1.careContext.episodeOfCare.careSpell.id = :CARESPELL_ID)");
    problemsQuery.append(" and c1_1.isRIE is null and c1_1.patientProblem.isRIE is null");

    ArrayList params = new ArrayList();
    params.add("ACTIVE");
    params.add("CARESPELL_ID");

    ArrayList values = new ArrayList();
    values.add(Boolean.TRUE);
    values.add(careSpellRefVo.getID_CareSpell());

    List diagnosisList = factory.find(diagnosisQuery.toString(), params, values);
    List problemsList = factory.find(problemsQuery.toString(), params, values);

    CSPrimaryDiagnosisAndPoceduresVo voPrimary = new CSPrimaryDiagnosisAndPoceduresVo();
    voPrimary.setPrimaryDiagnosis(new CSPatientSummaryDiagnosisVoCollection());
    voPrimary.setPrimaryProcedures(new CSPatientSummaryProcedureVoCollection());

    for (int i = 0; diagnosisList != null && i < diagnosisList.size(); i++)
    {
        Object[] diagObjects = (Object[]) diagnosisList.get(i);
        if(diagObjects != null)
        {
            CSPatientSummaryDiagnosisVo voCSPatientSummaryDiagnosis = new CSPatientSummaryDiagnosisVo();
            if(diagObjects[0] instanceof Integer)
            {
                voCSPatientSummaryDiagnosis.setID_CSPatientSummaryDiagnosis((Integer)diagObjects[0]);
            }

            if(diagObjects[1] instanceof String)
            {
                voCSPatientSummaryDiagnosis.setDiagnosisName((String)diagObjects[1]);
            }
            voPrimary.getPrimaryDiagnosis().add(voCSPatientSummaryDiagnosis);
        }
    }

    for (int i = 0; i < problemsList.size(); i++)
    {
        Object[] procObjects = (Object[]) problemsList.get(i);
        if(procObjects != null)
        {
            CSPatientSummaryProcedureVo voCSPatientSummaryProcedure = new CSPatientSummaryProcedureVo();
            if(procObjects[0] instanceof Integer)
            {
                voCSPatientSummaryProcedure.setID_CSPatientSummaryProcedure((Integer)procObjects[0]);
            }

            if(procObjects[1] instanceof String)
            {
                voCSPatientSummaryProcedure.setProcedureName((String)procObjects[1]);
            }
            voPrimary.getPrimaryProcedures().add(voCSPatientSummaryProcedure);
        }
    }

    return voPrimary;
}