i2b2 LCBRU Customisations
1. Remove primary key from Observation Fact table in Data database
The primary key creates a unique constraint on Encounter_Num, Concept_Cd, Provider_Id, Start_Date & Modifier_Code. However, we have genuine data that is duplicated on these fields. For example, a repeat test on the same sample where the first was inconclusive.
The customisation has been applied to the following i2b2 instances:
To apply the customisation, run the following SQL in the i2b2 data database:
ALTER TABLE [dbo].[Observation_Fact] DROP CONSTRAINT [OBSERVATION_FACT_PK] GO
To roll back the customisation, run the following SQL in the i2b2 data database:
ALTER TABLE [dbo].[Observation_Fact] ADD CONSTRAINT [OBSERVATION_FACT_PK] PRIMARY KEY NONCLUSTERED ( [Encounter_Num] ASC, [Concept_Cd] ASC, [Provider_Id] ASC, [Start_Date] ASC, [Modifier_Cd] ASC ) GO
2. New versions of data load stored procedures
The procedures that come with i2b2 are broken, but are used by the i2b2 mapped importer. Ideally I will write the process into the mapped importer.
The procedures are named the same as the original i2b2 stored procedures, but with the suffix