Menu

#553 Maternal death

open
5
2010-01-03
2010-01-03
No

Discussion

  • Christophe B.

    Christophe B. - 2010-01-03
     
  • Łukasz Wileński

    Christophe,
    do you plan to add this to svn?

     
  • Anonymous

    Anonymous - 2010-01-06

    It will need some improvement. I tried and it timed out on my DB.

     
  • Christophe B.

    Christophe B. - 2010-01-06

    Not ready for SVN.
    Just quick and dirty code to show how maternal death report could be done by reusing existing functions.

     
  • Greg Roach

    Greg Roach - 2010-01-14

    This sort of thing is much better done in SQL. Try the following query. It runs on my 10000 gedcom in a tenth of a second. This inlcudes both parents. Join in the pgv_individuals table and add i_sex='F' to restrict it to mothers.

    SELECT birth.d_file, birth.d_gid
    FROM pgv_dates birth
    JOIN pgv_link famc ON (birth.d_file=famc.l_file AND birth.d_gid=famc.l_from AND famc.l_type='FAMC')
    JOIN pgv_link fams ON (fams.l_file=famc.l_file AND fams.l_to=famc.l_to AND fams.l_type='FAMS')
    JOIN pgv_dates death ON (death.d_file=fams.l_file AND death.d_gid=fams.l_from)
    WHERE birth.d_fact IN ('BIRT', 'CHR', 'BAPM')
    AND death.d_fact IN ('DEAT', 'CREM', 'BURI')
    AND death.d_julianday1 < birth.d_julianday2 + 90

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.