USE [PATIENT_DATA] GO Create FUNCTION [fn_WithCompleteVitalSigns] (@Idnum as varchar(15)) RETURNS Varchar(1) AS BEGIN Declare @Complete as varchar(1) Set @Complete = '' select @Complete = Case When a.Height = '' then '0' When a.Weight = '' then '0' When a.Temperature = '' then '0' When a.BloodPressure = '' then '0' When c.bloodtype = '' then '0' When a.PulseRate = '' then '0' Else '1' End From Patient_Data..tbOutPatientHistory a Left Join PATIENT_DATA..tboutpatient b on a.idnum = b.idnum Left Join PATIENT_DATA..tbMaster c on b.HospNum = c.HospNum Where a.IDNUm = @Idnum; RETURN(@Complete) END GO