$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:
  RDReportResults:
    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"
      hpo_terms:
        type: array
        items:
          type: string
        examples:
          - "Seizure"
          - "Hypertelorism"
      next_steps:
        $ref: "../../structs.json#/definitions/ReportNextSteps"
      toplines:
        $ref: "#/definitions/RDTopline"
      sample_limitations:
        type: array
        items:
          type: string

  RDTopline:
    description: Uses topline finding definition from structs.json.
    type: array
    minItems: 1
    maxItems: 5
    items:
      allOf:
        - $ref: "../../structs.json#/definitions/ToplineFinding"
        - properties:
            finding:
              #TBD for Rare Disease
              $ref: "../../core.json#/definitions/MonogenicToplineFinding"
    example:
      finding: POSITIVE
      text: A pathogenic variant was identified on chromosome chr1.