
INSERT INTO pal_Module
(module,sequence,path,control,isActive,isCanvas,isPicklist,objectName,displayField,valueField,isCalendar,isSurfaceField)
VALUES
('Medical Symptoms',29,'Medical_Symptoms.aspx','medical/symptoms.ascx',1,1,0,NULL,NULL,NULL,NULL,NULL),
('Medical Conditions',30,'Medical_Conditions.aspx','medical/conditions.ascx',1,1,0,NULL,NULL,NULL,NULL,NULL),
('BodyMap',31,NULL,NULL,1,0,0,NULL,NULL,NULL,NULL,1),
('Health History',30,NULL,NULL,1,0,0,NULL,NULL,NULL,NULL,1)



IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES 
           WHERE TABLE_NAME = N'pal_MedicalCondition')
BEGIN
CREATE TABLE [dbo].[pal_MedicalCondition] (
    [recId]         INT           IDENTITY (1, 1) NOT NULL,
    [conditionType] INT           NULL,
    [condition]     VARCHAR (200) NULL,
    [isActive]      BIT           NULL,
    [sequence]      INT           NULL,
    CONSTRAINT [PK_pal_MedicalCondition] PRIMARY KEY CLUSTERED ([recId] ASC)
);
END
IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES 
           WHERE TABLE_NAME = N'pal_MedicalConditionType')
BEGIN
CREATE TABLE [dbo].[pal_MedicalConditionType] (
    [recId]         INT          IDENTITY (1, 1) NOT NULL,
    [conditionType] VARCHAR (50) NULL,
    CONSTRAINT [PK_pal_MedicalHistoryType] PRIMARY KEY CLUSTERED ([recId] ASC)
);
END
IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES 
           WHERE TABLE_NAME = N'pal_MedicalPatientHistory')
BEGIN
CREATE TABLE [dbo].[pal_MedicalPatientHistory] (
    [recId]                 INT           IDENTITY (1, 1) NOT NULL,
    [patientId]             INT           NULL,
    [specifiedConditions]   VARCHAR (500) NULL,
    [seriousConditions]     VARCHAR (500) NULL,
    [familyConditions]      VARCHAR (500) NULL,
    [familyTreated]         VARCHAR (500) NULL,
    [hereditaryConditions]  VARCHAR (500) NULL,
    [pastCurrentConditions] VARCHAR (500) NULL,
    [socialConditions]      VARCHAR (500) NULL,
    CONSTRAINT [PK_pal_MedicalPatientHistory] PRIMARY KEY CLUSTERED ([recId] ASC)
);
END
IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES 
           WHERE TABLE_NAME = N'pal_MedicalSymptom')
BEGIN
CREATE TABLE [dbo].[pal_MedicalSymptom] (
    [recId]       INT           IDENTITY (1, 1) NOT NULL,
    [symptomType] INT           NULL,
    [symptom]     VARCHAR (200) NULL,
    [isActive]    BIT           NULL,
    CONSTRAINT [PK_pal_MedicalSymptoms] PRIMARY KEY CLUSTERED ([recId] ASC)
);
END
IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES 
           WHERE TABLE_NAME = N'pal_MedicalSymptomType')
BEGIN
CREATE TABLE [dbo].[pal_MedicalSymptomType] (
    [recId]       INT          IDENTITY (1, 1) NOT NULL,
    [symptomType] VARCHAR (50) NULL,
    CONSTRAINT [PK_pal_MedicalSymptomType] PRIMARY KEY CLUSTERED ([recId] ASC)
);
END

TRUNCATE TABLE pal_MedicalSymptomType
DBCC CHECKIDENT (pal_MedicalSymptomType, reseed, 1)
TRUNCATE TABLE pal_MedicalSymptom
DBCC CHECKIDENT (pal_MedicalSymptom, reseed, 1)

INSERT INTO pal_MedicalSymptomType
(symptomType)
VALUES
('Adult'),
('Paediatric')

