= Notes on the Pregnancy-Related Tables = [[PageOutline]] The correct and accurate modelling of a pregnancy and its outcomes is rather involved, and some assumptions had to be made. This page illustrates the model used in the pregnancy tables to which these assumptions lead. == Example == Consider the following example: 1. A female patient (123) gets pregnant at time `(a)`. 1. At time `(b)` she has an abortion which causes the dead fetus of `CHILD 701`. 1. At time `(c)`, she gets pregnant again. 1. The delivery of this pregnancy is at time `(d)`, when the twins (`CHILD 702` and `CHILD 703`) are born. {{{ (a) (b) (c) (d) MUM 123 -----|-------|---------------|------------|-------------------- CHILD 701 |-| CHILD 702 |-------------------- CHILD 703 |-------------------- }}} This story is described in the different pregnancy tables as follows: **There are two records in [[TablePreg|tblPREG]], one for each pregnancy:** ||= **MOTHER_ID** =||= **PREG_SEQ** =||= MENS_D =||= ... =|| || 123 || 1 || (a) || ... || || 123 || 2 || (c) || ... || **There are three records in [[TablePregOut|tblPREG_OUT]] describing the pregnancy outcome for each fetus**: ||= **MOTHER_ID** =||= **PREG_SEQ** =||= **CHILD_ID** =||= OUTCOM =||= ... =|| || 123 || 1 || 701 || 21 || ... || || 123 || 2 || 702 || 1 || ... || || 123 || 2 || 703 || 1 || ... || **There is one record in [[TableDeliveryMum|tblDELIVERY_MUM]]:** ||= **MOTHER_ID** =||= **PREG_SEQ** =||= **MEMRUP_D** =||= ... =|| || 123 || 2 || (d) || ... || **There are two records in [[TableDeliveryChild|tblDELIVERY_CHILD]]:** ||= **MOTHER_ID** =||= **MEMRUP_D** =||= **CHILD_ID** =||= ... =|| || 123 || (d) || 702 || ... || || 123 || (d) || 703 || ... || **There are two records in [[TableNewborn|tblNEWBORN]]**: ||= **CHILD_ID** =||= ... =|| || 702 || ... || || 703 || ... || == Important relations == The following statements are true for a well-encoded data set: 1. Every record in [[TablePregOut|tblPREG_OUT]] refers to some existing record in [[TablePreg|tblPREG]]. 2. For every record in [[TablePregOut|tblPREG_OUT]] that describes a delivery, there is exactly one record in [[TableDeliveryChild|tblDELIVERY_CHILD]] referring to it. 3. For every record in [[TableDeliveryMum|tblDELIVERY_MUM]], there are 1 or more records in [[TableDeliveryChild|tblDELIVERY_CHILD]] referring to it. 4. For every record in [[TableNewborn|tblNEWBORN]] there is exactly one record in [[TableDeliveryChild|tblDELIVERY_CHILD]] referring to the same child. 5. For every record in [[TableDeliveryMum|tblDELIVERY_MUM]], there is some record in [[TablePreg|tblPREG]] to which it refers.