{
   "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": "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"
                  ]
               }
            ]
         }
      },
      "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
            }
         }
      },
      "subject": {
         "$ref": "./CatalystSubject.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": "../../../structs.json#/definitions/BillingInstitutional"
      },
      "sample_request": {
         "$ref": "../../../structs.json#/definitions/SampleRequest",
         "default": {
            "type": "BUCCAL_SWAB",
            "send_kit": true
         }
      },
      "campaign_information": {
         "title": "Catalyst Program Information",
         "type": "object",
         "properties": {
            "participant_id": {
               "type": "string",
               "title": "Catalyst Participant Identifier",
               "default": "PID-",
               "pattern": "PID-[0-9]{7,}"
            }
         },
         "required": [
            "participant_id"
         ]
      }
   },
   "required": [
      "clinicians",
      "product_type",
      "product_ids",
      "consents_granted",
      "subject",
      "sample_request",
      "billing",
      "campaign_information"
   ],
   "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_subtype": {
                     "type": "string",
                     "title": "Test Type",
                     "default": "DIAGNOSTIC_RD",
                     "enum": [
                        "DIAGNOSTIC_RD",
                        "DIAGNOSTIC_FVT"
                     ],
                     "enumNames": [
                        "MyOme Rare Disease",
                        "MyOme Family Variant Testing"
                     ]
                  }
               },
               "required": [
                  "product_subtype"
               ]
            }
         ]
      },
      "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"
                              ]
                           }
                        ]
                     }
                  }
               }
            },
            {
               "properties": {
                  "product_subtype": {
                     "enum": [
                        "DIAGNOSTIC_RD"
                     ]
                  },
                  "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"
               ]
            },
            {
               "properties": {
                  "product_subtype": {
                     "enum": [
                        "DIAGNOSTIC_FVT"
                     ]
                  },
                  "product_ids": {
                     "maxItems": 1,
                     "default": [
                        "PR1234"
                     ],
                     "items": {
                        "anyOf": [
                           {
                              "$ref": "../../../ids.json#/definitions/ProductId",
                              "title": "Family Variant Testing",
                              "enum": [
                                 "PR1234"
                              ]
                           }
                        ]
                     }
                  },
                  "relative": {
                     "title": "Relative",
                     "type": "object",
                     "additionalProperties": false,
                     "properties": {
                        "relationship": {
                           "title": "Relationship to Relative",
                           "type": "string",
                           "enum": [
                              "PARENT",
                              "CHILD",
                              "SIBLING",
                              "1ST_COUSIN",
                              "GRANDPARENT",
                              "GRANDCHILD",
                              "AUNT_UNCLE",
                              "NEICE_NEPHEW",
                              "HALF_SIBLING",
                              "OTHER"
                           ],
                           "enumNames": [
                              "Parent",
                              "Child",
                              "Sibling",
                              "1st Cousin",
                              "Grandparent",
                              "Grandchild",
                              "Aunt/Uncle",
                              "Neice/Nephew",
                              "Half-Sibling",
                              "Other (up to 4th degree)"
                           ]
                        },
                        "requisition": {
                           "title": "Order ID",
                           "type": "string",
                           "description": "RQxxxx"
                        },
                        "dob": {
                           "$ref": "../../../core.json#/definitions/Date",
                           "title": "Relative's Date of Birth",
                           "description": "mm/dd/yyyy"
                        }
                     }
                  },
                  "fvt_variants": {
                     "type": "array",
                     "minItems": 1,
                     "uniqueItems": true,
                     "title": "Requested Variants to Test",
                     "default": [
                        "NC_000017.10:g.41197702T"
                     ],
                     "items": {
                        "anyOf": [
                           {
                              "type": "string",
                              "title": "GENE1, c.123, p.123 (Pathogenic)",
                              "enum": [
                                 "NC_000017.10:g.41197702T"
                              ]
                           }
                        ]
                     }
                  }
               },
               "required": [
                  "relative"
               ]
            }
         ]
      }
   }
}