smart-on-fhir / cumulus-library

https://docs.smarthealthit.org/cumulus/library/
Apache License 2.0
2 stars 0 forks source link

core__medicationrequest ignores rows without dosage instructions #218

Closed mikix closed 2 months ago

mikix commented 2 months ago

Currently, any MedicationRequest row for which dosageInstruction IS NULL is left out of 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 ...