USP_DATALIST_RATESCALERESOURCE

Returns all supplies/equipment resources belonging to a rate scale.

Parameters

Parameter Parameter Type Mode Description
@CONTEXTID uniqueidentifier IN Input parameter indicating the context ID for the data list.

Definition

Copy


            CREATE procedure dbo.USP_DATALIST_RATESCALERESOURCE
            (
                @CONTEXTID uniqueidentifier
            )
            as
            begin
                set nocount on;

                declare @INCLUDEALLRESOURCES bit
                select
                    @INCLUDEALLRESOURCES = INCLUDEALLRESOURCES
                from dbo.RATESCALE
                where ID = @CONTEXTID

                if @INCLUDEALLRESOURCES = 1
                begin
                    select
                        null,
                        'All supply/equipment resources included' as NAME
                end
                else
                begin
                    select 
                        RESOURCE.ID,
                        RESOURCE.NAME
                    from dbo.RATESCALERESOURCE
                        inner join dbo.RESOURCE on RATESCALERESOURCE.RESOURCEID = RESOURCE.ID
                    where RATESCALEID = @CONTEXTID
                    order by RESOURCE.NAME
                end

            end