
CREATE TABLE [dbo].[HTIBBIMALZEMERECETE](
	[HTIBBIMALZEMERECETEID] [int] NOT NULL,
	[HMUAYENEID] [int] NOT NULL,
	[HRECTARIH] [smalldatetime] NULL,
	[DRID] [int] NULL,
	[DURUM] [int] NULL,
	[RECETETURID] [int] NOT NULL,
	[SERINO] [nvarchar](20) NULL,
	[MdlRAltTuruID] [int] NULL,
	[MdlEreceteNo] [nvarchar](15) NULL,
	[HDOSYAID] [int] NULL,
	[SNEreceteKodu] [int] NULL,
	[MdlOnay] [bit] NOT NULL,
	[ReceteOnayTuruNo] [int] NULL,
	[ONAYTRH] [datetime] NULL,
	[ERECETEIMZALI] [bit] NULL,
	[KYTTARIH] [datetime] NULL,
	[RAPORID] [int] NULL,
	[ACIKLAMATURUID] [int] NULL,
	[ACIKLAMA] [nvarchar](500) NULL,
 CONSTRAINT [PK_HRECETEMALZEME] PRIMARY KEY CLUSTERED 
(
	[HTIBBIMALZEMERECETEID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[HTIBBIMALZEMERECETE] ADD  CONSTRAINT [DF_HRECETEMALZEME_DURUMU]  DEFAULT ((0)) FOR [DURUM]
GO

ALTER TABLE [dbo].[HTIBBIMALZEMERECETE] ADD  CONSTRAINT [DF_HRECETEMALZEME_RECETETURID]  DEFAULT ((1)) FOR [RECETETURID]
GO

ALTER TABLE [dbo].[HTIBBIMALZEMERECETE] ADD  CONSTRAINT [DF_HRECETEMALZEME_MdlOnay]  DEFAULT ((0)) FOR [MdlOnay]
GO

ALTER TABLE [dbo].[HTIBBIMALZEMERECETE]  WITH CHECK ADD  CONSTRAINT [FK_HTIBBIMALZEMERECETE_HMUAYENE] FOREIGN KEY([HMUAYENEID])
REFERENCES [dbo].[HMUAYENE] ([HMUAYENEID])
GO

ALTER TABLE [dbo].[HTIBBIMALZEMERECETE] CHECK CONSTRAINT [FK_HTIBBIMALZEMERECETE_HMUAYENE]
GO


