{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/api-evangelist/elation-health/main/json-schema/elation-health-referral-order-schema.json", "title": "ReferralOrder", "x-generated": "2026-10-12", "x-method": "derived", "x-generator": "derive-json-schema.py", "x-source": "openapi/elation-health-referrals-api-openapi.yml#/components/schemas/ReferralOrder", "properties": { "auth_number": { "maxLength": 20, "type": [ "string", "null" ] }, "authorization_for": { "oneOf": [ { "$ref": "#/$defs/AuthorizationForEnum" }, { "$ref": "#/$defs/NullEnum" } ] }, "authorization_for_short": { "type": [ "string", "null" ] }, "consultant_name": { "maxLength": 1024, "type": [ "string", "null" ] }, "date_for_reEval": { "format": "date", "type": [ "string", "null" ] }, "icd10_codes": { "items": { "$ref": "#/$defs/ICD10Code" }, "type": "array" }, "id": { "readOnly": true, "type": "integer" }, "letter": { "deprecated": true, "description": "The letter associated with this referral order. Use referral_letter for the full nested letter object.", "format": "int64", "readOnly": true, "type": "integer" }, "patient": { "format": "int64", "type": "integer" }, "practice": { "format": "int64", "type": "integer" }, "referral_letter": { "allOf": [ { "$ref": "#/$defs/ReferralLetter" } ], "description": "Nested letter object with full details.", "readOnly": true }, "resolution": { "$ref": "#/$defs/DocumentResolutionState" }, "short_consultant_name": { "maxLength": 1024, "type": [ "string", "null" ] }, "sign_date": { "description": "The datetime when this referral order was signed.", "format": "date-time", "readOnly": true, "type": [ "string", "null" ] }, "signed_by": { "description": "The ID of the user who signed this referral order.", "readOnly": true, "type": "integer" }, "specialty": { "$ref": "#/$defs/MedicalSpecialty" } }, "required": [ "auth_number", "consultant_name", "date_for_reEval", "patient", "practice", "short_consultant_name", "specialty" ], "type": "object", "$defs": { "AuthorizationForEnum": { "enum": [ "Consult (One Visit Only)", "Procedure / Testing Only", "Referral For Treatment, includes Consult Visit" ], "type": "string" }, "DocumentResolutionState": { "properties": { "created_date": { "description": "The datetime when this resolution state was created.", "format": "date-time", "readOnly": true, "type": [ "string", "null" ] }, "deleted_date": { "description": "The datetime when this resolution was deleted. Should never be null because we're providing the most updated resolution.", "format": "date-time", "readOnly": true, "type": [ "string", "null" ] }, "document": { "description": "Will be the same as the id of the lab order.", "format": "int64", "readOnly": true, "type": "integer" }, "id": { "description": "Internal id to represent the resolution state.", "readOnly": true, "type": "integer" }, "note": { "description": "Any note that was added to represent why an order was cancelled.", "maxLength": 200, "type": [ "string", "null" ] }, "resolving_document": { "description": "If the order is fulfilled will indicate the document referenced. For lab orders will usually be a report. Must be an integer ID or null.", "format": "int64", "type": [ "integer", "null" ] }, "state": { "allOf": [ { "$ref": "#/$defs/StateEnum" } ], "description": "The resolution state of the order.\n\n* `outstanding` - Outstanding\n* `fulfilled` - Fulfilled\n* `cancelled` - Cancelled" } }, "required": [ "state" ], "type": "object" }, "ICD10Code": { "properties": { "code": { "maxLength": 50, "type": "string" }, "description": { "maxLength": 500, "type": [ "string", "null" ] } }, "required": [ "code" ], "type": "object" }, "MedicalSpecialty": { "properties": { "abbreviation": { "maxLength": 20, "type": "string" }, "category": { "$ref": "#/$defs/MedicalSpecialtyCategory" }, "created_date": { "format": "date-time", "readOnly": true, "type": [ "string", "null" ] }, "id": { "readOnly": true, "type": "integer" }, "name": { "maxLength": 100, "type": "string" }, "practice_created": { "format": "int64", "type": [ "integer", "null" ] } }, "required": [ "abbreviation", "name" ], "type": "object" }, "MedicalSpecialtyCategory": { "properties": { "abbreviation": { "maxLength": 20, "type": [ "string", "null" ] }, "created_date": { "format": "date-time", "readOnly": true, "type": [ "string", "null" ] }, "id": { "readOnly": true, "type": "integer" }, "name": { "maxLength": 100, "type": "string" } }, "required": [ "name" ], "type": "object" }, "NullEnum": { "type": "null" }, "ReferralLetter": { "properties": { "body": { "description": "The body of the letter.", "type": "string" }, "delivery_date": { "format": "date-time", "type": [ "string", "null" ] }, "id": { "readOnly": true, "type": "integer" }, "sign_date": { "format": "date-time", "type": [ "string", "null" ] } }, "type": "object" }, "StateEnum": { "description": "* `outstanding` - Outstanding\n* `fulfilled` - Fulfilled\n* `cancelled` - Cancelled", "enum": [ "outstanding", "fulfilled", "cancelled" ], "type": "string" } } }