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

项目:AvoinApotti    文件:HomeVisitAccessImpl.java   
public HomeVisitVo saveHomeVisitAccess(HomeVisitVo homeVisitVo) throws StaleObjectException, UniqueKeyViolationException {
    DomainFactory factory = getDomainFactory(); 

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

    if(homeVisitVo.getID_HomeVisit() == null)
    {
        if(homeVisitVo.getCareContextIsNotNull())
        {
            HomeVisitVoCollection coll = getHomeVisitVoByCareContext(homeVisitVo.getCareContext());
            if(coll != null && coll.size()>0)
                throw new UniqueKeyViolationException("A Home Visit record already exists for this CareContext. ");
        }
    }
    HomeVisit domHomeVisit = HomeVisitVoAssembler.extractHomeVisit(factory, homeVisitVo);

    factory.save(domHomeVisit);

    return HomeVisitVoAssembler.create(domHomeVisit);
}
项目:AvoinApotti    文件:HomeVisitAccessImpl.java   
public HomeVisitVo getHomeVisitAccByClinicalContact(ClinicalContactRefVo voClinicalContactRef)
{
    if(voClinicalContactRef == null || voClinicalContactRef.getID_ClinicalContact() == null)
        throw new DomainRuntimeException("Contact not provided for get call. ");

    DomainFactory factory = getDomainFactory();

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

    if  ((home != null) && (home.size()>0)){
        HomeVisitVoCollection collHomeVisit  = HomeVisitVoAssembler.createHomeVisitVoCollectionFromHomeVisit(home);
        if(collHomeVisit!=null && collHomeVisit.size()!=0)
            return collHomeVisit.get(0);
    }

    return null;
}
项目:AvoinApotti    文件:HomeVisitAccessImpl.java   
public HomeVisitVo getHomeVisitAccByCareContext(CareContextRefVo voCareContextRef)
{
    if(voCareContextRef == null || voCareContextRef.getID_CareContext() == null)
        throw new DomainRuntimeException("Context not provided for get call. ");

    DomainFactory factory = getDomainFactory();

    java.util.List home = factory.find("from HomeVisit hv where hv.careContext.id = :id and hv.clinicalContact is null", new String[]{"id"}, new Object[]{voCareContextRef.getID_CareContext()});

    //WDEV-13700
    if  (home == null || home.size() == 0)
        return null;

    HomeVisitVoCollection collection = HomeVisitVoAssembler.createHomeVisitVoCollectionFromHomeVisit(home);

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

    return null;
}
项目:openMAXIMS    文件:HomeVisitAccessImpl.java   
public HomeVisitVo saveHomeVisitAccess(HomeVisitVo homeVisitVo) throws StaleObjectException, UniqueKeyViolationException {
    DomainFactory factory = getDomainFactory(); 

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

    if(homeVisitVo.getID_HomeVisit() == null)
    {
        if(homeVisitVo.getCareContextIsNotNull())
        {
            HomeVisitVoCollection coll = getHomeVisitVoByCareContext(homeVisitVo.getCareContext());
            if(coll != null && coll.size()>0)
                throw new UniqueKeyViolationException("A Home Visit record already exists for this CareContext. ");
        }
    }
    HomeVisit domHomeVisit = HomeVisitVoAssembler.extractHomeVisit(factory, homeVisitVo);

    factory.save(domHomeVisit);

    return HomeVisitVoAssembler.create(domHomeVisit);
}
项目:openMAXIMS    文件:HomeVisitAccessImpl.java   
public HomeVisitVo getHomeVisitAccByClinicalContact(ClinicalContactRefVo voClinicalContactRef)
{
    if(voClinicalContactRef == null || voClinicalContactRef.getID_ClinicalContact() == null)
        throw new DomainRuntimeException("Contact not provided for get call. ");

    DomainFactory factory = getDomainFactory();

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

    if  ((home != null) && (home.size()>0)){
        HomeVisitVoCollection collHomeVisit  = HomeVisitVoAssembler.createHomeVisitVoCollectionFromHomeVisit(home);
        if(collHomeVisit!=null && collHomeVisit.size()!=0)
            return collHomeVisit.get(0);
    }

    return null;
}
项目:openMAXIMS    文件:HomeVisitAccessImpl.java   
public HomeVisitVo getHomeVisitAccByCareContext(CareContextRefVo voCareContextRef)
{
    if(voCareContextRef == null || voCareContextRef.getID_CareContext() == null)
        throw new DomainRuntimeException("Context not provided for get call. ");

    DomainFactory factory = getDomainFactory();

    java.util.List home = factory.find("from HomeVisit hv where hv.careContext.id = :id and hv.clinicalContact is null", new String[]{"id"}, new Object[]{voCareContextRef.getID_CareContext()});

    //WDEV-13700
    if  (home == null || home.size() == 0)
        return null;

    HomeVisitVoCollection collection = HomeVisitVoAssembler.createHomeVisitVoCollectionFromHomeVisit(home);

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

    return null;
}
项目:openMAXIMS    文件:HomeVisitAccessImpl.java   
public HomeVisitVo saveHomeVisitAccess(HomeVisitVo homeVisitVo) throws StaleObjectException, UniqueKeyViolationException {
    DomainFactory factory = getDomainFactory(); 

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

    if(homeVisitVo.getID_HomeVisit() == null)
    {
        if(homeVisitVo.getCareContextIsNotNull())
        {
            HomeVisitVoCollection coll = getHomeVisitVoByCareContext(homeVisitVo.getCareContext());
            if(coll != null && coll.size()>0)
                throw new UniqueKeyViolationException("A Home Visit record already exists for this CareContext. ");
        }
    }
    HomeVisit domHomeVisit = HomeVisitVoAssembler.extractHomeVisit(factory, homeVisitVo);

    factory.save(domHomeVisit);

    return HomeVisitVoAssembler.create(domHomeVisit);
}
项目:openMAXIMS    文件:HomeVisitAccessImpl.java   
public HomeVisitVo getHomeVisitAccByClinicalContact(ClinicalContactRefVo voClinicalContactRef)
{
    if(voClinicalContactRef == null || voClinicalContactRef.getID_ClinicalContact() == null)
        throw new DomainRuntimeException("Contact not provided for get call. ");

    DomainFactory factory = getDomainFactory();

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

    if  ((home != null) && (home.size()>0)){
        HomeVisitVoCollection collHomeVisit  = HomeVisitVoAssembler.createHomeVisitVoCollectionFromHomeVisit(home);
        if(collHomeVisit!=null && collHomeVisit.size()!=0)
            return collHomeVisit.get(0);
    }

    return null;
}
项目:openMAXIMS    文件:HomeVisitAccessImpl.java   
public HomeVisitVo getHomeVisitAccByCareContext(CareContextRefVo voCareContextRef)
{
    if(voCareContextRef == null || voCareContextRef.getID_CareContext() == null)
        throw new DomainRuntimeException("Context not provided for get call. ");

    DomainFactory factory = getDomainFactory();

    java.util.List home = factory.find("from HomeVisit hv where hv.careContext.id = :id and hv.clinicalContact is null", new String[]{"id"}, new Object[]{voCareContextRef.getID_CareContext()});

    //WDEV-13700
    if  (home == null || home.size() == 0)
        return null;

    HomeVisitVoCollection collection = HomeVisitVoAssembler.createHomeVisitVoCollectionFromHomeVisit(home);

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

    return null;
}
项目:openmaxims-linux    文件:HomeVisitAccessImpl.java   
public HomeVisitVo saveHomeVisitAccess(HomeVisitVo homeVisitVo) throws StaleObjectException, UniqueKeyViolationException {
    DomainFactory factory = getDomainFactory(); 

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

    if(homeVisitVo.getID_HomeVisit() == null)
    {
        if(homeVisitVo.getCareContextIsNotNull())
        {
            HomeVisitVoCollection coll = getHomeVisitVoByCareContext(homeVisitVo.getCareContext());
            if(coll != null && coll.size()>0)
                throw new UniqueKeyViolationException("A Home Visit record already exists for this CareContext. ");
        }
    }
    HomeVisit domHomeVisit = HomeVisitVoAssembler.extractHomeVisit(factory, homeVisitVo);

    factory.save(domHomeVisit);

    return HomeVisitVoAssembler.create(domHomeVisit);
}
项目:openmaxims-linux    文件:HomeVisitAccessImpl.java   
public HomeVisitVo getHomeVisitAccByClinicalContact(ClinicalContactRefVo voClinicalContactRef)
{
    if(voClinicalContactRef == null || voClinicalContactRef.getID_ClinicalContact() == null)
        throw new DomainRuntimeException("Contact not provided for get call. ");

    DomainFactory factory = getDomainFactory();

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

    if  ((home != null) && (home.size()>0)){
        HomeVisitVoCollection collHomeVisit  = HomeVisitVoAssembler.createHomeVisitVoCollectionFromHomeVisit(home);
        if(collHomeVisit!=null && collHomeVisit.size()!=0)
            return collHomeVisit.get(0);
    }

    return null;
}
项目:openmaxims-linux    文件:HomeVisitAccessImpl.java   
public HomeVisitVo getHomeVisitAccByCareContext(CareContextRefVo voCareContextRef)
{
    if(voCareContextRef == null || voCareContextRef.getID_CareContext() == null)
        throw new DomainRuntimeException("Context not provided for get call. ");

    DomainFactory factory = getDomainFactory();

    java.util.List home = factory.find("from HomeVisit hv where hv.careContext.id = :id and hv.clinicalContact is null", new String[]{"id"}, new Object[]{voCareContextRef.getID_CareContext()});

    //WDEV-13700
    if  (home == null || home.size() == 0)
        return null;

    HomeVisitVoCollection collection = HomeVisitVoAssembler.createHomeVisitVoCollectionFromHomeVisit(home);

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

    return null;
}
项目:AvoinApotti    文件:HomeVisitAccessImpl.java   
public HomeVisitVo getHomeVisit(HomeVisitRefVo voHomeVisitRef)
{
    if(voHomeVisitRef == null)
        throw new DomainRuntimeException("Invalid Home Visit record to get");

    return HomeVisitVoAssembler.create((HomeVisit) getDomainFactory().getDomainObject(HomeVisit.class, voHomeVisitRef.getID_HomeVisit()));      
}
项目:AvoinApotti    文件:HomeVisitAccessImpl.java   
public HomeVisitVoCollection getHomeVisitVoByCareContext(CareContextRefVo voCareContext)
{
    String hql = new String("from HomeVisit hv where hv.careContext.id = :CARECONTEXT_ID");

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

    return HomeVisitVoAssembler.createHomeVisitVoCollectionFromHomeVisit(list);
}
项目:openMAXIMS    文件:HomeVisitSummaryImpl.java   
@Override
public HomeVisitVo getHomeVisit(HomeVisitRefVo voHomeVisitRef) {
    if(voHomeVisitRef == null)
        throw new DomainRuntimeException("Invalid Home Visit record to get");

    return HomeVisitVoAssembler.create((HomeVisit) getDomainFactory().getDomainObject(voHomeVisitRef));

}
项目:openMAXIMS    文件:HomeVisitAccessImpl.java   
public HomeVisitVo getHomeVisit(HomeVisitRefVo voHomeVisitRef)
{
    if(voHomeVisitRef == null)
        throw new DomainRuntimeException("Invalid Home Visit record to get");

    return HomeVisitVoAssembler.create((HomeVisit) getDomainFactory().getDomainObject(HomeVisit.class, voHomeVisitRef.getID_HomeVisit()));      
}
项目:openMAXIMS    文件:HomeVisitAccessImpl.java   
public HomeVisitVoCollection getHomeVisitVoByCareContext(CareContextRefVo voCareContext)
{
    String hql = new String("from HomeVisit hv where hv.careContext.id = :CARECONTEXT_ID");

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

    return HomeVisitVoAssembler.createHomeVisitVoCollectionFromHomeVisit(list);
}
项目:openMAXIMS    文件:HomeVisitGeneralImpl.java   
@Override
public HomeVisitVo getHomeVisit(HomeVisitRefVo voHomeVisitRef) {

    if(voHomeVisitRef == null)
        throw new DomainRuntimeException("Invalid Home Visit record to get");

        return HomeVisitVoAssembler.create((HomeVisit) getDomainFactory().getDomainObject(voHomeVisitRef));
}
项目:openMAXIMS    文件:HomeVisitAccessImpl.java   
public HomeVisitVo getHomeVisit(HomeVisitRefVo voHomeVisitRef)
{
    if(voHomeVisitRef == null)
        throw new DomainRuntimeException("Invalid Home Visit record to get");

    return HomeVisitVoAssembler.create((HomeVisit) getDomainFactory().getDomainObject(HomeVisit.class, voHomeVisitRef.getID_HomeVisit()));      
}
项目:openMAXIMS    文件:HomeVisitAccessImpl.java   
public HomeVisitVoCollection getHomeVisitVoByCareContext(CareContextRefVo voCareContext)
{
    String hql = new String("from HomeVisit hv where hv.careContext.id = :CARECONTEXT_ID");

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

    return HomeVisitVoAssembler.createHomeVisitVoCollectionFromHomeVisit(list);
}
项目:openmaxims-linux    文件:HomeVisitAccessImpl.java   
public HomeVisitVo getHomeVisit(HomeVisitRefVo voHomeVisitRef)
{
    if(voHomeVisitRef == null)
        throw new DomainRuntimeException("Invalid Home Visit record to get");

    return HomeVisitVoAssembler.create((HomeVisit) getDomainFactory().getDomainObject(HomeVisit.class, voHomeVisitRef.getID_HomeVisit()));      
}
项目:openmaxims-linux    文件:HomeVisitAccessImpl.java   
public HomeVisitVoCollection getHomeVisitVoByCareContext(CareContextRefVo voCareContext)
{
    String hql = new String("from HomeVisit hv where hv.careContext.id = :CARECONTEXT_ID");

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

    return HomeVisitVoAssembler.createHomeVisitVoCollectionFromHomeVisit(list);
}