Java 类ims.emergency.vo.domain.EDPartialAdmissionVoAssembler 实例源码

项目:AvoinApotti    文件:TransferDialogImpl.java   
public ims.emergency.vo.EDTransferVo saveEDTransfer(EDTransferVo record, EDPartialAdmissionVo partialadmis) throws ims.domain.exceptions.StaleObjectException, ims.domain.exceptions.UniqueKeyViolationException
{
    if(record == null)
        throw new CodingRuntimeException("Cannot save a null EDTransfer record.");


    DomainFactory factory = getDomainFactory();
    EDTransfer doEDTransfer = EDTransferVoAssembler.extractEDTransfer(factory, record);

    factory.save(doEDTransfer);

    if( partialadmis != null )
    {
        partialadmis.setAllocatedStatus(AllocationStatus.CANCELLED_ADMISSION);
        EDPartialAdmission  doEDPartialAdmission = EDPartialAdmissionVoAssembler.extractEDPartialAdmission(factory, partialadmis);
        factory.save(doEDPartialAdmission);
    }

    return EDTransferVoAssembler.create(doEDTransfer);
}
项目:openMAXIMS    文件:TransferDialogImpl.java   
public ims.emergency.vo.EDTransferVo saveEDTransfer(EDTransferVo record, EDPartialAdmissionVo partialadmis) throws ims.domain.exceptions.StaleObjectException, ims.domain.exceptions.UniqueKeyViolationException
{
    if(record == null)
        throw new CodingRuntimeException("Cannot save a null EDTransfer record.");


    DomainFactory factory = getDomainFactory();
    EDTransfer doEDTransfer = EDTransferVoAssembler.extractEDTransfer(factory, record);

    factory.save(doEDTransfer);

    if( partialadmis != null )
    {
        partialadmis.setAllocatedStatus(AllocationStatus.CANCELLED_ADMISSION);
        EDPartialAdmission  doEDPartialAdmission = EDPartialAdmissionVoAssembler.extractEDPartialAdmission(factory, partialadmis);
        factory.save(doEDPartialAdmission);
    }

    return EDTransferVoAssembler.create(doEDTransfer);
}
项目:openMAXIMS    文件:EDPartialAdmissionDialogImpl.java   
public ims.emergency.vo.EDPartialAdmissionVo save(ims.emergency.vo.TrackingForEDPartialAdmissionVo trackingToSave, ims.emergency.vo.EDPartialAdmissionVo edPartialAdmissionToSave) throws ims.domain.exceptions.StaleObjectException
{
    if (edPartialAdmissionToSave == null && trackingToSave == null)
        throw new CodingRuntimeException("Cannot save null EDPartialAdmissionVo or TrackingForEDPartialAdmissionVo ");

    DomainFactory factory = getDomainFactory();

    if (edPartialAdmissionToSave != null && trackingToSave == null)
    {
        if (!edPartialAdmissionToSave.isValidated())
            throw new DomainRuntimeException("EDPartialAdmissionVo Not Validated.");

        EDPartialAdmission domainEDPartialAdmissionToSave = EDPartialAdmissionVoAssembler.extractEDPartialAdmission(factory, edPartialAdmissionToSave);
        factory.save(domainEDPartialAdmissionToSave);

        return EDPartialAdmissionVoAssembler.create(domainEDPartialAdmissionToSave);
    }
    else if (edPartialAdmissionToSave == null && trackingToSave != null)
    {
        if (!trackingToSave.isValidated())
            throw new DomainRuntimeException("TrackingForEDPartialAdmissionVo Not Validated.");

        Tracking domainTrackingforReferral = TrackingForEDPartialAdmissionVoAssembler.extractTracking(factory, trackingToSave);
        factory.save(domainTrackingforReferral);

        TrackingForEDPartialAdmissionVo track = TrackingForEDPartialAdmissionVoAssembler.create(domainTrackingforReferral);

        if (track != null)
            return track.getCurrentPartialAdmission();
    }


    return null;
}
项目:openmaxims-linux    文件:TransferDialogImpl.java   
public ims.emergency.vo.EDTransferVo saveEDTransfer(EDTransferVo record, EDPartialAdmissionVo partialadmis) throws ims.domain.exceptions.StaleObjectException, ims.domain.exceptions.UniqueKeyViolationException
{
    if(record == null)
        throw new CodingRuntimeException("Cannot save a null EDTransfer record.");


    DomainFactory factory = getDomainFactory();
    EDTransfer doEDTransfer = EDTransferVoAssembler.extractEDTransfer(factory, record);

    factory.save(doEDTransfer);

    if( partialadmis != null )
    {
        partialadmis.setAllocatedStatus(AllocationStatus.CANCELLED_ADMISSION);
        EDPartialAdmission  doEDPartialAdmission = EDPartialAdmissionVoAssembler.extractEDPartialAdmission(factory, partialadmis);
        factory.save(doEDPartialAdmission);
    }

    return EDTransferVoAssembler.create(doEDTransfer);
}
项目:openmaxims-linux    文件:EDPartialAdmissionDialogImpl.java   
public ims.emergency.vo.EDPartialAdmissionVo save(ims.emergency.vo.TrackingForEDPartialAdmissionVo trackingToSave, ims.emergency.vo.EDPartialAdmissionVo edPartialAdmissionToSave) throws ims.domain.exceptions.StaleObjectException
{
    if (edPartialAdmissionToSave == null && trackingToSave == null)
        throw new CodingRuntimeException("Cannot save null EDPartialAdmissionVo or TrackingForEDPartialAdmissionVo ");

    DomainFactory factory = getDomainFactory();

    if (edPartialAdmissionToSave != null && trackingToSave == null)
    {
        if (!edPartialAdmissionToSave.isValidated())
            throw new DomainRuntimeException("EDPartialAdmissionVo Not Validated.");

        EDPartialAdmission domainEDPartialAdmissionToSave = EDPartialAdmissionVoAssembler.extractEDPartialAdmission(factory, edPartialAdmissionToSave);
        factory.save(domainEDPartialAdmissionToSave);

        return EDPartialAdmissionVoAssembler.create(domainEDPartialAdmissionToSave);
    }
    else if (edPartialAdmissionToSave == null && trackingToSave != null)
    {
        if (!trackingToSave.isValidated())
            throw new DomainRuntimeException("TrackingForEDPartialAdmissionVo Not Validated.");

        Tracking domainTrackingforReferral = TrackingForEDPartialAdmissionVoAssembler.extractTracking(factory, trackingToSave);
        factory.save(domainTrackingforReferral);

        TrackingForEDPartialAdmissionVo track = TrackingForEDPartialAdmissionVoAssembler.create(domainTrackingforReferral);

        if (track != null)
            return track.getCurrentPartialAdmission();
    }


    return null;
}
项目:AvoinApotti    文件:EDPartialAdmissionDialogImpl.java   
public ims.emergency.vo.EDPartialAdmissionVo save(ims.emergency.vo.TrackingForEDPartialAdmissionVo trackingToSave, ims.emergency.vo.EDPartialAdmissionVo edPartialAdmissionToSave) throws ims.domain.exceptions.StaleObjectException
{
    if (edPartialAdmissionToSave == null && trackingToSave == null)
        throw new CodingRuntimeException("Cannot save null EDPartialAdmissionVo or TrackingForEDPartialAdmissionVo ");

    DomainFactory factory = getDomainFactory();

    if (edPartialAdmissionToSave != null && trackingToSave == null)
    {
        if (!edPartialAdmissionToSave.isValidated())
            throw new DomainRuntimeException("EDPartialAdmissionVo Not Validated.");

        EDPartialAdmission domainEDPartialAdmissionToSave = EDPartialAdmissionVoAssembler.extractEDPartialAdmission(factory, edPartialAdmissionToSave);
        factory.save(domainEDPartialAdmissionToSave);

        return EDPartialAdmissionVoAssembler.create(domainEDPartialAdmissionToSave);
    }
    else if (edPartialAdmissionToSave == null && trackingToSave != null)
    {
        if (!trackingToSave.isValidated())
            throw new DomainRuntimeException("TrackingForEDPartialAdmissionVo Not Validated.");

        Tracking domainTrackingforReferral = TrackingForEDPartialAdmissionVoAssembler.extractTracking(factory, trackingToSave);
        factory.save(domainTrackingforReferral);

        TrackingForEDPartialAdmissionVo track = TrackingForEDPartialAdmissionVoAssembler.create(domainTrackingforReferral);

        if (track != null)
            return track.getCurrentPartialAdmission();
    }


    return null;
}
项目:openMAXIMS    文件:TrackingImpl.java   
public TrackingWithPartialAdmissionVo cancelCurrentPartialAdmission(TrackingWithPartialAdmissionVo trWithPartialAdmission, EDPartialAdmissionVo partialAdmission) throws StaleObjectException, UniqueKeyViolationException
{
    if(trWithPartialAdmission == null || partialAdmission== null)
        throw new CodingRuntimeException("Cannot save a null tracking record.");

    if(!trWithPartialAdmission.isValidated() || !trWithPartialAdmission.isValidated())
        throw new CodingRuntimeException("tracking record is not validated.");

    DomainFactory factory = getDomainFactory();

    EDPartialAdmission doPartialAdmission = EDPartialAdmissionVoAssembler.extractEDPartialAdmission(factory, partialAdmission);
    factory.save(doPartialAdmission);

    Tracking doTracking = TrackingWithPartialAdmissionVoAssembler.extractTracking(factory, trWithPartialAdmission);
    factory.save(doTracking);

    EDPartialAdmissionDialog dom = (EDPartialAdmissionDialog) getDomainImpl(EDPartialAdmissionDialogImpl.class);
    try
    {
        dom.triggerCancelPartialAdmission(trWithPartialAdmission.getAttendance(), trWithPartialAdmission.getCurrentPartialAdmission());
    }
    catch (DomainInterfaceException e)
    {
        e.printStackTrace();
    }

    return TrackingWithPartialAdmissionVoAssembler.create(doTracking);
}
项目:openMAXIMS    文件:TransferDialogImpl.java   
public EDPartialAdmissionVo getTrackingWithEDPartialAdmission(TrackingRefVo trackingRef)
{
    if(trackingRef == null || trackingRef.getID_Tracking() == null)
        throw new CodingRuntimeException("Cannot get Tracking record on null Tracking Id.");

    DomainFactory factory = getDomainFactory();
    Tracking doTracking = (Tracking) factory.getDomainObject(Tracking.class, trackingRef.getID_Tracking());

    EDPartialAdmission currentPartialAdm = null;
    if (doTracking != null)
        currentPartialAdm = doTracking.getCurrentPartialAdmission();

    return EDPartialAdmissionVoAssembler.create(currentPartialAdm);
}
项目:openMAXIMS    文件:TransferDialogImpl.java   
public EDPartialAdmissionVo cancelCurrentPartialAdmission(EDPartialAdmissionVo edPartialAdmissionVo,TrackingForTransferVo trackingRecord) throws StaleObjectException
{
    DomainFactory factory = getDomainFactory();
    if( edPartialAdmissionVo != null )
    {
        edPartialAdmissionVo.setAllocatedStatus(AllocationStatus.CANCELLED_ADMISSION);
        EDPartialAdmission  doEDPartialAdmission = EDPartialAdmissionVoAssembler.extractEDPartialAdmission(factory, edPartialAdmissionVo);
        factory.save(doEDPartialAdmission);

        if (trackingRecord != null)
        {
            Tracking dotrackingRecord = TrackingForTransferVoAssembler.extractTracking(factory, trackingRecord);
            dotrackingRecord.setCurrentPartialAdmission(null);
            dotrackingRecord.setBedAvailability(null);          
            factory.save(dotrackingRecord);

            EDPartialAdmissionDialog dom = (EDPartialAdmissionDialog) getDomainImpl(EDPartialAdmissionDialogImpl.class);
            try
            {
                dom.triggerCancelPartialAdmission(trackingRecord.getAttendance(), edPartialAdmissionVo);
            }
            catch (DomainInterfaceException e)
            {
                e.printStackTrace();
            }
        }

        return EDPartialAdmissionVoAssembler.create(doEDPartialAdmission);
    }
    return null;
}
项目:openMAXIMS    文件:EDReferralToSpecialtyDialogImpl.java   
public EDPartialAdmissionVo cancelCurrentPartialAdmission(EDPartialAdmissionVo edPartialAdmissionVo, TrackingForReferalToSpecialtyVo trackingRecord) throws StaleObjectException
{
    DomainFactory factory = getDomainFactory();
    if( edPartialAdmissionVo != null )
    {
        edPartialAdmissionVo.setAllocatedStatus(AllocationStatus.CANCELLED_ADMISSION);
        EDPartialAdmission  doEDPartialAdmission = EDPartialAdmissionVoAssembler.extractEDPartialAdmission(factory, edPartialAdmissionVo);
        factory.save(doEDPartialAdmission);

        if (trackingRecord != null)
        {
            Tracking dotrackingRecord = TrackingForReferalToSpecialtyVoAssembler.extractTracking(factory, trackingRecord);
            dotrackingRecord.setBedAvailability(null);
            dotrackingRecord.setCurrentPartialAdmission(null);
            factory.save(dotrackingRecord);

            EDPartialAdmissionDialog dom = (EDPartialAdmissionDialog) getDomainImpl(EDPartialAdmissionDialogImpl.class);
            try
            {
                dom.triggerCancelPartialAdmission(trackingRecord.getAttendance(), edPartialAdmissionVo);
            }
            catch (DomainInterfaceException e)
            {
                e.printStackTrace();
            }
        }

        return EDPartialAdmissionVoAssembler.create(doEDPartialAdmission);
    }
    return null;
}