An algorithm for Inferring pregnancy episodes has been developed, validated, and published: https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0192033. It can be implemented with this: https://github.com/OHDSI/PhenotypeLibrary/tree/master/pregnancy%20episodes%20and%20outcomes.
@Jill_Hardin and I have done some work developing and validating an algorithm for identifying mother-infant linkages, but unfortunately it’s been put aside for a while. Given the advances in the FeatureExtraction package and some new info on mother-infant linkages from some data vendors, I’ll likely have to considerably overhaul at least some of this work. Stay tuned.