{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ellkay/json-schema/ellkay-lkcloud-connect-swagger-swagger-requests-update-patient-create-patient-swagger-request-schema.json",
  "title": "LKCloudConnect.Swagger.SwaggerRequests.UpdatePatient.CreatePatientSwaggerRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ellkay-updatepatient-api-openapi.yml#/components/schemas/LKCloudConnect.Swagger.SwaggerRequests.UpdatePatient.CreatePatientSwaggerRequest",
  "type": "object",
  "properties": {
    "request": {
      "allOf": [
        {
          "$ref": "#/$defs/LKCloudConnect.Contracts.Bridge.CreatePatientRequest"
        }
      ]
    }
  },
  "additionalProperties": false,
  "$defs": {
    "LKCloudConnect.Contracts.Bridge.CountryCode": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "description": "Country code"
        },
        "sourceText": {
          "type": "string",
          "description": "Any free text accompanying the system-specific code"
        },
        "source": {
          "type": "string",
          "description": "System-specific code"
        }
      },
      "additionalProperties": false,
      "description": "Country code"
    },
    "LKCloudConnect.Contracts.Bridge.CreatePatient": {
      "type": "object",
      "properties": {
        "createPatientDetails": {
          "allOf": [
            {
              "$ref": "#/$defs/LKCloudConnect.Contracts.Bridge.CreatePatientDetail"
            }
          ],
          "description": "Details and demographics of the patient to store"
        },
        "primaryFacility": {
          "allOf": [
            {
              "$ref": "#/$defs/LKCloudConnect.Contracts.Bridge.PrimaryFacility"
            }
          ],
          "description": "Facility the patient primarily visits"
        },
        "custom": {
          "type": "object",
          "additionalProperties": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": "System-specific data for special cases"
        }
      },
      "additionalProperties": false
    },
    "LKCloudConnect.Contracts.Bridge.CreatePatientDetail": {
      "required": [
        "dateOfBirth",
        "firstName",
        "lastName"
      ],
      "type": "object",
      "properties": {
        "firstName": {
          "minLength": 1,
          "type": "string",
          "description": "Patient first name"
        },
        "middleName": {
          "type": "string",
          "description": "Patient middle name"
        },
        "lastName": {
          "minLength": 1,
          "type": "string",
          "description": "Patient last name"
        },
        "dateOfBirth": {
          "type": "string",
          "description": "Patient DOB e.g. 2019-01-01",
          "format": "date-time"
        },
        "sex": {
          "type": "string",
          "description": "Patient sex"
        },
        "email": {
          "type": "string",
          "description": "Patient email"
        },
        "mobilePhone": {
          "type": "string",
          "description": "Patient mobile phone, Supported formats: +1-999-999-9999, +1-9999999999, +19999999999, +1-(999) 999 9999, +1 (999) 999-9999, +1999 999 9999, 999-999-9999, 9999999999, (999) 999 9999, (999)999-9999, 999 999 9999"
        },
        "homePhone": {
          "type": "string",
          "description": "Patient home phone, Supported formats: +1-999-999-9999, +1-9999999999, +19999999999, +1-(999) 999 9999, +1 (999) 999-9999, +1999 999 9999, 999-999-9999, 9999999999, (999) 999 9999, (999)999-9999, 999 999 9999"
        },
        "address1": {
          "type": "string",
          "description": "Patient address line 1"
        },
        "address2": {
          "type": "string",
          "description": "Patient address line 2"
        },
        "city": {
          "type": "string",
          "description": "Patient city"
        },
        "state": {
          "type": "string",
          "description": "Patient state"
        },
        "zip": {
          "type": "string",
          "description": "Patient zip"
        },
        "socialSecurityNumber": {
          "type": "string",
          "description": "Patient social security number"
        },
        "ssnNotProvidedReason": {
          "allOf": [
            {
              "$ref": "#/$defs/LKCloudConnect.Contracts.Bridge.MappedCode"
            }
          ],
          "description": "Reason code for not providing social security number"
        },
        "providerId": {
          "type": "string",
          "description": "Id of the provider seeing the patient"
        },
        "externalId": {
          "type": "string",
          "description": "External Id of the patient"
        },
        "releaseOfInformation": {
          "type": "string",
          "description": "Indicates patient consent to share medical records"
        },
        "rxHistoryConsent": {
          "type": "string",
          "description": "Captures consent for sharing prescription history"
        },
        "notes": {
          "type": "string",
          "description": "Stores general patient notes"
        },
        "sexAtBirth": {
          "type": "string",
          "description": "Records the patient's sex assigned at birth"
        },
        "pronouns": {
          "type": "string",
          "description": "Specifies the pronouns that the patient identifies with (e.g., he/him, she/her, they/them)"
        },
        "workPhone": {
          "type": "string",
          "description": "Patient work phone, Supported formats: +1-999-999-9999, +1-9999999999, +19999999999, +1-(999) 999 9999, +1 (999) 999-9999, +1999 999 9999, 999-999-9999, 9999999999, (999) 999 9999, (999)999-9999, 999 999 9999"
        },
        "workPhoneExt": {
          "type": "string",
          "description": "Patient work phone extension"
        },
        "countryCode": {
          "allOf": [
            {
              "$ref": "#/$defs/LKCloudConnect.Contracts.Bridge.CountryCode"
            }
          ],
          "description": "Patient Country code"
        },
        "identifiers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/LKCloudConnect.Contracts.Bridge.PatientIdentifierInputs"
          },
          "description": "Additional patient identifiers"
        }
      },
      "additionalProperties": false
    },
    "LKCloudConnect.Contracts.Bridge.CreatePatientRequest": {
      "type": "object",
      "properties": {
        "createPatient": {
          "allOf": [
            {
              "$ref": "#/$defs/LKCloudConnect.Contracts.Bridge.CreatePatient"
            }
          ],
          "description": "Create patient request object"
        }
      },
      "additionalProperties": false
    },
    "LKCloudConnect.Contracts.Bridge.MappedCode": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "description": "Our mapped code (If one is available)"
        },
        "source": {
          "type": "string",
          "description": "System-specific code"
        },
        "sourceText": {
          "type": "string",
          "description": "System-specific free text when additional free text is allowed, usually found with “other” fields"
        }
      },
      "additionalProperties": false
    },
    "LKCloudConnect.Contracts.Bridge.PatientIdentifierInputs": {
      "type": "object",
      "properties": {
        "value": {
          "type": "string",
          "description": "The actual identifier value assigned to the patient."
        },
        "type": {
          "allOf": [
            {
              "$ref": "#/$defs/LKCloudConnect.Contracts.Bridge.PatientIdentifierType"
            }
          ],
          "description": "The type of identifier, including standardized code and optional source mapping."
        }
      },
      "additionalProperties": false,
      "description": "Represents a patient identifiers."
    },
    "LKCloudConnect.Contracts.Bridge.PatientIdentifierType": {
      "type": "object",
      "properties": {
        "code": {
          "enum": [
            "Other",
            "ChartNumber",
            "MedicalRecordNumber"
          ],
          "type": "string",
          "description": "Standardized identifier type code defined by Ellkay."
        },
        "source": {
          "type": "string",
          "description": "Source-specific identifier type as defined by the originating EMR system."
        }
      },
      "additionalProperties": false,
      "description": "Represents the type of patient identifier, including a standardized code and optional source-specific value."
    },
    "LKCloudConnect.Contracts.Bridge.PrimaryFacility": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Facility Id"
        }
      },
      "additionalProperties": false
    }
  }
}