Java 类ims.therapies.vo.domain.WheelchairAssessmentVoAssembler 实例源码

项目:AvoinApotti    文件:WheelchairAssessmentImpl.java   
public WheelchairAssessmentVo saveWheelchairAssessment(WheelchairAssessmentVo wheelchairAssessment) throws StaleObjectException, UniqueKeyViolationException 
{
    DomainFactory factory = getDomainFactory(); 

    if (!wheelchairAssessment.isValidated())
    {
        throw new DomainRuntimeException("This WheelchairAssessmentVo has not been validated");
    }

    if (wheelchairAssessment.getID_WheelchairAssessment() == null)//Inserting a record
    {
        WheelchairAssessmentVoCollection voWA = getWheelchairAssessment(wheelchairAssessment.getClinicalContact().getID_ClinicalContact()); //wdev-13410
        WheelchairAssessmentVo tempVo = null;  //wdev-13410
        if(voWA != null && voWA.size() > 0)     //wdev-13410
        {
            tempVo = voWA.get(0);
        }
        else
        {
            tempVo = null;
        }

        if(tempVo != null )
            throw new UniqueKeyViolationException("A record exists for this clinical contact, the screen will be refreshed");
    }
    WheelchairAssessment domWheelchairAssessment = WheelchairAssessmentVoAssembler.extractWheelchairAssessment(factory, wheelchairAssessment);

    factory.save(domWheelchairAssessment);

    return WheelchairAssessmentVoAssembler.create(domWheelchairAssessment);
}
项目:AvoinApotti    文件:WheelchairAssessmentImpl.java   
public WheelchairAssessmentVoCollection getWheelchairAssessment(Integer contactId) {
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer(" ");
    String query = "from WheelchairAssessment w ";
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();
    String andStr = " ";

    if (contactId != null)
    {
        hql.append(andStr + " w.clinicalContact.id = :id_ClinicalContact order by w.id desc");      //wdev-13410
        markers.add("id_ClinicalContact");
        values.add(contactId);          
        andStr = " and ";
    }

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


    List assessments = factory.find(query, markers, values);    
    WheelchairAssessmentVoCollection collHomeVisitVo = WheelchairAssessmentVoAssembler.createWheelchairAssessmentVoCollectionFromWheelchairAssessment(assessments);
    //if(collHomeVisitVo!=null && collHomeVisitVo.size()>0)
        return collHomeVisitVo;     //wdev-13410
        //return collHomeVisitVo.get(0);

    //return null;
}
项目:openMAXIMS    文件:WheelchairAssessmentImpl.java   
public WheelchairAssessmentVo saveWheelchairAssessment(WheelchairAssessmentVo wheelchairAssessment) throws StaleObjectException, UniqueKeyViolationException 
{
    DomainFactory factory = getDomainFactory(); 

    if (!wheelchairAssessment.isValidated())
    {
        throw new DomainRuntimeException("This WheelchairAssessmentVo has not been validated");
    }

    if (wheelchairAssessment.getID_WheelchairAssessment() == null)//Inserting a record
    {
        WheelchairAssessmentVoCollection voWA = getWheelchairAssessment(wheelchairAssessment.getClinicalContact().getID_ClinicalContact()); //wdev-13410
        WheelchairAssessmentVo tempVo = null;  //wdev-13410
        if(voWA != null && voWA.size() > 0)     //wdev-13410
        {
            tempVo = voWA.get(0);
        }
        else
        {
            tempVo = null;
        }

        if(tempVo != null )
            throw new UniqueKeyViolationException("A record exists for this clinical contact, the screen will be refreshed");
    }
    WheelchairAssessment domWheelchairAssessment = WheelchairAssessmentVoAssembler.extractWheelchairAssessment(factory, wheelchairAssessment);

    factory.save(domWheelchairAssessment);

    return WheelchairAssessmentVoAssembler.create(domWheelchairAssessment);
}
项目:openMAXIMS    文件:WheelchairAssessmentImpl.java   
public WheelchairAssessmentVoCollection getWheelchairAssessment(Integer contactId) {
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer(" ");
    String query = "from WheelchairAssessment w ";
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();
    String andStr = " ";

    if (contactId != null)
    {
        hql.append(andStr + " w.clinicalContact.id = :id_ClinicalContact order by w.id desc");      //wdev-13410
        markers.add("id_ClinicalContact");
        values.add(contactId);          
        andStr = " and ";
    }

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


    List assessments = factory.find(query, markers, values);    
    WheelchairAssessmentVoCollection collHomeVisitVo = WheelchairAssessmentVoAssembler.createWheelchairAssessmentVoCollectionFromWheelchairAssessment(assessments);
    //if(collHomeVisitVo!=null && collHomeVisitVo.size()>0)
        return collHomeVisitVo;     //wdev-13410
        //return collHomeVisitVo.get(0);

    //return null;
}
项目:openMAXIMS    文件:WheelchairAssessmentImpl.java   
public WheelchairAssessmentVo saveWheelchairAssessment(WheelchairAssessmentVo wheelchairAssessment) throws StaleObjectException, UniqueKeyViolationException 
{
    DomainFactory factory = getDomainFactory(); 

    if (!wheelchairAssessment.isValidated())
    {
        throw new DomainRuntimeException("This WheelchairAssessmentVo has not been validated");
    }

    if (wheelchairAssessment.getID_WheelchairAssessment() == null)//Inserting a record
    {
        WheelchairAssessmentVoCollection voWA = getWheelchairAssessment(wheelchairAssessment.getClinicalContact().getID_ClinicalContact()); //wdev-13410
        WheelchairAssessmentVo tempVo = null;  //wdev-13410
        if(voWA != null && voWA.size() > 0)     //wdev-13410
        {
            tempVo = voWA.get(0);
        }
        else
        {
            tempVo = null;
        }

        if(tempVo != null )
            throw new UniqueKeyViolationException("A record exists for this clinical contact, the screen will be refreshed");
    }
    WheelchairAssessment domWheelchairAssessment = WheelchairAssessmentVoAssembler.extractWheelchairAssessment(factory, wheelchairAssessment);

    factory.save(domWheelchairAssessment);

    return WheelchairAssessmentVoAssembler.create(domWheelchairAssessment);
}
项目:openMAXIMS    文件:WheelchairAssessmentImpl.java   
public WheelchairAssessmentVoCollection getWheelchairAssessment(Integer contactId) {
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer(" ");
    String query = "from WheelchairAssessment w ";
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();
    String andStr = " ";

    if (contactId != null)
    {
        hql.append(andStr + " w.clinicalContact.id = :id_ClinicalContact order by w.id desc");      //wdev-13410
        markers.add("id_ClinicalContact");
        values.add(contactId);          
        andStr = " and ";
    }

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


    List assessments = factory.find(query, markers, values);    
    WheelchairAssessmentVoCollection collHomeVisitVo = WheelchairAssessmentVoAssembler.createWheelchairAssessmentVoCollectionFromWheelchairAssessment(assessments);
    //if(collHomeVisitVo!=null && collHomeVisitVo.size()>0)
        return collHomeVisitVo;     //wdev-13410
        //return collHomeVisitVo.get(0);

    //return null;
}
项目:openmaxims-linux    文件:WheelchairAssessmentImpl.java   
public WheelchairAssessmentVo saveWheelchairAssessment(WheelchairAssessmentVo wheelchairAssessment) throws StaleObjectException, UniqueKeyViolationException 
{
    DomainFactory factory = getDomainFactory(); 

    if (!wheelchairAssessment.isValidated())
    {
        throw new DomainRuntimeException("This WheelchairAssessmentVo has not been validated");
    }

    if (wheelchairAssessment.getID_WheelchairAssessment() == null)//Inserting a record
    {
        WheelchairAssessmentVoCollection voWA = getWheelchairAssessment(wheelchairAssessment.getClinicalContact().getID_ClinicalContact()); //wdev-13410
        WheelchairAssessmentVo tempVo = null;  //wdev-13410
        if(voWA != null && voWA.size() > 0)     //wdev-13410
        {
            tempVo = voWA.get(0);
        }
        else
        {
            tempVo = null;
        }

        if(tempVo != null )
            throw new UniqueKeyViolationException("A record exists for this clinical contact, the screen will be refreshed");
    }
    WheelchairAssessment domWheelchairAssessment = WheelchairAssessmentVoAssembler.extractWheelchairAssessment(factory, wheelchairAssessment);

    factory.save(domWheelchairAssessment);

    return WheelchairAssessmentVoAssembler.create(domWheelchairAssessment);
}
项目:openmaxims-linux    文件:WheelchairAssessmentImpl.java   
public WheelchairAssessmentVoCollection getWheelchairAssessment(Integer contactId) {
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer(" ");
    String query = "from WheelchairAssessment w ";
    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();
    String andStr = " ";

    if (contactId != null)
    {
        hql.append(andStr + " w.clinicalContact.id = :id_ClinicalContact order by w.id desc");      //wdev-13410
        markers.add("id_ClinicalContact");
        values.add(contactId);          
        andStr = " and ";
    }

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


    List assessments = factory.find(query, markers, values);    
    WheelchairAssessmentVoCollection collHomeVisitVo = WheelchairAssessmentVoAssembler.createWheelchairAssessmentVoCollectionFromWheelchairAssessment(assessments);
    //if(collHomeVisitVo!=null && collHomeVisitVo.size()>0)
        return collHomeVisitVo;     //wdev-13410
        //return collHomeVisitVo.get(0);

    //return null;
}