{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/axuall/json-schema/axuall-provider-prefill-schema-schema.json",
  "title": "ProviderPrefillSchema",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/axuall-provider-preview-api-openapi.yml#/components/schemas/ProviderPrefillSchema",
  "properties": {
    "source": {
      "$ref": "#/$defs/ProviderPrefillSource"
    },
    "demographics": {
      "$ref": "#/$defs/ProviderPrefillDemographicsSchema"
    },
    "identifiers": {
      "$ref": "#/$defs/ProviderPrefillIdentifiersSchema"
    },
    "facilities": {
      "items": {
        "$ref": "#/$defs/FacilitySchema"
      },
      "type": "array",
      "title": "Facilities",
      "default": []
    }
  },
  "type": "object",
  "required": [
    "source",
    "demographics",
    "identifiers"
  ],
  "$defs": {
    "FacilitySchema": {
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "name": {
          "type": "string",
          "title": "Name"
        },
        "status": {
          "anyOf": [
            {
              "$ref": "#/$defs/SubscriptionStatus"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "type": "object",
      "required": [
        "id",
        "name"
      ],
      "title": "FacilitySchema"
    },
    "ProviderPrefillDemographicsSchema": {
      "properties": {
        "first_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "First Name"
        },
        "middle_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Middle Name"
        },
        "last_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Last Name"
        },
        "email": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Email"
        },
        "degree": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Degree"
        },
        "suffix": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Suffix"
        }
      },
      "type": "object",
      "title": "ProviderPrefillDemographicsSchema"
    },
    "ProviderPrefillIdType": {
      "type": "string",
      "enum": [
        "NPI",
        "NCSBN"
      ],
      "title": "ProviderPrefillIdType"
    },
    "ProviderPrefillIdentifiersSchema": {
      "properties": {
        "id_type": {
          "$ref": "#/$defs/ProviderPrefillIdType"
        },
        "npi": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Npi"
        },
        "ncsbn": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Ncsbn"
        },
        "clinician_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Clinician Id",
          "description": "The clinician's ID for this client's default external system, or null when they hold none for it. Only ever populated for the `existing_clinician` source; NPPES and resume-reader prefills have no clinician ID to offer."
        }
      },
      "type": "object",
      "required": [
        "id_type"
      ],
      "title": "ProviderPrefillIdentifiersSchema"
    },
    "ProviderPrefillSource": {
      "type": "string",
      "enum": [
        "existing_clinician",
        "nppes",
        "resume_reader"
      ],
      "title": "ProviderPrefillSource"
    },
    "SubscriptionStatus": {
      "type": "string",
      "enum": [
        "pending",
        "active",
        "inactive",
        "adding",
        "addition_failed",
        "terminating",
        "termination_failed",
        "pending_termination"
      ],
      "title": "SubscriptionStatus"
    }
  }
}