Created
December 6, 2019 14:33
-
-
Save juanandresnyc/7dea13a3f3b61df086e8920f8e6e0d22 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
"capsule_core_patientmedication"."id", "capsule_core_patientmedication"."should_process_refill", "capsule_core_patientmedication"."standard_fill_size", "capsule_core_patientmedication"."next_refill_date", "capsule_core_patientmedication"."medication_id", "capsule_core_medication"."primary_name", "capsule_core_medication"."secondary_name", "capsule_core_medication"."control_schedule", "capsule_core_medication"."mixing_type", "capsule_core_medication"."refrigeration_type", "capsule_core_medication"."strength", "capsule_core_medication"."unknown_status", "capsule_core_patientmedication"."last_delivered_fill_id", "capsule_core_prescriptionfulfillment"."price", "capsule_core_prescriptionfulfillment"."price_at_checkout", "capsule_core_prescriptionfulfillment"."should_waive_copay", "capsule_core_prescriptionfulfillment"."updated_at", "capsule_core_patientmedication"."upcoming_fill_id", T5."price", T5."price_at_checkout", T5."should_waive_copay", T5."updated_at", "capsule_core_patientmedication"."active_rx_id", "capsule_core_prescription"."control_schedule", "capsule_core_prescription"."quantity", "capsule_core_prescription"."quantity_remaining" | |
FROM | |
"capsule_core_patientmedication" | |
INNER JOIN "capsule_core_medication" ON ("capsule_core_patientmedication"."medication_id" = "capsule_core_medication"."id") | |
LEFT OUTER JOIN "capsule_core_prescriptionfulfillment" ON ("capsule_core_patientmedication"."last_delivered_fill_id" = "capsule_core_prescriptionfulfillment"."id") | |
LEFT OUTER JOIN "capsule_core_prescriptionfulfillment" T5 ON ("capsule_core_patientmedication"."upcoming_fill_id" = T5."id") | |
LEFT OUTER JOIN "capsule_core_prescription" ON ("capsule_core_patientmedication"."active_rx_id" = "capsule_core_prescription"."id") | |
WHERE ( | |
"capsule_core_patientmedication"."deleted_at" IS NULL AND "capsule_core_patientmedication"."patient_id" = 59101 | |
) | |
ORDER BY "capsule_core_patientmedication"."updated_at" DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment