Closed mikix closed 2 months ago
Currently, any MedicationRequest row for which dosageInstruction IS NULL is left out of core__medicationrequest.
dosageInstruction IS NULL
core__medicationrequest
That's because of this unnest:
FROM temp_mr AS mr, UNNEST(mr.dosageInstruction) AS dose_row (dose_col)
But we are trying to migrate from such statements to left joins. We should probably make a temporary select and then join like:
FROM temp_mr AS mr, LEFT JOIN temp_flattened_dosages ...
Currently, any MedicationRequest row for which
dosageInstruction IS NULL
is left out ofcore__medicationrequest
.That's because of this unnest:
But we are trying to migrate from such statements to left joins. We should probably make a temporary select and then join like: