OHDSI / Atlas

ATLAS is an open source software tool for researchers to conduct scientific analyses on standardized observational data
http://atlas-demo.ohdsi.org/
Apache License 2.0
266 stars 136 forks source link

Enhancement: Filter cohort data based upon visit_detail_id and visit_detail_concept_id #2896

Open TomWhite-MedStar opened 10 months ago

TomWhite-MedStar commented 10 months ago

Expected behavior

Within EHR data, visit_detail is often used to represent a patient's physical location. Multiple quality measures need to focus upon (or exclude) data from particular physical locations. For example:

Atlas should have the ability to:

  1. Restrict data to specific visit_detail_concept_ids (either only including drug/measurement/procedure/etc. data from a set of visit_detal_concept_id values - or specifically excluding data from a set of visit_detail_concept_id)
  2. Restrict data to specific visit_detail_id (similar to how one can check the box to "restrict to same visit occurrence"

Actual behavior

This is not adequately supported with the current visit_detail options:

chrisknoll commented 10 months ago

At least on the topic of 'same visit checkbox', the visit details should all share the visit_id (of the parent) so it should be the case that when you select a visit->visit_detail or visit_detail->visit_detail, the visits/details belonging to the same visit should be exposed throughout such that if you say 'same visit' it checks that the 'index' visit is the same as the associated visit/visit_detail. This should also work with condition -> drug or procedure-> measurement in that if there is a visit associated to it, then the query should expose the visit_id across all of those, and the 'same visit' checkbox checks that they are equal.

I don't think we use (and I don't think we should) use visit_detail_id, insofar as it is just a row identifier and not used in any relationships.

chrisknoll commented 10 months ago

About the ability to restrict the domain criteria (measurement, drug, condition for example) there is an option to specify the Visit criteria, which should cause a join back to the visit (based on visit_id) and look for visit_concept_id: image

However, this goes back to the parent visit, not a particular visit_detail, but I don't think the CDM links procedures to visit_details.

TomWhite-MedStar commented 10 months ago

@chrisknoll , per my read of the CDM 5.3.1 data model, visit_detail_id is used in relationships. All of the main clinical event tables (condition, procedure, measurement, drug, observation, device) do include an optional visit_detail_id field.

We use visit_occurrence to represent a full hospital stay, but the patient may move across settings (e.g. from ED, specific wards/units within the hospital, or specific operating rooms or intensive care units). So, our plan was to use visit_detail to track patient movements within the hospital, and then include/exclude clinical events based upon that patient location. By enabling a "restrict to same visit_detail", we'd be able to support much of the desired logic.

chrisknoll commented 10 months ago

I see. Certainly complicates matters: My understanding was the same as you say about 'how a patient moves around' within a visit, for example, visit only supports one provider, but visit detail allows you to associate different providers within the same visit_detail. I thought that Visit_Detail was about giving more context to the visit, and not breaking down where specific conditions were identified. But, that's what they are trying to support in the model.

So, this complicates things a bit, that we need to say 'same visit' and also 'same visit detail'? Currently we have the Query elements return the Visit_ID that this record is associated with, is it a matter of returning the visit_detail_id too? and then adding the option to not only check same visit, but an additional option of 'same visit detail' (ie: another checkbox)?

TomWhite-MedStar commented 10 months ago

@chrisknoll , yes, adding another checkbox for "same visit detail" would solve some of this.

For example, for looking at data only from the Emergency Department, I could use either of these tactics:

Say I'm looking for use of rocuronium for rapid sequence intubation in the ER, this might work if we had "same visit detail" image

This might also work, and would capture the administration datetime of rocuronium (instead of ED visit detail start time): image

Adding that additional checkbox might also support some negation examples. For example, for the Hospital Harm Opioid Related Adverse Event measure, perhaps I could do the following. The measure is looking for any cases where Narcan had to be used outside of the OR.

image

So, adding the additional checkbox would be great start.