Hello - Looking for suggestions regarding best practices for constructing an OHDSI Atlas query that subsets a patient cohort with a specific diagnosis by a specific drug exposures. I am counting the number of daily ED patient encounters with a diagnosis of asthma. I would like to only include those patients who received an asthma medication on that ED visit. To that end, I created the following query which (a) selects all patients with a visit occurrence of an ED visit, (b) reduces this population to only those patients who received an asthma diagnosis on that visit, and © reduces this population further to only those patients who received an asthma diagnosis AND received asthma medications on that same ED visit. The critical part of this (because I am simply looking at #s of visits per day) is that my date offset exit criteria is
Date Offset Exit Criteria
This cohort defintion end date will be the index event’s start date plus 0 days
So that people can enter and exit the cohort repeatedly (i.e. multiple ED visits on different days by the same person count as multiple visits).
However, I am wondering if this date offset of 0 days is interfering with the drug exposure inclusion criteria. When I run the query on my home database without the drug exposure criteria, I have 268K visits from 98K unique people. When I run the query with the drug exposure criteria using “Drug exposure: restrict to same visit occurrence”, I lose almost 260K visits.
Because we previous discussions indicated that the visit_occurrence_id is an optional field in the drug exposure table, I then ran the query with drug exposure criteria using “+/- 7 days from event index date and ending at any time” and still lose ~200K visits.
I am wondering if this is due to my cohort exit offset being set to 0 days (which I am using to ensure that I catch repeat visits for asthma by the same person).
Any suggestions for reshaping this query using the Atlas Web API? Thanks!
Chris