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

项目:AvoinApotti    文件:EDischargeAllergiesEtcComponentImpl.java   
public PatientAlertEDischargeVoCollection listPatientAlerts(PatientShort patient, Boolean active) 
{
    if(patient == null)
        throw new CodingRuntimeException("Mandatory parameter - Patient not supplied");

    ArrayList names = new ArrayList();
    ArrayList values = new ArrayList();

    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer("from PatientAlert patAlrt ");
    hql.append(" where patAlrt.patient.id = :patient");
    names.add("patient");
    values.add(patient.getID_Patient());

    if (active.equals(Boolean.TRUE))
    {
        hql.append (" and patAlrt.isCurrentlyActiveAlert = :isActive");
        names.add("isActive");
        values.add(Boolean.TRUE);   
    }
    List list = factory.find(hql.toString(), names,values);
    return PatientAlertEDischargeVoAssembler.createPatientAlertEDischargeVoCollectionFromPatientAlert(list).sort();
}
项目:openMAXIMS    文件:EDischargeAllergiesEtcComponentImpl.java   
public PatientAlertEDischargeVoCollection listPatientAlerts(PatientShort patient, Boolean active) 
{
    if(patient == null)
        throw new CodingRuntimeException("Mandatory parameter - Patient not supplied");

    ArrayList names = new ArrayList();
    ArrayList values = new ArrayList();

    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer("from PatientAlert patAlrt ");
    hql.append(" where patAlrt.patient.id = :patient");
    names.add("patient");
    values.add(patient.getID_Patient());

    if (active.equals(Boolean.TRUE))
    {
        hql.append (" and patAlrt.isCurrentlyActiveAlert = :isActive");
        names.add("isActive");
        values.add(Boolean.TRUE);   
    }
    List list = factory.find(hql.toString(), names,values);
    return PatientAlertEDischargeVoAssembler.createPatientAlertEDischargeVoCollectionFromPatientAlert(list).sort();
}
项目:openmaxims-linux    文件:EDischargeAllergiesEtcComponentImpl.java   
public PatientAlertEDischargeVoCollection listPatientAlerts(PatientShort patient, Boolean active) 
{
    if(patient == null)
        throw new CodingRuntimeException("Mandatory parameter - Patient not supplied");

    ArrayList names = new ArrayList();
    ArrayList values = new ArrayList();

    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer("from PatientAlert patAlrt ");
    hql.append(" where patAlrt.patient.id = :patient");
    names.add("patient");
    values.add(patient.getID_Patient());

    if (active.equals(Boolean.TRUE))
    {
        hql.append (" and patAlrt.isCurrentlyActiveAlert = :isActive");
        names.add("isActive");
        values.add(Boolean.TRUE);   
    }
    List list = factory.find(hql.toString(), names,values);
    return PatientAlertEDischargeVoAssembler.createPatientAlertEDischargeVoCollectionFromPatientAlert(list).sort();
}
项目:openMAXIMS    文件:EDischargeAllergiesEtcComponentImpl.java   
public PatientAlertEDischargeVoCollection listPatientAlerts(PatientShort patient, Boolean active, IAppRole role) 
{
    if(patient == null)
        throw new CodingRuntimeException("Mandatory parameter - Patient not supplied");

    ArrayList names = new ArrayList();
    ArrayList values = new ArrayList();

    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer("select patAlrt from PatientAlert patAlrt left join patAlrt.alertType as alertType ");
    hql.append(" where patAlrt.patient.id = :patient");
    names.add("patient");
    values.add(patient.getID_Patient());

    String alertCategoryIds = getAlertCategoryIds(role);

    if(alertCategoryIds == null || alertCategoryIds.length() == 0)
        return null;

    hql.append (" and alertType.parent is not null and alertType.parent.id in (");
    hql.append(alertCategoryIds);
    hql.append(")");

    if (active.equals(Boolean.TRUE))
    {
        hql.append (" and patAlrt.isCurrentlyActiveAlert = :isActive");
        names.add("isActive");
        values.add(Boolean.TRUE);   
    }
    List list = factory.find(hql.toString(), names,values);
    return PatientAlertEDischargeVoAssembler.createPatientAlertEDischargeVoCollectionFromPatientAlert(list).sort();
}