{
   "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"
                  ]
               }
            ]
         }
      },
      "optional_consents": {
         "type": "object",
         "title": "Optional Consents",
         "properties": {
            "hie_opt_in": {
               "type": "boolean",
               "title": "Check this box if your patient wishes to participate in Health Information Exchange. This will improve the accuracy of our analyses for your patient.",
               "default": true
            },
            "research_contact_opt_in": {
               "type": "boolean",
               "title": "Check this box if the patient consents to being contacted by MyOme regarding research studies or clinical trial opportunities.",
               "description": "MyOme may share contact information for the ordering provider and other healthcare providers listed on this order with third parties regarding the requested genetic testing and potential clinical trial opportunities. The patient or the individual/family member authorized has agreed to be contacted via the email address or mobile phone number, SMS and/or calls, provided for this and future testing.",
               "default": true
            },
            "transactional_sms_opt_in": {
               "type": "boolean",
               "title": "Check this box if the patient consents to receiving phone calls  or text messages regarding updates related to the current testing order.",
               "description": "The patient, or the individual/family member authorized to act on the patient\u2019s behalf, has agreed to be contacted via the mobile phone number, SMS/text messages, and/or phone calls regarding updates to the current testing order and associated testing services.",
               "default": true
            },
            "marketing_opt_in": {
               "type": "boolean",
               "title": "Check this box if the patient consents to receiving marketing or promotional communications from MyOme via email, phone call, or text message.",
               "description": "The patient, or the individual/family member authorized to act on the patient\u2019s behalf, has agreed to receive marketing or promotional communications from MyOme via email, phone call, and/or SMS/text message.",
               "default": false
            }
         }
      },
      "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": {
                  "$ref": "../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
}