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.ProcedureCodes
(
--this table is populated with a hodge-podge of ICDs, CPTs, and who knows what else
--source:
--A06.CDWWork.FBCS.ub92
--prinproccode
--, otherproccodea
--, otherproccodeb
--, otherproccodec
--, otherproccoded
--, otherproccodee

--fields
ProcedureCodeID int IDENTITY(1,1) NOT NULL, --EPRS assigned (PK)
ProcedureCode varchar (50) NOT NULL, --various proc code fields
ProcedureCodeType varchar (20) NULL, --SME fill, ICD, CPT, etc.

--primary key
CONSTRAINT PK_ProcedureCodes PRIMARY KEY CLUSTERED
(
ProcedureCodeID ASC
)
)
ON DefinitionData
--when using clustered columnstore index, can't set data compression to PAGE
--WITH (DATA_COMPRESSION = PAGE) --less than 10,000 rows, don't need compression
GO

--foreign keys

--indexes

CREATE NONCLUSTERED INDEX IX_ProcedureCodes_ProcedureCode ON dbo.ProcedureCodes
(
ProcedureCode
) 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 = NONE --don't need, less than 10,000 rows
)
ON DefinitionIndex
GO

CREATE NONCLUSTERED INDEX IX_ProcedureCodes_ProcedureCodeType ON dbo.ProcedureCodes
(
ProcedureCodeType
) 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 = NONE --don't need, less than 10,000 rows
)
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'ProcedureCodes',
N'COLUMN', N'ProcedureCodeID'
GO

EXECUTE sp_addextendedproperty
N'MS_Description', N'Procedure code; source: prinproccode, otherproccodea, otherproccodeb, otherproccodec, otherproccoded, otherproccodee',
N'SCHEMA', N'dbo',
N'TABLE', N'ProcedureCodes',
N'COLUMN', N'ProcedureCode'
GO


EXECUTE sp_addextendedproperty
N'MS_Description', N'Custom field applied to assist with collating the procedure codes into types (ICD, CPT, etc.)',
N'SCHEMA', N'dbo',
N'TABLE', N'ProcedureCodes',
N'COLUMN', N'ProcedureCodeType'
GO