$schema: https://json-schema.org/draft/2020-12/schema

title: PRS Findings Format
type: object

description: >
  The PRS interpretation format stores risk for a disease across a certain timespan.

properties:
  _version:
    $ref: ../../core.json#/definitions/Version
  findings:
    items:
      $ref: '#/definitions/Interpretation'
    maxItems: 1
    minItems: 1
    type: array
    
required:
- _version
- findings

definitions:
  Interpretation:
    properties:
      clinical:
        items:
          $ref: '#/definitions/PRSResult'
        maxItems: 2
        minItems: 1
        type: array
      integrated:
        items:
          $ref: '#/definitions/PRSResult'
        maxItems: 2
        minItems: 1
        type: array
      prs_type:
        $ref: ../../core.json#/definitions/PRSType
    required:
    - prs_type
    - integrated
    - clinical
  PRSResult:
    properties:
      score:
        example: 0.1
        type: number
        description: Expecting score in decimal format then converted to percentage by report generator.
        minimum: 0
        maximum: 1
      timespan:
        $ref: ../../core.json#/definitions/PRSTimespan
    required:
    - timespan
    - score
    type: object
