
IF NOT EXISTS (SELECT * FROM SYSCOLUMNS INNER JOIN SYSOBJECTS ON SYSOBJECTS.id = SYSCOLUMNS.id 
              WHERE SYSOBJECTS.name = 'HYBBYS')
			
CREATE TABLE [dbo].[HYBBYS](
	[HYBBYSID] [int] NOT NULL,
	[HDOSYAID] [int] NOT NULL,
	[HYATISID] [int] NOT NULL,
	[YBHESAPISLID] [int] NOT NULL,
	[ISLEMREFERANSNUMARASI] [int] NULL,
	[DEGERLENDIRMEREFERANSNUMARASI] [int] NULL,
	[HKANGRUBUID] [int] NULL,
	[TARIH] [datetime] NULL,	
	[YBGIRISZAMANI] [datetime] NULL,
	[YBCIKISZAMANI] [datetime] NULL,
	[HAVALIHASTAYATAKDURUMU] [bit] NULL,
	[DEKUBITULSERISKORSONUCU] [nvarchar](30) NULL,
	[DEKUBITULSERISKORLAMATURU] [int] NULL,
	[DRENBILGISI] [int] NULL,	
	[DUSMERISKI] [bit] NULL,
	[YBUNITEADI] [nvarchar](200) NULL,
	[YBUNITEID] [int] NULL,
	[ENFEKTEOLMADURUMBILGISI] [bit] NULL,
	[SEPSISDURUMU] [bit] NULL,
	[SEPTIKSOK] [bit] NULL,
	[AKIDURUMU] [bit] NULL,
	[VENTILASYONDURUMU] [bit] NULL,
	[VENTILATORILISKILIPNOMONIVARLIGI] [bit] NULL,
	[ASIDOZDURUMU] [bit] NULL,
	[ALKOLOZDURUMU] [bit] NULL,	
	[ARDSGELISMEDURUMU] [bit] NULL,
	[HEMODIYALIZIHTIYACI] [bit] NULL,
	[ECMOIHTIYACI] [bit] NULL,
	[YATAKBASIYARASIVARLIGI] [bit] NULL,
	[DRENVARLIGI] [bit] NULL,
	[ACTBALANSDEGERI] [nvarchar](70) NULL,
	[BESLENMEBILGISIID]  [int] NULL,
	[BESLENMEBILGISI] [nvarchar](70) NULL,
	[YBUNITESISEVIYESI] [int] NULL,
	[APACHESKORU] [int] NULL,
	[APACHEBEKLENENOLUMORANI] [numeric](18, 0) NULL,
	[APACHEBEKLENENOLUMORANIDUZELTILMIS] [numeric](18, 0) NULL,
	[APACHEOLCUMZAMANI] [datetime] NULL,	
	[GLASKOWGOZLER] [int] NULL,
	[GLASKOWSOZEL] [int] NULL,
	[GLASKOWMOTOR] [int] NULL,
	[SOFASKORU] [int] NULL,
	[SOFABEKLENENOLUMORANI] [numeric](18, 0) NULL,
	[SOFAOLCUMZAMANI] [datetime] NULL,	
	[SAPSIISKORU] [int] NULL,
	[SAPSIIBEKLENENOLUMORANI] [numeric](18, 0) NULL,
	[SAPSIIGENISLETILMIS] [numeric](18, 0) NULL,
	[SAPSIIOLCUMZAMANI] [datetime] NULL,
	[TIDALVOLUMDEGERI] [nvarchar](30) NULL,
	[FREKANSDEGERI] [nvarchar](30) NULL,
	[TEPEBASINCDEGERI] [nvarchar](30) NULL,
	[FIOIIDEGERI] [nvarchar](30) NULL,
	[PEEPDEGERI] [nvarchar](30) NULL,
	[VENTILATORMODU] [int] NULL,
	[SANTRALVENOZBASINC] [nvarchar](30) NULL,
	[IBPSISTOLIK] [nvarchar](30) NULL,
	[IBPDIASTOLIK] [nvarchar](30) NULL,
	[SPOIIDEGERI] [numeric](18, 0)  NULL,
	[NABIZ] [nvarchar](10) NULL,
	[SKB] [nvarchar](10) NULL,
	[DKB] [nvarchar](10) NULL,
	[VUCUTISISI] [nvarchar](30) NULL,
	[KANGAZIPH] [nvarchar](30) NULL,
	[KANGAZIPAOII] [nvarchar](30) NULL,
	[KANGAZIPACOII] [nvarchar](30) NULL,
	[KANGAZIHCOIII] [nvarchar](30) NULL,
	[KANGAZILAKTAT] [nvarchar](30) NULL,
	[KANGAZIGLUKOZ] [nvarchar](30) NULL,
	[KATATERBILGISI] [int] NULL,		
	[VENTILASYONYONTEMI] [int] NULL,	
	[VENTILASYONBASLANGICZAMANI] [datetime] NULL,	
	[VENTILASYONBITISZAMANI] [datetime] NULL,	
	[KAYITTARIHI] [datetime] NULL,
	[KYKULLANICI] [nvarchar](15) NULL,
	[SNOTAKIPNO] [nvarchar](40) NULL,
	[GONDERILDI] [bit] NULL
 CONSTRAINT [PK_HYBBYS] PRIMARY KEY CLUSTERED 
(
	[HYBBYSID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
