$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: "NDD_CNA"
        type: string
      results:
        $ref: "#/definitions/NDDCNAReportResults"


definitions:
  NDDCNAReportResults:
    description: >-
      ReportResults is the editable, versioned component of a MyOme
      lab report. 
    type: object
    additionalProperties: false
    required:
      - toplines
      - next_steps
      - classifications
    properties:
      classifications:
        minItems: 1
        type: array
        items:
          $ref: "../../structs.json#/definitions/CNAVariationClassification"
      clinical_summary:
        type: array
        items:
          type: string
        example:
          - "The individual harbors one copy (heterozygous) of a partial duplication of the chr1q32.1-44 region, 
          which may be associated with partial trisomy 1q syndrome."
          - "The individual harbors one copy (heterozygous) of a partial deletion of the chr15q11.2 region,
          which may be associated with 15q11.2 BP1\u2013BP2 microdeletion syndrome"
      hpo_terms:
        type: array
        items:
          type: string
        examples:
          - "Seizure" 
          - "Hypertelorism"
      next_steps:
        $ref: "../../structs.json#/definitions/ReportNextSteps"
      toplines:
        $ref: "#/definitions/NDDCNATopline"

  NDDCNATopline:
    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:
            #CNA topline findings will follow the same scheme as Monogenic topline findings
            $ref: "../../core.json#/definitions/MonogenicToplineFinding"
    example:
      finding: POSITIVE
      text: A pathogenic variant was identified on chromosome chr1.
