$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: "MONOGENIC"
        type: string
      results:
        $ref: "#/definitions/MonogenicReportResults"
  - required:
      - toplines
      - next_steps
      - classifications


definitions:
  MonogenicReportResults:
    description: >-
      ReportResults is the editable, versioned component of a MyOme
      lab report. 
    type: object
    additionalProperties: false
    properties:
      classifications:
        type: array
        items:
          $ref: "../../structs.json#/definitions/VariationClassification"
      clinical_summary:
        type: string
        example: >-
          A pathogenic variant was identified in PMS2.  PMS2 is
          associated with autosomal dominant Lynch Syndrome.
      disease_information:
        type: array
        example:
          - >-
            *Lynch Syndrome*: Testing positive for a pathogenic variant
            in the PMS2 gene means your risks of developing certain
            cancers including colorectal cancer are greater than that
            of the average US individual. This is also known as Lynch
            Syndrome. Individuals with this genetic change may benefit
            from earlier and/or more frequent colonoscopy screenings.
          - >-
            *MYBPC3-related cardiomyopathy*: Individuals with mutations
            in MYBPC3 are at a higher risk of
            cardiomyopathy. Cardiomyopathy is a disease of the heart
            that causes problems with the way the heart pumps
            blood. Individuals with this genetic change can benefit
            from additional cardiac screening which may include
            imaging, EKG or additional tests.
      next_steps:
        $ref: "../../structs.json#/definitions/ReportNextSteps"
      toplines:
        $ref: "#/definitions/MonogenicTopline"

  MonogenicTopline:
    description: Uses topline finding definition from structs.json and reinforces that finding must be MonogenicToplineFinding since the finding property in ToplineFinding includes PRS and Monogenic enums.
    type: array
    minItems: 1
    maxItems: 1
    items:
      allOf:
      - $ref: "../../structs.json#/definitions/ToplineFinding"
      - properties:
          finding:
            $ref: "../../core.json#/definitions/MonogenicToplineFinding"
    example:
      finding: POSITIVE
      text: A pathogenic mutation was identified in the PMS2 gene.
