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

项目:AvoinApotti    文件:RACPCPMHExamImpl.java   
public ims.clinical.vo.RACPPastMedicalHistoryVo saveRACPPastMedicalHistoryVo(ims.clinical.vo.RACPPastMedicalHistoryVo voRACPPastMedicalHistory, VitalSignsVo voVitalSigns, Boolean bUpdateVitalSigns) throws ims.domain.exceptions.StaleObjectException
{
    if (voRACPPastMedicalHistory == null  || !voRACPPastMedicalHistory.isValidated())
        throw new CodingRuntimeException("Past Medical History is null or has not been validated");
    if (voVitalSigns == null  || !voVitalSigns.isValidated())
        throw new CodingRuntimeException("Vital Signs is null or has not been validated");

    DomainFactory factory=getDomainFactory();

    if(bUpdateVitalSigns){
        VitalSigns doVitalSigns = VitalSignsVoAssembler.extractVitalSigns(factory, voVitalSigns);
        factory.save(doVitalSigns);
    }

    RACPPastMedicalHistory doRACPPastMedicalHistory = RACPPastMedicalHistoryVoAssembler.extractRACPPastMedicalHistory(factory, voRACPPastMedicalHistory);
    factory.save(doRACPPastMedicalHistory);
    return RACPPastMedicalHistoryVoAssembler.create(doRACPPastMedicalHistory);
}
项目:AvoinApotti    文件:RACPCPMHExamImpl.java   
public VitalSignsVo getVitalSignsForCareContext(CareContextRefVo refVoCareContext) {
    if (refVoCareContext == null)
        throw new CodingRuntimeException("Cannot get CareContext for null CareContextRefVo");

    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer(" from VitalSigns vs where "); 

    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();

    hql.append(" vs.careContext.id = :ccId");
    markers.add("ccId");
    values.add(refVoCareContext.getID_CareContext());

    hql.append(" order by vs.vitalsTakenDateTime");

    List listVitalSigns = factory.find(hql.toString(), markers,values);
    if(listVitalSigns != null && listVitalSigns.size() > 0)
    { 
        VitalSignsVoCollection voColl = VitalSignsVoAssembler.createVitalSignsVoCollectionFromVitalSigns(listVitalSigns);
        if(voColl != null && voColl.size() > 0)
            return voColl.get(0);
    }
    return null;
}
项目:AvoinApotti    文件:VitalSignsBaselineAndAllImpl.java   
/**
* Saves a vital sign
*/
public ims.core.vo.VitalSignsVo saveVitalSign(ims.core.vo.VitalSignsVo vitalSign) throws ims.domain.exceptions.StaleObjectException
{
    if (!vitalSign.isValidated())
    {
        throw new DomainRuntimeException("This Vital Sign has not been validated");
    }

    DomainFactory factory = getDomainFactory();
    VitalSigns doVitals = VitalSignsVoAssembler.extractVitalSigns(factory, vitalSign);

    try
    {
        factory.save(doVitals);
        return VitalSignsVoAssembler.create(doVitals);
    }
    catch (DomainException e)
    {
        throw new DomainRuntimeException("Domain Exception Occurred.\r\n" + e.getMessage(), e);
    }
}
项目:AvoinApotti    文件:VitalSignsBaselineAndAllImpl.java   
public VitalSignsVo saveABGO2Sats(VitalSignsVo voVitalABGO2) throws StaleObjectException
{
    if (!voVitalABGO2.isValidated())
    {
        throw new DomainRuntimeException("This Vital Sign has not been validated");
    }

    DomainFactory factory = getDomainFactory();
    VitalSigns doVitals = VitalSignsVoAssembler.extractVitalSigns(factory, voVitalABGO2);

    try
    {
        factory.save(doVitals);
        return VitalSignsVoAssembler.create(doVitals);
    }
    catch (DomainException e)
    {
        throw new DomainRuntimeException("Domain Exception Occurred.\r\n" + e.getMessage(), e);
    }
}
项目:AvoinApotti    文件:VitalSignsBaselineAndAllImpl.java   
public VitalSignsVo getVitalSignsById(VitalSignsRefVo vitalSignsRef) 
{   
    if(vitalSignsRef == null || !vitalSignsRef.getID_VitalSignsIsNotNull())
        return null;

    DomainFactory factory = getDomainFactory();

    List vitalSign =   factory.find("from VitalSigns as v1_1 where v1_1.id = :idVitalSign",
            new String[]{"idVitalSign" },
            new Object[]{ vitalSignsRef.getID_VitalSigns()});

    VitalSignsVoCollection voCollVitalSign = VitalSignsVoAssembler.createVitalSignsVoCollectionFromVitalSigns(vitalSign);

    if(voCollVitalSign.size()>0)
        return voCollVitalSign.get(0);
    else 
        return null;
}
项目:openMAXIMS    文件:RACPCPMHExamImpl.java   
public ims.clinical.vo.RACPPastMedicalHistoryVo saveRACPPastMedicalHistoryVo(ims.clinical.vo.RACPPastMedicalHistoryVo voRACPPastMedicalHistory, VitalSignsVo voVitalSigns, Boolean bUpdateVitalSigns) throws ims.domain.exceptions.StaleObjectException
{
    if (voRACPPastMedicalHistory == null  || !voRACPPastMedicalHistory.isValidated())
        throw new CodingRuntimeException("Past Medical History is null or has not been validated");
    if (voVitalSigns == null  || !voVitalSigns.isValidated())
        throw new CodingRuntimeException("Vital Signs is null or has not been validated");

    DomainFactory factory=getDomainFactory();

    if(bUpdateVitalSigns){
        VitalSigns doVitalSigns = VitalSignsVoAssembler.extractVitalSigns(factory, voVitalSigns);
        factory.save(doVitalSigns);
    }

    RACPPastMedicalHistory doRACPPastMedicalHistory = RACPPastMedicalHistoryVoAssembler.extractRACPPastMedicalHistory(factory, voRACPPastMedicalHistory);
    factory.save(doRACPPastMedicalHistory);
    return RACPPastMedicalHistoryVoAssembler.create(doRACPPastMedicalHistory);
}
项目:openMAXIMS    文件:RACPCPMHExamImpl.java   
public VitalSignsVo getVitalSignsForCareContext(CareContextRefVo refVoCareContext) {
    if (refVoCareContext == null)
        throw new CodingRuntimeException("Cannot get CareContext for null CareContextRefVo");

    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer(" from VitalSigns vs where "); 

    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();

    hql.append(" vs.careContext.id = :ccId");
    markers.add("ccId");
    values.add(refVoCareContext.getID_CareContext());

    hql.append(" order by vs.vitalsTakenDateTime");

    List listVitalSigns = factory.find(hql.toString(), markers,values);
    if(listVitalSigns != null && listVitalSigns.size() > 0)
    { 
        VitalSignsVoCollection voColl = VitalSignsVoAssembler.createVitalSignsVoCollectionFromVitalSigns(listVitalSigns);
        if(voColl != null && voColl.size() > 0)
            return voColl.get(0);
    }
    return null;
}
项目:openMAXIMS    文件:VitalSignsBaselineAndAllImpl.java   
/**
* Saves a vital sign
*/
public ims.core.vo.VitalSignsVo saveVitalSign(ims.core.vo.VitalSignsVo vitalSign) throws ims.domain.exceptions.StaleObjectException
{
    if (!vitalSign.isValidated())
    {
        throw new DomainRuntimeException("This Vital Sign has not been validated");
    }

    DomainFactory factory = getDomainFactory();
    VitalSigns doVitals = VitalSignsVoAssembler.extractVitalSigns(factory, vitalSign);

    try
    {
        factory.save(doVitals);
        return VitalSignsVoAssembler.create(doVitals);
    }
    catch (DomainException e)
    {
        throw new DomainRuntimeException("Domain Exception Occurred.\r\n" + e.getMessage(), e);
    }
}
项目:openMAXIMS    文件:VitalSignsBaselineAndAllImpl.java   
public VitalSignsVo saveABGO2Sats(VitalSignsVo voVitalABGO2) throws StaleObjectException
{
    if (!voVitalABGO2.isValidated())
    {
        throw new DomainRuntimeException("This Vital Sign has not been validated");
    }

    DomainFactory factory = getDomainFactory();
    VitalSigns doVitals = VitalSignsVoAssembler.extractVitalSigns(factory, voVitalABGO2);

    try
    {
        factory.save(doVitals);
        return VitalSignsVoAssembler.create(doVitals);
    }
    catch (DomainException e)
    {
        throw new DomainRuntimeException("Domain Exception Occurred.\r\n" + e.getMessage(), e);
    }
}
项目:openMAXIMS    文件:VitalSignsBaselineAndAllImpl.java   
public VitalSignsVo getVitalSignsById(VitalSignsRefVo vitalSignsRef) 
{   
    if(vitalSignsRef == null || !vitalSignsRef.getID_VitalSignsIsNotNull())
        return null;

    DomainFactory factory = getDomainFactory();

    List vitalSign =   factory.find("from VitalSigns as v1_1 where v1_1.id = :idVitalSign",
            new String[]{"idVitalSign" },
            new Object[]{ vitalSignsRef.getID_VitalSigns()});

    VitalSignsVoCollection voCollVitalSign = VitalSignsVoAssembler.createVitalSignsVoCollectionFromVitalSigns(vitalSign);

    if(voCollVitalSign.size()>0)
        return voCollVitalSign.get(0);
    else 
        return null;
}
项目:openMAXIMS    文件:RACPCPMHExamImpl.java   
public ims.clinical.vo.RACPPastMedicalHistoryVo saveRACPPastMedicalHistoryVo(ims.clinical.vo.RACPPastMedicalHistoryVo voRACPPastMedicalHistory, VitalSignsVo voVitalSigns, Boolean bUpdateVitalSigns) throws ims.domain.exceptions.StaleObjectException
{
    if (voRACPPastMedicalHistory == null  || !voRACPPastMedicalHistory.isValidated())
        throw new CodingRuntimeException("Past Medical History is null or has not been validated");
    if (voVitalSigns == null  || !voVitalSigns.isValidated())
        throw new CodingRuntimeException("Vital Signs is null or has not been validated");

    DomainFactory factory=getDomainFactory();

    if(bUpdateVitalSigns){
        VitalSigns doVitalSigns = VitalSignsVoAssembler.extractVitalSigns(factory, voVitalSigns);
        factory.save(doVitalSigns);
    }

    RACPPastMedicalHistory doRACPPastMedicalHistory = RACPPastMedicalHistoryVoAssembler.extractRACPPastMedicalHistory(factory, voRACPPastMedicalHistory);
    factory.save(doRACPPastMedicalHistory);
    return RACPPastMedicalHistoryVoAssembler.create(doRACPPastMedicalHistory);
}
项目:openMAXIMS    文件:RACPCPMHExamImpl.java   
public VitalSignsVo getVitalSignsForCareContext(CareContextRefVo refVoCareContext) {
    if (refVoCareContext == null)
        throw new CodingRuntimeException("Cannot get CareContext for null CareContextRefVo");

    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer(" from VitalSigns vs where "); 

    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();

    hql.append(" vs.careContext.id = :ccId");
    markers.add("ccId");
    values.add(refVoCareContext.getID_CareContext());

    hql.append(" order by vs.vitalsTakenDateTime");

    List listVitalSigns = factory.find(hql.toString(), markers,values);
    if(listVitalSigns != null && listVitalSigns.size() > 0)
    { 
        VitalSignsVoCollection voColl = VitalSignsVoAssembler.createVitalSignsVoCollectionFromVitalSigns(listVitalSigns);
        if(voColl != null && voColl.size() > 0)
            return voColl.get(0);
    }
    return null;
}
项目:openMAXIMS    文件:VitalSignsBaselineAndAllImpl.java   
/**
* Saves a vital sign
*/
public ims.core.vo.VitalSignsVo saveVitalSign(ims.core.vo.VitalSignsVo vitalSign) throws ims.domain.exceptions.StaleObjectException
{
    if (!vitalSign.isValidated())
    {
        throw new DomainRuntimeException("This Vital Sign has not been validated");
    }

    DomainFactory factory = getDomainFactory();
    VitalSigns doVitals = VitalSignsVoAssembler.extractVitalSigns(factory, vitalSign);

    try
    {
        factory.save(doVitals);
        return VitalSignsVoAssembler.create(doVitals);
    }
    catch (DomainException e)
    {
        throw new DomainRuntimeException("Domain Exception Occurred.\r\n" + e.getMessage(), e);
    }
}
项目:openMAXIMS    文件:VitalSignsBaselineAndAllImpl.java   
public VitalSignsVo saveABGO2Sats(VitalSignsVo voVitalABGO2) throws StaleObjectException
{
    if (!voVitalABGO2.isValidated())
    {
        throw new DomainRuntimeException("This Vital Sign has not been validated");
    }

    DomainFactory factory = getDomainFactory();
    VitalSigns doVitals = VitalSignsVoAssembler.extractVitalSigns(factory, voVitalABGO2);

    try
    {
        factory.save(doVitals);
        return VitalSignsVoAssembler.create(doVitals);
    }
    catch (DomainException e)
    {
        throw new DomainRuntimeException("Domain Exception Occurred.\r\n" + e.getMessage(), e);
    }
}
项目:openMAXIMS    文件:VitalSignsBaselineAndAllImpl.java   
public VitalSignsVo getVitalSignsById(VitalSignsRefVo vitalSignsRef) 
{   
    if(vitalSignsRef == null || !vitalSignsRef.getID_VitalSignsIsNotNull())
        return null;

    DomainFactory factory = getDomainFactory();

    List vitalSign =   factory.find("from VitalSigns as v1_1 where v1_1.id = :idVitalSign",
            new String[]{"idVitalSign" },
            new Object[]{ vitalSignsRef.getID_VitalSigns()});

    VitalSignsVoCollection voCollVitalSign = VitalSignsVoAssembler.createVitalSignsVoCollectionFromVitalSigns(vitalSign);

    if(voCollVitalSign.size()>0)
        return voCollVitalSign.get(0);
    else 
        return null;
}
项目:openmaxims-linux    文件:RACPCPMHExamImpl.java   
public ims.clinical.vo.RACPPastMedicalHistoryVo saveRACPPastMedicalHistoryVo(ims.clinical.vo.RACPPastMedicalHistoryVo voRACPPastMedicalHistory, VitalSignsVo voVitalSigns, Boolean bUpdateVitalSigns) throws ims.domain.exceptions.StaleObjectException
{
    if (voRACPPastMedicalHistory == null  || !voRACPPastMedicalHistory.isValidated())
        throw new CodingRuntimeException("Past Medical History is null or has not been validated");
    if (voVitalSigns == null  || !voVitalSigns.isValidated())
        throw new CodingRuntimeException("Vital Signs is null or has not been validated");

    DomainFactory factory=getDomainFactory();

    if(bUpdateVitalSigns){
        VitalSigns doVitalSigns = VitalSignsVoAssembler.extractVitalSigns(factory, voVitalSigns);
        factory.save(doVitalSigns);
    }

    RACPPastMedicalHistory doRACPPastMedicalHistory = RACPPastMedicalHistoryVoAssembler.extractRACPPastMedicalHistory(factory, voRACPPastMedicalHistory);
    factory.save(doRACPPastMedicalHistory);
    return RACPPastMedicalHistoryVoAssembler.create(doRACPPastMedicalHistory);
}
项目:openmaxims-linux    文件:RACPCPMHExamImpl.java   
public VitalSignsVo getVitalSignsForCareContext(CareContextRefVo refVoCareContext) {
    if (refVoCareContext == null)
        throw new CodingRuntimeException("Cannot get CareContext for null CareContextRefVo");

    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer(" from VitalSigns vs where "); 

    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();

    hql.append(" vs.careContext.id = :ccId");
    markers.add("ccId");
    values.add(refVoCareContext.getID_CareContext());

    hql.append(" order by vs.vitalsTakenDateTime");

    List listVitalSigns = factory.find(hql.toString(), markers,values);
    if(listVitalSigns != null && listVitalSigns.size() > 0)
    { 
        VitalSignsVoCollection voColl = VitalSignsVoAssembler.createVitalSignsVoCollectionFromVitalSigns(listVitalSigns);
        if(voColl != null && voColl.size() > 0)
            return voColl.get(0);
    }
    return null;
}
项目:openmaxims-linux    文件:VitalSignsBaselineAndAllImpl.java   
/**
* Saves a vital sign
*/
public ims.core.vo.VitalSignsVo saveVitalSign(ims.core.vo.VitalSignsVo vitalSign) throws ims.domain.exceptions.StaleObjectException
{
    if (!vitalSign.isValidated())
    {
        throw new DomainRuntimeException("This Vital Sign has not been validated");
    }

    DomainFactory factory = getDomainFactory();
    VitalSigns doVitals = VitalSignsVoAssembler.extractVitalSigns(factory, vitalSign);

    try
    {
        factory.save(doVitals);
        return VitalSignsVoAssembler.create(doVitals);
    }
    catch (DomainException e)
    {
        throw new DomainRuntimeException("Domain Exception Occurred.\r\n" + e.getMessage(), e);
    }
}
项目:openmaxims-linux    文件:VitalSignsBaselineAndAllImpl.java   
public VitalSignsVo saveABGO2Sats(VitalSignsVo voVitalABGO2) throws StaleObjectException
{
    if (!voVitalABGO2.isValidated())
    {
        throw new DomainRuntimeException("This Vital Sign has not been validated");
    }

    DomainFactory factory = getDomainFactory();
    VitalSigns doVitals = VitalSignsVoAssembler.extractVitalSigns(factory, voVitalABGO2);

    try
    {
        factory.save(doVitals);
        return VitalSignsVoAssembler.create(doVitals);
    }
    catch (DomainException e)
    {
        throw new DomainRuntimeException("Domain Exception Occurred.\r\n" + e.getMessage(), e);
    }
}
项目:openmaxims-linux    文件:VitalSignsBaselineAndAllImpl.java   
public VitalSignsVo getVitalSignsById(VitalSignsRefVo vitalSignsRef) 
{   
    if(vitalSignsRef == null || !vitalSignsRef.getID_VitalSignsIsNotNull())
        return null;

    DomainFactory factory = getDomainFactory();

    List vitalSign =   factory.find("from VitalSigns as v1_1 where v1_1.id = :idVitalSign",
            new String[]{"idVitalSign" },
            new Object[]{ vitalSignsRef.getID_VitalSigns()});

    VitalSignsVoCollection voCollVitalSign = VitalSignsVoAssembler.createVitalSignsVoCollectionFromVitalSigns(vitalSign);

    if(voCollVitalSign.size()>0)
        return voCollVitalSign.get(0);
    else 
        return null;
}
项目:openmaxims-linux    文件:VitalSignsVentilationChartDialogImpl.java   
/**
* Saves the given ventilationChartRecord
*/
public VitalSignsVo saveVentilationChartRecord(VitalSignsVo voVitalSigns) throws DomainInterfaceException, StaleObjectException 
{

    DomainFactory factory = getDomainFactory();
    VitalSigns domVital = VitalSignsVoAssembler.extractVitalSigns(factory, voVitalSigns);
    domVital.setIsVentilationChartRecord(Boolean.TRUE);
    factory.save(domVital);

    return VitalSignsVoAssembler.create(domVital);
}
项目:AvoinApotti    文件:RACPCPMHExamImpl.java   
public VitalSignsVo saveVitalSignsForCareContext(VitalSignsVo voVitalSigns) throws StaleObjectException {
    if (voVitalSigns == null  || !voVitalSigns.isValidated())
        throw new CodingRuntimeException("Vital Signs is null or has not been validated");
    DomainFactory factory=getDomainFactory();

    VitalSigns doRACPPastMedicalHistory = VitalSignsVoAssembler.extractVitalSigns(factory, voVitalSigns);
    factory.save(doRACPPastMedicalHistory);
    return VitalSignsVoAssembler.create(doRACPPastMedicalHistory);
}
项目:AvoinApotti    文件:SleepAssessmentImpl.java   
public VitalSignsVoCollection listVitalsByCareContext(CareContextLiteVo voCareContext)
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer();
    String query = " from VitalSigns vs ";
    ArrayList markers= new ArrayList();
    ArrayList values = new ArrayList();
    String andStr = " ";

    if(voCareContext.getEpisodeOfCareIsNotNull())
    {
        hql.append(andStr + " vs.careContext.id = :ec");
        markers.add("ec");
        values.add(voCareContext.getID_CareContext());
        andStr = " and ";
    }

    if (markers.size() > 0) query += " where ";
    query += hql.toString();    

    java.util.List vsList = factory.find(query,markers,values);
    VitalSignsVoCollection voVitalSignsColl = VitalSignsVoAssembler.createVitalSignsVoCollectionFromVitalSigns(vsList);
    if(voVitalSignsColl.size()>0)
        return voVitalSignsColl;
    else
        return null;
}
项目:AvoinApotti    文件:SleepAssessmentImpl.java   
public VitalSignsVo getVitalSignsByCareContext(CareContextLiteVo voCareContext)
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer();
    String query = " from VitalSigns vs ";
    ArrayList markers= new ArrayList();
    ArrayList values = new ArrayList();
    String andStr = " ";

    if(voCareContext.getEpisodeOfCareIsNotNull())
    {
        hql.append(andStr + " vs.careContext.id = :ec");
        markers.add("ec");
        values.add(voCareContext.getID_CareContext());
        andStr = " and ";
    }

    if (markers.size() > 0) query += " where ";
    query += hql.toString();    

    java.util.List vsList = factory.find(query,markers,values);
    VitalSignsVoCollection voVitalSignsColl = VitalSignsVoAssembler.createVitalSignsVoCollectionFromVitalSigns(vsList);
    if(voVitalSignsColl.size()>0)
        return voVitalSignsColl.get(0);
    else
        return null;
}
项目:AvoinApotti    文件:NutritionalRiskAssessmentDialogImpl.java   
public VitalSignsVo saveVitalSign(VitalSignsVo vitalSign) throws ims.domain.exceptions.StaleObjectException
{
    if (!vitalSign.isValidated())
    {
        throw new DomainRuntimeException("This Vital Sign has not been validated");
    }

    DomainFactory factory = getDomainFactory();

    VitalSigns doVitals = VitalSignsVoAssembler.extractVitalSigns(factory, vitalSign);

    factory.save(doVitals);
    return VitalSignsVoAssembler.create(doVitals);
}
项目:AvoinApotti    文件:NutritionalRiskAssessmentDialogImpl.java   
public VitalSignsVoCollection getLastMetrics(Integer idPatient)
{
    if (idPatient == null)
        return null;

    DomainFactory factory = getDomainFactory();
    StringBuffer filterString = new StringBuffer();
    String query = "from VitalSigns vs ";
    ArrayList markers= new ArrayList();
    ArrayList values = new ArrayList();

    filterString.append(" vs.careContext.episodeOfCare.careSpell.patient.id = :idPat");
    markers.add("idPat");
    values.add(idPatient);

    if (markers.size() > 0) query += " where ";
    query += filterString.toString();   
    java.util.List vitals = factory.find(query,markers,values);
    VitalSignsVoCollection voVitalsColl = VitalSignsVoAssembler.createVitalSignsVoCollectionFromVitalSigns(vitals);
    if(voVitalsColl != null && voVitalsColl.size() > 0)
    {
            voVitalsColl.sort(SortOrder.DESCENDING);
            return voVitalsColl;
    }
    else
        return null;
}
项目:AvoinApotti    文件:VitalSignsImpl.java   
/**
 * Generic Save for all Vital Signs
 */
