IF NOT EXISTS(
    SELECT * FROM sys.columns 
    WHERE Name      = N'patientType'
      AND Object_ID = Object_ID(N'pal_MedicalCondition'))
BEGIN
    ALTER TABLE pal_MedicalCondition
	ADD patientType INT NULL; 
END

IF NOT EXISTS(
    SELECT * FROM sys.columns 
    WHERE Name      = N'traumaticEvents'
      AND Object_ID = Object_ID(N'pal_MedicalPatientSymptom'))
BEGIN
    ALTER TABLE pal_MedicalPatientSymptom
	ADD traumaticEvents VARCHAR(500) NULL; 
END

IF NOT EXISTS(
    SELECT * FROM sys.columns 
    WHERE Name      = N'patientType'
      AND Object_ID = Object_ID(N'pal_MedicalSymptom'))
BEGIN
    ALTER TABLE pal_MedicalSymptom
	ADD patientType INT NULL; 
END

IF EXISTS(
    SELECT * FROM sys.columns 
    WHERE Name      = N'symptomType'
      AND Object_ID = Object_ID(N'pal_MedicalSymptom'))
BEGIN
    ALTER TABLE pal_MedicalSymptom
	DROP COLUMN symptomType; 
END

IF NOT EXISTS(
    SELECT * FROM sys.columns 
    WHERE Name      = N'hasBottomBorder'
      AND Object_ID = Object_ID(N'pal_SurfaceField'))
BEGIN
    ALTER TABLE pal_SurfaceField
	ADD hasBottomBorder BIT NULL; 
END

IF NOT EXISTS(
    SELECT * FROM sys.columns 
    WHERE Name      = N'hasFullBorder'
      AND Object_ID = Object_ID(N'pal_SurfaceField'))
BEGIN
    ALTER TABLE pal_SurfaceField
	ADD hasFullBorder BIT NULL; 
END

IF NOT EXISTS(
    SELECT * FROM sys.columns 
    WHERE Name      = N'userDisplay'
      AND Object_ID = Object_ID(N'pal_MedicalPatientComplaints'))
BEGIN
    ALTER TABLE pal_MedicalPatientComplaints
	ADD userDisplay AS dbo.GetUserDisplay(updatedBy); 
END



