CEDStandards/CEDS-IDS

Bug in the Populate-CEDS-Ref-Tables.sql Script for 8.0

Closed this issue · 1 comments

Describe the bug
There's a bug in the populate reference table script for RefPersonIdentificationSystem and RefOrganizationIdentificationSystem

The 'IF NOT EXISTS' clause for populating values doesn't differentiate by RefPersonIdentifierTypeId which leads to some values not being populated.

For example:
Once
IF NOT EXISTS (SELECT 1 FROM dbo.[RefPersonIdentificationSystem] WHERE [Code] = 'SSN') BEGIN INSERT INTO dbo.[RefPersonIdentificationSystem]([Code], [Description], [Definition], [SortOrder], [RefPersonIdentifierTypeId])
VALUES ('SSN', 'Social Security Administration number', 'The related Child Identifier uses the child''s Social Security Administration number.', 7.00, 1) END

Runs

The following line does not populate because the IF NOT EXISTS clause fails
IF NOT EXISTS (SELECT 1 FROM dbo.[RefPersonIdentificationSystem] WHERE [Code] = 'SSN') BEGIN INSERT INTO dbo.[RefPersonIdentificationSystem]([Code], [Description], [Definition], [SortOrder], [RefPersonIdentifierTypeId])
VALUES ('SSN', 'Social Security Administration number', 'The related Person Identifier uses the person''s Social Security Administration number.', 1.00, 4) END

Addressed in V9.0.0.0 release, #42. See CEDS OSC IDS Summary v9 Changes.xlsx for additional details.