-- =============================================
-- Author:		Jas Rademeyer
-- Create date: 2016-11-03
-- Description:	Gets Practice Extras for specified surfaceItemId
-- =============================================
CREATE PROC [dbo].[sp_GetPracticeExtrasForSurfaceItemId]
(	
	@surfaceItemId INT
)
AS
SELECT	M.recId,
		M.practiceExtra,
		M.isActive,
		P.surfaceItemId,
		P.isActive patientActive
FROM	pal_MedicalPracticeExtra M
		LEFT JOIN pal_MedicalPatientPracticeExtra P
			ON P.practiceExtraId = M.recId
			AND P.surfaceItemId = @surfaceItemId
