For example, we have survey data where patients were interviewed.
We are trying to convert this to OMOP CDM form. But it’s natural that we don’t have visit data/table for these patients (who come under survey data). What we have is interview date which I feel it syncs with “observation_date” column of “observation” table.
I understand that we can key in Zero for missing visit_ids but when the domain itself is missing, will that result in any problem if I leave the visit_table empty (which I am not able to foresee due to limited knowledge). I know some constraints might fail but how do we handle a scenario like this?
So, do I just key in zero in domain tables (wherever there is visit_occurrence id column)?
visit_occurrence_id fields are not mandatory in CDM event tables. If you don’t have an associated visit for a clinical event, set visit_occurrence_id to NULL. Note that it’s not a concept field, so you don’t have to set it to zero when missing — unless you have a Visit Occurrence record with visit_occurrence_id = 0, this would break foreign key constraints.
Sorry, @rookie_crewkie. They are mandatory. If you write a Visit Occurrence you need to give it a counter.
If you don’t have information about a Visit you can just not write one. An survey interview is not really an interaction with the healthcare system. So, no worries. Most use cases will work without explicit Visit information.
I only meant the clinical event tables (Measurement, Procedure, etc), where visit_occurrence_id is a foreign key to Visit Occurrence. Of course this field is mandatory in Visit Occurrence itself. Apologies for the potentially misleading wording here.
You have two options: 1) you infer the visit date (taking the first and last event, for example), or 2) you drop the visit and only write the events (lab, medications, conditions). Either one is legitimate from a CDM perspective. If you can do 1) with some level of precision I’d prefer that if I were you.