Skip to content

Unknown drugs in prescriptions table: "Bag" and "SW" #1405

Answered by marymlucas
LV3ga asked this question in MIMIC-IV
Discussion options

You must be logged in to vote

Hi @LV3ga you can find the name of the drug for each row by joining to the Pharmacy table in hosp module on 'pharmacy_id'.

Some sample code to try on BigQuery that accomplishes this:

with bag_sw as 
  (select * from `physionet-data.mimic_hosp.prescriptions` where drug="Bag" or drug="SW")
    select a.hadm_id, a.pharmacy_id, a.drug, b.medication from bag_sw a left join  `physionet-data.mimic_hosp.pharmacy` b
             on a.pharmacy_id  = b.pharmacy_id;

You can also cross-check with emar table, but I had better success with pharmacy table.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@LV3ga
Comment options

Answer selected by LV3ga
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants