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

项目:AvoinApotti    文件:Logic.java   
private void fillRecordBrowser()
{
    Integer currentCareContextId = form.getLocalContext().getCurrentCareContextId();

    form.recbrSpacticityAssess().clear();
    CareContextShortVoCollection collCareContextShort = domain.listOPDCareContextsByEpisodeOfCare(form.getGlobalContext().Core.getEpisodeofCareShort());

    collCareContextShort = addCurrentContextToCollection(currentCareContextId, collCareContextShort);
    for(int i=0; i<collCareContextShort.size(); i++){
        CareContextShortVo voCareContextShort =  collCareContextShort.get(i); 
        if(voCareContextShort.getID_CareContext().equals(currentCareContextId)){
            form.recbrSpacticityAssess().newRow(voCareContextShort, voCareContextShort.getRecordBrowserText(), Color.Green);
        }
        else
            form.recbrSpacticityAssess().newRow(voCareContextShort, voCareContextShort.getRecordBrowserText());
    }
}
项目:AvoinApotti    文件:Logic.java   
private CareContextShortVoCollection addCurrentContextToCollection(Integer currentCareContextId, CareContextShortVoCollection collCareContextShort) {
    boolean bRecordExistsForCurrent = false;
    for(int i=0; i<collCareContextShort.size(); i++){
        CareContextShortVo voCareContextShort =  collCareContextShort.get(i); 
        if(voCareContextShort.getID_CareContext().equals(currentCareContextId)){
            bRecordExistsForCurrent = true;
        }
    }

    if(!bRecordExistsForCurrent){
        collCareContextShort.add(form.getGlobalContext().Core.getCurrentCareContext());
        collCareContextShort.sort(SortOrder.DESCENDING);
    }

    return collCareContextShort;        
}
项目:AvoinApotti    文件:Logic.java   
private void fillRecordBrowser()
{
    form.recbrOPDEDClinicNotes().clear();

    Integer currentCareContextId = form.getLocalContext().getCurrentCareContextId();

    CareContextShortVoCollection collCareContextShortVo = domain.listOPEDCareContextsByEpisodeOfCare(form.getGlobalContext().Core.getEpisodeofCareShort());

    collCareContextShortVo = addCurrentContextToCollection(currentCareContextId, collCareContextShortVo);
    for (int i = 0; i < collCareContextShortVo.size(); i++)
    {
        CareContextShortVo voCareContextShort = collCareContextShortVo.get(i);
        if (voCareContextShort.getID_CareContext().equals(currentCareContextId))
        {
            form.recbrOPDEDClinicNotes().newRow(voCareContextShort, voCareContextShort.getRecordBrowserText(), Color.Green);
        }
        else
            form.recbrOPDEDClinicNotes().newRow(voCareContextShort, voCareContextShort.getRecordBrowserText());
    }

}
项目:AvoinApotti    文件:Logic.java   
private CareContextShortVoCollection addCurrentContextToCollection(Integer currentCareContextId, CareContextShortVoCollection collCareContextShort)
{
    boolean bRecordExistsForCurrent = false;
    for (int i = 0; i < collCareContextShort.size(); i++)
    {
        CareContextShortVo voCareContextShort = collCareContextShort.get(i);
        if (voCareContextShort.getID_CareContext().equals(currentCareContextId))
        {
            bRecordExistsForCurrent = true;
        }
    }

    if (!bRecordExistsForCurrent)
    {
        collCareContextShort.add(form.getGlobalContext().Core.getCurrentCareContext());
        collCareContextShort.sort(SortOrder.DESCENDING);
    }

    return collCareContextShort;
}
项目:AvoinApotti    文件:OPDEDClinicNotesImpl.java   
public CareContextShortVoCollection listOPEDCareContextsByEpisodeOfCare(EpisodeOfCareRefVo refEpisodeOfCare) {

    DomainFactory factory = getDomainFactory();
    List OPDList  = factory.find(" from OPDErectDysfxn opd where opd.careContext.episodeOfCare.id = :ecId and opd.isRIE is null order by opd.careContext.startDateTime desc",
            new String[]{"ecId"},
            new Integer[]{refEpisodeOfCare.getID_EpisodeOfCare()});

    CareContextShortVoCollection voCareContextList = new CareContextShortVoCollection();
    for (int x = 0; x < OPDList.size(); x++)
    {
        OPDErectDysfxn domOPD = (OPDErectDysfxn) OPDList.get(x);

        CareContextVo voCareContext = CareContextVoAssembler.create(domOPD.getCareContext());

        voCareContextList.add(voCareContext);
    }

    return voCareContextList;

}
项目:AvoinApotti    文件:OPDSpasticityAssessImpl.java   
public CareContextShortVoCollection listOPDCareContextsByEpisodeOfCare(EpisodeOfCareRefVo refEpisodeOfCare)
{
    DomainFactory factory = getDomainFactory();
    List OPDList  = factory.find(" from OPDSpasticityAssessTreat opd where opd.careContext.episodeOfCare.id = :ecId and opd.isRIE is null order by opd.careContext.startDateTime desc",
            new String[]{"ecId"},
            new Integer[]{refEpisodeOfCare.getID_EpisodeOfCare()});

    CareContextShortVoCollection voCareContextList = new CareContextShortVoCollection();
    for (int x = 0; x < OPDList.size(); x++)
    {
        OPDSpasticityAssessTreat domOPD = (OPDSpasticityAssessTreat) OPDList.get(x);

        CareContextVo voCareContext = CareContextVoAssembler.create(domOPD.getCareContext());
        voCareContextList.add(voCareContext);
    }

    return voCareContextList;

}
项目:AvoinApotti    文件:Logic.java   
private CareContextShortVo findEpis(CareContextShortVoCollection coll, PatientShort ps)
{
    for (int i = 0; i < coll.size(); i++)
    {
        if (coll.get(i) != null && ps != null)
        {
            PatientShort patShort = domain.getPatientFromCareContext(coll.get(i));
            if (patShort != null)
            {
                if (patShort.equals(ps))
                    return coll.get(i);
            }
        }
    }
    return null;
}
项目:AvoinApotti    文件:Logic.java   
/**
 * Function used to populate the Care Contexts (with stool scale assessments) to record browser 
 */
