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.
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…)
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.
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).
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.