public VitalSignsVo saveVitalSign(VitalSignsVo vitalSign) throws ims.domain.exceptions.StaleObjectException
{
    if (!vitalSign.isValidated())
    {
        throw new DomainRuntimeException("This Vital Sign has not been validated");
    }

    DomainFactory factory = getDomainFactory();
    VitalSigns doVitals = VitalSignsVoAssembler.extractVitalSigns(factory, vitalSign);

    factory.save(doVitals);
    return VitalSignsVoAssembler.create(doVitals);
}
项目:AvoinApotti    文件:VitalSignsImpl.java   
/**
 * 
 * Generic List for all Vital Signs By Vital Signs Type
 * 
 */

public VitalSignsVoCollection listVitalSigns(Date dateFrom, Date dateTo, VSType[] vitalSignsTypes, CareContextRefVo refCareContext)
{
    VitalSignsVoCollection voVitalsColl = VitalSignsVoAssembler.createVitalSignsVoCollectionFromVitalSigns((List<?>) listVitalSignsDo(dateFrom, dateTo, vitalSignsTypes, refCareContext));

    if (vitalSignsTypes == null) // if listing all then sort
    {
        voVitalsColl.sort(SortOrder.DESCENDING);
    }
    return voVitalsColl;
}
项目:AvoinApotti    文件:VitalSignsImpl.java   
/**
 * Retrieves a list of Metrics, sorts, and returns last record
 */