INSERT INTO pal_MedicalSymptom
(symptomType,symptom,isActive)
VALUES
(1,'ADD / ADHD'								 ,1),
(1,'Allergies'								 ,1),
(1,'Asthma'									 ,1),
(1,'Back Curvature'							 ,1),
(1,'Back Pain (Lower)'						 ,1),
(1,'Back Pain (Middle)'						 ,1),
(1,'Back Pain (Upper)'						 ,1),
(1,'Bed Wetting'							 ,1),
(1,'Blood Pressure (High)'					 ,1),
(1,'Blood Pressure (Low)'					 ,1),
(1,'Blurred Vision'							 ,1),
(1,'Chest Pain'								 ,1),
(1,'Colon Trouble'							 ,1),
(1,'Convulsions / Epilepsy'					 ,1),
(1,'Depression'								 ,1),
(1,'Diarrhea / Constipation'				 ,1),
(1,'Difficulty Breathing'					 ,1),
(1,'Digestive Problems'						 ,1),
(1,'Dizziness'								 ,1),
(1,'Double Vision'							 ,1),
(1,'Eating Disorder'						 ,1),
(1,'Fainting'								 ,1),
(1,'Foot or Knee Problems'					 ,1),
(1,'Frequent Colds / Flu'					 ,1),
(1,'Gall Bladder Trouble'					 ,1),
(1,'Headache'								 ,1),
(1,'Hearing Loss'							 ,1),
(1,'Heart Problems'							 ,1),
(1,'Heartburn'								 ,1),
(1,'Hepatitis (A,B,C)'						 ,1),
(1,'Hip Pain'								 ,1),
(1,'Impotence / Sexual Dysfunction'			 ,1),
(1,'Irritable'								 ,1),
(1,'Jaw Pain / TMJ'							 ,1),
(1,'Kidney Trouble'							 ,1),
(1,'Learning Disability'					 ,1),
(1,'Liver Trouble'							 ,1),
(1,'Loss of Balance'						 ,1),
(1,'Lung Problems'							 ,1),
(1,'Menopausal Problems'					 ,1),
(1,'Menstrual Problem'						 ,1),
(1,'Mood Changes'							 ,1),
(1,'Neck Pain'								 ,1),
(1,'Numbness / Tingling (Arms/Hands/Fingers)',1),
(1,'Numbness / Tingling (Legs/Feet/Toes)'	 ,1),
(1,'Pain when Cough / Sneeze'				 ,1),
(1,'Pregnant'								 ,1),
(1,'Premenstrual Syndrome (PMS)'			 ,1),
(1,'Prostate Problems'						 ,1),
(1,'Ringing in Ears'						 ,1),
(1,'Scoliosis'								 ,1),
(1,'Shoulder Pain'							 ,1),
(1,'Sinus / Drainage Problem'				 ,1),
(1,'Skin Problems'							 ,1),
(1,'Swollen / Painful Joints'				 ,1),
(1,'Tremors'								 ,1),
(1,'Trouble Sleeping / Insomnia'			 ,1),
(1,'Ulcers'									 ,1),
(2,'Allergies'			,1),
(2,'Anemia'				,1),
(2,'Arm Problems'		,1),
(2,'Asthma'				,1),
(2,'Backaches'			,1),
(2,'Bed Wetting'		,1),
(2,'Behavioral Problems',1),
(2,'Chronic Earaches'	,1),
(2,'Colds / Flu'		,1),
(2,'Colic'				,1),
(2,'Constipation'		,1),
(2,'Diarrhea'			,1),
(2,'Digestive Disorders',1),
(2,'Dizziness'			,1),
(2,'Fainting'			,1),
(2,'Growing Pains'		,1),
(2,'Headaches'			,1),
(2,'Heart Trouble'		,1),
(2,'Hypertension'		,1),
(2,'Joint Problems'		,1),
(2,'Muscle Pain'		,1),
(2,'Neck Problems'		,1),
(2,'Orthopedic Problems',1),
(2,'Poor Appetite'		,1),
(2,'Poor Posture'		,1),
(2,'Scoliosis'			,1),
(2,'Sinus Trouble'		,1),
(2,'Sleeping Problems'	,1),
(2,'Walking Trouble'	,1)

