-- Tables

-- Alters

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] DROP COLUMN [Trisomy21]
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] DROP COLUMN [Trisomy18]
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] DROP COLUMN [Trisomy13]
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] DROP COLUMN [PreeclampsiaRisk]
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] DROP COLUMN [FetalGrowthRisk]
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] DROP COLUMN [PrematureBirthRisk]
GO


ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ADD [Trisomy21BaseFirst] int NULL
GO
UPDATE [AKUZ].[T_PRENATAL_SCREENING] SET [Trisomy21BaseFirst] = 0
GO
ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ALTER COLUMN [Trisomy21BaseFirst] int NOT NULL
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ADD [Trisomy18BaseFirst] int NULL
GO
UPDATE [AKUZ].[T_PRENATAL_SCREENING] SET [Trisomy18BaseFirst] = 0
GO
ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ALTER COLUMN [Trisomy18BaseFirst] int NOT NULL
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ADD [Trisomy13BaseFirst] int NULL
GO
UPDATE [AKUZ].[T_PRENATAL_SCREENING] SET [Trisomy13BaseFirst] = 0
GO
ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ALTER COLUMN [Trisomy13BaseFirst] int NOT NULL
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ADD [Trisomy21BaseSecond] int NULL
GO
UPDATE [AKUZ].[T_PRENATAL_SCREENING] SET [Trisomy21BaseSecond] = 0
GO
ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ALTER COLUMN [Trisomy21BaseSecond] int NOT NULL
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ADD [Trisomy18BaseSecond] int NULL
GO
UPDATE [AKUZ].[T_PRENATAL_SCREENING] SET [Trisomy18BaseSecond] = 0
GO
ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ALTER COLUMN [Trisomy18BaseSecond] int NOT NULL
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ADD [Trisomy13BaseSecond] int NULL
GO
UPDATE [AKUZ].[T_PRENATAL_SCREENING] SET [Trisomy13BaseSecond] = 0
GO
ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ALTER COLUMN [Trisomy13BaseSecond] int NOT NULL
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ADD [Trisomy21First] int NULL
GO
UPDATE [AKUZ].[T_PRENATAL_SCREENING] SET [Trisomy21First] = 0
GO
ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ALTER COLUMN [Trisomy21First] int NOT NULL
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ADD [Trisomy18First] int NULL
GO
UPDATE [AKUZ].[T_PRENATAL_SCREENING] SET [Trisomy18First] = 0
GO
ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ALTER COLUMN [Trisomy18First] int NOT NULL
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ADD [Trisomy13First] int NULL
GO
UPDATE [AKUZ].[T_PRENATAL_SCREENING] SET [Trisomy13First] = 0
GO
ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ALTER COLUMN [Trisomy13First] int NOT NULL
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ADD [PreeclampsiaRiskFirst] int NULL
GO
UPDATE [AKUZ].[T_PRENATAL_SCREENING] SET [PreeclampsiaRiskFirst] = 0
GO
ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ALTER COLUMN [PreeclampsiaRiskFirst] int NOT NULL
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ADD [FetalGrowthRiskFirst] int NULL
GO
UPDATE [AKUZ].[T_PRENATAL_SCREENING] SET [FetalGrowthRiskFirst] = 0
GO
ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ALTER COLUMN [FetalGrowthRiskFirst] int NOT NULL
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ADD [PrematureBirthRiskFirst] int NULL
GO
UPDATE [AKUZ].[T_PRENATAL_SCREENING] SET [PrematureBirthRiskFirst] = 0
GO
ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ALTER COLUMN [PrematureBirthRiskFirst] int NOT NULL
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ADD [Trisomy21Second] int NULL
GO
UPDATE [AKUZ].[T_PRENATAL_SCREENING] SET [Trisomy21Second] = 0
GO
ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ALTER COLUMN [Trisomy21Second] int NOT NULL
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ADD [Trisomy18Second] int NULL
GO
UPDATE [AKUZ].[T_PRENATAL_SCREENING] SET [Trisomy18Second] = 0
GO
ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ALTER COLUMN [Trisomy18Second] int NOT NULL
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ADD [Trisomy13Second] int NULL
GO
UPDATE [AKUZ].[T_PRENATAL_SCREENING] SET [Trisomy13Second] = 0
GO
ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ALTER COLUMN [Trisomy13Second] int NOT NULL
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ADD [PreeclampsiaRiskSecond] int NULL
GO
UPDATE [AKUZ].[T_PRENATAL_SCREENING] SET [PreeclampsiaRiskSecond] = 0
GO
ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ALTER COLUMN [PreeclampsiaRiskSecond] int NOT NULL
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ADD [FetalGrowthRiskSecond] int NULL
GO
UPDATE [AKUZ].[T_PRENATAL_SCREENING] SET [FetalGrowthRiskSecond] = 0
GO
ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ALTER COLUMN [FetalGrowthRiskSecond] int NOT NULL
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ADD [PrematureBirthRiskSecond] int NULL
GO
UPDATE [AKUZ].[T_PRENATAL_SCREENING] SET [PrematureBirthRiskSecond] = 0
GO
ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ALTER COLUMN [PrematureBirthRiskSecond] int NOT NULL
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ADD [Trisomy21EhrRus2glkfs0nqj] uniqueidentifier NULL
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ADD [Trisomy18EhrRus2glkfs0nqj] uniqueidentifier NULL
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ADD [Trisomy13EhrRus2glkfs0nqj] uniqueidentifier NULL
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ADD [PreeclampsiaRiskEhrRus2glkfs0nqj] uniqueidentifier NULL
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ADD [FetalGrowthRiskEhrRus2glkfs0nqj] uniqueidentifier NULL
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ADD [PrematureBirthRiskEhrRus2glkfs0nqj] uniqueidentifier NULL
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ADD [RecordDate] datetime NULL
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ADD [Users] uniqueidentifier NULL
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ADD CONSTRAINT [FK_T_EHR_RUS_2GLKFS0NQJ_T_PRENATAL_SCREENING_Trisomy21EhrRus2glkfs0nqj]
FOREIGN KEY([Trisomy21EhrRus2glkfs0nqj]) REFERENCES [EHR].[T_EHR_RUS_2GLKFS0NQJ] ([EhrRusID])
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ADD CONSTRAINT [FK_T_EHR_RUS_2GLKFS0NQJ_T_PRENATAL_SCREENING_Trisomy18EhrRus2glkfs0nqj]
FOREIGN KEY([Trisomy18EhrRus2glkfs0nqj]) REFERENCES [EHR].[T_EHR_RUS_2GLKFS0NQJ] ([EhrRusID])
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ADD CONSTRAINT [FK_T_EHR_RUS_2GLKFS0NQJ_T_PRENATAL_SCREENING_Trisomy13EhrRus2glkfs0nqj]
FOREIGN KEY([Trisomy13EhrRus2glkfs0nqj]) REFERENCES [EHR].[T_EHR_RUS_2GLKFS0NQJ] ([EhrRusID])
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ADD CONSTRAINT [FK_T_EHR_RUS_2GLKFS0NQJ_T_PRENATAL_SCREENING_PreeclampsiaRiskEhrRus2glkfs0nqj]
FOREIGN KEY([PreeclampsiaRiskEhrRus2glkfs0nqj]) REFERENCES [EHR].[T_EHR_RUS_2GLKFS0NQJ] ([EhrRusID])
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ADD CONSTRAINT [FK_T_EHR_RUS_2GLKFS0NQJ_T_PRENATAL_SCREENING_FetalGrowthRiskEhrRus2glkfs0nqj]
FOREIGN KEY([FetalGrowthRiskEhrRus2glkfs0nqj]) REFERENCES [EHR].[T_EHR_RUS_2GLKFS0NQJ] ([EhrRusID])
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ADD CONSTRAINT [FK_T_EHR_RUS_2GLKFS0NQJ_T_PRENATAL_SCREENING_PrematureBirthRiskEhrRus2glkfs0nqj]
FOREIGN KEY([PrematureBirthRiskEhrRus2glkfs0nqj]) REFERENCES [EHR].[T_EHR_RUS_2GLKFS0NQJ] ([EhrRusID])
GO

ALTER TABLE [AKUZ].[T_PRENATAL_SCREENING] ADD CONSTRAINT [FK_T_USERS_T_PRENATAL_SCREENING_Users]
FOREIGN KEY([Users]) REFERENCES [AKUZ].[T_USERS] ([UserID])
GO

