-- Tables

-- Alters

ALTER TABLE [AKUZ].[T_MEDICAL_EPISODE] ADD [Mes] uniqueidentifier NULL
GO

ALTER TABLE [AKUZ].[T_MEDICAL_EPISODE] ADD [Mes2] uniqueidentifier NULL
GO

ALTER TABLE [AKUZ].[T_MEDICAL_EPISODE] ADD [Mes_Rec_Id] int NULL
GO

ALTER TABLE [AKUZ].[T_MEDICAL_EPISODE] ADD [OnkoSuspicion] bit NOT NULL CONSTRAINT [df_OnkoSuspicion] DEFAULT 0 WITH VALUES
GO
ALTER TABLE [AKUZ].[T_MEDICAL_EPISODE] DROP CONSTRAINT [df_OnkoSuspicion]
GO



ALTER TABLE [AKUZ].[T_MEDICAL_EPISODE] ADD CONSTRAINT [FK_T_MES_T_MEDICAL_EPISODE_Mes]
FOREIGN KEY([Mes]) REFERENCES [AKUZ].[T_MES] ([MesID])
GO

ALTER TABLE [AKUZ].[T_MEDICAL_EPISODE] ADD CONSTRAINT [FK_T_MES_T_MEDICAL_EPISODE_Mes2]
FOREIGN KEY([Mes2]) REFERENCES [AKUZ].[T_MES] ([MesID])
GO



ALTER TABLE [AKUZ].[T_ONK_TREATMENT_CASE] ADD [MedicalEpisode] uniqueidentifier NULL
GO

ALTER TABLE [AKUZ].[T_ONK_TREATMENT_CASE] ADD CONSTRAINT [FK_T_MEDICAL_EPISODE_T_ONK_TREATMENT_CASE_MedicalEpisode]
FOREIGN KEY([MedicalEpisode]) REFERENCES [AKUZ].[T_MEDICAL_EPISODE] ([MedicalEpisodeID])
GO




ALTER TABLE [AKUZ].[T_MOVEMENT_RESULT_LEK_PREP_LINK] ADD [MedicalEpisode] uniqueidentifier NULL
GO

ALTER TABLE [AKUZ].[T_MOVEMENT_RESULT_LEK_PREP_LINK] ADD CONSTRAINT [FK_T_MEDICAL_EPISODE_T_MOVEMENT_RESULT_LEK_PREP_LINK_MedicalEpisode]
FOREIGN KEY([MedicalEpisode]) REFERENCES [AKUZ].[T_MEDICAL_EPISODE] ([MedicalEpisodeID])
GO

ALTER TABLE [AKUZ].[T_MOVEMENT_RESULT_LEK_PREP_LINK] ALTER COLUMN [OutcomeOfInspection] uniqueidentifier NULL