public VitalSignsVo getLastMetrics(CareContextRefVo refCareContext) throws DomainInterfaceException
{
    if (refCareContext != null)
    {
        DomainFactory factory = getDomainFactory();

        String filter = " from VitalSigns vs ";
        StringBuffer filterString = new StringBuffer();

        ArrayList<String> markerNames = new ArrayList<String>();
        ArrayList<Object> markerValues = new ArrayList<Object>();

        filterString.append(" where vs.careContext.id = :cc");
        markerNames.add("cc");
        markerValues.add(refCareContext.getID_CareContext());
        filter += filterString.toString();

        /*
        Changes made to String below to reflect changes to the VitalSigns Business Object
            authoringDateTime changes to authoringInformation.authoringDateTime 
        */
        filter += " and vs.metrics is not null order by vs.authoringInformation.authoringDateTime desc";

        VitalSignsVoCollection voVitalsColl = VitalSignsVoAssembler.createVitalSignsVoCollectionFromVitalSigns(factory.find(filter, markerNames, markerValues));

        if (voVitalsColl != null && voVitalsColl.size() > 0)
        {
            voVitalsColl.sort(SortOrder.DESCENDING);
            return voVitalsColl.get(0);
        }
    }

    return null;
}
项目:AvoinApotti    文件:VitalSignsImpl.java   
public VitalSignsVo saveABGO2Sats(VitalSignsVo voVitalABGO2) throws StaleObjectException
{
    if (!voVitalABGO2.isValidated())
    {
        throw new DomainRuntimeException("This Vital Sign has not been validated");
    }

    DomainFactory factory = getDomainFactory();
    VitalSigns doVitals = VitalSignsVoAssembler.extractVitalSigns(factory, voVitalABGO2);

    factory.save(doVitals);

    return VitalSignsVoAssembler.create(doVitals);

}
项目:AvoinApotti    文件:VitalSignsBaselineAndAllImpl.java   
/**
 * 
 * Generic List for all Vital Signs By Vital Signs Type
 * 
 */

