{"id":21674201,"url":"https://github.com/aehrc/redcap_pedigree_editor","last_synced_at":"2025-04-12T04:22:09.513Z","repository":{"id":68118994,"uuid":"236619106","full_name":"aehrc/redcap_pedigree_editor","owner":"aehrc","description":"Redcap External Module to allow the entry of a pedigree diagram, storing the result as a FHIR resource","archived":false,"fork":false,"pushed_at":"2023-11-15T00:03:52.000Z","size":7424,"stargazers_count":8,"open_issues_count":2,"forks_count":2,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-25T23:51:22.330Z","etag":null,"topics":["redcap","redcap-external-module","redcap-repo"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aehrc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-27T23:34:12.000Z","updated_at":"2025-01-28T18:54:21.000Z","dependencies_parsed_at":"2024-11-25T16:02:48.002Z","dependency_job_id":null,"html_url":"https://github.com/aehrc/redcap_pedigree_editor","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aehrc%2Fredcap_pedigree_editor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aehrc%2Fredcap_pedigree_editor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aehrc%2Fredcap_pedigree_editor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aehrc%2Fredcap_pedigree_editor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aehrc","download_url":"https://codeload.github.com/aehrc/redcap_pedigree_editor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248514494,"owners_count":21116971,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["redcap","redcap-external-module","redcap-repo"],"created_at":"2024-11-25T13:43:26.463Z","updated_at":"2025-04-12T04:22:09.493Z","avatar_url":"https://github.com/aehrc.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pedigree Editor External Module\n\nThe pedigree editor external module allows a notes field to be marked with an anotation to indicate the field will represent a pedigree diagram.\n\nThe module will then hide or disable the notes field and instead spawn a new window to allow the entry of the pedigree diagram. The diagram will then be serialised as a FHIR Composition JSON string and written into the notes field. \nThe pedigree editor used is based on [https://github.com/aehrc/open-pedigree](https://github.com/aehrc/open-pedigree) which is an open version of the phenotips pedigree editor.\nThe [feature/redcap_em_0.4](https://github.com/aehrc/open-pedigree/tree/feature/redcap_em_0.4) branch of this codebase is included in the module.\nThe plugin also makes use of [pako](https://github.com/nodeca/pako) a javascript implementation of the Zlib library.\n\nThis module will not function in internet explorer.\n\n## Installing the module\n\nTo install first you need to retrieve the distribution. This can be found on the releases page [https://github.com/aehrc/redcap_pedigree_editor/releases](https://github.com/aehrc/redcap_pedigree_editor/releases) page or \nthe official redcap repository [https://redcap.vanderbilt.edu/consortium/modules/](https://redcap.vanderbilt.edu/consortium/modules/)\n\nAlternatively you can clone the git repository and generate your own distribution file. To do this, clone the git repository into a working directory, then use the git archive command to build a release.\n```\ngit clone https://github.com/aehrc/redcap_pedigree_editor.git\ncd redcap_pedigree_editor\ngit archive --format=zip  --prefix=redcap_pedigree_editor_v0.4/ -o ../redcap_pedigree_editor_v0.4.zip HEAD\n```\n\nThis will give you a file redcap_pedigree_editor_v0.4.zip\n\n## Changes\n- v0.1 - Initial Release \n- v0.1.1 - Allow use inside a survey\n- v0.2 - Upgrade open-pedigree version to allow use of the svg image encoded in the pedigree data to show real \nrepresentation of the diagram, add compression for large diagrams.\n- v0.3 - Change to use the new GA4GH FHIR format, do terminology lookups via a web service hosted in redcap.\n- v0.3.1 - Minor bug fix in open-pedigree\n- v0.3.2 - Add new action tag **@PEDIGREE** which uses configurable terminology settings.\n- v0.4 - Add support for PED and DADA2 formats.\n\n# Install the distribution\n\nThe distribution is installed by unzipping the distribution file into the `redcap/modules/` directory of the redcap installation.\n\nThis should result in the new directory `'redcap_pedigree_editor_v0.4'`. The external module directory name must meet a strict naming\nconvention, if the directory is missing the `'v'` before the version number then the module won't be picked up by redcap, so rename\nthe directory to match the form `'\u003cmodule name\u003e_v\u003cversion number\u003e'`.\n\nIf everything has gone to plan the module should now appear in the list of available modules that can be enabled.\n\n## Configuring the module\n\nOnce installed the module has a number of system-wide options:\n\n - *Hide Text* - Flag to indicate if the text area associated with the note should be shown. The format used to store \n   diagram will likely not make sense to anyone so this option should probably set to true.\n - *Allow Manual Entry* - Normal if the text area is shown it is made readonly to prevent accidental entry. This option\n   allow manual entry into the field (it is recommended not to enable this).\n - *Storage Format* - Allows the selection of which Storage format to use. This is to allow the legacy FHIR format used for \n   version prior to v0.3 to continue to be used. The GA4GH format is recommended. In version 0.4 five new formats were \n   added, ***PED***, ***PEDX***, ***DADA2***, ***DADA2X*** and ***internal***. ***PED*** is a very simple format that \n   only captures the base structure of the pedigree, it was added to allow piping to construct a basic pedigree. \n   ***PEDX*** is an extension to this that wraps the ***PED*** format in an XML document to allow the resulting SVG image\n   produced to also be stored. ***DADA2*** and ***DADA2X*** are a customization of the PED format for use at DADA2.org. \n   It includes an extra field for life status. Finally, ***internal*** uses the openpedigree internal json model which \n   is not documented and may not be compatible with future versions of the external module but should allow the best \n   round tripping. This format, PED and DADA2 do not include a svg version of the pedigree diagram so will not show the\n   diagram except when the diagram is saved into the system. This is the system wide setting, there is also a project \n   level storage format setting which can be used to override this.\n - *Compress Data* - Specifies how to deal with large diagrams. The fhir format returned from the open_pedigree editor \n   will now have a new section called 'Pedigree Diagram' which will contain a DocumentReference which will have an SVG \n   representation of the pedigree diagram. This diagram will be used by the redcap plugin to show the pedigree diagram. \n   Because there are size limitations for the text in the redcap database associated with the pedigree field the \n   addition of the 'Pedigree Diagram' section can quite easilly exceed the limit. The 'Compress Data' options tells the\n   system how to deal with the returned text exceeding 64K. The options are:\n   - *Never Compress* - (this is the default) Compression is not used. If the data exceeds 65K characters the diagram will\n     be stripped from the result and any future views of the diagram inside redcap will instead show a placeholder image.\n   - *Compress Large Diagrams \u003e65K* - The data is compressed if its over 65K. If its still too large after being \n     compressed, the diagram is stripped and the if its greater than 65K its compressed.\n   - *Always Compress* - The data is always compressed. If the compressed data is greater than 65K the diagram is stripped.\n - *Ontology Server URL* - The URL for FHIR ontology server used to lookup disorders, phenotypes and genes.\n - *Authentication Type* - The authentication to use when communicating with the FHIR server. This can be either `none`\n      or `OAuth2 Client Credentials`. The client credentials flow uses a client id and secret to obtain an access token.\n   - *OAuth2 token endpoint*  - The token endpoint used to obtain the access token. This is required for `Oauth2 Client Credentials` authentication type.\n   - *Client Id* - The client id to use to fetch an access token. This is required for `Oauth2 Client Credentials` authentication type.\n   - *Client Secret* - The client secret to use to fetch an access token. This is required for `Oauth2 Client Credentials` authentication type.\n - *Default Terminology* - This setting configures the system level default terminologies to use with the @PEDIGREE tag. It will be one of:\n   - *SNOMEDCT* - This uses the same terminology as the @PEDIGREE_SCT tag.\n   - *HPO* - This uses the same terminology as the @PEDIGREE_HPO tag.\n   - *Custom* - The terminology settings will be entered into additional fields.\n     - *Disorder Code System* - The FHIR code system to use for disorders.\n     - *Disorder Valueset* - The FHIR valueset to use for disorders.\n     - *Disorder Regex* - Regular expression used to test if a code could be a member of the phenotype code system.\n     - *Phenotype Code System* - The FHIR code system to use for phenotypes.\n     - *Phenotype Valueset* - The FHIR valueset to use for phenotypes.\n     - *Phenotype Regex* - Regular expression used to test if a code could be a member of the phenotype code system.\n     - *Gene Code System* - The FHIR code system to use for genes.\n     - *Gene Valueset* - The FHIR valueset to use for genes.\n     - *Gene Regex* - Regular expression used to test if a code could be a member of the gene code system.\n\n![Configure](documentation/pedigree_v0.4_system_settings.png)\n\n\n### Project Settings\n\nEach project can override the *Allow Manual Entry*, *Storage Format* and *Compress Data* setting. If left blank then the system setting will be used.\nThe project can also override the terminology to use with the @PEDIGREE action tag\n- *Default Terminology* - This setting configures the system level default terminologies to use with the @PEDIGREE tag. It will be one of:\n    - *SNOMEDCT* - This uses the same terminology as the @PEDIGREE_SCT tag.\n    - *HPO* - This uses the same terminology as the @PEDIGREE_HPO tag.\n    - *System* - This uses the system default terminology settings.\n    - *Custom* - The terminology settings will be entered into additional fields.\n        - *Disorder Code System* - The FHIR code system to use for disorders.\n        - *Disorder Valueset* - The FHIR valueset to use for disorders.\n        - *Disorder Regex* - Regular expression used to test if a code could be a member of the phenotype code system.\n        - *Phenotype Code System* - The FHIR code system to use for phenotypes.\n        - *Phenotype Valueset* - The FHIR valueset to use for phenotypes.\n        - *Phenotype Regex* - Regular expression used to test if a code could be a member of the phenotype code system.\n        - *Gene Code System* - The FHIR code system to use for genes.\n        - *Gene Valueset* - The FHIR valueset to use for genes.\n        - *Gene Regex* - Regular expression used to test if a code could be a member of the gene code system.\n\n\n![Configure](documentation/pedigree_v0.4_project_settings.png)\n\n## Creating a Pedigree field\nTo make use of the editor a field needs to be created in the online designer and marked with one of two action tags. Only fields of type `Notes Box` are considered.\n  - *@PEDIGREE_HPO* - Marks a field to be a pedigree editor using the HPO and OMIM coding systems for phenotypes and disorders.\n  - *@PEDIGREE_SCT* - Marks a field to be a pedigree editor using the SNOMED-CT coding system for phenotypes and disorders.\n  - *@PEDIGREE* - Marks a field to be a pedigree editor using the default coding system for phenotypes and disorders (new to version 0.3.2).\n\nThe default 'Hide Text' and 'Compress Data' options can be overriden in the action tag by appending '=' plus a comma \nseparated list of options.\n  - *HIDE_TEXT* - Hide the text area.\n  - *SHOW_TEXT* - Show the text area.\n  - *NEVER_COMPRESS* - Never compress the data stored in this field.\n  - *COMPRESS_LARGE* - Compress the data if it exceeds 65K characters.\n  - *ALWAYS_COMPRESS* - Always compress the data for this field.\n\nAn action tag of @PEDIGREE_HPO=HIDE_TEXT,NEVER_COMPRESS will use the HPO code system and hide the text area for the \nfield and prevent compression of the data stored in the field.\n\n![Online Designer](documentation/pedigree_v0.2_designer.png)\n\n\n## Data Entry\n\nIn the data entry page, a notes field marked with the pedigree editor action tag will show a large image, if this is clicked \na new window will open and allow the pedigree diagram to be editted. \nAn empty field will appear as the words 'Create Diagram' with a single diamond.\nA field for which a diagram has been added will show the image for the diagram extracted from the data returned from the \neditor. If this has been stripped for some reason instead a placeholder image is shown.\n \n\n![Data Entry (empty)](documentation/pedigree_v0.2_create_diagram.png)\n\n![Panogram Editor](documentation/panogram.png)\n\n![Data Entry (with data extracted from pedigree data)](documentation/pedigree_v0.2_with_data_no_text.png)\n\nIf the pedigree data does not contain an image a placeholder image is shown.\n\n![Data Entry (Placeholder as no diagram in pedigree data)](documentation/pedigree_v0.2_data_placeholder_show.png)\n\n\n# Upgrade Issues\n\nVersion 0.3 of this plugin stores data using the fhir format developed by GA4GH (Global Alliance for Genomics and Health).\nInformation on the proposed format can be found https://github.com/GA4GH-Pedigree-Standard/pedigree-fhir-ig\nThis is a different format to ealier version of the plugin.\n\nVersions of the module before v0.3 use a different FHIR based representation. The open-pedigree editor can read both formats,\nthe old format is referred to as `Legacy FHIR` in the editor. If you have an existing project and wish to\nmove existing pedigree diagrams to use the new format, it will be necessary to open the diagrams in the editor and resave\nthe diagram to move it into the new format.\n\nThe open-pedigree editor has three different lookups which are queried from a FHIR terminology server.\nThese are in the clinical tab of a person and are disorders, genes and phenotypic features. For versions\nbefore v0.3, these lookups are made from web browser to the FHIR terminology server. In v0.3 this was\nchanged to go via redcap. This change was made to allow the use of a terminology server which requires\nauthentication. Along with this change, the default Fhir server changed from \n`https://genomics.ontoserver.csiro.au/fhir` to `https://r4.ontoserver.csiro.au/fhir`. This also meant\nsome changes in the FHIR valuesets used. This may mean that opening a previously saved diagram may have\nproblems reloading the disorder, genes and phenotypic features fields.\n\n## Terminology Changes\n\n|Field               |\u003cv0.3 Value                                            | v0.3 Value                                            |\n|--------------------|-------------------------------------------------------|-------------------------------------------------------|\n| HPO                                                                                                                                |\n|Disorder CodeSystem |http://www.omim.org                                    |http://www.omim.org                                    |\n|Disorder ValueSet   |http://www.omim.org                                    |http://www.omim.org?vs                                 |\n|Gene CodeSystem     |http://www.genenames.org                               |http://www.genenames.org/geneId                        |\n|Gene ValueSet       |http://www.genenames.org                               |http://www.genenames.org/geneId?vs                     |\n|Phenotype CodeSystem|http://purl.obolibrary.org/obo/hp.owl                  |http://purl.obolibrary.org/obo/hp.fhir                 |\n|Phenotype ValueSet  |http://purl.obolibrary.org/obo/hp.owl?vs               |http://purl.obolibrary.org/obo/hp.fhir?vs              |\n| SCT                                                                                                                                |\n|Disorder CodeSystem |http://snomed.info/sct                                 |http://snomed.info/sct                                 |\n|Disorder ValueSet   |http://snomed.info/sct?fhir_vs=refset/32570581000036105|http://snomed.info/sct?fhir_vs=refset/32570581000036105|\n|Gene CodeSystem     |http://www.genenames.org                               |http://www.genenames.org/geneId                        |\n|Gene ValueSet       |http://www.genenames.org                               |http://www.genenames.org/geneId?vs                     |\n|Phenotype CodeSystem|http://snomed.info/sct                                 |http://snomed.info/sct                                 |\n|Phenotype ValueSet  |http://ga4gh.org/fhir/ValueSet/phenotype               |http://ga4gh.org/fhir/ValueSet/phenotype               |\n|--------------------|-------------------------------------------------------|-------------------------------------------------------|\n\nIn version 0.3.2 a new action tag **@PEDIGREE** was added, this will use the terminology configured as the default terminology.\nThe default terminology may be a custom set of terminology bindings.\n\n# Large Data Issues\nA redcap notes field can store up to 65K of character data. This should be fine if someone was typing a note, but with\nadding an svg representation of the pedigree diagram as well as the verbose nature of FHIR a large diagram can hit this\nlimit. The compress data option will tell the plugin how to handle large data.  \nCompressed data will be gzipped, converted to base64 and have 'GZ:' appended to the start of the text.\n\n# GA4GH FHIR Formation Limitations\nThere is a slight disconnect between the data that can be entered into the open-pedigree editor and what\nis stored in the GA4GH FHIR format. The editor allows for the entry of a multi-person node, which represents multiple\noffspring. In the GA4GH format these will be represented as a single individual and the count will be lost.\n\n# PED and DADA2 Formats\nIn version 0.4 of this external module, support was added for the PED and DADA2 formats. Julie Williams from the \n[dada2 Foundation](https://dada2.org/) made the suggestion of using piping to pre-populate the pedigree diagram. The\ntwo existing FHIR formats are a bit complex for such a procedure but the pedigree editor could already import and export\nusing the very simple PED format, which made it a possible candidate for piping. We had some success using `@CALCTEXT`\nand `@DEFAULT` to build up a default value for the pedigree diagram using this PED format. We then extended the existing\nPED format to include an information on life status and called this version DADA2 format. A slight tweak was made to the\nPED format to allow lines starting with a `#` to be considered a comment. This is because new lines are not well\nsupported by CALCTEXT, and blank values are replaced by `____` with DEFAULT. The PEDX and DADA2X formats were added to\nallow the SVG of the image to be included in the resulting format.\n\n## PED format\nThe PED format described in the open-pedigree source as follows:\n\n```\n * PED format:\n * (from http://pngu.mgh.harvard.edu/~purcell/plink/data.shtml#ped)\n *   Family ID\n *   Individual ID\n *   Paternal ID\n *   Maternal ID\n *   Sex (1=male; 2=female; other=unknown)\n *   Phenotype\n *\n *   Phenotype, by default, should be coded as:\n *      -9 missing\n *       0 missing\n *       1 unaffected\n *       2 affected\n```\nHere is an example:\n```\nOPENPED Proband Father Mother 1 2\nOPENPED Mother 0 0 2 2\nOPENPED Father 0 0 1 -9\nOPENPED Sister Father Mother 2 2\n```\n\n## DADA2 format\nThe format is based on PED, but there is a field for life status and adopted, and the phenotype\nmapping includes 0=missing; 1= unaffected; 2=affected; 3=Carrier; 4=Pre-symptomatic;-9=missing\n\nFirst entry is the proband.\n\n * Family ID\n * Individual ID\n * Paternal ID\n * Maternal ID\n * Sex (1=male; 2=female; other=unknown)\n * Affected (1= unaffected; 2=affected; 3=Carrier; 4=Pre-symptomatic;other=unaffected)\n * Life Status (1=Alive; 2=Deceased; 3=Unborn; 4=Stillborn; 5=Miscarriage; 6=Aborted; other/blank=Alive)\n * Adopted Outs (0=Not Adopted; 1=Adopted Out; other/blank=Not Adopted)\n\nHere is an example:\n```\nDADA2 1 2 3 1 2 1\nDADA2 2 0 0 1 -9 2\nDADA2 3 0 0 2 2 1\nDADA2 4 3 2 2 3 1\n```\n\n## PEDX Format\nThe open-pedigree editor which is used to create the pedigree diagram returns an SVG of the diagram to the redcap. This\nwill be displayed in the form. The existing FHIR format includes this svg, but it may be removed if the fhir format with\nthe diagram is larger than 65K. This allows the external module to show the diagram if the form is returned to at a\nlater date. The PEDX and DADA2X format are meant to allow the same mechanism to exist but for these simplier formats.\nThe PEDX format is an xml with two main elements, `\u003cped\u003e` which contains the PED format of the diagram and `\u003cimage\u003e`\nwhich contains the svg image of the diagram. Like the PED format, it should be possible to use `@CALCTEXT` and `@DEFAULT`\nto pipe variables into the pedigree field to prepopulate the diagram.\n\n```xml\n\u003copenpedigree\u003e\n    \u003cped\u003e\nOPENPED Proband Father Mother 1 2\nOPENPED Mother 0 0 2 2\nOPENPED Father 0 0 1 -9\nOPENPED Sister Father Mother 2 2        \n    \u003c/ped\u003e\n    \u003cimage\u003e\n        ...\n    \u003c/image\u003e\n\u003c/openpedigree\u003e\n```\n\n## DADAX Format\nLike the PEDX format, DADA2X is the DADA2 format inside of an xml document to allow the svg image of the pedigree diagram\nto be included.\n\n```xml\n\u003copenpedigree\u003e\n    \u003cdada2\u003e\nDADA2 1 2 3 1 2 1\nDADA2 2 0 0 1 -9 2\nDADA2 3 0 0 2 2 1\nDADA2 4 3 2 2 3 1\n    \u003c/dada2\u003e\n    \u003cimage\u003e\n        ...\n    \u003c/image\u003e\n\u003c/openpedigree\u003e\n```\n\n# Legacy FHIR Formation Limitations\nUnfortunately the legacy FHIR format specification does not map all the data field in the open-pedigree editor into the\nformat. Additionally some aspects of the mapping do not translate directly, where possible\nnaming conventions are used to try and account for these. For example the FHIR FamilyHistory resource has a single\nname field which is a string. The pedigree editor has a first name, last name and a last name at birth, this will\nbe written into the FamilyHistory resource as \u003cfirst name\u003e \u003clast name\u003e (\u003clast name at birth\u003e). When importing the FHIR\nresource everything but the last word is the first name a trailing '(name)' will be taken as last name at birth.\n\nHeredity options - This can be 'Childless' or 'Infertile' in the editor, but is not currently stored on the fhir resource.\nCarrier Status - This can be 'Carrier' or 'Pre-symptomatic' in the editor, but is not currently stored on the fhir resource.\nEvaluated - This is a checkbox in the editor, but is not currently stored on the fhir resource.\nLost Contact - This is a checkbox in the editor, but is not currently stored on the fhir resource. \nMultiple Sibling Nodes - In the editor you can create a single node to represent multiple siblings, at the moment these\nwill be saved as a single familiy history resource with no name and the number of siblings will be lost.\n\nPhenotype and Candidate Genes are both stored as Observation Resources associated with a family history resource. The\nsystem uses a naming convention to distinguish the two, otherwise it tries to match the code system to try and determine\nif the observation represents a Phenotype or Candidate gene.\n\nLife status - This can be 'unborn', 'stillborn' and 'aborted' with an associated gestation age. This will be written into\nthe deceasedString field on the family history resource in a form like 'stillborn 34 weeks'.\n\n#Legacy FHIR format\n\nThis is a breakdown of how the legacy FHIR format used in version of the plugin before v0.3.\n\nThe FHIR format uses a Composition as a container for the data.\nhttps://www.hl7.org/fhir/composition.html\n\n\nThe composition contains 2-3 sections:\n- Patient Condition - Contains information on the proband\n- Family History - Contains information on family members\n- Pedigree Diagram (may not be present) - If present will contain the pedigree diagram\n\nThe base composition will look like:\n```json\n{\n  \"resourceType\" : \"Composition\", \n  \"status\" : \"preliminary\", \n  \"type\" : {\n      \"coding\" : {\n        \"system\" : \"http://loinc.org\", \n        \"code\" : \"11488-4\",\n        \"display\" : \"Consult note\"\n      }\n    }, \n  \"subject\" : {\n      \"type\": \"Patient\",\n      \"reference\": \"#pat\"\n    },\n  \"date\" : \"2019-11-11T11:44:25-10:00\",\n  \"title\" : \"Pedigree Details\",\t  \n  \"section\" : [\n          {\n            \"title\": \"Patient Condition\",\n            \"entry\": [\n              {\n                \"type\": \"Condition\",\n                \"reference\": \"#cond_0\"\n              },\n              {\n                \"type\": \"Observation\",\n                \"reference\": \"#fmh_clinical_0_0\"\n              }\n            ]\n          },\n          {\n            \"title\": \"Family History\",\n            \"code\": {\n              \"coding\": {\n                \"system\": \"http://loinc.org\",\n                \"code\": \"10157-6\",\n                \"display\": \"History of family member diseases\"\n              }\n            },\n            \"entry\": [\n              {\n                \"type\": \"FamilyMemberHistory\",\n                \"reference\": \"#FMH_0\"\n              },\n              {\n                \"type\": \"FamilyMemberHistory\",\n                \"reference\": \"#FMH_1\"\n              },\n              {\n                \"type\": \"FamilyMemberHistory\",\n                \"reference\": \"#FMH_2\"\n              }\n            ]\n          },\n          {\n            \"title\" : \"Pedigree Diagram\",\n            \"entry\" : [{\n              \"type\" : \"DocumentReference\",\n              \"reference\" : \"#pedigreeImage\"\n            }]\n          }\n        ], \n  \"contained\" : [\n          //the resources\n  ]\n}\n```\n\nWithin the pedigree editor each node contains the following data.\n- parents - parent nodes - Are encoded in the fmh resource using an extension.\n- partners - nodes who are/were a partner of the person\n- twins - siblings associated with same birth\n- monozygotic - a flag to indicate twin type\n- disorders - Set of disorders associated with the person\n- hpo terms - Set of phenotypes associated with the person\n- candidate genes - Set of genes associated with the person\n- carrier status - flag to indicate if the person is a carrier of the disorder\n- childless status - flag to indicate if the person is childless\n- Last name\n- First name\n- Last name at birth\n- gender\n- Date of Birth\n- Date of Death\n- life status - This can be 'unborn', 'stillborn' and 'aborted'.\n- gestation age - Used with life status to indicate gestation age for the status\n- comments\n- external ID\n\nEach node is converted into a Family Member History resource, including the proband.\nhttps://www.hl7.org/FHIR/familymemberhistory.html\n\nThree different extensions are used to add data to the family member history resource\n- http://hl7.org/fhir/StructureDefinition/family-member-history-genetics-parent - This extension is used to\n  indicate the family members whom are the direct parents of this family member. The standard relationship field\n  in family member history is how the person is related to the patient, not how other family members relate to\n  each other.\n- http://hl7.org/fhir/StructureDefinition/family-member-history-genetics-sibling - This extension is used to\n  indicate the family member who is a sibling of this family member. This is used primarily to indicate twins or\n  similar same birth siblings.\n- http://hl7.org/fhir/StructureDefinition/family-member-history-genetics-observation - Links an observation\n  resource to this family member. Normally in FHIR observations relate to the patient.\n\nDisorders are encoded as a condition in the family member history record, which is not a separate resource. The\nprobands disorders will also have an associated Condition resource added (in the Patient Condition section).\n\nPhenotypes and Genes are encoded as Observation resources.\n\nHere is an example family member history resource\n```json\n{\n      \"resourceType\": \"FamilyMemberHistory\",\n      \"id\": \"FMH_0\",\n      \"status\": \"completed\",\n      \"patient\": {\n        \"type\": \"Patient\",\n        \"reference\": \"#pat\"\n      },\n      \"name\": \"Jane Smith (Cooper)\",\n      \"sex\": {\n        \"coding\": [\n          {\n            \"system\": \"http://hl7.org/fhir/administrative-gender\",\n            \"code\": \"female\",\n            \"display\": \"Female\"\n          }\n        ]\n      },\n      \"relationship\": {\n        \"coding\": [\n          {\n            \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n            \"code\": \"ONESELF\",\n            \"display\": \"self\"\n          }\n        ]\n      },\n      \"extension\": [\n        {\n          \"url\": \"http://hl7.org/fhir/StructureDefinition/family-member-history-genetics-parent\",\n          \"extension\": [\n            {\n              \"url\": \"type\",\n              \"valueCodeableConcept\": {\n                \"coding\": [\n                  {\n                    \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n                    \"code\": \"NMTH\",\n                    \"display\": \"natural mother\"\n                  }\n                ]\n              }\n            },\n            {\n              \"url\": \"reference\",\n              \"valueReference\": {\n                \"reference\": \"#FMH_1\"\n              }\n            }\n          ]\n        },\n        {\n          \"url\": \"http://hl7.org/fhir/StructureDefinition/family-member-history-genetics-parent\",\n          \"extension\": [\n            {\n              \"url\": \"type\",\n              \"valueCodeableConcept\": {\n                \"coding\": [\n                  {\n                    \"system\": \"http://terminology.hl7.org/CodeSystem/v3-RoleCode\",\n                    \"code\": \"NFTH\",\n                    \"display\": \"natural father\"\n                  }\n                ]\n              }\n            },\n            {\n              \"url\": \"reference\",\n              \"valueReference\": {\n                \"reference\": \"#FMH_2\"\n              }\n            }\n          ]\n        },\n        {\n          \"url\": \"http://hl7.org/fhir/StructureDefinition/family-member-history-genetics-observation\",\n          \"valueReference\": {\n            \"type\": \"Observation\",\n            \"reference\": \"#fmh_clinical_0_0\"\n          }\n        }\n      ],\n      \"bornDate\": \"1970-02-10\",\n      \"note\": [\n        {\n          \"text\": \"This is the comment\"\n        }\n      ],\n      \"condition\": [\n        {\n          \"code\": {\n            \"coding\": [\n              {\n                \"system\": \"http://snomed.info/sct\",\n                \"code\": \"59494005\",\n                \"display\": \"Congenital septal defect of heart\"\n              }\n            ]\n          }\n        }\n      ]\n    }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faehrc%2Fredcap_pedigree_editor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faehrc%2Fredcap_pedigree_editor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faehrc%2Fredcap_pedigree_editor/lists"}