Java 类ims.core.vo.domain.CareContextShortVoAssembler 实例源码

项目:AvoinApotti    文件:MedMskSpinePathImpl.java   
/**
 * Saves the given details
 */
public MSKSpinePathologyFindingVo saveMskSpinePath(MSKSpinePathologyFindingVo exam, CareContextShortVo careContext) throws StaleObjectException
{
    if (!exam.isValidated())
        throw new DomainRuntimeException("Examination has not been validated!");

    DomainFactory factory = getDomainFactory();     
    CareContext domCareContext = CareContextShortVoAssembler.extractCareContext(factory, careContext);

    MskSpinePath domPath = MSKSpinePathologyFindingVoAssembler.extractMskSpinePath(factory, exam);
    if (exam.getIsProblem().booleanValue() == true)
    {
        PatientProblem prob = new PatientProblem();
        prob.setIsActive(Boolean.TRUE);
        prob.setPatientProblem("MSK Spine Pathology - Level:" +  exam.getPathSite().getName() + " of injury");
        prob.setProblemContext("Spine Pathology");
        prob.setCareContext(domCareContext);
        factory.save(prob);
    }
    factory.save(domPath);          
    return MSKSpinePathologyFindingVoAssembler.create(domPath);
}
项目: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    文件:ADTAdmissionDetailsComponentImpl.java   
public CareContextShortVo updateAdmissionDetails(InpatientEpisodeVo episVo, CareContextShortVo careContextVo) throws StaleObjectException
{
    if (episVo == null )
    {
        throw new CodingRuntimeException("episVo is null on Save");
    }

    if (careContextVo == null )
    {
        throw new CodingRuntimeException("careContextVo is null on Save");
    }

    ADT implLoc = (ADT)getDomainImpl(ADTImpl.class);
    DomainFactory factory = getDomainFactory();

    CareContext domCareContext = CareContextShortVoAssembler.extractCareContext(factory, careContextVo);
    factory.save(domCareContext);

    implLoc.updateInpatient(episVo, null);

    return CareContextShortVoAssembler.create(domCareContext);

}
项目: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    文件: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;
}
项目:AvoinApotti    文件:DischargeInpatientImpl.java   
public CareContextShortVo updateCareContextWithEndDateTime(CareContextRefVo careContext, DateTime endDateTime) throws StaleObjectException
{
    if(careContext == null || careContext.getID_CareContext() == null)
        throw new CodingRuntimeException("careContext parameter cannot be null in method updateCareContextAndEpisodeOfCareWithEndDateTime");

    if(endDateTime == null)
        throw new CodingRuntimeException("endDateTime parameter cannot be null in method updateCareContextAndEpisodeOfCareWithEndDateTime");


    DomainFactory factory = getDomainFactory();

    CareContext doCareContext = (CareContext) factory.getDomainObject(careContext);

    if(endDateTime != null)
        doCareContext.setEndDateTime(endDateTime.getJavaDate());
    //if(doCareContext.getEpisodeOfCare() != null && endDateTime != null)
        //doCareContext.getEpisodeOfCare().setEndDate(endDateTime.getJavaDate());

    factory.save(doCareContext);
    return CareContextShortVoAssembler.create(doCareContext);
}
项目:AvoinApotti    文件:DischargeInpatientImpl.java   
public CareContextShortVo updateCareContextAndEpisodeOfCareWithEndDateTime(CareContextRefVo careContext, DateTime endDateTime) throws StaleObjectException
{
    if(careContext == null || careContext.getID_CareContext() == null)
        throw new CodingRuntimeException("careContext parameter cannot be null in method updateCareContextAndEpisodeOfCareWithEndDateTime");

    if(endDateTime == null)
        throw new CodingRuntimeException("endDateTime parameter cannot be null in method updateCareContextAndEpisodeOfCareWithEndDateTime");


    DomainFactory factory = getDomainFactory();

    CareContext doCareContext = (CareContext) factory.getDomainObject(careContext);

    if(endDateTime != null)
        doCareContext.setEndDateTime(endDateTime.getJavaDate());
    if(doCareContext.getEpisodeOfCare() != null && endDateTime != null)
        doCareContext.getEpisodeOfCare().setEndDate(endDateTime.getJavaDate());

    factory.save(doCareContext);
    return CareContextShortVoAssembler.create(doCareContext);
}
项目: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-linux    文件:DischargeInpatientImpl.java   
public CareContextShortVo updateCareContextAndEpisodeOfCareWithEndDateTime(CareContextRefVo careContext, DateTime endDateTime) throws StaleObjectException
{
    if(careContext == null || careContext.getID_CareContext() == null)
        throw new CodingRuntimeException("careContext parameter cannot be null in method updateCareContextAndEpisodeOfCareWithEndDateTime");

    if(endDateTime == null)
        throw new CodingRuntimeException("endDateTime parameter cannot be null in method updateCareContextAndEpisodeOfCareWithEndDateTime");


    DomainFactory factory = getDomainFactory();

    CareContext doCareContext = (CareContext) factory.getDomainObject(careContext);

    if(endDateTime != null)
        doCareContext.setEndDateTime(endDateTime.getJavaDate());
    if(doCareContext.getEpisodeOfCare() != null && endDateTime != null)
        doCareContext.getEpisodeOfCare().setEndDate(endDateTime.getJavaDate());

    factory.save(doCareContext);
    return CareContextShortVoAssembler.create(doCareContext);
}
项目: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    文件: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    文件:CcoContextEvalProvider.java   
public ValueObjectRef getReferralCareContextForCareContext(ValueObjectRef refVo) {
    CareContext ctx = (CareContext)this.getDomainFactory().getDomainObject(CareContext.class, refVo.getBoId());
    if (ctx == null)
        throw new DomainRuntimeException("Invalid CareContext refVo passed into getReferralCareContextForCareContext. ");

    //get CareSpell
    String epidodeHQL ="select epis.id from CareContext as cc left join cc.episodeOfCare as epis where (cc.id = :careContextID) ";
    List<?> list = this.getDomainFactory().find(epidodeHQL,new String[]{"careContextID"},new Object[]{refVo.getBoId()});
    Integer episodeId = null;
    if(list!=null&&list.size()>0)
    {
        for (Object object : list)
        {
            episodeId= (Integer)object;
        }
        String referralCareContextHQL = "select cc from CareContext as cc left join cc.episodeOfCare as epis  where (cc.context.id = -3076 and epis.id = :episodeID)"; // -3076 == ContextType Referral
        CareContext referralCareContext = (CareContext)this.getDomainFactory().findFirst(referralCareContextHQL,new String[]{"episodeID"},new Object[]{episodeId});
        return CareContextShortVoAssembler.create(referralCareContext);
    }
    else 
    {
        return null;
    }
}
项目:openMAXIMS    文件:ADTAdmissionDetailsComponentImpl.java   
public CareContextShortVo updateAdmissionDetails(InpatientEpisodeVo episVo, CareContextShortVo careContextVo) throws StaleObjectException
{
    if (episVo == null )
    {
        throw new CodingRuntimeException("episVo is null on Save");
    }

    if (careContextVo == null )
    {
        throw new CodingRuntimeException("careContextVo is null on Save");
    }

    ADT implLoc = (ADT)getDomainImpl(ADTImpl.class);
    DomainFactory factory = getDomainFactory();

    CareContext domCareContext = CareContextShortVoAssembler.extractCareContext(factory, careContextVo);
    factory.save(domCareContext);

    implLoc.updateInpatient(episVo, null);

    return CareContextShortVoAssembler.create(domCareContext);

}
项目:openMAXIMS    文件:DischargeInpatientImpl.java   
public CareContextShortVo updateCareContextAndEpisodeOfCareWithEndDateTime(CareContextRefVo careContext, DateTime endDateTime) throws StaleObjectException
{
    if(careContext == null || careContext.getID_CareContext() == null)
        throw new CodingRuntimeException("careContext parameter cannot be null in method updateCareContextAndEpisodeOfCareWithEndDateTime");

    if(endDateTime == null)
        throw new CodingRuntimeException("endDateTime parameter cannot be null in method updateCareContextAndEpisodeOfCareWithEndDateTime");


    DomainFactory factory = getDomainFactory();

    CareContext doCareContext = (CareContext) factory.getDomainObject(careContext);

    if(endDateTime != null)
        doCareContext.setEndDateTime(endDateTime.getJavaDate());
    if(doCareContext.getEpisodeOfCare() != null && endDateTime != null)
        doCareContext.getEpisodeOfCare().setEndDate(endDateTime.getJavaDate());

    factory.save(doCareContext);
    return CareContextShortVoAssembler.create(doCareContext);
}
项目: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    文件: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    文件: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    文件:ADTAdmissionDetailsComponentImpl.java   
public CareContextShortVo updateAdmissionDetails(InpatientEpisodeVo episVo, CareContextShortVo careContextVo) throws StaleObjectException
{
    if (episVo == null )
    {
        throw new CodingRuntimeException("episVo is null on Save");
    }

    if (careContextVo == null )
    {
        throw new CodingRuntimeException("careContextVo is null on Save");
    }

    ADT implLoc = (ADT)getDomainImpl(ADTImpl.class);
    DomainFactory factory = getDomainFactory();

    CareContext domCareContext = CareContextShortVoAssembler.extractCareContext(factory, careContextVo);
    factory.save(domCareContext);

    implLoc.updateInpatient(episVo, null);

    return CareContextShortVoAssembler.create(domCareContext);

}
项目: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    文件: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    文件: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    文件: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    文件:MedMskSpinePathImpl.java   
/**
 * Saves the given details
 */
