Closed jklann closed 7 years ago
Because we haven't standardized tval_char for lab results yet, all non-null tval_char should be mapped to null for the moment.
E.g., change this line CASE WHEN m.ValType_Cd='T' THEN isnull(substring(nullif(m.TVal_Char,''),1,12),'NI') ELSE 'NI' END RESULT_QUAL,
CASE WHEN m.ValType_Cd='T' THEN isnull(substring(nullif(m.TVal_Char,''),1,12),'NI') ELSE 'NI' END RESULT_QUAL,
to
CASE WHEN m.ValType_Cd='T' THEN CASE WHEN m.Tval_Char IS NOT NULL THEN 'OT' ELSE 'NI' END END RESULT_QUAL,
(though please test this)
All set for both MSSQL and Oracle.
Because we haven't standardized tval_char for lab results yet, all non-null tval_char should be mapped to null for the moment.
E.g., change this line
CASE WHEN m.ValType_Cd='T' THEN isnull(substring(nullif(m.TVal_Char,''),1,12),'NI') ELSE 'NI' END RESULT_QUAL,
to
CASE WHEN m.ValType_Cd='T' THEN CASE WHEN m.Tval_Char IS NOT NULL THEN 'OT' ELSE 'NI' END END RESULT_QUAL,
(though please test this)