private void populateCareContextRecords(CareContextShortVoCollection careContextList)
{
    // Clear CareContext list for record browser
    form.recbrAssessment().clear();

    // Terminate function if careContext collection is null
    if (careContextList == null || careContextList.size() == 0)
        return;

    for (int i = 0; i < careContextList.size(); i++)
    {
        CareContextShortVo careContext = careContextList.get(i);

        // Skip null care contexts records
        if (careContext == null)
            continue;

        if (careContext.equals(form.getGlobalContext().Core.getCurrentCareContext()))
            form.recbrAssessment().newRow(careContext, "<Currently selected Care Context> " + careContext.getStartDateTime().getDate().toString() + " " + careContext.getStartDateTime().getTime().toString());
        else
            form.recbrAssessment().newRow(careContext, careContext.getStartDateTime().getDate().toString() + " " + careContext.getStartDateTime().getTime().toString());
    }
}
项目:AvoinApotti    文件:MRSATreatmentImpl.java   
public CareContextShortVoCollection listMRSACareContexts(Integer idPatient)
{
    if (idPatient != null)
    {
        DomainFactory factory = getDomainFactory();
        List MRSAaList  = factory.find(" select distinct mrsa.careContext from MRSAAssessment mrsa where mrsa.careContext.episodeOfCare.careSpell.patient.id = :patId",
                new String[]{"patId"},
                new Object[]{idPatient});

        CareContextShortVoCollection voCareContextList = new CareContextShortVoCollection();
        for (int x = 0; x < MRSAaList.size(); x++)
        {
            CareContext domMrsa = (CareContext) MRSAaList.get(x);
            voCareContextList.add(CareContextShortVoAssembler.create(domMrsa));
        }

        return voCareContextList.sort();
    }

    return null;
}
项目:AvoinApotti    文件:PainReviewImpl.java   
public CareContextShortVoCollection listPainReviewCareContexts(Integer idPatient)
{
    if (idPatient != null)
    {
        DomainFactory factory = getDomainFactory();
        List PAaList  = factory.find(" select distinct pa.careContext from PainAssessment pa where pa.careContext.episodeOfCare.careSpell.patient.id = :patId",
                new String[]{"patId"},
                new Object[]{idPatient});

        CareContextShortVoCollection voCareContextList = new CareContextShortVoCollection();
        for (int x = 0; x < PAaList.size(); x++)
        {
            CareContext domPAa = (CareContext) PAaList.get(x);
            voCareContextList.add(CareContextShortVoAssembler.create(domPAa));  
        }

        return voCareContextList.sort();
    }

    return null;
}
项目:AvoinApotti    文件:MRSAAssessmentImpl.java   
public CareContextShortVoCollection listMRSACareContexts(Integer idPatient)
{
    if (idPatient != null)
    {
        DomainFactory factory = getDomainFactory();
        List MRSAaList  = factory.find(" select distinct mrsa.careContext from MRSAAssessment mrsa where mrsa.careContext.episodeOfCare.careSpell.patient.id = :patId",
                new String[]{"patId"},
                new Object[]{idPatient});

        CareContextShortVoCollection voCareContextList = new CareContextShortVoCollection();
        for (int x = 0; x < MRSAaList.size(); x++)
        {
            CareContext domMrsa = (CareContext) MRSAaList.get(x);
            voCareContextList.add(CareContextShortVoAssembler.create(domMrsa));
        }

        return voCareContextList.sort();
    }

    return null;
}
项目:AvoinApotti    文件:SkinReviewImpl.java   
public CareContextShortVoCollection listSkinReviewCareContexts(Integer idPatient)
{
    if (idPatient != null)
    {
        DomainFactory factory = getDomainFactory();
        List SkAsList  = factory.find(" select distinct scas.careContext from SkinAssessment scas where scas.careContext.episodeOfCare.careSpell.patient.id = :patId",
                new String[]{"patId"},
                new Object[]{idPatient});

        CareContextShortVoCollection voCareContextList = new CareContextShortVoCollection();
        for (int x = 0; x < SkAsList.size(); x++)
        {
            CareContext domSkAs = (CareContext) SkAsList.get(x);
            voCareContextList.add(CareContextShortVoAssembler.create(domSkAs));
        }

        return voCareContextList.sort();
    }

    return null;

}
项目:AvoinApotti    文件:SupportNetworkProfessionalServicesImpl.java   
public CareContextShortVoCollection listCareContexts(PatientRefVo voPatientRef)
{
    if (voPatientRef == null)
        throw new CodingRuntimeException("Patient was not supplied. Mandatory argument");

    DomainFactory factory = getDomainFactory();

    String hql = " from CareContext cc where cc.episodeOfCare.careSpell.patient.id = :patient";
    ArrayList markerNames = new ArrayList();
    ArrayList markerValues = new ArrayList();
    markerNames.add("patient");
    markerValues.add(voPatientRef.getID_Patient());

    java.util.List lst = factory.find(hql, markerNames, markerValues);
    return CareContextShortVoAssembler.createCareContextShortVoCollectionFromCareContext(lst);
}
项目:AvoinApotti    文件:EmergencyHelper.java   
public CareContextShortVoCollection getCareContextsByPatient(PatientRefVo patientRef)
{
    if (patientRef == null || patientRef.getID_Patient() == null)
    {
        throw new CodingRuntimeException("Cannot get CareContextShortVoCollection on null Id for Patient ");
    }

    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer();
    hql.append("select careContext from CareContext as careContext left join careContext.episodeOfCare as episOfCare left join episOfCare.careSpell as careSpell where careSpell.patient.id = :patID ");

    List<?> list = factory.find(hql.toString(), new String[] { "patID" }, new Object[] { patientRef.getID_Patient() });

    return CareContextShortVoAssembler.createCareContextShortVoCollectionFromCareContext(list);
}
项目:AvoinApotti    文件:SupportServicesImpl.java   
public CareContextShortVoCollection listCareContexts(PatientRefVo voPatientRef) 
{
    if (voPatientRef == null)
        throw new CodingRuntimeException("Patient was not supplied. Mandatory argument");

    DomainFactory factory = getDomainFactory();

    String hql = " from CareContext cc where cc.episodeOfCare.careSpell.patient.id = :patient";
    ArrayList markerNames = new ArrayList();
    ArrayList markerValues = new ArrayList();
    markerNames.add("patient");
    markerValues.add(voPatientRef.getID_Patient());

    java.util.List lst = factory.find(hql, markerNames, markerValues);
    return CareContextShortVoAssembler.createCareContextShortVoCollectionFromCareContext(lst);
}
项目:AvoinApotti    文件:Logic.java   
private void loadCareContexts() 
{
    CareContextShortVoCollection voColl = domain.listCareContexts(form.getGlobalContext().Core.getPatientShort());

    form.cmbCareContext().clear();

    for (int i = 0 ; voColl != null && i < voColl.size() ; i++)
    {
        StringBuffer sb = new StringBuffer();
        sb.append(voColl.get(i).createDisplayString());
        if (voColl.get(i).getContextIsNotNull())
        {
            sb.append(" - ");
            sb.append(voColl.get(i).getContext()); 
        }
        form.cmbCareContext().newRow(voColl.get(i), sb.toString());
    }

}
项目:AvoinApotti    文件:VTERiskAssessmentImpl.java   
public CareContextShortVo getCareContextByPasEventId(PASEventRefVo pasEventRef) 
{
    if(pasEventRef == null )
        throw new CodingRuntimeException("PAS EVENT not provided");

    DomainFactory factory = getDomainFactory();
    List carecontexts = factory.find("select c1_1 from CareContext as c1_1 left join c1_1.pasEvent as p1_1 where    p1_1.id =:idPasEvent   ", new String[] {"idPasEvent"}, new Object[] {pasEventRef.getID_PASEvent()});


    if( carecontexts != null && carecontexts.size() > 0)
    {
        CareContextShortVoCollection tempColl = CareContextShortVoAssembler.createCareContextShortVoCollectionFromCareContext(carecontexts).sort(SortOrder.DESCENDING);
        if( tempColl != null && tempColl.size() > 0)
            return tempColl.get(0);
    }


    return null;
}
项目:openMAXIMS    文件:Logic.java   
private void fillRecordBrowser()
{
    Integer currentCareContextId = form.getLocalContext().getCurrentCareContextId();

    form.recbrSpacticityAssess().clear();
    CareContextShortVoCollection collCareContextShort = domain.listOPDCareContextsByEpisodeOfCare(form.getGlobalContext().Core.getEpisodeofCareShort());

    collCareContextShort = addCurrentContextToCollection(currentCareContextId, collCareContextShort);
    for(int i=0; i<collCareContextShort.size(); i++){
        CareContextShortVo voCareContextShort =  collCareContextShort.get(i); 
        if(voCareContextShort.getID_CareContext().equals(currentCareContextId)){
            form.recbrSpacticityAssess().newRow(voCareContextShort, voCareContextShort.getRecordBrowserText(), Color.Green);
        }
        else
            form.recbrSpacticityAssess().newRow(voCareContextShort, voCareContextShort.getRecordBrowserText());
    }
}
项目:openmaxims-linux    文件:MRSAAssessmentImpl.java   
public CareContextShortVoCollection listMRSACareContexts(Integer idPatient)
{
    if (idPatient != null)
    {
        DomainFactory factory = getDomainFactory();
        List MRSAaList  = factory.find(" select distinct mrsa.careContext from MRSAAssessment mrsa where mrsa.careContext.episodeOfCare.careSpell.patient.id = :patId",
                new String[]{"patId"},
                new Object[]{idPatient});

        CareContextShortVoCollection voCareContextList = new CareContextShortVoCollection();
        for (int x = 0; x < MRSAaList.size(); x++)
        {
            CareContext domMrsa = (CareContext) MRSAaList.get(x);
            voCareContextList.add(CareContextShortVoAssembler.create(domMrsa));
        }

        return voCareContextList.sort();
    }

    return null;
}
项目:openMAXIMS    文件:Logic.java   
private void fillRecordBrowser()
{
    form.recbrOPDEDClinicNotes().clear();

    Integer currentCareContextId = form.getLocalContext().getCurrentCareContextId();

    CareContextShortVoCollection collCareContextShortVo = domain.listOPEDCareContextsByEpisodeOfCare(form.getGlobalContext().Core.getEpisodeofCareShort());

    collCareContextShortVo = addCurrentContextToCollection(currentCareContextId, collCareContextShortVo);
    for (int i = 0; i < collCareContextShortVo.size(); i++)
    {
        CareContextShortVo voCareContextShort = collCareContextShortVo.get(i);
        if (voCareContextShort.getID_CareContext().equals(currentCareContextId))
        {
            form.recbrOPDEDClinicNotes().newRow(voCareContextShort, voCareContextShort.getRecordBrowserText(), Color.Green);
        }
        else
            form.recbrOPDEDClinicNotes().newRow(voCareContextShort, voCareContextShort.getRecordBrowserText());
    }

}
项目:openMAXIMS    文件:Logic.java   
private CareContextShortVoCollection addCurrentContextToCollection(Integer currentCareContextId, CareContextShortVoCollection collCareContextShort)
{
    boolean bRecordExistsForCurrent = false;
    for (int i = 0; i < collCareContextShort.size(); i++)
    {
        CareContextShortVo voCareContextShort = collCareContextShort.get(i);
        if (voCareContextShort.getID_CareContext().equals(currentCareContextId))
        {
            bRecordExistsForCurrent = true;
        }
    }

    if (!bRecordExistsForCurrent)
    {
        collCareContextShort.add(form.getGlobalContext().Core.getCurrentCareContext());
        collCareContextShort.sort(SortOrder.DESCENDING);
    }

    return collCareContextShort;
}
项目:openMAXIMS    文件:OPDEDClinicNotesImpl.java   
public CareContextShortVoCollection listOPEDCareContextsByEpisodeOfCare(EpisodeOfCareRefVo refEpisodeOfCare) {

    DomainFactory factory = getDomainFactory();
    List OPDList  = factory.find(" from OPDErectDysfxn opd where opd.careContext.episodeOfCare.id = :ecId and opd.isRIE is null order by opd.careContext.startDateTime desc",
            new String[]{"ecId"},
            new Integer[]{refEpisodeOfCare.getID_EpisodeOfCare()});

    CareContextShortVoCollection voCareContextList = new CareContextShortVoCollection();
    for (int x = 0; x < OPDList.size(); x++)
    {
        OPDErectDysfxn domOPD = (OPDErectDysfxn) OPDList.get(x);

        CareContextVo voCareContext = CareContextVoAssembler.create(domOPD.getCareContext());

        voCareContextList.add(voCareContext);
    }

    return voCareContextList;

}
项目:openmaxims-linux    文件:VTERiskAssessmentImpl.java   
public CareContextShortVo getCareContextByPasEventId(PASEventRefVo pasEventRef) 
{
    if(pasEventRef == null )
        throw new CodingRuntimeException("PAS EVENT not provided");

    DomainFactory factory = getDomainFactory();
    List carecontexts = factory.find("select c1_1 from CareContext as c1_1 left join c1_1.pasEvent as p1_1 where    p1_1.id =:idPasEvent   ", new String[] {"idPasEvent"}, new Object[] {pasEventRef.getID_PASEvent()});


    if( carecontexts != null && carecontexts.size() > 0)
    {
        CareContextShortVoCollection tempColl = CareContextShortVoAssembler.createCareContextShortVoCollectionFromCareContext(carecontexts).sort(SortOrder.DESCENDING);
        if( tempColl != null && tempColl.size() > 0)
            return tempColl.get(0);
    }


    return null;
}
项目:openmaxims-linux    文件:SupportServicesImpl.java   
public CareContextShortVoCollection listCareContexts(PatientRefVo voPatientRef) 
{
    if (voPatientRef == null)
        throw new CodingRuntimeException("Patient was not supplied. Mandatory argument");

    DomainFactory factory = getDomainFactory();

    String hql = " from CareContext cc where cc.episodeOfCare.careSpell.patient.id = :patient";
    ArrayList markerNames = new ArrayList();
    ArrayList markerValues = new ArrayList();
    markerNames.add("patient");
    markerValues.add(voPatientRef.getID_Patient());

    java.util.List lst = factory.find(hql, markerNames, markerValues);
    return CareContextShortVoAssembler.createCareContextShortVoCollectionFromCareContext(lst);
}
项目:openmaxims-linux    文件:Logic.java   
/**
 * Function used to populate the Care Contexts (with stool scale assessments) to record browser 
 */