public MSKSpinePathologyFindingVo saveMskSpinePath(MSKSpinePathologyFindingVo exam, CareContextShortVo careContext) throws StaleObjectException
{
    if (!exam.isValidated())
        throw new DomainRuntimeException("Examination has not been validated!");

    DomainFactory factory = getDomainFactory();     
    CareContext domCareContext = CareContextShortVoAssembler.extractCareContext(factory, careContext);

    MskSpinePath domPath = MSKSpinePathologyFindingVoAssembler.extractMskSpinePath(factory, exam);
    if (exam.getIsProblem().booleanValue() == true)
    {
        PatientProblem prob = new PatientProblem();
        prob.setIsActive(Boolean.TRUE);
        prob.setPatientProblem("MSK Spine Pathology - Level:" +  exam.getPathSite().getName() + " of injury");
        prob.setProblemContext("Spine Pathology");
        prob.setCareContext(domCareContext);
        factory.save(prob);
    }
    factory.save(domPath);          
    return MSKSpinePathologyFindingVoAssembler.create(domPath);
}
项目: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    文件: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-linux    文件:ADTAdmissionDetailsComponentImpl.java   
public CareContextShortVo updateAdmissionDetails(InpatientEpisodeVo episVo, CareContextShortVo careContextVo) throws StaleObjectException
{
    if (episVo == null )
    {
        throw new CodingRuntimeException("episVo is null on Save");
    }

    if (careContextVo == null )
    {
        throw new CodingRuntimeException("careContextVo is null on Save");
    }

    ADT implLoc = (ADT)getDomainImpl(ADTImpl.class);
    DomainFactory factory = getDomainFactory();

    CareContext domCareContext = CareContextShortVoAssembler.extractCareContext(factory, careContextVo);
    factory.save(domCareContext);

    implLoc.updateInpatient(episVo, null);

    return CareContextShortVoAssembler.create(domCareContext);

}
项目:AvoinApotti    文件:OPDFertilityCLinicImpl.java   
public CareContextShortVoCollection listFertilityCareContextsByEpisode(EpisodeOfCareRefVo voRefEpisodeOfCare) 
{
    DomainFactory factory = getDomainFactory();
    String hql= "select careContext from OPDFertClinic opd where opd.careContext.episodeOfCare.id = " + voRefEpisodeOfCare.getID_EpisodeOfCare();
    List lstCareContexts = factory.find(hql);       
    return CareContextShortVoAssembler.createCareContextShortVoCollectionFromCareContext(lstCareContexts);
}
项目:AvoinApotti    文件:OPDMedExamImpl.java   
public CareContextShortVoCollection listOPDMedExamByCareContextShort(EpisodeofCareLiteVo voEpisodeOfCareLite)
{
    if (voEpisodeOfCareLite == null)
        throw new CodingRuntimeException("Episode of Care was not supplied. Mandatory argument");

    DomainFactory factory = getDomainFactory();
    String hql = "select careContext from ExamGen examGen where examGen.careContext.episodeOfCare.id = " + voEpisodeOfCareLite.getID_EpisodeOfCare(); 
    List investList = factory.find(hql);                            
    return CareContextShortVoAssembler.createCareContextShortVoCollectionFromCareContext(investList).sort(SortOrder.DESCENDING);
}
项目:AvoinApotti    文件:SleepAssessmentImpl.java   
public CareContextShortVoCollection listSleepCareContextsByEpisodeOfCare(EpisodeOfCareRefVo voRefEpisodeOfCare) 
{
    DomainFactory factory = getDomainFactory();
    String hql= "select careContext from SleepReferral sr where sr.careContext.episodeOfCare.id = " + voRefEpisodeOfCare.getID_EpisodeOfCare();
    List lstsleepreferrals = factory.find(hql);     
    return CareContextShortVoAssembler.createCareContextShortVoCollectionFromCareContext(lstsleepreferrals);
}
项目:AvoinApotti    文件:StoolScaleImpl.java   
/**
 * Function used to list care contexts for given patient that have a Stool Assessment registered
 */