TRUNCATE TABLE pal_MedicalConditionType
DBCC CHECKIDENT (pal_MedicalConditionType, reseed, 1)
TRUNCATE TABLE pal_MedicalCondition
DBCC CHECKIDENT (pal_MedicalCondition, reseed, 1)

INSERT INTO pal_MedicalConditionType
(conditionType)
VALUES
('Health / Specified Conditions'),
('Past / Current Conditions'),
('Social Activities')

SET IDENTITY_INSERT [dbo].[pal_MedicalCondition] ON 
INSERT [dbo].[pal_MedicalCondition] ([recId], [conditionType], [condition], [isActive], [sequence]) VALUES (1, 1, N'Broken Bone', 1, 1)
INSERT [dbo].[pal_MedicalCondition] ([recId], [conditionType], [condition], [isActive], [sequence]) VALUES (2, 1, N'Cancer', 1, 1)
INSERT [dbo].[pal_MedicalCondition] ([recId], [conditionType], [condition], [isActive], [sequence]) VALUES (3, 1, N'Cerebral Vascular', 1, 1)
INSERT [dbo].[pal_MedicalCondition] ([recId], [conditionType], [condition], [isActive], [sequence]) VALUES (4, 1, N'Diabetes', 1, 1)
INSERT [dbo].[pal_MedicalCondition] ([recId], [conditionType], [condition], [isActive], [sequence]) VALUES (5, 1, N'Disability', 1, 1)
INSERT [dbo].[pal_MedicalCondition] ([recId], [conditionType], [condition], [isActive], [sequence]) VALUES (6, 1, N'Dislocations', 1, 1)
INSERT [dbo].[pal_MedicalCondition] ([recId], [conditionType], [condition], [isActive], [sequence]) VALUES (7, 1, N'Heart Attack', 1, 1)
INSERT [dbo].[pal_MedicalCondition] ([recId], [conditionType], [condition], [isActive], [sequence]) VALUES (8, 1, N'HIV/AIDS', 1, 1)
INSERT [dbo].[pal_MedicalCondition] ([recId], [conditionType], [condition], [isActive], [sequence]) VALUES (9, 1, N'Osteo Arthritis', 1, 1)
INSERT [dbo].[pal_MedicalCondition] ([recId], [conditionType], [condition], [isActive], [sequence]) VALUES (10, 1, N'Rheumatoid Arthritis', 1, 1)
INSERT [dbo].[pal_MedicalCondition] ([recId], [conditionType], [condition], [isActive], [sequence]) VALUES (11, 1, N'Tumors', 1, 1)
INSERT [dbo].[pal_MedicalCondition] ([recId], [conditionType], [condition], [isActive], [sequence]) VALUES (12, 2, N'Injuries', 1, 1)
INSERT [dbo].[pal_MedicalCondition] ([recId], [conditionType], [condition], [isActive], [sequence]) VALUES (13, 2, N'Surgeries', 1, 2)
INSERT [dbo].[pal_MedicalCondition] ([recId], [conditionType], [condition], [isActive], [sequence]) VALUES (14, 2, N'Childhood Diseases', 1, 3)
INSERT [dbo].[pal_MedicalCondition] ([recId], [conditionType], [condition], [isActive], [sequence]) VALUES (15, 2, N'Adult Diseases', 1, 4)
INSERT [dbo].[pal_MedicalCondition] ([recId], [conditionType], [condition], [isActive], [sequence]) VALUES (16, 3, N'Smoking', 1, 1)
INSERT [dbo].[pal_MedicalCondition] ([recId], [conditionType], [condition], [isActive], [sequence]) VALUES (17, 3, N'Alcohol Consumption', 1, 2)
INSERT [dbo].[pal_MedicalCondition] ([recId], [conditionType], [condition], [isActive], [sequence]) VALUES (18, 3, N'Recreational Drug Use', 1, 3)
SET IDENTITY_INSERT [dbo].[pal_MedicalCondition] OFF