private void populateCareContextRecords(CareContextShortVoCollection careContextList)
{
    // Clear CareContext list for record browser
    form.recbrAssessment().clear();

    // Terminate function if careContext collection is null
    if (careContextList == null || careContextList.size() == 0)
        return;

    for (int i = 0; i < careContextList.size(); i++)
    {
        CareContextShortVo careContext = careContextList.get(i);

        // Skip null care contexts records
        if (careContext == null)
            continue;

        if (careContext.equals(form.getGlobalContext().Core.getCurrentCareContext()))
            form.recbrAssessment().newRow(careContext, "<Currently selected Care Context> " + careContext.getStartDateTime().getDate().toString() + " " + careContext.getStartDateTime().getTime().toString());
        else
            form.recbrAssessment().newRow(careContext, careContext.getStartDateTime().getDate().toString() + " " + careContext.getStartDateTime().getTime().toString());
    }
}
项目:openMAXIMS    文件:MRSATreatmentImpl.java   
public CareContextShortVoCollection listMRSACareContexts(Integer idPatient)
{
    if (idPatient != null)
    {
        DomainFactory factory = getDomainFactory();
        List MRSAaList  = factory.find(" select distinct mrsa.careContext from MRSAAssessment mrsa where mrsa.careContext.episodeOfCare.careSpell.patient.id = :patId",
                new String[]{"patId"},
                new Object[]{idPatient});

        CareContextShortVoCollection voCareContextList = new CareContextShortVoCollection();
        for (int x = 0; x < MRSAaList.size(); x++)
        {
            CareContext domMrsa = (CareContext) MRSAaList.get(x);
            voCareContextList.add(CareContextShortVoAssembler.create(domMrsa));
        }

        return voCareContextList.sort();
    }

    return null;
}
项目:openMAXIMS    文件:PainReviewImpl.java   
public CareContextShortVoCollection listPainReviewCareContexts(Integer idPatient)
{
    if (idPatient != null)
    {
        DomainFactory factory = getDomainFactory();
        List PAaList  = factory.find(" select distinct pa.careContext from PainAssessment pa where pa.careContext.episodeOfCare.careSpell.patient.id = :patId",
                new String[]{"patId"},
                new Object[]{idPatient});

        CareContextShortVoCollection voCareContextList = new CareContextShortVoCollection();
        for (int x = 0; x < PAaList.size(); x++)
        {
            CareContext domPAa = (CareContext) PAaList.get(x);
            voCareContextList.add(CareContextShortVoAssembler.create(domPAa));  
        }

        return voCareContextList.sort();
    }

    return null;
}
项目:openMAXIMS    文件:MRSAAssessmentImpl.java   
public CareContextShortVoCollection listMRSACareContexts(Integer idPatient)
{
    if (idPatient != null)
    {
        DomainFactory factory = getDomainFactory();
        List MRSAaList  = factory.find(" select distinct mrsa.careContext from MRSAAssessment mrsa where mrsa.careContext.episodeOfCare.careSpell.patient.id = :patId",
                new String[]{"patId"},
                new Object[]{idPatient});

        CareContextShortVoCollection voCareContextList = new CareContextShortVoCollection();
        for (int x = 0; x < MRSAaList.size(); x++)
        {
            CareContext domMrsa = (CareContext) MRSAaList.get(x);
            voCareContextList.add(CareContextShortVoAssembler.create(domMrsa));
        }

        return voCareContextList.sort();
    }

    return null;
}
项目:openmaxims-linux    文件:SupportNetworkProfessionalServicesImpl.java   
public CareContextShortVoCollection listCareContexts(PatientRefVo voPatientRef)
{
    if (voPatientRef == null)
        throw new CodingRuntimeException("Patient was not supplied. Mandatory argument");

    DomainFactory factory = getDomainFactory();

    String hql = " from CareContext cc where cc.episodeOfCare.careSpell.patient.id = :patient";
    ArrayList markerNames = new ArrayList();
    ArrayList markerValues = new ArrayList();
    markerNames.add("patient");
    markerValues.add(voPatientRef.getID_Patient());

    java.util.List lst = factory.find(hql, markerNames, markerValues);
    return CareContextShortVoAssembler.createCareContextShortVoCollectionFromCareContext(lst);
}
项目:openmaxims-linux    文件:EmergencyHelper.java   
public CareContextShortVoCollection getCareContextsByPatient(PatientRefVo patientRef)
{
    if (patientRef == null || patientRef.getID_Patient() == null)
    {
        throw new CodingRuntimeException("Cannot get CareContextShortVoCollection on null Id for Patient ");
    }

    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer();
    hql.append("select careContext from CareContext as careContext left join careContext.episodeOfCare as episOfCare left join episOfCare.careSpell as careSpell where careSpell.patient.id = :patID ");

    List<?> list = factory.find(hql.toString(), new String[] { "patID" }, new Object[] { patientRef.getID_Patient() });

    return CareContextShortVoAssembler.createCareContextShortVoCollectionFromCareContext(list);
}
项目:openMAXIMS    文件:SupportNetworkProfessionalServicesImpl.java   
public CareContextShortVoCollection listCareContexts(PatientRefVo voPatientRef)
{
    if (voPatientRef == null)
        throw new CodingRuntimeException("Patient was not supplied. Mandatory argument");

    DomainFactory factory = getDomainFactory();

    String hql = " from CareContext cc where cc.episodeOfCare.careSpell.patient.id = :patient";
    ArrayList markerNames = new ArrayList();
    ArrayList markerValues = new ArrayList();
    markerNames.add("patient");
    markerValues.add(voPatientRef.getID_Patient());

    java.util.List lst = factory.find(hql, markerNames, markerValues);
    return CareContextShortVoAssembler.createCareContextShortVoCollectionFromCareContext(lst);
}
项目:openmaxims-linux    文件:SkinReviewImpl.java   
public CareContextShortVoCollection listSkinReviewCareContexts(Integer idPatient)
{
    if (idPatient != null)
    {
        DomainFactory factory = getDomainFactory();
        List SkAsList  = factory.find(" select distinct scas.careContext from SkinAssessment scas where scas.careContext.episodeOfCare.careSpell.patient.id = :patId",
                new String[]{"patId"},
                new Object[]{idPatient});

        CareContextShortVoCollection voCareContextList = new CareContextShortVoCollection();
        for (int x = 0; x < SkAsList.size(); x++)
        {
            CareContext domSkAs = (CareContext) SkAsList.get(x);
            voCareContextList.add(CareContextShortVoAssembler.create(domSkAs));
        }

        return voCareContextList.sort();
    }

    return null;

}
项目:openMAXIMS    文件:EmergencyHelper.java   
public CareContextShortVoCollection getCareContextsByPatient(PatientRefVo patientRef)
{
    if (patientRef == null || patientRef.getID_Patient() == null)
    {
        throw new CodingRuntimeException("Cannot get CareContextShortVoCollection on null Id for Patient ");
    }

    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer();
    hql.append("select careContext from CareContext as careContext left join careContext.episodeOfCare as episOfCare left join episOfCare.careSpell as careSpell where careSpell.patient.id = :patID ");

    List<?> list = factory.find(hql.toString(), new String[] { "patID" }, new Object[] { patientRef.getID_Patient() });

    return CareContextShortVoAssembler.createCareContextShortVoCollectionFromCareContext(list);
}
项目:openmaxims-linux    文件:Logic.java   
private void loadCareContexts() 
{
    CareContextShortVoCollection voColl = domain.listCareContexts(form.getGlobalContext().Core.getPatientShort());

    form.cmbCareContext().clear();

    for (int i = 0 ; voColl != null && i < voColl.size() ; i++)
    {
        StringBuffer sb = new StringBuffer();
        sb.append(voColl.get(i).createDisplayString());
        if (voColl.get(i).getContextIsNotNull())
        {
            sb.append(" - ");
            sb.append(voColl.get(i).getContext()); 
        }
        form.cmbCareContext().newRow(voColl.get(i), sb.toString());
    }

}
项目:openMAXIMS    文件:Logic.java   
private void loadCareContexts() 
{
    CareContextShortVoCollection voColl = domain.listCareContexts(form.getGlobalContext().Core.getPatientShort());

    form.cmbCareContext().clear();

    for (int i = 0 ; voColl != null && i < voColl.size() ; i++)
    {
        StringBuffer sb = new StringBuffer();
        sb.append(voColl.get(i).createDisplayString());
        if (voColl.get(i).getContextIsNotNull())
        {
            sb.append(" - ");
            sb.append(voColl.get(i).getContext()); 
        }
        form.cmbCareContext().newRow(voColl.get(i), sb.toString());
    }

}
项目:openMAXIMS    文件:VTERiskAssessmentImpl.java   
public CareContextShortVo getCareContextByPasEventId(PASEventRefVo pasEventRef) 
{
    if(pasEventRef == null )
        throw new CodingRuntimeException("PAS EVENT not provided");

    DomainFactory factory = getDomainFactory();
    List carecontexts = factory.find("select c1_1 from CareContext as c1_1 left join c1_1.pasEvent as p1_1 where    p1_1.id =:idPasEvent   ", new String[] {"idPasEvent"}, new Object[] {pasEventRef.getID_PASEvent()});


    if( carecontexts != null && carecontexts.size() > 0)
    {
        CareContextShortVoCollection tempColl = CareContextShortVoAssembler.createCareContextShortVoCollectionFromCareContext(carecontexts).sort(SortOrder.DESCENDING);
        if( tempColl != null && tempColl.size() > 0)
            return tempColl.get(0);
    }


    return null;
}
项目:openMAXIMS    文件:Logic.java   
private void fillRecordBrowser()
{
    Integer currentCareContextId = form.getLocalContext().getCurrentCareContextId();

    form.recbrSpacticityAssess().clear();
    CareContextShortVoCollection collCareContextShort = domain.listOPDCareContextsByEpisodeOfCare(form.getGlobalContext().Core.getEpisodeofCareShort());

    collCareContextShort = addCurrentContextToCollection(currentCareContextId, collCareContextShort);
    for(int i=0; i<collCareContextShort.size(); i++){
        CareContextShortVo voCareContextShort =  collCareContextShort.get(i); 
        if(voCareContextShort.getID_CareContext().equals(currentCareContextId)){
            form.recbrSpacticityAssess().newRow(voCareContextShort, voCareContextShort.getRecordBrowserText(), Color.Green);
        }
        else
            form.recbrSpacticityAssess().newRow(voCareContextShort, voCareContextShort.getRecordBrowserText());
    }
}
项目:openMAXIMS    文件:Logic.java   
private CareContextShortVoCollection addCurrentContextToCollection(Integer currentCareContextId, CareContextShortVoCollection collCareContextShort) {
    boolean bRecordExistsForCurrent = false;
    for(int i=0; i<collCareContextShort.size(); i++){
        CareContextShortVo voCareContextShort =  collCareContextShort.get(i); 
        if(voCareContextShort.getID_CareContext().equals(currentCareContextId)){
            bRecordExistsForCurrent = true;
        }
    }

    if(!bRecordExistsForCurrent){
        collCareContextShort.add(form.getGlobalContext().Core.getCurrentCareContext());
        collCareContextShort.sort(SortOrder.DESCENDING);
    }

    return collCareContextShort;        
}
项目:openMAXIMS    文件:Logic.java   
private void fillRecordBrowser()
{
    form.recbrOPDEDClinicNotes().clear();

    Integer currentCareContextId = form.getLocalContext().getCurrentCareContextId();

    CareContextShortVoCollection collCareContextShortVo = domain.listOPEDCareContextsByEpisodeOfCare(form.getGlobalContext().Core.getEpisodeofCareShort());

    collCareContextShortVo = addCurrentContextToCollection(currentCareContextId, collCareContextShortVo);
    for (int i = 0; i < collCareContextShortVo.size(); i++)
    {
        CareContextShortVo voCareContextShort = collCareContextShortVo.get(i);
        if (voCareContextShort.getID_CareContext().equals(currentCareContextId))
        {
            form.recbrOPDEDClinicNotes().newRow(voCareContextShort, voCareContextShort.getRecordBrowserText(), Color.Green);
        }
        else
            form.recbrOPDEDClinicNotes().newRow(voCareContextShort, voCareContextShort.getRecordBrowserText());
    }

}
项目:openMAXIMS    文件:OPDEDClinicNotesImpl.java   
public CareContextShortVoCollection listOPEDCareContextsByEpisodeOfCare(EpisodeOfCareRefVo refEpisodeOfCare) {

    DomainFactory factory = getDomainFactory();
    List OPDList  = factory.find(" from OPDErectDysfxn opd where opd.careContext.episodeOfCare.id = :ecId and opd.isRIE is null order by opd.careContext.startDateTime desc",
            new String[]{"ecId"},
            new Integer[]{refEpisodeOfCare.getID_EpisodeOfCare()});

    CareContextShortVoCollection voCareContextList = new CareContextShortVoCollection();
    for (int x = 0; x < OPDList.size(); x++)
    {
        OPDErectDysfxn domOPD = (OPDErectDysfxn) OPDList.get(x);

        CareContextVo voCareContext = CareContextVoAssembler.create(domOPD.getCareContext());

        voCareContextList.add(voCareContext);
    }

    return voCareContextList;

}