public VitalSignsVoCollection listVitalSigns(Date dateFrom, Date dateTo, VSType[] vitalSignsTypes, CareContextRefVo refCareContext)
{
    java.util.List vitals = listVitalSignsDo(dateFrom, dateTo, vitalSignsTypes, refCareContext);
    VitalSignsVoCollection voVitalsColl = VitalSignsVoAssembler.createVitalSignsVoCollectionFromVitalSigns(vitals);

    if (vitalSignsTypes == null) // if listing all then sort
    {
        voVitalsColl.sort(SortOrder.DESCENDING);
    }
    return voVitalsColl;
}
项目:AvoinApotti    文件:VitalSignsBaselineAndAllImpl.java   
/**
 * Retrieves a list of Metrics, sorts, and returns last record
 */
public VitalSignsVo getLastMetrics(CareContextRefVo refCareContext) throws DomainInterfaceException
{
    if (refCareContext != null)
    {
        DomainFactory factory = getDomainFactory();

        String filter = " from VitalSigns vs ";
        StringBuffer filterString = new StringBuffer();

        ArrayList markerNames = new ArrayList();
        ArrayList markerValues = new ArrayList();

        filterString.append(" where vs.careContext.id = :cc");
        markerNames.add("cc");
        markerValues.add(refCareContext.getID_CareContext());
        filter += filterString.toString();

        /*
        Changes made to String below to reflect changes to the VitalSigns Business Object
            authoringDateTime changes to authoringInformation.authoringDateTime 
        */
        filter += " and vs.metrics is not null order by vs.authoringInformation.authoringDateTime desc";

        java.util.List vitals = factory.find(filter, markerNames, markerValues);
        VitalSignsVoCollection voVitalsColl = VitalSignsVoAssembler.createVitalSignsVoCollectionFromVitalSigns(vitals);

        if (voVitalsColl != null && voVitalsColl.size() > 0)
        {
            voVitalsColl.sort(SortOrder.DESCENDING);
            return voVitalsColl.get(0);
        }
    }

    return null;
}
项目:AvoinApotti    文件:VitalSignsVentilationChartImpl.java   
/**
* Lists ventilation chart records for the given episode
*/
public VitalSignsVoCollection listVentilationCharts(CareContextRefVo refCareContext, ShiftDetailsVo shift) 
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer(" ");
    String query = "from VitalSigns vc ";
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();
    String andStr = " ";

    if (refCareContext != null)

    {
        hql.append(andStr + " vc.careContext.id = :cc");
        markers.add("cc");
        values.add(refCareContext.getID_CareContext());
        andStr = " and ";

        hql.append(andStr + " vc.isVentilationChartRecord = :record");
        markers.add("record");
        values.add(Boolean.TRUE);
        andStr = " and ";
    }

    if (shift != null)
    {
        hql.append(andStr + " vc.ventilationChart.shiftDetails.id = :shiftId ");
        markers.add("shiftId");
        values.add(shift.getID_ShiftDetails());
        andStr = " and ";

    }

    if(andStr.equals(" and "))
        query += " where";
    query += hql.toString();
    List lst = factory.find(query, markers, values);        
    VitalSignsVoCollection voVitalsColl = VitalSignsVoAssembler.createVitalSignsVoCollectionFromVitalSigns(lst);
    return voVitalsColl;
}
项目:AvoinApotti    文件:VitalSignsVentilationChartDialogImpl.java   
/**
* Saves the given ventilationChartRecord
*/
public VitalSignsVo saveVentilationChartRecord(VitalSignsVo voVitalSigns) throws DomainInterfaceException, StaleObjectException 
{

    DomainFactory factory = getDomainFactory();
    VitalSigns domVital = VitalSignsVoAssembler.extractVitalSigns(factory, voVitalSigns);
    domVital.setIsVentilationChartRecord(Boolean.TRUE);
    factory.save(domVital);

    return VitalSignsVoAssembler.create(domVital);
}
项目:openMAXIMS    文件:RACPCPMHExamImpl.java   
public VitalSignsVo saveVitalSignsForCareContext(VitalSignsVo voVitalSigns) throws StaleObjectException {
    if (voVitalSigns == null  || !voVitalSigns.isValidated())
        throw new CodingRuntimeException("Vital Signs is null or has not been validated");
    DomainFactory factory=getDomainFactory();

    VitalSigns doRACPPastMedicalHistory = VitalSignsVoAssembler.extractVitalSigns(factory, voVitalSigns);
    factory.save(doRACPPastMedicalHistory);
    return VitalSignsVoAssembler.create(doRACPPastMedicalHistory);
}
项目:openMAXIMS    文件:SleepAssessmentImpl.java   
public VitalSignsVoCollection listVitalsByCareContext(CareContextLiteVo voCareContext)
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer();
    String query = " from VitalSigns vs ";
    ArrayList markers= new ArrayList();
    ArrayList values = new ArrayList();
    String andStr = " ";

    if(voCareContext.getEpisodeOfCareIsNotNull())
    {
        hql.append(andStr + " vs.careContext.id = :ec");
        markers.add("ec");
        values.add(voCareContext.getID_CareContext());
        andStr = " and ";
    }

    if (markers.size() > 0) query += " where ";
    query += hql.toString();    

    java.util.List vsList = factory.find(query,markers,values);
    VitalSignsVoCollection voVitalSignsColl = VitalSignsVoAssembler.createVitalSignsVoCollectionFromVitalSigns(vsList);
    if(voVitalSignsColl.size()>0)
        return voVitalSignsColl;
    else
        return null;
}
项目:openMAXIMS    文件:SleepAssessmentImpl.java   
public VitalSignsVo getVitalSignsByCareContext(CareContextLiteVo voCareContext)
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer();
    String query = " from VitalSigns vs ";
    ArrayList markers= new ArrayList();
    ArrayList values = new ArrayList();
    String andStr = " ";

    if(voCareContext.getEpisodeOfCareIsNotNull())
    {
        hql.append(andStr + " vs.careContext.id = :ec");
        markers.add("ec");
        values.add(voCareContext.getID_CareContext());
        andStr = " and ";
    }

    if (markers.size() > 0) query += " where ";
    query += hql.toString();    

    java.util.List vsList = factory.find(query,markers,values);
    VitalSignsVoCollection voVitalSignsColl = VitalSignsVoAssembler.createVitalSignsVoCollectionFromVitalSigns(vsList);
    if(voVitalSignsColl.size()>0)
        return voVitalSignsColl.get(0);
    else
        return null;
}
项目:openMAXIMS    文件:NutritionalRiskAssessmentDialogImpl.java   
public VitalSignsVo saveVitalSign(VitalSignsVo vitalSign) throws ims.domain.exceptions.StaleObjectException
{
    if (!vitalSign.isValidated())
    {
        throw new DomainRuntimeException("This Vital Sign has not been validated");
    }

    DomainFactory factory = getDomainFactory();

    VitalSigns doVitals = VitalSignsVoAssembler.extractVitalSigns(factory, vitalSign);

    factory.save(doVitals);
    return VitalSignsVoAssembler.create(doVitals);
}
项目:openMAXIMS    文件:NutritionalRiskAssessmentDialogImpl.java   
public VitalSignsVoCollection getLastMetrics(Integer idPatient)
{
    if (idPatient == null)
        return null;

    DomainFactory factory = getDomainFactory();
    StringBuffer filterString = new StringBuffer();
    String query = "from VitalSigns vs ";
    ArrayList markers= new ArrayList();
    ArrayList values = new ArrayList();

    filterString.append(" vs.careContext.episodeOfCare.careSpell.patient.id = :idPat");
    markers.add("idPat");
    values.add(idPatient);

    if (markers.size() > 0) query += " where ";
    query += filterString.toString();   
    java.util.List vitals = factory.find(query,markers,values);
    VitalSignsVoCollection voVitalsColl = VitalSignsVoAssembler.createVitalSignsVoCollectionFromVitalSigns(vitals);
    if(voVitalsColl != null && voVitalsColl.size() > 0)
    {
            voVitalsColl.sort(SortOrder.DESCENDING);
            return voVitalsColl;
    }
    else
        return null;
}
项目:openMAXIMS    文件:VitalSignsImpl.java   
/**
 * Generic Save for all Vital Signs
 */
public VitalSignsVo saveVitalSign(VitalSignsVo vitalSign) throws ims.domain.exceptions.StaleObjectException
{
    if (!vitalSign.isValidated())
    {
        throw new DomainRuntimeException("This Vital Sign has not been validated");
    }

    DomainFactory factory = getDomainFactory();
    VitalSigns doVitals = VitalSignsVoAssembler.extractVitalSigns(factory, vitalSign);

    factory.save(doVitals);
    return VitalSignsVoAssembler.create(doVitals);
}