Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- /api/v2/inpatient/hospitalizations/find_by_date
- -- Запрос с параматрами
- SELECT "ehr_hospitalizations".*
- FROM "ehr_hospitalizations"
- INNER JOIN "disease_histories" ON "disease_histories"."id" = "ehr_hospitalizations"."episode_of_care_id"
- INNER JOIN "user_patients" ON "user_patients"."id" = "ehr_hospitalizations"."patient_id"
- WHERE "disease_histories"."period_start" BETWEEN '2022-10-05 21:00:00' AND '2024-05-13 07:55:26.058000'
- AND "user_patients"."id" = 86
- AND ("ehr_hospitalizations"."state" NOT IN ('hospitalized_refusal', 'discharged') OR
- "ehr_hospitalizations"."state" = 'discharged' AND (discharge_date >= '2024-05-13 07:55:26.058000'))
- ORDER BY "period_start" ASC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement