Summary Table
Categories |
Total Count |
PII |
0 |
URL |
0 |
DNS |
0 |
EKL |
0 |
IP |
0 |
PORT |
0 |
VsID |
0 |
CF |
0 |
AI |
0 |
VPD |
0 |
PL |
0 |
Other |
0 |
File Content
?CREATE TABLE dbo.DiagnosisCodes
(
--sources:
--A06.CDWWork.FBCS.hcfa
--A06.CDWWork.FBCS.ub92
--fields
DiagnosisCodeID int IDENTITY(1,1) NOT NULL, --EPRS assigned (PK)
DiagnosisCodeNumber varchar(50) NOT NULL, --this field will have to be made available via administrative form for SME backfilling
ICDIndicator tinyint, --icdindicator (from UB92)
FBCSDiagnosisCodeNumber varchar(50) NULL,
DiagnosisCodeName varchar (200) NULL, --this field will have to be made available via administrative form for SME backfilling
--primary key
CONSTRAINT PK_DiagnosisCodes PRIMARY KEY CLUSTERED
(
DiagnosisCodeID ASC
)
)
ON DefinitionData
--when using clustered columnstore index, can't set data compression to PAGE
WITH (DATA_COMPRESSION = PAGE)
GO
--foreign keys
--indexes
CREATE NONCLUSTERED INDEX IX_DiagnosisCodes_DiagnosisCodeNumber ON dbo.DiagnosisCodes
(
DiagnosisCodeNumber
) WITH (
PAD_INDEX = ON, --If want to use a Fill Factor, then PAD_INDEX must = ON
FILLFACTOR = 100, --100 = max fill; set to 90 if going to insert new values incrementally; 100 if doing bulk load
SORT_IN_TEMPDB = ON, -- sorts the index in the TempDB; default = OFF
IGNORE_DUP_KEY = OFF,
STATISTICS_NORECOMPUTE = OFF,
STATISTICS_INCREMENTAL = OFF,
DROP_EXISTING = OFF,
ONLINE = OFF,
ALLOW_ROW_LOCKS = ON,
ALLOW_PAGE_LOCKS = ON,
MAXDOP = 0, --degrees of parallelism, controls how many CPUs to use; 0 = default (all available), max = 64
DATA_COMPRESSION = PAGE --use page compression; default = NONE
)
ON DefinitionIndex
GO
CREATE NONCLUSTERED INDEX IX_DiagnosisCodes_FBCSDiagnosisCodeNumber ON dbo.DiagnosisCodes
(
FBCSDiagnosisCodeNumber
) WITH (
PAD_INDEX = ON, --If want to use a Fill Factor, then PAD_INDEX must = ON
FILLFACTOR = 100, --100 = max fill; set to 90 if going to insert new values incrementally; 100 if doing bulk load
SORT_IN_TEMPDB = ON, -- sorts the index in the TempDB; default = OFF
IGNORE_DUP_KEY = OFF,
STATISTICS_NORECOMPUTE = OFF,
STATISTICS_INCREMENTAL = OFF,
DROP_EXISTING = OFF,
ONLINE = OFF,
ALLOW_ROW_LOCKS = ON,
ALLOW_PAGE_LOCKS = ON,
MAXDOP = 0, --degrees of parallelism, controls how many CPUs to use; 0 = default (all available), max = 64
DATA_COMPRESSION = PAGE --use page compression; default = NONE
)
ON DefinitionIndex
GO
--constraints
--Metadata descriptions for each field
EXECUTE sp_addextendedproperty
N'MS_Description', N'Primary Key, unique to EPRS',
N'SCHEMA', N'dbo',
N'TABLE', N'DiagnosisCodes',
N'COLUMN', N'DiagnosisCodeID'
GO
EXECUTE sp_addextendedproperty
N'MS_Description', N'Official diagnosis code from gold standard authoritative source (or hand-entered by admin)',
N'SCHEMA', N'dbo',
N'TABLE', N'DiagnosisCodes',
N'COLUMN', N'DiagnosisCodeNumber'
GO
EXECUTE sp_addextendedproperty
N'MS_Description', N'Identifies if the diagnosis code is associated with ICD9 or ICD10 or not at all (NULL, 0, or 9)',
N'SCHEMA', N'dbo',
N'TABLE', N'DiagnosisCodes',
N'COLUMN', N'ICDIndicator'
GO
EXECUTE sp_addextendedproperty
N'MS_Description', N'FBCS diagnosis code (may or may not match what is the gold standard diagnosis code',
N'SCHEMA', N'dbo',
N'TABLE', N'DiagnosisCodes',
N'COLUMN', N'FBCSDiagnosisCodeNumber'
GO
EXECUTE sp_addextendedproperty
N'MS_Description', N'Name of diagnosis',
N'SCHEMA', N'dbo',
N'TABLE', N'DiagnosisCodes',
N'COLUMN', N'DiagnosisCodeName'
GO