Details
Description
There is difference between what's documented in the CRC Design Document (p 42) and the actual DB constraints.
According to this document, the PK includes:
Encounter number
Patient number
Concept code
Start date
Modifier code
Observer code
However, in reality[1], it consists of:
ENCOUNTER_NUM,
CONCEPT_CD,
PROVIDER_ID,
START_DATE,
MODIFIER_CD,
INSTANCE_NUM
I think it would make sense to at least add the patient_num to the pk. This could be necessary when the encounter and provider are unknown and point to a default row in the dimension tables. I don't have a strong preference on how to deal with the remaining differences.
[1]:
NewInstall/Crcdata/scripts/crc_create_datamart_oracle.sql:140: CONSTRAINT OBSERVATION_FACT_PK PRIMARY KEY(ENCOUNTER_NUM,CONCEPT_CD,PROVIDER_ID,START_DATE,MODIFIER_CD,INSTANCE_NUM)
NewInstall/Crcdata/scripts/crc_create_datamart_sqlserver.sql:138: CONSTRAINT OBSERVATION_FACT_PK PRIMARY KEY nonclustered (ENCOUNTER_NUM, CONCEPT_CD, PROVIDER_ID, START_DATE, MODIFIER_CD, INSTANCE_NUM)
Upgrade/Crcdata/scripts/crc_create_datamart_oracle.sql:21:drop CONSTRAINT OBSERVATION_FACT_PK
Upgrade/Crcdata/scripts/crc_create_datamart_oracle.sql:29:add CONSTRAINT OBSERVATION_FACT_PK PRIMARY KEY (ENCOUNTER_NUM,CONCEPT_CD,PROVIDER_ID,START_DATE,MODIFIER_CD,INSTANCE_NUM)
Upgrade/Crcdata/scripts/crc_create_datamart_sqlserver.sql:41:drop CONSTRAINT OBSERVATION_FACT_PK
Upgrade/Crcdata/scripts/crc_create_datamart_sqlserver.sql:82:add CONSTRAINT OBSERVATION_FACT_PK PRIMARY KEY (ENCOUNTER_NUM,CONCEPT_CD,PROVIDER_ID,START_DATE,MODIFIER_CD,INSTANCE_NUM)
According to this document, the PK includes:
Encounter number
Patient number
Concept code
Start date
Modifier code
Observer code
However, in reality[1], it consists of:
ENCOUNTER_NUM,
CONCEPT_CD,
PROVIDER_ID,
START_DATE,
MODIFIER_CD,
INSTANCE_NUM
I think it would make sense to at least add the patient_num to the pk. This could be necessary when the encounter and provider are unknown and point to a default row in the dimension tables. I don't have a strong preference on how to deal with the remaining differences.
[1]:
NewInstall/Crcdata/scripts/crc_create_datamart_oracle.sql:140: CONSTRAINT OBSERVATION_FACT_PK PRIMARY KEY(ENCOUNTER_NUM,CONCEPT_CD,PROVIDER_ID,START_DATE,MODIFIER_CD,INSTANCE_NUM)
NewInstall/Crcdata/scripts/crc_create_datamart_sqlserver.sql:138: CONSTRAINT OBSERVATION_FACT_PK PRIMARY KEY nonclustered (ENCOUNTER_NUM, CONCEPT_CD, PROVIDER_ID, START_DATE, MODIFIER_CD, INSTANCE_NUM)
Upgrade/Crcdata/scripts/crc_create_datamart_oracle.sql:21:drop CONSTRAINT OBSERVATION_FACT_PK
Upgrade/Crcdata/scripts/crc_create_datamart_oracle.sql:29:add CONSTRAINT OBSERVATION_FACT_PK PRIMARY KEY (ENCOUNTER_NUM,CONCEPT_CD,PROVIDER_ID,START_DATE,MODIFIER_CD,INSTANCE_NUM)
Upgrade/Crcdata/scripts/crc_create_datamart_sqlserver.sql:41:drop CONSTRAINT OBSERVATION_FACT_PK
Upgrade/Crcdata/scripts/crc_create_datamart_sqlserver.sql:82:add CONSTRAINT OBSERVATION_FACT_PK PRIMARY KEY (ENCOUNTER_NUM,CONCEPT_CD,PROVIDER_ID,START_DATE,MODIFIER_CD,INSTANCE_NUM)
Attachments
Activity
Field | Original Value | New Value |
---|---|---|
Fix Version/s | 1.7.00 [ 10081 ] | |
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Resolved [ 5 ] |
Status | Resolved [ 5 ] | Closed [ 6 ] |
Workflow | classic default workflow [ 10219 ] | i2b2 Issues [ 10417 ] |
Component/s | Data [ 10024 ] | |
Component/s | Documentation [ 10010 ] |
Assignee | Mike Mendis [ mem61 ] | Janice Donahoe [ jmd86 ] |
SVN Revision Number | CRC-2623 |
Workflow | i2b2 Issues [ 10417 ] | i2b2 Issues Workflow [ 10591 ] |
Component/s | CRC Cell [ 10049 ] | |
Component/s | Data [ 10050 ] | |
Component/s | CRC Cell [ 10000 ] | |
Component/s | Data [ 10024 ] | |
Fix Version/s | 1.7.00 [ 10153 ] | |
Fix Version/s | 1.7.00 [ 10081 ] | |
Key |
|
|
Project | i2b2 [ 10000 ] | i2b2 Core Project [ 10034 ] |
Affects Version/s | 1.6.08 [ 10149 ] | |
Affects Version/s | 1.6.08 [ 10074 ] |