USP_DATAFORMTEMPLATE_ADD_ITINERARYITEMDAILYADMISSION

The save procedure used by the add dataform template "Itinerary Item Daily Admission Add Form".

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier INOUT The output parameter indicating the ID of the record added.
@ITINERARYID uniqueidentifier IN Input parameter indicating the context ID for the record being added.
@CHANGEAGENTID uniqueidentifier IN Input parameter indicating the ID of the change agent invoking the procedure.
@PROGRAMID uniqueidentifier IN Program
@STARTDATE date IN Start date
@STARTTIME UDT_HOURMINUTE IN Start time
@ENDTIME UDT_HOURMINUTE IN End time
@NOTES nvarchar(500) IN Notes
@RESOURCES xml IN Supplies/Equipment resources
@IGNORECONFLICTS bit IN Ignore conflicts when saving
@STAFFRESOURCES xml IN Staffing resources

Definition

Copy


                CREATE procedure dbo.USP_DATAFORMTEMPLATE_ADD_ITINERARYITEMDAILYADMISSION
                (
                    @ID uniqueidentifier = null output,
                    @ITINERARYID uniqueidentifier,
                    @CHANGEAGENTID uniqueidentifier = null,
                    @PROGRAMID uniqueidentifier = null,
                    @STARTDATE date = null,
                    @STARTTIME dbo.UDT_HOURMINUTE = null,
                    @ENDTIME dbo.UDT_HOURMINUTE = null,
                    @NOTES nvarchar(500) = null,
                    @RESOURCES xml = null,
                    @IGNORECONFLICTS bit = null,
                    @STAFFRESOURCES xml = null
                )
                as

                set nocount on;

                if @ID is null
                    set @ID = newid()

                if @CHANGEAGENTID is null  
                    exec dbo.USP_CHANGEAGENT_GETORCREATECHANGEAGENT @CHANGEAGENTID output

                declare @CURRENTDATE datetime
                set @CURRENTDATE = getdate()

                begin try

                    exec dbo.USP_ITINERARYITEMDAILYADMISSION_ADD @ID, @CHANGEAGENTID, @CURRENTDATE, @ITINERARYID,
                        @PROGRAMID, @STARTDATE, @STARTTIME, @ENDTIME, @NOTES, @RESOURCES, @IGNORECONFLICTS, @STAFFRESOURCES;

                end try
                begin catch
                    exec dbo.USP_RAISE_ERROR
                    return 1
                end catch

                return 0