$schema: "https://json-schema.org/draft/2020-12/schema"
title: "Requisition"
type: "object"

properties:
  requisition_id:
    $ref: '../ids.json#/definitions/RequisitionId'
  product_ids:
    type: array
    items:
      $ref: '../ids.json#/definitions/ProductId'
  stage:
    $ref: '../core.json#/definitions/RequisitionStage'
  status:
    $ref: '../core.json#/definitions/Status'
  clinicians:
    type: array
    items:
      $ref: 'Clinician.json'
  referring_lab:
      $ref: 'Institution.json'
  consents:
    type: array
    items:
      $ref: '../structs.json#/definitions/Consent'
  subject:
    $ref: 'Subject.json'
  sample_request:
      $ref: '../structs.json#/definitions/SampleRequest'
  sample_ids:
    type: array
    items:
      $ref: '../ids.json#/definitions/SampleId'
  order_ids:
    type: array
    items:
      $ref: '../ids.json#/definitions/OrderId'
oneOf:
  - required:
    - clinicians
  - required:
    - institution
additionalProperties: false
