{
   "$schema": "https://json-schema.org/draft/2020-12/schema",
   "title": "MyOme json report",
   "description": "MyOme report object",
   "type": "object",
   "allOf": [
      {
         "$ref": "base.json"
      },
      {
         "properties": {
            "report_type": {
               "const": "RARE_DISEASE",
               "type": "string"
            },
            "results": {
               "$ref": "#/definitions/RDReportResults"
            }
         }
      }
   ],
   "definitions": {
      "RareDiseaseVariationClassification": {
         "type": "object",
         "additionalProperties": false,
         "required": [
            "classification"
         ],
         "properties": {
            "variantfinding_id": {
               "$ref": "../../ids.json#/definitions/VariantFindingId"
            },
            "finding_type": {
               "$ref": "../../core.json#/definitions/FindingType"
            },
            "classification": {
               "title": "ACMG Classification",
               "$ref": "../../core.json#/definitions/ACMGPlusNegativeClassification"
            },
            "gene_symbol": {
               "type": "string"
            },
            "cytoband": {
               "title": "Location for CNV",
               "$ref": "../../core.json#/definitions/Cytoband"
            },
            "iscn_nomenclature": {
               "title": "Description of CNV",
               "$ref": "../../core.json#/definitions/ISCNNomenclature"
            },
            "event": {
               "title": "Variant Event",
               "type": [
                  "string",
                  "null"
               ]
            },
            "copy_number": {
               "title": "Total Copy Number",
               "$ref": "../../core.json#/definitions/CopyNumber"
            },
            "variation": {
               "type": "object",
               "$ref": "../../structs.json#/definitions/RareDiseaseVariation"
            },
            "phenotype": {
               "type": "object",
               "properties": {
                  "evidence_summary": {
                     "type": [
                        "string",
                        "null"
                     ]
                  }
               }
            },
            "inheritance": {
               "type": "object",
               "properties": {
                  "mode": {
                     "title": "Mode of Inheritance",
                     "$ref": "../../core.json#/definitions/Inheritance"
                  },
                  "zygosity": {
                     "title": "Zygosity",
                     "$ref": "../../core.json#/definitions/Zygosity"
                  },
                  "percent_heteroplasmy": {
                     "title": "Percent Heteroplasmy",
                     "$ref": "../../core.json#/definitions/PercentHeteroplasmy"
                  },
                  "pattern": {
                     "title": "Inherited From",
                     "$ref": "../../core.json#/definitions/VariantInheritance"
                  }
               }
            },
            "variant_description": {
               "title": "Evidence",
               "type": [
                  "string",
                  "null"
               ]
            },
            "gene_info": {
               "type": "string"
            },
            "condition": {
               "type": "string"
            },
            "alleles": {
               "title": "Pathogenic TRE Alleles",
               "type": "array",
               "minItems": 1,
               "maxItems": 2,
               "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                     "event",
                     "classification"
                  ],
                  "properties": {
                     "event": {
                        "title": "TRE Event",
                        "type": "string"
                     },
                     "classification": {
                        "title": "ACMG Classification",
                        "$ref": "../../core.json#/definitions/ACMGPlusNegativeClassification"
                     },
                     "number": {
                        "type": "integer"
                     }
                  }
               }
            }
         },
         "if": {
            "required": [
               "finding_type"
            ],
            "properties": {
               "finding_type": {
                  "const": "RARE_DISEASE_TRE"
               }
            }
         },
         "then": {
            "required": [
               "alleles"
            ]
         }
      },
      "RDTopline": {
         "description": "The report's main conclusion. Typically at the top of the report.",
         "type": "array",
         "minItems": 1,
         "maxItems": 5,
         "items": {
            "type": "object",
            "required": [
               "finding",
               "text"
            ],
            "example": {
               "finding": "POSITIVE",
               "text": "A pathogenic variant was identified on chromosome chr1."
            },
            "properties": {
               "finding": {
                  "$ref": "../../core.json#/definitions/RareDiseaseToplineFinding"
               },
               "text": {
                  "title": "Text",
                  "type": "string"
               }
            }
         }
      },
      "RDReportResults": {
         "description": "ReportResults is the editable, versioned component of a MyOme lab report.",
         "type": "object",
         "additionalProperties": false,
         "required": [
            "toplines",
            "next_steps",
            "classifications",
            "qc_metrics"
         ],
         "properties": {
            "classifications": {
               "minItems": 1,
               "type": "array",
               "items": {
                  "$ref": "#/definitions/RareDiseaseVariationClassification"
               }
            },
            "hpo_terms": {
               "type": "array",
               "items": {
                  "type": "string"
               },
               "examples": [
                  "Seizure",
                  "Hypertelorism"
               ]
            },
            "disclaimers": {
               "title": "Disclaimers",
               "description": "DEPRECATED: maintained for backwards compatibility",
               "type": "array",
               "items": {
                  "type": "string"
               },
               "example": [
                  "This test was developed, and its performance characteristics were determined, by MyOme, Inc., a clinical laboratory certified under the Clinical Laboratory Improvement Amendments of 1988 (CLIA) and College of American Pathologist (CAP) accredited to perform high complexity clinical laboratory testing. This test has not been cleared or approved by the U.S. Food and Drug Administration (FDA).",
                  "Like most tests, this test carries a risk of false negative or false positive results. Testing is unavailable for samples damaged by human error, lost/destroyed due to weather, transit issues or other problems beyond the control of MyOme. Test results should always be interpreted by a clinician in the context of clinical and familial data with the availability of genetic counseling when appropriate. MyOme is not responsible for the content of third-party websites referenced in this report.",
                  "The interpretation of variants is based on our current understanding of the genome. These interpretations may change over time as more information about these alterations becomes available. Possible diagnostic errors include CNV call errors, sample misidentification, and other sources.",
                  "Whole exome sequencing did not identify any reportable variants classified as pathogenic (P), likely pathogenic (LP), or variant of uncertain significance (VUS). Reportable variants are those P, LP, or VUS variants with phenotypic overlap with the indication for testing for this individual."
               ]
            },
            "next_steps": {
               "title": "Next Steps",
               "type": "array",
               "items": {
                  "type": "string"
               },
               "example": [
                  "Women with an estimated lifetime breast cancer risk of 20% or higher should speak with their healthcare provider about American Cancer Society (ACS) guidelines for increased breast cancer surveillance as outlined below, as well as published recommendations for risk-reducing agents and comprehensive risk assessment.",
                  "Annual mammograms starting at age 40 or 10 years younger than the earliest breast cancer diagnosis in the family (but no earlier than age 30)\n",
                  "Annual breast MRI starting at age 40 or 10 years younger than the earliest breast cancer diagnosis in the family (but no earlier than age 25)\n",
                  "These results should be interpreted in the context of the individual's personal medical history and family history. The patient's female relatives may wish to speak with their healthcare provider to undergo a personalized risk assessment."
               ]
            },
            "sample_limitations": {
               "title": "Sample Limitations",
               "type": "array",
               "items": {
                  "type": "string"
               }
            },
            "toplines": {
               "$ref": "#/definitions/RDTopline"
            },
            "qc_metrics": {
               "title": "QC Metrics",
               "$ref": "../../structs.json#/definitions/RareDiseaseQCMetrics"
            }
         }
      }
   }
}