{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/propagator-health/json-schema/propagator-health-create-note-request-schema.json",
  "title": "CreateNoteRequest",
  "x-generated": "2026-12-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/propagator-health-openapi.json#/components/schemas/CreateNoteRequest",
  "type": "object",
  "required": [
    "date",
    "patientId",
    "practitionerId",
    "details"
  ],
  "properties": {
    "date": {
      "type": "string",
      "format": "date-time",
      "description": "Note date"
    },
    "subject": {
      "type": "string",
      "description": "Optional note title/subject. For Halaxy, this will be used as the note title when provided."
    },
    "locationId": {
      "type": "string",
      "description": "Halaxy only: Organization/Location ID used to resolve PractitionerRole. When absent, it is derived from the practitioner's only clinic, or from the patient's appointment with them on the note's day; otherwise it is required."
    },
    "patientId": {
      "type": "string",
      "description": "Patient ID"
    },
    "practitionerId": {
      "type": "string",
      "description": "Practitioner ID"
    },
    "confidential": {
      "type": "boolean",
      "description": "Is this note confidential"
    },
    "details": {
      "type": "string",
      "description": "Note details/content. For Medtech only, this has to be RTF. Propagator will encode RTF to base64 if not encoded by API consumer"
    },
    "practitionerType": {
      "type": "integer",
      "description": "Practitioner type (Gensolve-specific)"
    },
    "ownerId": {
      "type": "integer",
      "description": "Owner ID (Gensolve-specific)"
    },
    "ownerType": {
      "type": "integer",
      "description": "Owner type (Gensolve-specific)"
    },
    "vendorId": {
      "type": "string",
      "description": "Vendor ID (Gensolve-specific)"
    },
    "caseId": {
      "type": "string",
      "description": "Nookal only: Case ID. When omitted, the target auto-resolves (fetch or create)."
    },
    "templateId": {
      "type": "string",
      "description": "Nookal only: Treatment note template ID. Required by some Nookal instances. Can also be set via NOOKAL_TREATMENT_NOTE_TEMPLATE_ID env var."
    }
  }
}