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

项目:AvoinApotti    文件:OPDSpasticityAssessImpl.java   
public ClinicalContactShortVoCollection listRootClinicalContacts(ClinicalContactFilterVo filter, PatientShort patient) 
{
    PatientSummary impl = (PatientSummary) getDomainImpl(PatientSummaryImpl.class);
    return impl.listClinicalContactsShort(patient, filter, Boolean.TRUE);
}
项目:AvoinApotti    文件:Patient_SummaryImpl.java   
public ClinicalContactShortVoCollection listClinicalContacts(ClinicalContactFilterVo filter, Boolean bOnlyRootClinicalContacts)
{
    DomainFactory factory = getDomainFactory();

    List clinicalContactList = null;
    String hql;
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();

    if (filter == null)
    {
        clinicalContactList = factory.listDomainObjects(ClinicalContact.class);
    }
    else
    {
        hql = " from ClinicalContact rc ";
        StringBuffer condStr = new StringBuffer();
        String andStr = " ";

        if (filter.getContactType() != null)
        {
            condStr.append(andStr + " rc.contactType = :contactType");
            markers.add("contactType");
            values.add(getDomLookup(filter.getContactType()));
            andStr = " and ";
        }

        if (filter.getLocation() != null) // no Ward available in Value
                                          // Object
        {
            condStr.append(andStr + " rc.patient.ward.id = :wardId");
            markers.add("wardId");
            values.add(filter.getLocation().getID_Location());
            andStr = " and ";
        }
        if (filter.getMemberOfStaff() != null) // no seenBy available in
                                               // Value Object
        {
            if (filter.getMemberOfStaff().getHcp() != null)
            {
                condStr.append(andStr + " rc.responsibleHCP.id = :hcpId");
                markers.add("hcpId");
                values.add(filter.getMemberOfStaff().getHcp().getID_Hcp());
                andStr = " and ";
            }
        }
        if (bOnlyRootClinicalContacts.booleanValue())
        {
            condStr.append(andStr + " rc.parentClinContact is null");
        }

        condStr.append(andStr + " rc.endDateTime is null");

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

        clinicalContactList = factory.find(hql, markers, values);
    }

    ClinicalContactShortVoCollection voContactColl = new ClinicalContactShortVoCollection();

    for (int x = 0; x < clinicalContactList.size(); x++)
    {
        ClinicalContact domClinContact = (ClinicalContact) clinicalContactList.get(x);
        ClinicalContactShortVo voClinicalContact = ClinicalContactShortVoAssembler.create(domClinContact);
        voContactColl.add(voClinicalContact);
    }

    return voContactColl.sort();
}
项目:AvoinApotti    文件:PatientSummaryImpl.java   
public ClinicalContactShortVoCollection listClinicalContactsShort(PatientShort voPatientShort, ClinicalContactFilterVo voClinicalContactFilter, Boolean bOnlyRootClinicalContacts) 
{
    DomainFactory factory = getDomainFactory();

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

    hql = " from ClinicalContact rc ";
    StringBuffer condStr = new StringBuffer();
    String andStr = " ";

    if (voPatientShort != null)
    {
        condStr.append(andStr + " rc.patient.id = :patientID");
        markers.add("patientID");
        values.add(voPatientShort.getID_Patient());
        andStr = " and ";
    }
    else
    {
        // LIST CLINICAL CONTACTS FOR ALL PATIENTS
        return listClinicalContacts(voClinicalContactFilter, bOnlyRootClinicalContacts);
    }
    if (voClinicalContactFilter != null)
    {
        if (voClinicalContactFilter.getContactType() != null)
        {
            condStr.append(andStr + " rc.contactType = :contactType");
            markers.add("contactType");
            values.add(getDomLookup(voClinicalContactFilter.getContactType()));
            andStr = " and ";
        }
        if (voClinicalContactFilter.getLocation() != null)
        {
            condStr.append(andStr + " rc.patient.ward.id = :wardId");
            markers.add("wardId");
            values.add(voClinicalContactFilter.getLocation().getID_Location());
            andStr = " and ";
        }
        if (voClinicalContactFilter.getMemberOfStaff() != null) //no seenBy available in Value Object
        {
            if (voClinicalContactFilter.getMemberOfStaff().getHcp() != null)
            {
                condStr.append(andStr + " rc.responsibleHCP.id = :hcpId");
                markers.add("hcpId");
                values.add(voClinicalContactFilter.getMemberOfStaff().getHcp().getID_Hcp());
                andStr = " and ";
            }
        }
        if (voClinicalContactFilter.getIsContactTypeInpatient() == Boolean.TRUE)
        {
            condStr.append(andStr + " rc.contactType != :contactType");
            markers.add("contactType");
            values.add(getDomLookup(ContactType.OUTPATIENT));
            andStr = " and ";
        }
    }

    if (bOnlyRootClinicalContacts.booleanValue())
    {
        condStr.append(andStr + " rc.parentClinContact is null");
    }

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

    List clinicalContactList = factory.find(hql, markers, values);

    ClinicalContactShortVoCollection voContactColl = new ClinicalContactShortVoCollection();

    for (int x = 0; x < clinicalContactList.size(); x++)
    {
        ClinicalContact domClinContact = (ClinicalContact) clinicalContactList.get(x);
        ClinicalContactShortVo voClinicalContact = ClinicalContactShortVoAssembler.create(domClinContact);
        voContactColl.add(voClinicalContact);
    }

    return voContactColl.sort();
}
项目:AvoinApotti    文件:PatientSummaryImpl.java   
public ClinicalContactShortVoCollection listClinicalContacts(ClinicalContactFilterVo filter, Boolean bOnlyRootClinicalContacts) {
    DomainFactory factory = getDomainFactory();

    List clinicalContactList = null;
    String hql;
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();

    if (filter == null)
    {
        clinicalContactList = factory.listDomainObjects(ClinicalContact.class);
    }
    else
    {
        hql = " from ClinicalContact rc ";
        StringBuffer condStr = new StringBuffer();
        String andStr = " ";

        if (filter.getContactType() != null)
        {
            condStr.append(andStr + " rc.contactType = :contactType");
            markers.add("contactType");
            values.add(getDomLookup(filter.getContactType()));
            andStr = " and ";
        }

        if (filter.getLocation() != null) //no Ward available in Value Object
        {
            condStr.append(andStr + " rc.patient.ward.id = :wardId");
            markers.add("wardId");
            values.add(filter.getLocation().getID_Location());
            andStr = " and ";
        }
        if (filter.getMemberOfStaff() != null) //no seenBy available in Value Object
        {
            if (filter.getMemberOfStaff().getHcp() != null)
            {
                condStr.append(andStr + " rc.responsibleHCP.id = :hcpId");
                markers.add("hcpId");
                values.add(filter.getMemberOfStaff().getHcp().getID_Hcp());
                andStr = " and ";
            }
        }
        if (bOnlyRootClinicalContacts.booleanValue())
        {
            condStr.append(andStr + " rc.parentClinContact is null");
        }

        condStr.append(andStr + " rc.endDateTime is null");

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

        clinicalContactList = factory.find(hql, markers, values);
    }

    ClinicalContactShortVoCollection voContactColl = new ClinicalContactShortVoCollection();

    for (int x = 0; x < clinicalContactList.size(); x++)
    {
        ClinicalContact domClinContact = (ClinicalContact) clinicalContactList.get(x);
        ClinicalContactShortVo voClinicalContact = ClinicalContactShortVoAssembler.create(domClinContact);
        voContactColl.add(voClinicalContact);
    }

    return voContactColl.sort();
}
项目:openMAXIMS    文件:OPDSpasticityAssessImpl.java   
public ClinicalContactShortVoCollection listRootClinicalContacts(ClinicalContactFilterVo filter, PatientShort patient) 
{
    PatientSummary impl = (PatientSummary) getDomainImpl(PatientSummaryImpl.class);
    return impl.listClinicalContactsShort(patient, filter, Boolean.TRUE);
}
项目:openMAXIMS    文件:Patient_SummaryImpl.java   
public ClinicalContactShortVoCollection listClinicalContacts(ClinicalContactFilterVo filter, Boolean bOnlyRootClinicalContacts)
{
    DomainFactory factory = getDomainFactory();

    List clinicalContactList = null;
    String hql;
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();

    if (filter == null)
    {
        clinicalContactList = factory.listDomainObjects(ClinicalContact.class);
    }
    else
    {
        hql = " from ClinicalContact rc ";
        StringBuffer condStr = new StringBuffer();
        String andStr = " ";

        if (filter.getContactType() != null)
        {
            condStr.append(andStr + " rc.contactType = :contactType");
            markers.add("contactType");
            values.add(getDomLookup(filter.getContactType()));
            andStr = " and ";
        }

        if (filter.getLocation() != null) // no Ward available in Value
                                          // Object
        {
            condStr.append(andStr + " rc.patient.ward.id = :wardId");
            markers.add("wardId");
            values.add(filter.getLocation().getID_Location());
            andStr = " and ";
        }
        if (filter.getMemberOfStaff() != null) // no seenBy available in
                                               // Value Object
        {
            if (filter.getMemberOfStaff().getHcp() != null)
            {
                condStr.append(andStr + " rc.responsibleHCP.id = :hcpId");
                markers.add("hcpId");
                values.add(filter.getMemberOfStaff().getHcp().getID_Hcp());
                andStr = " and ";
            }
        }
        if (bOnlyRootClinicalContacts.booleanValue())
        {
            condStr.append(andStr + " rc.parentClinContact is null");
        }

        condStr.append(andStr + " rc.endDateTime is null");

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

        clinicalContactList = factory.find(hql, markers, values);
    }

    ClinicalContactShortVoCollection voContactColl = new ClinicalContactShortVoCollection();

    for (int x = 0; x < clinicalContactList.size(); x++)
    {
        ClinicalContact domClinContact = (ClinicalContact) clinicalContactList.get(x);
        ClinicalContactShortVo voClinicalContact = ClinicalContactShortVoAssembler.create(domClinContact);
        voContactColl.add(voClinicalContact);
    }

    return voContactColl.sort();
}
项目:openMAXIMS    文件:PatientSummaryImpl.java   
public ClinicalContactShortVoCollection listClinicalContactsShort(PatientShort voPatientShort, ClinicalContactFilterVo voClinicalContactFilter, Boolean bOnlyRootClinicalContacts) 
{
    DomainFactory factory = getDomainFactory();

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

    hql = " from ClinicalContact rc ";
    StringBuffer condStr = new StringBuffer();
    String andStr = " ";

    if (voPatientShort != null)
    {
        condStr.append(andStr + " rc.patient.id = :patientID");
        markers.add("patientID");
        values.add(voPatientShort.getID_Patient());
        andStr = " and ";
    }
    else
    {
        // LIST CLINICAL CONTACTS FOR ALL PATIENTS
        return listClinicalContacts(voClinicalContactFilter, bOnlyRootClinicalContacts);
    }
    if (voClinicalContactFilter != null)
    {
        if (voClinicalContactFilter.getContactType() != null)
        {
            condStr.append(andStr + " rc.contactType = :contactType");
            markers.add("contactType");
            values.add(getDomLookup(voClinicalContactFilter.getContactType()));
            andStr = " and ";
        }
        if (voClinicalContactFilter.getLocation() != null)
        {
            condStr.append(andStr + " rc.patient.ward.id = :wardId");
            markers.add("wardId");
            values.add(voClinicalContactFilter.getLocation().getID_Location());
            andStr = " and ";
        }
        if (voClinicalContactFilter.getMemberOfStaff() != null) //no seenBy available in Value Object
        {
            if (voClinicalContactFilter.getMemberOfStaff().getHcp() != null)
            {
                condStr.append(andStr + " rc.responsibleHCP.id = :hcpId");
                markers.add("hcpId");
                values.add(voClinicalContactFilter.getMemberOfStaff().getHcp().getID_Hcp());
                andStr = " and ";
            }
        }
        if (voClinicalContactFilter.getIsContactTypeInpatient() == Boolean.TRUE)
        {
            condStr.append(andStr + " rc.contactType != :contactType");
            markers.add("contactType");
            values.add(getDomLookup(ContactType.OUTPATIENT));
            andStr = " and ";
        }
    }

    if (bOnlyRootClinicalContacts.booleanValue())
    {
        condStr.append(andStr + " rc.parentClinContact is null");
    }

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

    List clinicalContactList = factory.find(hql, markers, values);

    ClinicalContactShortVoCollection voContactColl = new ClinicalContactShortVoCollection();

    for (int x = 0; x < clinicalContactList.size(); x++)
    {
        ClinicalContact domClinContact = (ClinicalContact) clinicalContactList.get(x);
        ClinicalContactShortVo voClinicalContact = ClinicalContactShortVoAssembler.create(domClinContact);
        voContactColl.add(voClinicalContact);
    }

    return voContactColl.sort();
}
项目:openMAXIMS    文件:PatientSummaryImpl.java   
public ClinicalContactShortVoCollection listClinicalContacts(ClinicalContactFilterVo filter, Boolean bOnlyRootClinicalContacts) {
    DomainFactory factory = getDomainFactory();

    List clinicalContactList = null;
    String hql;
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();

    if (filter == null)
    {
        clinicalContactList = factory.listDomainObjects(ClinicalContact.class);
    }
    else
    {
        hql = " from ClinicalContact rc ";
        StringBuffer condStr = new StringBuffer();
        String andStr = " ";

        if (filter.getContactType() != null)
        {
            condStr.append(andStr + " rc.contactType = :contactType");
            markers.add("contactType");
            values.add(getDomLookup(filter.getContactType()));
            andStr = " and ";
        }

        if (filter.getLocation() != null) //no Ward available in Value Object
        {
            condStr.append(andStr + " rc.patient.ward.id = :wardId");
            markers.add("wardId");
            values.add(filter.getLocation().getID_Location());
            andStr = " and ";
        }
        if (filter.getMemberOfStaff() != null) //no seenBy available in Value Object
        {
            if (filter.getMemberOfStaff().getHcp() != null)
            {
                condStr.append(andStr + " rc.responsibleHCP.id = :hcpId");
                markers.add("hcpId");
                values.add(filter.getMemberOfStaff().getHcp().getID_Hcp());
                andStr = " and ";
            }
        }
        if (bOnlyRootClinicalContacts.booleanValue())
        {
            condStr.append(andStr + " rc.parentClinContact is null");
        }

        condStr.append(andStr + " rc.endDateTime is null");

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

        clinicalContactList = factory.find(hql, markers, values);
    }

    ClinicalContactShortVoCollection voContactColl = new ClinicalContactShortVoCollection();

    for (int x = 0; x < clinicalContactList.size(); x++)
    {
        ClinicalContact domClinContact = (ClinicalContact) clinicalContactList.get(x);
        ClinicalContactShortVo voClinicalContact = ClinicalContactShortVoAssembler.create(domClinContact);
        voContactColl.add(voClinicalContact);
    }

    return voContactColl.sort();
}
项目:openMAXIMS    文件:OPDSpasticityAssessImpl.java   
public ClinicalContactShortVoCollection listRootClinicalContacts(ClinicalContactFilterVo filter, PatientShort patient) 
{
    PatientSummary impl = (PatientSummary) getDomainImpl(PatientSummaryImpl.class);
    return impl.listClinicalContactsShort(patient, filter, Boolean.TRUE);
}
项目:openMAXIMS    文件:Patient_SummaryImpl.java   
public ClinicalContactShortVoCollection listClinicalContacts(ClinicalContactFilterVo filter, Boolean bOnlyRootClinicalContacts)
{
    DomainFactory factory = getDomainFactory();

    List clinicalContactList = null;
    String hql;
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();

    if (filter == null)
    {
        clinicalContactList = factory.listDomainObjects(ClinicalContact.class);
    }
    else
    {
        hql = " from ClinicalContact rc ";
        StringBuffer condStr = new StringBuffer();
        String andStr = " ";

        if (filter.getContactType() != null)
        {
            condStr.append(andStr + " rc.contactType = :contactType");
            markers.add("contactType");
            values.add(getDomLookup(filter.getContactType()));
            andStr = " and ";
        }

        if (filter.getLocation() != null) // no Ward available in Value
                                          // Object
        {
            condStr.append(andStr + " rc.patient.ward.id = :wardId");
            markers.add("wardId");
            values.add(filter.getLocation().getID_Location());
            andStr = " and ";
        }
        if (filter.getMemberOfStaff() != null) // no seenBy available in
                                               // Value Object
        {
            if (filter.getMemberOfStaff().getHcp() != null)
            {
                condStr.append(andStr + " rc.responsibleHCP.id = :hcpId");
                markers.add("hcpId");
                values.add(filter.getMemberOfStaff().getHcp().getID_Hcp());
                andStr = " and ";
            }
        }
        if (bOnlyRootClinicalContacts.booleanValue())
        {
            condStr.append(andStr + " rc.parentClinContact is null");
        }

        condStr.append(andStr + " rc.endDateTime is null");

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

        clinicalContactList = factory.find(hql, markers, values);
    }

    ClinicalContactShortVoCollection voContactColl = new ClinicalContactShortVoCollection();

    for (int x = 0; x < clinicalContactList.size(); x++)
    {
        ClinicalContact domClinContact = (ClinicalContact) clinicalContactList.get(x);
        ClinicalContactShortVo voClinicalContact = ClinicalContactShortVoAssembler.create(domClinContact);
        voContactColl.add(voClinicalContact);
    }

    return voContactColl.sort();
}
项目:openMAXIMS    文件:PatientSummaryImpl.java   
public ClinicalContactShortVoCollection listClinicalContactsShort(PatientShort voPatientShort, ClinicalContactFilterVo voClinicalContactFilter, Boolean bOnlyRootClinicalContacts) 
{
    DomainFactory factory = getDomainFactory();

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

    hql = " from ClinicalContact rc ";
    StringBuffer condStr = new StringBuffer();
    String andStr = " ";

    if (voPatientShort != null)
    {
        condStr.append(andStr + " rc.patient.id = :patientID");
        markers.add("patientID");
        values.add(voPatientShort.getID_Patient());
        andStr = " and ";
    }
    else
    {
        // LIST CLINICAL CONTACTS FOR ALL PATIENTS
        return listClinicalContacts(voClinicalContactFilter, bOnlyRootClinicalContacts);
    }
    if (voClinicalContactFilter != null)
    {
        if (voClinicalContactFilter.getContactType() != null)
        {
            condStr.append(andStr + " rc.contactType = :contactType");
            markers.add("contactType");
            values.add(getDomLookup(voClinicalContactFilter.getContactType()));
            andStr = " and ";
        }
        if (voClinicalContactFilter.getLocation() != null)
        {
            condStr.append(andStr + " rc.patient.ward.id = :wardId");
            markers.add("wardId");
            values.add(voClinicalContactFilter.getLocation().getID_Location());
            andStr = " and ";
        }
        if (voClinicalContactFilter.getMemberOfStaff() != null) //no seenBy available in Value Object
        {
            if (voClinicalContactFilter.getMemberOfStaff().getHcp() != null)
            {
                condStr.append(andStr + " rc.responsibleHCP.id = :hcpId");
                markers.add("hcpId");
                values.add(voClinicalContactFilter.getMemberOfStaff().getHcp().getID_Hcp());
                andStr = " and ";
            }
        }
        if (voClinicalContactFilter.getIsContactTypeInpatient() == Boolean.TRUE)
        {
            condStr.append(andStr + " rc.contactType != :contactType");
            markers.add("contactType");
            values.add(getDomLookup(ContactType.OUTPATIENT));
            andStr = " and ";
        }
    }

    if (bOnlyRootClinicalContacts.booleanValue())
    {
        condStr.append(andStr + " rc.parentClinContact is null");
    }

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

    List clinicalContactList = factory.find(hql, markers, values);

    ClinicalContactShortVoCollection voContactColl = new ClinicalContactShortVoCollection();

    for (int x = 0; x < clinicalContactList.size(); x++)
    {
        ClinicalContact domClinContact = (ClinicalContact) clinicalContactList.get(x);
        ClinicalContactShortVo voClinicalContact = ClinicalContactShortVoAssembler.create(domClinContact);
        voContactColl.add(voClinicalContact);
    }

    return voContactColl.sort();
}
项目:openMAXIMS    文件:PatientSummaryImpl.java   
public ClinicalContactShortVoCollection listClinicalContacts(ClinicalContactFilterVo filter, Boolean bOnlyRootClinicalContacts) {
    DomainFactory factory = getDomainFactory();

    List clinicalContactList = null;
    String hql;
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();

    if (filter == null)
    {
        clinicalContactList = factory.listDomainObjects(ClinicalContact.class);
    }
    else
    {
        hql = " from ClinicalContact rc ";
        StringBuffer condStr = new StringBuffer();
        String andStr = " ";

        if (filter.getContactType() != null)
        {
            condStr.append(andStr + " rc.contactType = :contactType");
            markers.add("contactType");
            values.add(getDomLookup(filter.getContactType()));
            andStr = " and ";
        }

        if (filter.getLocation() != null) //no Ward available in Value Object
        {
            condStr.append(andStr + " rc.patient.ward.id = :wardId");
            markers.add("wardId");
            values.add(filter.getLocation().getID_Location());
            andStr = " and ";
        }
        if (filter.getMemberOfStaff() != null) //no seenBy available in Value Object
        {
            if (filter.getMemberOfStaff().getHcp() != null)
            {
                condStr.append(andStr + " rc.responsibleHCP.id = :hcpId");
                markers.add("hcpId");
                values.add(filter.getMemberOfStaff().getHcp().getID_Hcp());
                andStr = " and ";
            }
        }
        if (bOnlyRootClinicalContacts.booleanValue())
        {
            condStr.append(andStr + " rc.parentClinContact is null");
        }

        condStr.append(andStr + " rc.endDateTime is null");

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

        clinicalContactList = factory.find(hql, markers, values);
    }

    ClinicalContactShortVoCollection voContactColl = new ClinicalContactShortVoCollection();

    for (int x = 0; x < clinicalContactList.size(); x++)
    {
        ClinicalContact domClinContact = (ClinicalContact) clinicalContactList.get(x);
        ClinicalContactShortVo voClinicalContact = ClinicalContactShortVoAssembler.create(domClinContact);
        voContactColl.add(voClinicalContact);
    }

    return voContactColl.sort();
}
项目:openmaxims-linux    文件:OPDSpasticityAssessImpl.java   
public ClinicalContactShortVoCollection listRootClinicalContacts(ClinicalContactFilterVo filter, PatientShort patient) 
{
    PatientSummary impl = (PatientSummary) getDomainImpl(PatientSummaryImpl.class);
    return impl.listClinicalContactsShort(patient, filter, Boolean.TRUE);
}
项目:openmaxims-linux    文件:Patient_SummaryImpl.java   
public ClinicalContactShortVoCollection listClinicalContacts(ClinicalContactFilterVo filter, Boolean bOnlyRootClinicalContacts)
{
    DomainFactory factory = getDomainFactory();

    List clinicalContactList = null;
    String hql;
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();

    if (filter == null)
    {
        clinicalContactList = factory.listDomainObjects(ClinicalContact.class);
    }
    else
    {
        hql = " from ClinicalContact rc ";
        StringBuffer condStr = new StringBuffer();
        String andStr = " ";

        if (filter.getContactType() != null)
        {
            condStr.append(andStr + " rc.contactType = :contactType");
            markers.add("contactType");
            values.add(getDomLookup(filter.getContactType()));
            andStr = " and ";
        }

        if (filter.getLocation() != null) // no Ward available in Value
                                          // Object
        {
            condStr.append(andStr + " rc.patient.ward.id = :wardId");
            markers.add("wardId");
            values.add(filter.getLocation().getID_Location());
            andStr = " and ";
        }
        if (filter.getMemberOfStaff() != null) // no seenBy available in
                                               // Value Object
        {
            if (filter.getMemberOfStaff().getHcp() != null)
            {
                condStr.append(andStr + " rc.responsibleHCP.id = :hcpId");
                markers.add("hcpId");
                values.add(filter.getMemberOfStaff().getHcp().getID_Hcp());
                andStr = " and ";
            }
        }
        if (bOnlyRootClinicalContacts.booleanValue())
        {
            condStr.append(andStr + " rc.parentClinContact is null");
        }

        condStr.append(andStr + " rc.endDateTime is null");

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

        clinicalContactList = factory.find(hql, markers, values);
    }

    ClinicalContactShortVoCollection voContactColl = new ClinicalContactShortVoCollection();

    for (int x = 0; x < clinicalContactList.size(); x++)
    {
        ClinicalContact domClinContact = (ClinicalContact) clinicalContactList.get(x);
        ClinicalContactShortVo voClinicalContact = ClinicalContactShortVoAssembler.create(domClinContact);
        voContactColl.add(voClinicalContact);
    }

    return voContactColl.sort();
}
项目:openmaxims-linux    文件:PatientSummaryImpl.java   
public ClinicalContactShortVoCollection listClinicalContactsShort(PatientShort voPatientShort, ClinicalContactFilterVo voClinicalContactFilter, Boolean bOnlyRootClinicalContacts) 
{
    DomainFactory factory = getDomainFactory();

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

    hql = " from ClinicalContact rc ";
    StringBuffer condStr = new StringBuffer();
    String andStr = " ";

    if (voPatientShort != null)
    {
        condStr.append(andStr + " rc.patient.id = :patientID");
        markers.add("patientID");
        values.add(voPatientShort.getID_Patient());
        andStr = " and ";
    }
    else
    {
        // LIST CLINICAL CONTACTS FOR ALL PATIENTS
        return listClinicalContacts(voClinicalContactFilter, bOnlyRootClinicalContacts);
    }
    if (voClinicalContactFilter != null)
    {
        if (voClinicalContactFilter.getContactType() != null)
        {
            condStr.append(andStr + " rc.contactType = :contactType");
            markers.add("contactType");
            values.add(getDomLookup(voClinicalContactFilter.getContactType()));
            andStr = " and ";
        }
        if (voClinicalContactFilter.getLocation() != null)
        {
            condStr.append(andStr + " rc.patient.ward.id = :wardId");
            markers.add("wardId");
            values.add(voClinicalContactFilter.getLocation().getID_Location());
            andStr = " and ";
        }
        if (voClinicalContactFilter.getMemberOfStaff() != null) //no seenBy available in Value Object
        {
            if (voClinicalContactFilter.getMemberOfStaff().getHcp() != null)
            {
                condStr.append(andStr + " rc.responsibleHCP.id = :hcpId");
                markers.add("hcpId");
                values.add(voClinicalContactFilter.getMemberOfStaff().getHcp().getID_Hcp());
                andStr = " and ";
            }
        }
        if (voClinicalContactFilter.getIsContactTypeInpatient() == Boolean.TRUE)
        {
            condStr.append(andStr + " rc.contactType != :contactType");
            markers.add("contactType");
            values.add(getDomLookup(ContactType.OUTPATIENT));
            andStr = " and ";
        }
    }

    if (bOnlyRootClinicalContacts.booleanValue())
    {
        condStr.append(andStr + " rc.parentClinContact is null");
    }

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

    List clinicalContactList = factory.find(hql, markers, values);

    ClinicalContactShortVoCollection voContactColl = new ClinicalContactShortVoCollection();

    for (int x = 0; x < clinicalContactList.size(); x++)
    {
        ClinicalContact domClinContact = (ClinicalContact) clinicalContactList.get(x);
        ClinicalContactShortVo voClinicalContact = ClinicalContactShortVoAssembler.create(domClinContact);
        voContactColl.add(voClinicalContact);
    }

    return voContactColl.sort();
}
项目:openmaxims-linux    文件:PatientSummaryImpl.java   
public ClinicalContactShortVoCollection listClinicalContacts(ClinicalContactFilterVo filter, Boolean bOnlyRootClinicalContacts) {
    DomainFactory factory = getDomainFactory();

    List clinicalContactList = null;
    String hql;
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();

    if (filter == null)
    {
        clinicalContactList = factory.listDomainObjects(ClinicalContact.class);
    }
    else
    {
        hql = " from ClinicalContact rc ";
        StringBuffer condStr = new StringBuffer();
        String andStr = " ";

        if (filter.getContactType() != null)
        {
            condStr.append(andStr + " rc.contactType = :contactType");
            markers.add("contactType");
            values.add(getDomLookup(filter.getContactType()));
            andStr = " and ";
        }

        if (filter.getLocation() != null) //no Ward available in Value Object
        {
            condStr.append(andStr + " rc.patient.ward.id = :wardId");
            markers.add("wardId");
            values.add(filter.getLocation().getID_Location());
            andStr = " and ";
        }
        if (filter.getMemberOfStaff() != null) //no seenBy available in Value Object
        {
            if (filter.getMemberOfStaff().getHcp() != null)
            {
                condStr.append(andStr + " rc.responsibleHCP.id = :hcpId");
                markers.add("hcpId");
                values.add(filter.getMemberOfStaff().getHcp().getID_Hcp());
                andStr = " and ";
            }
        }
        if (bOnlyRootClinicalContacts.booleanValue())
        {
            condStr.append(andStr + " rc.parentClinContact is null");
        }

        condStr.append(andStr + " rc.endDateTime is null");

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

        clinicalContactList = factory.find(hql, markers, values);
    }

    ClinicalContactShortVoCollection voContactColl = new ClinicalContactShortVoCollection();

    for (int x = 0; x < clinicalContactList.size(); x++)
    {
        ClinicalContact domClinContact = (ClinicalContact) clinicalContactList.get(x);
        ClinicalContactShortVo voClinicalContact = ClinicalContactShortVoAssembler.create(domClinContact);
        voContactColl.add(voClinicalContact);
    }

    return voContactColl.sort();
}