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

项目:AvoinApotti    文件:EnvironmentalVisitImpl.java   
public EnvironmentalVisitVo getEnvironmentalVisitByClinicalContact(ClinicalContactRefVo voClinicalContactRef) 
{
    if(voClinicalContactRef == null || voClinicalContactRef.getID_ClinicalContact() == null)
        throw new DomainRuntimeException("Contact not provided for get call. ");

    DomainFactory factory = getDomainFactory();

    java.util.List environVisitList = factory.find("from  EnvironmentalVisit environList where environList.clinicalContact.id = :contactId ", new String[]{"contactId"}, new Object[]{voClinicalContactRef.getID_ClinicalContact()});

    EnvironmentalVisitVoCollection  coll = null;
    if  ((environVisitList != null) && (environVisitList.size()>0))
        coll = EnvironmentalVisitVoAssembler.createEnvironmentalVisitVoCollectionFromEnvironmentalVisit(environVisitList);

    if(coll != null && coll.size()>0)
        return coll.get(0);

    return null;
}
项目:AvoinApotti    文件:EnvironmentalVisitImpl.java   
public EnvironmentalVisitVo saveEnvironmentalVisit(EnvironmentalVisitVo voEnvironmentalVisit) throws StaleObjectException, UniqueKeyViolationException 
{
    DomainFactory factory = getDomainFactory(); 

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

    if(voEnvironmentalVisit.getID_EnvironmentalVisit() == null)
    {
        if(voEnvironmentalVisit.getCareContextIsNotNull())
        {
            EnvironmentalVisitVoCollection coll = getEnvironmentalVisitVoByCareContext(voEnvironmentalVisit.getCareContext());
            if(coll != null && coll.size()>0)
                throw new UniqueKeyViolationException("A Environmental Visit record already exists for this CareContext. ");
        }
    }

    EnvironmentalVisit domEnvironmentalVisit = EnvironmentalVisitVoAssembler.extractEnvironmentalVisit(factory, voEnvironmentalVisit);
    factory.save(domEnvironmentalVisit);
    return EnvironmentalVisitVoAssembler.create(domEnvironmentalVisit);
}
项目:openMAXIMS    文件:EnvironmentalVisitImpl.java   
public EnvironmentalVisitVo getEnvironmentalVisitByClinicalContact(ClinicalContactRefVo voClinicalContactRef) 
{
    if(voClinicalContactRef == null || voClinicalContactRef.getID_ClinicalContact() == null)
        throw new DomainRuntimeException("Contact not provided for get call. ");

    DomainFactory factory = getDomainFactory();

    java.util.List environVisitList = factory.find("from  EnvironmentalVisit environList where environList.clinicalContact.id = :contactId ", new String[]{"contactId"}, new Object[]{voClinicalContactRef.getID_ClinicalContact()});

    EnvironmentalVisitVoCollection  coll = null;
    if  ((environVisitList != null) && (environVisitList.size()>0))
        coll = EnvironmentalVisitVoAssembler.createEnvironmentalVisitVoCollectionFromEnvironmentalVisit(environVisitList);

    if(coll != null && coll.size()>0)
        return coll.get(0);

    return null;
}
项目:openMAXIMS    文件:EnvironmentalVisitImpl.java   
public EnvironmentalVisitVo saveEnvironmentalVisit(EnvironmentalVisitVo voEnvironmentalVisit) throws StaleObjectException, UniqueKeyViolationException 
{
    DomainFactory factory = getDomainFactory(); 

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

    if(voEnvironmentalVisit.getID_EnvironmentalVisit() == null)
    {
        if(voEnvironmentalVisit.getCareContextIsNotNull())
        {
            EnvironmentalVisitVoCollection coll = getEnvironmentalVisitVoByCareContext(voEnvironmentalVisit.getCareContext());
            if(coll != null && coll.size()>0)
                throw new UniqueKeyViolationException("A Environmental Visit record already exists for this CareContext. ");
        }
    }

    EnvironmentalVisit domEnvironmentalVisit = EnvironmentalVisitVoAssembler.extractEnvironmentalVisit(factory, voEnvironmentalVisit);
    factory.save(domEnvironmentalVisit);
    return EnvironmentalVisitVoAssembler.create(domEnvironmentalVisit);
}
项目:openMAXIMS    文件:EnvironmentalVisitImpl.java   
public EnvironmentalVisitVo getEnvironmentalVisitByClinicalContact(ClinicalContactRefVo voClinicalContactRef) 
{
    if(voClinicalContactRef == null || voClinicalContactRef.getID_ClinicalContact() == null)
        throw new DomainRuntimeException("Contact not provided for get call. ");

    DomainFactory factory = getDomainFactory();

    java.util.List environVisitList = factory.find("from  EnvironmentalVisit environList where environList.clinicalContact.id = :contactId ", new String[]{"contactId"}, new Object[]{voClinicalContactRef.getID_ClinicalContact()});

    EnvironmentalVisitVoCollection  coll = null;
    if  ((environVisitList != null) && (environVisitList.size()>0))
        coll = EnvironmentalVisitVoAssembler.createEnvironmentalVisitVoCollectionFromEnvironmentalVisit(environVisitList);

    if(coll != null && coll.size()>0)
        return coll.get(0);

    return null;
}
项目:openMAXIMS    文件:EnvironmentalVisitImpl.java   
public EnvironmentalVisitVo saveEnvironmentalVisit(EnvironmentalVisitVo voEnvironmentalVisit) throws StaleObjectException, UniqueKeyViolationException 
{
    DomainFactory factory = getDomainFactory(); 

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

    if(voEnvironmentalVisit.getID_EnvironmentalVisit() == null)
    {
        if(voEnvironmentalVisit.getCareContextIsNotNull())
        {
            EnvironmentalVisitVoCollection coll = getEnvironmentalVisitVoByCareContext(voEnvironmentalVisit.getCareContext());
            if(coll != null && coll.size()>0)
                throw new UniqueKeyViolationException("A Environmental Visit record already exists for this CareContext. ");
        }
    }

    EnvironmentalVisit domEnvironmentalVisit = EnvironmentalVisitVoAssembler.extractEnvironmentalVisit(factory, voEnvironmentalVisit);
    factory.save(domEnvironmentalVisit);
    return EnvironmentalVisitVoAssembler.create(domEnvironmentalVisit);
}
项目:openmaxims-linux    文件:EnvironmentalVisitImpl.java   
public EnvironmentalVisitVo getEnvironmentalVisitByClinicalContact(ClinicalContactRefVo voClinicalContactRef) 
{
    if(voClinicalContactRef == null || voClinicalContactRef.getID_ClinicalContact() == null)
        throw new DomainRuntimeException("Contact not provided for get call. ");

    DomainFactory factory = getDomainFactory();

    java.util.List environVisitList = factory.find("from  EnvironmentalVisit environList where environList.clinicalContact.id = :contactId ", new String[]{"contactId"}, new Object[]{voClinicalContactRef.getID_ClinicalContact()});

    EnvironmentalVisitVoCollection  coll = null;
    if  ((environVisitList != null) && (environVisitList.size()>0))
        coll = EnvironmentalVisitVoAssembler.createEnvironmentalVisitVoCollectionFromEnvironmentalVisit(environVisitList);

    if(coll != null && coll.size()>0)
        return coll.get(0);

    return null;
}
项目:openmaxims-linux    文件:EnvironmentalVisitImpl.java   
public EnvironmentalVisitVo saveEnvironmentalVisit(EnvironmentalVisitVo voEnvironmentalVisit) throws StaleObjectException, UniqueKeyViolationException 
{
    DomainFactory factory = getDomainFactory(); 

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

    if(voEnvironmentalVisit.getID_EnvironmentalVisit() == null)
    {
        if(voEnvironmentalVisit.getCareContextIsNotNull())
        {
            EnvironmentalVisitVoCollection coll = getEnvironmentalVisitVoByCareContext(voEnvironmentalVisit.getCareContext());
            if(coll != null && coll.size()>0)
                throw new UniqueKeyViolationException("A Environmental Visit record already exists for this CareContext. ");
        }
    }

    EnvironmentalVisit domEnvironmentalVisit = EnvironmentalVisitVoAssembler.extractEnvironmentalVisit(factory, voEnvironmentalVisit);
    factory.save(domEnvironmentalVisit);
    return EnvironmentalVisitVoAssembler.create(domEnvironmentalVisit);
}
项目:AvoinApotti    文件:EnvironmentalVisitImpl.java   
public EnvironmentalVisitVo getEnvironmentalVisit(EnvironmentalVisitRefVo voEnvironmentalVisitRef)
{
    return EnvironmentalVisitVoAssembler.create((EnvironmentalVisit) getDomainFactory().getDomainObject(EnvironmentalVisit.class,voEnvironmentalVisitRef.getID_EnvironmentalVisit()));
}
项目:openMAXIMS    文件:EnvironmentalVisitImpl.java   
public EnvironmentalVisitVo getEnvironmentalVisit(EnvironmentalVisitRefVo voEnvironmentalVisitRef)
{
    return EnvironmentalVisitVoAssembler.create((EnvironmentalVisit) getDomainFactory().getDomainObject(EnvironmentalVisit.class,voEnvironmentalVisitRef.getID_EnvironmentalVisit()));
}
项目:openMAXIMS    文件:EnvironmentalVisitImpl.java   
public EnvironmentalVisitVo getEnvironmentalVisit(EnvironmentalVisitRefVo voEnvironmentalVisitRef)
{
    return EnvironmentalVisitVoAssembler.create((EnvironmentalVisit) getDomainFactory().getDomainObject(EnvironmentalVisit.class,voEnvironmentalVisitRef.getID_EnvironmentalVisit()));
}
项目:openmaxims-linux    文件:EnvironmentalVisitImpl.java   
public EnvironmentalVisitVo getEnvironmentalVisit(EnvironmentalVisitRefVo voEnvironmentalVisitRef)
{
    return EnvironmentalVisitVoAssembler.create((EnvironmentalVisit) getDomainFactory().getDomainObject(EnvironmentalVisit.class,voEnvironmentalVisitRef.getID_EnvironmentalVisit()));
}
项目:AvoinApotti    文件:EnvironmentalVisitImpl.java   
private EnvironmentalVisitVoCollection getEnvironmentalVisitVoByCareContext(CareContextRefVo voCareContext) {
    String hql = new String("from EnvironmentalVisit ev where ev.careContext.id = :CARECONTEXT_ID");

    java.util.List list = getDomainFactory().find(hql, "CARECONTEXT_ID", voCareContext.getID_CareContext());

    return EnvironmentalVisitVoAssembler.createEnvironmentalVisitVoCollectionFromEnvironmentalVisit(list);
}
项目:openMAXIMS    文件:EnvironmentalVisitImpl.java   
private EnvironmentalVisitVoCollection getEnvironmentalVisitVoByCareContext(CareContextRefVo voCareContext) {
    String hql = new String("from EnvironmentalVisit ev where ev.careContext.id = :CARECONTEXT_ID");

    java.util.List list = getDomainFactory().find(hql, "CARECONTEXT_ID", voCareContext.getID_CareContext());

    return EnvironmentalVisitVoAssembler.createEnvironmentalVisitVoCollectionFromEnvironmentalVisit(list);
}
项目:openMAXIMS    文件:EnvironmentalVisitImpl.java   
private EnvironmentalVisitVoCollection getEnvironmentalVisitVoByCareContext(CareContextRefVo voCareContext) {
    String hql = new String("from EnvironmentalVisit ev where ev.careContext.id = :CARECONTEXT_ID");

    java.util.List list = getDomainFactory().find(hql, "CARECONTEXT_ID", voCareContext.getID_CareContext());

    return EnvironmentalVisitVoAssembler.createEnvironmentalVisitVoCollectionFromEnvironmentalVisit(list);
}
项目:openmaxims-linux    文件:EnvironmentalVisitImpl.java   
private EnvironmentalVisitVoCollection getEnvironmentalVisitVoByCareContext(CareContextRefVo voCareContext) {
    String hql = new String("from EnvironmentalVisit ev where ev.careContext.id = :CARECONTEXT_ID");

    java.util.List list = getDomainFactory().find(hql, "CARECONTEXT_ID", voCareContext.getID_CareContext());

    return EnvironmentalVisitVoAssembler.createEnvironmentalVisitVoCollectionFromEnvironmentalVisit(list);
}