{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ellkay/json-schema/ellkay-lkcloud-connect-swagger-swagger-requests-lkdocuments-create-document-swagger-request-schema.json",
  "title": "LKCloudConnect.Swagger.SwaggerRequests.LKDocuments.CreateDocumentSwaggerRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ellkay-lkdocuments-api-openapi.yml#/components/schemas/LKCloudConnect.Swagger.SwaggerRequests.LKDocuments.CreateDocumentSwaggerRequest",
  "type": "object",
  "properties": {
    "request": {
      "allOf": [
        {
          "$ref": "#/$defs/LKCloudConnect.Contracts.Documents.CreateDocumentRequest"
        }
      ]
    }
  },
  "additionalProperties": false,
  "$defs": {
    "LKCloudConnect.Contracts.Documents.CreateDocumentRequest": {
      "required": [
        "documentTypeId",
        "name",
        "patientId"
      ],
      "type": "object",
      "properties": {
        "name": {
          "minLength": 1,
          "type": "string",
          "description": "The name of Document"
        },
        "date": {
          "type": "string",
          "description": "The created date of Document (DateTimeOffset) eg 2019-01-01T00:00:00+00:00",
          "format": "date-time"
        },
        "documentTypeId": {
          "minLength": 1,
          "type": "string",
          "description": "Document type id (ref GetDocumentTypes)"
        },
        "patientId": {
          "minLength": 1,
          "type": "string",
          "description": "Patient id"
        },
        "providerId": {
          "type": "string",
          "description": "Provider id"
        },
        "body": {
          "type": "string",
          "description": "Document body - base64 encoded string",
          "format": "byte"
        },
        "fileFormat": {
          "type": "string",
          "description": "Document file format e.g. Png, Pdf, Json"
        },
        "encounterId": {
          "type": "string",
          "description": "Encounter Id"
        },
        "facilityId": {
          "type": "string",
          "description": "Facilty Id"
        },
        "assignedTo": {
          "allOf": [
            {
              "$ref": "#/$defs/LKCloudConnect.Contracts.Documents.DocumentAssigned"
            }
          ],
          "description": "The practicioner the document should be assigned to for review"
        },
        "needsReview": {
          "type": "boolean",
          "description": "The review status of the document - true if needs review, false otherwise"
        },
        "metadata": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/LKCloudConnect.Contracts.Documents.DocumentMetadata"
          },
          "description": "Meta data for create document request"
        },
        "custom": {
          "type": "object",
          "additionalProperties": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": "System-specific data for special cases"
        }
      },
      "additionalProperties": false
    },
    "LKCloudConnect.Contracts.Documents.DocumentAssigned": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "ID of the user to assign the document to. Use SearchPracticioner"
        }
      },
      "additionalProperties": false
    },
    "LKCloudConnect.Contracts.Documents.DocumentMetadata": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Name"
        },
        "value": {
          "type": "string",
          "description": "Value"
        }
      },
      "additionalProperties": false,
      "description": "Meta data for create document request"
    }
  }
}