wsd_djy/Docs/CFK.sql
2019-02-28 10:03:26 +08:00

149 lines
7.4 KiB
Transact-SQL

USE [Ehis]
GO
/****** Object: Table [dbo].[MZYSZ_CFK] Script Date: 02/25/2019 13:20:01 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[MZYSZ_CFK](
[CFxh] [varchar](36) NOT NULL,
[brkh] [char](30) NOT NULL,
[brsfz] [varchar](18) NULL,
[brzlh] [varchar](36) NOT NULL,
[brmzh] [char](16) NULL,
[brxm] [char](16) NOT NULL,
[brxb] [char](2) NOT NULL,
[brnl] [int] NOT NULL,
[brlx] [int] NOT NULL,
[cflx] [smallint] NOT NULL,
[cfysdm] [int] NOT NULL,
[cfrq] [datetime] NULL,
[cfysksdm] [int] NOT NULL,
[cfzxksdm] [int] NOT NULL,
[cfje] [money] NOT NULL,
[ckbh] [int] NOT NULL,
[Tfsj] [datetime] NULL,
[Tfczy] [int] NULL,
[cfyxq] [datetime] NOT NULL,
[Jbxxbh] [int] NULL,
[mzcflx] [int] NOT NULL,
[jlzt] [smallint] NOT NULL,
[othersysbrid] [varchar](36) NOT NULL,
[othersyszlid] [varchar](36) NOT NULL,
[othersyscfid] [varchar](36) NOT NULL,
[bybz] [int] NOT NULL,
[bzdm] [char](12) NOT NULL,
[Blxh] [int] NOT NULL,
[yscf_cfh] [varchar](50) NULL,
[yscf_jgdm] [varchar](50) NULL,
[kfsqdbz] [int] NULL,
[ccfbz] [varchar](2) NULL,
CONSTRAINT [PK_MZYSZ_CFK] PRIMARY KEY CLUSTERED
(
[CFxh] 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
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'CFxh(处方序号)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MZYSZ_CFK', @level2type=N'COLUMN',@level2name=N'CFxh'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'brkh(病人卡号)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MZYSZ_CFK', @level2type=N'COLUMN',@level2name=N'brkh'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'brsfz(病人身份证)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MZYSZ_CFK', @level2type=N'COLUMN',@level2name=N'brsfz'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'brzlh(病人治疗号)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MZYSZ_CFK', @level2type=N'COLUMN',@level2name=N'brzlh'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'brmzh(病人门诊号)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MZYSZ_CFK', @level2type=N'COLUMN',@level2name=N'brmzh'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'brxm(病人姓名)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MZYSZ_CFK', @level2type=N'COLUMN',@level2name=N'brxm'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'brxb(病人性别)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MZYSZ_CFK', @level2type=N'COLUMN',@level2name=N'brxb'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'brnl(病人年龄)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MZYSZ_CFK', @level2type=N'COLUMN',@level2name=N'brnl'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'brlx(病人类型)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MZYSZ_CFK', @level2type=N'COLUMN',@level2name=N'brlx'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'cflx(处方类型)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MZYSZ_CFK', @level2type=N'COLUMN',@level2name=N'cflx'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'cfysdm(处方医生代码)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MZYSZ_CFK', @level2type=N'COLUMN',@level2name=N'cfysdm'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'cfrq(处方日期)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MZYSZ_CFK', @level2type=N'COLUMN',@level2name=N'cfrq'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'cfysksdm(处方医生科室代码)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MZYSZ_CFK', @level2type=N'COLUMN',@level2name=N'cfysksdm'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'cfzxksdm(处方执行科室代码)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MZYSZ_CFK', @level2type=N'COLUMN',@level2name=N'cfzxksdm'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'cfje(处方金额)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MZYSZ_CFK', @level2type=N'COLUMN',@level2name=N'cfje'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ckbh(诊间编号)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MZYSZ_CFK', @level2type=N'COLUMN',@level2name=N'ckbh'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Tfsj(退方时间)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MZYSZ_CFK', @level2type=N'COLUMN',@level2name=N'Tfsj'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Tfczy(退方操作员)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MZYSZ_CFK', @level2type=N'COLUMN',@level2name=N'Tfczy'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'cfyxq(处方有效期)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MZYSZ_CFK', @level2type=N'COLUMN',@level2name=N'cfyxq'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Jbxxbh(基本信息编号)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MZYSZ_CFK', @level2type=N'COLUMN',@level2name=N'Jbxxbh'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'mzcflx(门诊处方类型)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MZYSZ_CFK', @level2type=N'COLUMN',@level2name=N'mzcflx'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'jlzt(记录状态)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MZYSZ_CFK', @level2type=N'COLUMN',@level2name=N'jlzt'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'othersysbrid(其他系统病人唯一号)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MZYSZ_CFK', @level2type=N'COLUMN',@level2name=N'othersysbrid'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'othersyszlid(其他系统挂号唯一号)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MZYSZ_CFK', @level2type=N'COLUMN',@level2name=N'othersyszlid'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'othersyscfid(其他系统处方唯一号)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MZYSZ_CFK', @level2type=N'COLUMN',@level2name=N'othersyscfid'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'MZYSZ_CFK(处方库)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'MZYSZ_CFK'
GO
ALTER TABLE [dbo].[MZYSZ_CFK] ADD DEFAULT ((0)) FOR [mzcflx]
GO
ALTER TABLE [dbo].[MZYSZ_CFK] ADD DEFAULT ((0)) FOR [bybz]
GO
ALTER TABLE [dbo].[MZYSZ_CFK] ADD DEFAULT ('01') FOR [bzdm]
GO
ALTER TABLE [dbo].[MZYSZ_CFK] ADD DEFAULT ((0)) FOR [Blxh]
GO