Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#553 Maternal death

open
Christophe B.
5
2010-01-03
2010-01-03
Christophe B.
No

Discussion

  • Christophe B.
    Christophe B.
    2010-01-03

     
    Attachments
  • Christophe,
    do you plan to add this to svn?

     
  • kiwi_pgv
    kiwi_pgv
    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