IF NOT EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
               WHERE SYSCOLUMNS.NAME = 'ACILIYETDURUMU' AND SYSOBJECTS.name = 'HKANBILESENIISTEM')
ALTER TABLE dbo.HKANBILESENIISTEM ADD ACILIYETDURUMU integer NULL
GO

IF NOT EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
               WHERE SYSCOLUMNS.NAME = 'BILINENKANGRUBU' AND SYSOBJECTS.name = 'HKANBILESENIISTEM')
ALTER TABLE dbo.HKANBILESENIISTEM ADD BILINENKANGRUBU integer NULL
GO

IF NOT EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
               WHERE SYSCOLUMNS.NAME = 'HASTANEKAYDI' AND SYSOBJECTS.name = 'HKANBILESENIISTEM')
ALTER TABLE dbo.HKANBILESENIISTEM ADD HASTANEKAYDI integer NULL
GO

IF NOT EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
               WHERE SYSCOLUMNS.NAME = 'USTGRUPADI' AND SYSOBJECTS.name = 'TKANTRANSFUZYONENDIKASYON')
ALTER TABLE dbo.TKANTRANSFUZYONENDIKASYON ADD
	USTGRUPADI nvarchar(100) null
GO
UPDATE TKANTRANSFUZYONENDIKASYON SET USTGRUPADI='ERİTROSİT KONSANTRESİ (E)'   WHERE USTKODU='E'
GO
UPDATE TKANTRANSFUZYONENDIKASYON SET USTGRUPADI='TAZE DONMUŞ PLAZMA (P)'   WHERE USTKODU='P'
GO
UPDATE TKANTRANSFUZYONENDIKASYON SET USTGRUPADI='KRİYOPRESİPİTAT (K)'   WHERE USTKODU='K'
GO
UPDATE TKANTRANSFUZYONENDIKASYON SET USTGRUPADI='TAM KAN (TK)'   WHERE USTKODU='TK'
GO
UPDATE TKANTRANSFUZYONENDIKASYON SET USTGRUPADI='TROMBOSİT KONSANTRESİ (T)'   WHERE USTKODU IN ('T','T1','T2','T3','T4','T5','T6','T7')
GO
UPDATE TKANTRANSFUZYONENDIKASYON SET USTGRUPADI='GRANÜLOSİT KONSANTRESİ (G)'   WHERE USTKODU='G'
GO
UPDATE HKANBILESENIISTEM SET ACILCROSSMATCHISLEMI=6 WHERE HBSAG_ANTIHCV_ANTIHIV_VDRL_ISLEMI=0
GO
UPDATE HKANBILESENIISTEM SET ACILCROSSMATCHISLEMI=7 WHERE HBSAG_ANTIHCV_ANTIHIV_VDRL_ISLEMI=1
GO
