{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/predoc/json-schema/predoc-record-upload-v2-inp-dto-schema.json",
  "title": "RecordUploadV2InpDto",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/predoc-record-upload-api-openapi.yml#/components/schemas/RecordUploadV2InpDto",
  "type": "object",
  "properties": {
    "patientData": {
      "description": "Patient data.",
      "allOf": [
        {
          "$ref": "#/$defs/RecordUploadPatientData"
        }
      ]
    },
    "partnerPatientId": {
      "type": "string",
      "description": "Partner patient ID."
    },
    "appointmentDate": {
      "type": "string",
      "description": "Appointment date."
    },
    "fileName": {
      "type": "string",
      "description": "File name."
    },
    "notificationEmails": {
      "description": "Email to send completion notification to. Should belong to the organization profile",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "allowDuplicatePatient": {
      "type": "boolean",
      "description": "Bypass the duplicate patient demographics check. This check only applies when creating a new patient (i.e., no partnerPatientId is provided). Defaults to false."
    }
  },
  "required": [
    "patientData",
    "partnerPatientId",
    "appointmentDate",
    "fileName",
    "notificationEmails"
  ],
  "$defs": {
    "RecordUploadPatientData": {
      "type": "object",
      "properties": {
        "firstName": {
          "type": "string",
          "description": "First name of the patient.",
          "maxLength": 45
        },
        "lastName": {
          "type": "string",
          "description": "Last name of the patient.",
          "maxLength": 60
        },
        "dateOfBirth": {
          "type": "string",
          "description": "Date of birth of the patient, in `YYYY-MM-DD` format."
        },
        "phone": {
          "type": "string",
          "description": "Phone number of the patient, with no special characters (only digits).",
          "maxLength": 10
        },
        "email": {
          "type": "string",
          "description": "Email address of the patient."
        },
        "address1": {
          "type": "string",
          "description": "Street address line 1."
        },
        "address2": {
          "type": "string",
          "description": "Street address line 2."
        },
        "city": {
          "type": "string",
          "description": "Name of the city."
        },
        "state": {
          "type": "string",
          "description": "Two letter state code for the address."
        },
        "postalCode": {
          "type": "string",
          "description": "Postal code for the address - 5 digits."
        },
        "genderName": {
          "type": "string",
          "description": "Gender of the patient.",
          "enum": [
            "male",
            "female",
            "na",
            "other"
          ]
        }
      },
      "required": [
        "firstName",
        "lastName",
        "dateOfBirth",
        "phone",
        "postalCode",
        "genderName"
      ]
    }
  }
}