OHDSI Home | Forums | Wiki | Github

Associate a primary diagnosis with in-patient visit?

(Jennifer Wilson) #1


I’m trying to identify in-patient visits associated with a psychiatry diagnosis. What is the best way to associate a primary diagnosis with a particular in-patient visit? I was exploring cohort generation in ATLAS, but it wasn’t obvious that a visit could be associated with a diagnosis.

Thank you!

(Seng Chan You) #2

@jenwilson521 You can try to use ‘visit_concept_id’ (in visit table) to identify inpatient event.

(Chris Knoll) #3

Also, in cohort definitions, you can search by visit, where the visit type is the specified visit concept ID.

(Jennifer Wilson) #4

Thanks! I am not having a problem identifying the “in-patient” visits. I wanted to know if I could further subset “in-patient” visits by a primary diagnosis? (e.g. was the in-patient visit associated with an asthma attack, a diabetic event, a seizure etc…)

(Chris Knoll) #5

First question when defining a cohort is what is the cohort entry? Do you want it to be the visit, or do you want it to be the date of diagnosis? From there, you can add additional rules around the context of the visit.

I made this example showing cohort entry as the diagnosis, looking for primary diagnosis and in patient setting: http://atlas-demo.ohdsi.org/#/cohortdefinition/1775997.

And here is an example where cohort entry is based on the visit, looking for a primary diagnosis of asthma at that visit: http://atlas-demo.ohdsi.org/#/cohortdefinition/1775998

(Christian Reich) #6


Forget the visit. You have to specify the status (condition_status_concept_id). You have primary and secondary right there, with respect to the visit it is linked to. If it is not linked to a visit it is the visit that the patient is in at the date of the Condition (diagnosis). If there is no visit, or there are 2 or more visits, you are out of luck. But a patient can only have one inpatient visit at a time, really.

However, Atlas 2.7 cannot do the status (too new an addition to the CDM). You have to encode that in SQL, @jenwilson521. If you have an older CDM and Vocabulary, you could pull it out of the Condition Type (Atlas has that).

(Jennifer Wilson) #7

Thank you both! @Chris_Knoll, I am trying to do the later and your cohort definition appears to be what I’m looking for.

@Christian_Reich - how would you approach differ from @Chris_Knoll? Are conditions not often recorded with a visit? Happy to write the SQL code match condition by date if there’s a reason that the diagnosis is not always linked to the visit.