$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: {
                 "oneOf": [ {
                   $ref: "../../structs.json#/definitions/CNAVariationClassification"
                 },
                   {
                     $ref: "../RARE_DISEASE.json#/definitions/RareDiseaseVariationClassification"
                   }

                  ]
        }
      hpo_terms:
        type: array
        items:
          type: string
        examples:
          - "Seizure" 
          - "Hypertelorism"
      next_steps:
        $ref: "../../structs.json#/definitions/ReportNextSteps"
      toplines:
        $ref: "#/definitions/NDDCNATopline"
      sample_limitations:
        type: array
        items:
          type: string

  NDDCNATopline:
    description: Uses topline finding definition from structs.json.
    type: array
    minItems: 1
    maxItems: 5
    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.
