title: "PaperRequisition"
type: "object"

properties:
  sample_request:
    $ref: '../structs.json#/definitions/SampleRequest'
  subject:
    $ref: './Subject.json'
  remote_mrn:
    type: string
    title: Patient ID MRN
    description: Clinic's Medical Record Number
    default: ""
  billing:
    $ref: './Billing.json'
  guardian:
    title: Parent or Guardian
    type: "object"
    properties:
      name:
        $ref: "../structs.json#/definitions/Name"
        title: Parent or Guardian Name
        default: {first: "", last: "", middle: ""}
      relationship_to_patient:
        title: Parent or Guardian Relationship to Patient
        type: string
        default: ""
        examples:
          - Mother
          - Father
          - Legal Guardian
  consents_granted:
    type: array
    title: Consents
    minItems: 2
    maxItems: 3
    uniqueItems: true
    items:
      anyOf:
      - $ref: "../ids.json#/definitions/ConsentUri"
        title: Signed Provider Attestation
        enum:
        - myome:consent:GENERAL
      - $ref: "../ids.json#/definitions/ConsentUri"
        title: Signed Patient Acknowledgement
        enum:
        - myome:consent:PATIENT_ACKNOWLEDGEMENT
      - $ref: "../ids.json#/definitions/ConsentUri"
        title: Patient consents to being contacted by MyOme and affiliates (unchecked box)
        enum:
        - myome:consent:PATIENT_CONTACT_CONSENT
  clinicians:
    type: array
    title: Clinicians
    description: Start typing to autocomplete, must select at least 1 clinician
    minItems: 1
    uniqueItems: true
    items:
      type: object
      properties:
        label:
          type: string
        id:
          type: string
          pattern: "../ids.json#/definitions/ClinicianId"
  preferred_report_delivery:
    $ref: "../core.json#/definitions/PreferredReportDeliveryMethod"
  product_ids:
    type: array
    title: Tests
    minItems: 1
    uniqueItems: true
    items:
      anyOf:
      - $ref: "../ids.json#/definitions/ProductId"
        title: Proactive Health Report
        enum:
        - PR-2019
      - $ref: "../ids.json#/definitions/ProductId"
        title: Pharmacogenomics Report
        enum:
        - PR-3009
      - $ref: "../ids.json#/definitions/ProductId"
        title: Neurodevelopmental Delay Copy Number Analysis Report
        enum:
        - PR-5004
  pre_test_counseling:
    title: Pre-Test Genetic Counseling
    type: string
    $ref: "../core.json#/definitions/PreTestCounselingType"
    default: NO_COUNSELING
  post_test_counseling:
    title: Post-Test Genetic Counseling
    type: string
    $ref: "../core.json#/definitions/PostTestCounselingType"
    default: NO_COUNSELING
  indications:
    title: Clinical Phenotype
    description: Indicate Clinical Phenotype
    type: string
    default: ""
  trf:
    title: TRF
    type: 'string'
    format: 'data-url'
  additional_files:
    title: Additional Files
    type: array
    uniqueItems: true
    items:
      type: 'string'
      format: 'data-url'
required:
  - consents_granted
  - subject
  - sample_request
  - billing
  - trf
additionalProperties: false
