{
   "title": "ClinicianPortalRequisition",
   "type": "object",
   "properties": {
      "rerequisition": {
         "$ref": "../ids.json#/definitions/RequisitionId",
         "description": "Original requisition ID for this individual"
      },
      "campaign_code": {
         "type": "string",
         "title": "Campaign Code"
      },
      "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",
         "default": "EMAIL"
      },
      "product_type": {
         "type": "string",
         "title": "Clinical Area",
         "default": "PROACTIVE",
         "enum": [
            "PROACTIVE",
            "DIAGNOSTIC"
         ],
         "enumNames": [
            "Proactive",
            "Diagnostic"
         ]
      },
      "product_ids": {
         "type": "array",
         "title": "Tests",
         "minItems": 1,
         "uniqueItems": true,
         "items": {
            "anyOf": [
               {
                  "$ref": "../ids.json#/definitions/ProductId",
                  "title": "Proactive Health Report \u2020",
                  "enum": [
                     "PR-2019"
                  ]
               },
               {
                  "$ref": "../ids.json#/definitions/ProductId",
                  "title": "Pharmacogenomics Report \u2020",
                  "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": "Patient receives 3rd-party post-test genetic counseling",
         "type": "string",
         "$ref": "../core.json#/definitions/PostTestCounselingType",
         "default": "NO_COUNSELING"
      },
      "indications": {
         "title": "Clinical Indications",
         "description": "Indicate reasons for testing",
         "type": "string",
         "default": ""
      },
      "additional_files": {
         "title": "File Upload",
         "description": "Clinical Notes, Insurance Cards, Letter of Medical Necessity, etc. (Max file size: 30MB)",
         "type": "array",
         "uniqueItems": true,
         "items": {
            "type": "string",
            "format": "data-url"
         }
      },
      "consents_granted": {
         "type": "array",
         "title": "Consents",
         "minItems": 1,
         "maxItems": 1,
         "uniqueItems": true,
         "items": {
            "anyOf": [
               {
                  "$ref": "../ids.json#/definitions/ConsentUri",
                  "title": "Signed Provider Attestation",
                  "description": "By checking this box, the medical professional acknowledges that the individual/guardian authorized to make decisions for the individual (collectively, the Patient) has been informed about the availability of genetic counseling and has been provided the opportunity to obtain genetic counseling before or after testing by MyOme or its affiliates, substantially as set forth in the Informed Consent for Genetic Testing, and/or as required by applicable law, and the Patient has been informed that MyOme and its affiliates may notify them of clinical updates related to genetic test results (in consultation with the ordering medical professional). For orders originating outside the USA, the Patient has been informed that their personal information and specimen will be transferred to and processed in the USA.",
                  "enum": [
                     "myome:consent:GENERAL"
                  ]
               }
            ]
         }
      },
      "subject": {
         "$ref": "./Subject.json"
      },
      "remote_mrn": {
         "type": "string",
         "title": "Patient ID MRN",
         "description": "Clinic's Medical Record Number",
         "default": ""
      },
      "guardian": {
         "title": "Parent or Guardian (required for minors)",
         "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"
               ]
            }
         }
      },
      "billing": {
         "$ref": "./Billing.json"
      },
      "sample_request": {
         "$ref": "../structs.json#/definitions/SampleRequest"
      },
      "family_information_1": {
         "$ref": "./FamilyMemberDetails.json"
      }
   },
   "required": [
      "clinicians",
      "product_type",
      "product_ids",
      "consents_granted",
      "subject",
      "sample_request",
      "billing"
   ],
   "additionalProperties": false,
   "dependencies": {
      "product_type": {
         "oneOf": [
            {
               "properties": {
                  "product_type": {
                     "enum": [
                        "PROACTIVE"
                     ]
                  },
                  "product_subtype": {
                     "type": "string",
                     "title": "Test Type",
                     "default": "PROACTIVE_WGS",
                     "enum": [
                        "PROACTIVE_WGS",
                        "PROACTIVE_BGE"
                     ],
                     "enumNames": [
                        "MyOme Proactive Health Plus",
                        "MyOme Proactive Health"
                     ]
                  }
               },
               "required": [
                  "product_subtype"
               ]
            },
            {
               "properties": {
                  "product_type": {
                     "enum": [
                        "DIAGNOSTIC"
                     ]
                  },
                  "product_ids": {
                     "maxItems": 1,
                     "description": "\u2020 Product requires minimum age of 1 year",
                     "items": {
                        "anyOf": [
                           {
                              "$ref": "../ids.json#/definitions/ProductId",
                              "title": "MyOme Neurodevelopmental Delay, Copy Number Analysis \u2020",
                              "enum": [
                                 "PR-2032"
                              ]
                           },
                           {
                              "$ref": "../ids.json#/definitions/ProductId",
                              "title": "MyOme Rare Disease, Proband Genome \u2020",
                              "enum": [
                                 "PR-2033"
                              ]
                           },
                           {
                              "$ref": "../ids.json#/definitions/ProductId",
                              "title": "MyOme Rare Disease, Trio Genome \u2020",
                              "enum": [
                                 "PR-2034"
                              ]
                           }
                        ]
                     }
                  },
                  "additional_files": {
                     "minItems": 1
                  }
               },
               "required": [
                  "additional_files"
               ]
            }
         ]
      },
      "product_subtype": {
         "oneOf": [
            {
               "properties": {
                  "product_subtype": {
                     "enum": [
                        "PROACTIVE_WGS"
                     ]
                  },
                  "product_ids": {
                     "description": "\u2020 Product requires minimum age of 18 years",
                     "default": [
                        "PR-2019",
                        "PR-2010"
                     ],
                     "items": {
                        "anyOf": [
                           {
                              "$ref": "../ids.json#/definitions/ProductId",
                              "title": "Single-Gene Risk, 151 Genes \u2020",
                              "enum": [
                                 "PR-2019"
                              ]
                           },
                           {
                              "$ref": "../ids.json#/definitions/ProductId",
                              "title": "Medication Response \u2020",
                              "enum": [
                                 "PR-2010"
                              ]
                           },
                           {
                              "$ref": "../ids.json#/definitions/ProductId",
                              "title": "Integrated Risk Coronary Artery Disease \u2020",
                              "enum": [
                                 "PR-2011"
                              ]
                           }
                        ]
                     }
                  }
               }
            },
            {
               "properties": {
                  "product_subtype": {
                     "enum": [
                        "PROACTIVE_BGE"
                     ]
                  },
                  "product_ids": {
                     "description": "\u2020 Product requires minimum age of 18 years",
                     "default": [
                        "PR-2020",
                        "PR-2021"
                     ],
                     "items": {
                        "anyOf": [
                           {
                              "$ref": "../ids.json#/definitions/ProductId",
                              "title": "Single-Gene Risk, 84 Genes \u2020",
                              "enum": [
                                 "PR-2020"
                              ]
                           },
                           {
                              "$ref": "../ids.json#/definitions/ProductId",
                              "title": "Medication Response \u2020",
                              "enum": [
                                 "PR-2022"
                              ]
                           },
                           {
                              "$ref": "../ids.json#/definitions/ProductId",
                              "title": "Integrated Risk Coronary Artery Disease \u2020",
                              "enum": [
                                 "PR-2021"
                              ]
                           }
                        ]
                     }
                  }
               }
            }
         ]
      }
   }
}