public CareContextShortVoCollection listStoolScaleCareContexts(PatientRefVo patient)
{
    if (patient == null || !patient.getID_PatientIsNotNull())
        return null;

    return CareContextShortVoAssembler.createCareContextShortVoCollectionFromCareContext(getDomainFactory().find("select distinct stool.careContext from StoolScale stool where stool.careContext.episodeOfCare.careSpell.patient.id = " + patient.getID_Patient().toString()));
}
项目:AvoinApotti    文件:ClinicalAdmissionImpl.java   
public CareContextShortVo getCareContextShort(CareContextRefVo careContexxtRefVo)
{
    DomainFactory factory = getDomainFactory();

    CareContext cc = (CareContext) factory.getDomainObject(CareContext.class, careContexxtRefVo.getID_CareContext());
    return CareContextShortVoAssembler.create(cc);
}
项目:AvoinApotti    文件:CarePlanReviewImpl.java   
public CareContextShortVoCollection listCareContexts(LocShortVo wardVo)
{
    DomainFactory factory = getDomainFactory();

    CareContextShortVoCollection  voCareContextColl = new CareContextShortVoCollection();
    List contacts = null;
    String hql;
    ArrayList<String> markers = new ArrayList<String>();
    ArrayList<Integer> values = new ArrayList<Integer>();

    hql = " from CareContext cc "; 
    StringBuffer condStr = new StringBuffer();
    String andStr = " ";    
    // WDEV-4491
    condStr.append(andStr + " cc.episodeOfCare.careSpell.patient.ward.id = :wardId and cc.endDateTime is null ");
    markers.add("wardId");
    values.add(wardVo.getID_Location());

    hql += " where " + condStr.toString();  

    contacts = factory.find(hql, markers, values);  

    for (int x = 0; x < contacts.size(); x++)
    {
        CareContext domCareContext = (CareContext) contacts.get(x); 
        CareContextShortVo voCareContext = CareContextShortVoAssembler.create(domCareContext);      
        voCareContextColl.add(voCareContext);
    }

    return voCareContextColl.sort();
}
项目:AvoinApotti    文件:ContextEvalProvider.java   
public ValueObjectRef getCareContextForClinicalContact(ValueObjectRef refVo)
{
    ClinicalContact con = (ClinicalContact)this.getDomainFactory().getDomainObject(ClinicalContact.class, refVo.getBoId());
    if (con == null)
        throw new DomainRuntimeException("Invalid ClinicalContact refVo passed into getCareContextForClinicalContact. ");

    CareContext ctx = (CareContext)this.getDomainFactory().getDomainObject(CareContext.class, con.getCareContext().getId());
    if (ctx == null)
        throw new DomainRuntimeException("CareContext not found for ClinicalContact passed into getCareContextForClinicalContact");

    return CareContextShortVoAssembler.create(ctx); 
}
项目:AvoinApotti    文件:InvestigationsImpl.java   
public CareContextShortVoCollection listInvestigationsByCareContextShort(EpisodeofCareLiteVo voEpisodeOfCareLite)
{
    if (voEpisodeOfCareLite == null)
        throw new CodingRuntimeException("Episode of Care was not supplied. Mandatory argument");

    DomainFactory factory = getDomainFactory();
    String hql = "select careContext from Investigations t where t.careContext.episodeOfCare.id = " + voEpisodeOfCareLite.getID_EpisodeOfCare(); 
    List investList = factory.find(hql);                            
    return CareContextShortVoAssembler.createCareContextShortVoCollectionFromCareContext(investList).sort(SortOrder.DESCENDING);
}
项目:AvoinApotti    文件:TransportImpl.java   
public CareContextShortVo getCareContext(CareContextRefVo careContext)
{
    if (careContext == null)
        return null;

    return CareContextShortVoAssembler.create((CareContext) getDomainFactory().getDomainObject(CareContext.class, careContext.getID_CareContext()));
}