{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/elation-health/main/json-schema/elation-health-facility-identifier-schema.json",
  "title": "FacilityIdentifier",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/elation-health-lab-facility-identifiers-api-openapi.yml#/components/schemas/FacilityIdentifier",
  "properties": {
    "active": {
      "description": "Whether the facility identifier should be used. Should be true in most cases.",
      "type": "boolean"
    },
    "bidi_connection": {
      "oneOf": [
        {
          "$ref": "#/$defs/BiDiLabConnection"
        },
        {
          "type": "null"
        }
      ],
      "readOnly": true
    },
    "compendium": {
      "description": "The id of the compendium that will be used when the user selects this facility identifier.",
      "format": "int64",
      "type": [
        "integer",
        "null"
      ]
    },
    "created_date": {
      "format": "date-time",
      "readOnly": true,
      "type": [
        "string",
        "null"
      ]
    },
    "deleted_date": {
      "format": "date-time",
      "readOnly": true,
      "type": [
        "string",
        "null"
      ]
    },
    "description": {
      "description": "The text that will displayed to users in the lab order dialog.",
      "maxLength": 255,
      "type": [
        "string",
        "null"
      ]
    },
    "id": {
      "readOnly": true,
      "type": "integer"
    },
    "lab_connection": {
      "type": [
        "integer",
        "null"
      ]
    },
    "lab_facility": {
      "description": "The id that represents the lab.",
      "maxLength": 50,
      "type": "string"
    },
    "practice": {
      "format": "int64",
      "type": "integer"
    },
    "practice_facility": {
      "description": "The id that represents the practice; often an account number provided by the lab vendor.",
      "maxLength": 50,
      "type": "string"
    },
    "practice_secondary_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "user_facing": {
      "description": "Whether this facility identifier will be visible in the lab order dialog. Should be true for most cases.",
      "type": "boolean"
    },
    "vendor": {
      "properties": {
        "display_name": {
          "type": "string"
        },
        "id": {
          "format": "int64",
          "type": "integer"
        },
        "name": {
          "type": "string"
        }
      },
      "type": "object"
    }
  },
  "required": [
    "active",
    "lab_facility",
    "practice",
    "practice_facility",
    "vendor"
  ],
  "type": "object",
  "$defs": {
    "BiDiLabConnection": {
      "properties": {
        "alias": {
          "description": "Get the alias of the connection.",
          "readOnly": true,
          "type": [
            "string",
            "null"
          ]
        },
        "enabled": {
          "description": "Get the enabled status of the connection.",
          "readOnly": true,
          "type": "boolean"
        },
        "id": {
          "readOnly": true,
          "type": "integer"
        },
        "priority": {
          "maximum": 65535,
          "minimum": 0,
          "type": "integer"
        },
        "protocol": {
          "description": "Get the protocol of the connection.",
          "readOnly": true,
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": "object"
    }
  }
}