OHDSI Home | Forums | Wiki | Github

Visit Detail / preceding_visit_detail_id, visit_detail_parent_id

Hi everyone, I’m studying the visit detail table now and I have a question.
There are two different columns (preceding_visit_detail_id, visit_detail_parent_id) in visit detail table.

  1. preceding_visit_detail_id : FK to the VISIT DETAIL table of the visit immediately preceding this visit
  2. visit_detail_parent_id : FK to the VISIT DETAIL table record to represent the immediate parent visit_detail record

I thought the parent is visit_occurrence of visit_detail(child)
but in 2) it is not about the visit_occurrence but visit_detail. it’s a little confusing.
how can we distinguish these two columns?

Thanks

@Jaeyong:

Occurrence is the parent, Detail the child. Every parent can have many children, every child only one parent. So:

  • The sequence of several Occurrences or Details is organized through the *_preceding_visit_id. This is if you have the exact Visit in the table.
  • The relationship between parent and child is in the visit_detail_parent_id. It’s recorded with the children, because each child only has one parent. Can’t do other way around because you’d need many visit_occurrence_child_id.

It’s not. the “visit_detail” is just part of the name of the field. All fields in VISIT_DETAIL start with that.

Except the explanation is wrong!!! Thanks for the catch. I fixed it.

t