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

项目:AvoinApotti    文件:HL7PathwayIfImpl.java   
public HL7ReferralVo getReferralByPatientAndRKEY(PatientRefVo patient,String referralKey) throws DomainInterfaceException
{
    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer(" from Referral ref where ref.patient.id = :patient and ref.extReferralKey =:refKey");

    ArrayList<String> labels = new ArrayList<String>();
    ArrayList<Object> values = new ArrayList<Object>();
    labels.add("patient");
    labels.add("refKey");
    values.add(patient.getID_Patient());
    values.add(referralKey);

    List lst = factory.find(hql.toString(), labels, values);
    if (lst != null && lst.size() == 1)
    {
        return HL7ReferralVoAssembler.create((Referral) lst.get(0));
    }

    if (lst != null && lst.size() > 1)
    {
        throw new DomainInterfaceException("More than one referral found for this patient and referral key");
    }
    return null;
}
项目:openMAXIMS    文件:HL7PathwayIfImpl.java   
public HL7ReferralVo getReferralByPatientAndRKEY(PatientRefVo patient,String referralKey) throws DomainInterfaceException
{
    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer(" from Referral ref where ref.patient.id = :patient and ref.extReferralKey =:refKey");

    ArrayList<String> labels = new ArrayList<String>();
    ArrayList<Object> values = new ArrayList<Object>();
    labels.add("patient");
    labels.add("refKey");
    values.add(patient.getID_Patient());
    values.add(referralKey);

    List lst = factory.find(hql.toString(), labels, values);
    if (lst != null && lst.size() == 1)
    {
        return HL7ReferralVoAssembler.create((Referral) lst.get(0));
    }

    if (lst != null && lst.size() > 1)
    {
        throw new DomainInterfaceException("More than one referral found for this patient and referral key");
    }
    return null;
}
项目:openMAXIMS    文件:HL7PathwayIfImpl.java   
public HL7ReferralVo getReferralByPatientAndRKEY(PatientRefVo patient,String referralKey) throws DomainInterfaceException
{
    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer(" from Referral ref where ref.patient.id = :patient and ref.extReferralKey =:refKey");

    ArrayList<String> labels = new ArrayList<String>();
    ArrayList<Object> values = new ArrayList<Object>();
    labels.add("patient");
    labels.add("refKey");
    values.add(patient.getID_Patient());
    values.add(referralKey);

    List lst = factory.find(hql.toString(), labels, values);
    if (lst != null && lst.size() == 1)
    {
        return HL7ReferralVoAssembler.create((Referral) lst.get(0));
    }

    if (lst != null && lst.size() > 1)
    {
        throw new DomainInterfaceException("More than one referral found for this patient and referral key");
    }
    return null;
}
项目:openmaxims-linux    文件:HL7PathwayIfImpl.java   
public HL7ReferralVo getReferralByPatientAndRKEY(PatientRefVo patient,String referralKey) throws DomainInterfaceException
{
    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer(" from Referral ref where ref.patient.id = :patient and ref.extReferralKey =:refKey");

    ArrayList<String> labels = new ArrayList<String>();
    ArrayList<Object> values = new ArrayList<Object>();
    labels.add("patient");
    labels.add("refKey");
    values.add(patient.getID_Patient());
    values.add(referralKey);

    List lst = factory.find(hql.toString(), labels, values);
    if (lst != null && lst.size() == 1)
    {
        return HL7ReferralVoAssembler.create((Referral) lst.get(0));
    }

    if (lst != null && lst.size() > 1)
    {
        throw new DomainInterfaceException("More than one referral found for this patient and referral key");
    }
    return null;
}
项目:AvoinApotti    文件:HL7PathwayIfImpl.java   
public HL7ReferralVo saveReferral(HL7ReferralVo referral) throws StaleObjectException 
{
    if (!referral.isValidated())
        throw new CodingRuntimeException("Referral has not been validated!");

    DomainFactory factory = getDomainFactory();

    Referral refBo = HL7ReferralVoAssembler.extractReferral(factory, referral);
    factory.save(refBo);

    return HL7ReferralVoAssembler.create(refBo);

}
项目:openMAXIMS    文件:HL7PathwayIfImpl.java   
public HL7ReferralVo saveReferral(HL7ReferralVo referral) throws StaleObjectException 
{
    if (!referral.isValidated())
        throw new CodingRuntimeException("Referral has not been validated!");

    DomainFactory factory = getDomainFactory();

    Referral refBo = HL7ReferralVoAssembler.extractReferral(factory, referral);
    factory.save(refBo);

    return HL7ReferralVoAssembler.create(refBo);

}
项目:openMAXIMS    文件:HL7PathwayIfImpl.java   
public HL7ReferralVo saveReferral(HL7ReferralVo referral) throws StaleObjectException 
{
    if (!referral.isValidated())
        throw new CodingRuntimeException("Referral has not been validated!");

    DomainFactory factory = getDomainFactory();

    Referral refBo = HL7ReferralVoAssembler.extractReferral(factory, referral);
    factory.save(refBo);

    return HL7ReferralVoAssembler.create(refBo);

}
项目:openmaxims-linux    文件:HL7PathwayIfImpl.java   
public HL7ReferralVo saveReferral(HL7ReferralVo referral) throws StaleObjectException 
{
    if (!referral.isValidated())
        throw new CodingRuntimeException("Referral has not been validated!");

    DomainFactory factory = getDomainFactory();

    Referral refBo = HL7ReferralVoAssembler.extractReferral(factory, referral);
    factory.save(refBo);

    return HL7ReferralVoAssembler.create(refBo);

}