IF  NOT EXISTS (SELECT * FROM sys.objects 
WHERE object_id = OBJECT_ID(N'[dbo].[pal_MedicalPatientType]') AND type in (N'U'))
BEGIN
	CREATE TABLE [dbo].[pal_MedicalPatientType](
		[recId] [int] IDENTITY(1,1) NOT NULL,
		[patientType] [varchar](50) NULL,
	 CONSTRAINT [PK_pal_MedicalPatientType] PRIMARY KEY CLUSTERED 
	(
		[recId] ASC
	)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
	) ON [PRIMARY]
END

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'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