USE [LABORATORY] GO /****** Object: StoredProcedure [dbo].[Lab_GetUserLogin] Script Date: 11/20/2017 15:56:01 ******/ SET ANSI_NULLS OFF GO SET QUOTED_IDENTIFIER OFF GO /* Function: Restriction of some parts of the program in each area of laboratory e.g. a. Communication/Pending Requests from Nurses should only be viewed in Extraction Area b. Discharged Notice should only be cleared and notified in Charging Areas Date Modified: 11/07/2002 7:36 PM By: Joanna de la Rosa */ ALTER PROCEDURE [dbo].[Lab_GetUserLogin] @NTUserName varchar(30) As Declare @Reception varchar(1), @Charging varchar(1), @LabSectionId varchar(3), @AllowWalkIn bit If exists(Select NTUserName From tbLab_ExtractionLogin where NTUserName = ltrim(rtrim(@NTUserName))) Begin Select @LabSectionId = LabSectionId From tbLab_ExtractionLogin where NTUserName = ltrim(rtrim(@NTUserName)) If @LabSectionId = '00' --Administrator Begin Set @Charging = 'Y' Set @Reception = 'Y' End Else If @LabSectionId = 'E' --Extraction Area Begin Set @Reception = 'Y' Set @Charging = 'N' End Else If @LabSectionId = 'C' --LRA Begin Set @Charging = 'Y' Set @Reception = 'N' End Else If @LabSectionId = 'BBK'--Blood Bank Begin Set @Charging = 'Y' Set @Reception = 'B' End End Else Begin -- Set @Reception = 'N' -- Set @Charging = 'N' Set @Reception = 'Y' Set @Charging = 'Y' End Set @AllowWalkIn = Isnull((select Top 1 AllowWalkin from Laboratory..tblabsetup),0); Select @Reception as Reception, @Charging as Charging, @AllowWalkIn as AllowWalkIn