Skip to main content

Diagnosis and Procedure Coding

JSON Schema

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "diagnosis_and_procedures/v1",
  "type": "object",
  "required": ["diags", "procs"],
  "properties": {
    "diags": {
      "type": "array",
      "description": "List of diagnosis codes (ICD-10)",
      "items": {
        "type": "string",
        "source": "CIE-10-MC-ES-2026"
      },
      "examples": [["A00.1", "B39.0"]]
    },
    "procs": {
      "type": "array",
      "description": "List of procedure codes (ICD-10-PCS or local codes)",
      "items": {
        "type": "string",
        "source": "CIE-10-PCS-ES-2026"
      },
      "examples": [["0016078", "005T0ZZ", "0QW234Z"]]
    }
  }
}

Complete Request

{
  "input": "45-year-old male patient with high fever (39°C), dry cough, and general malaise for 3 days. Chest X-ray suggests right lobar pneumonia. Amoxicillin-clavulanate prescribed.",
  "json_schema": {
    "$ref": "./diag-proc.schema.json"
  },
  "configure": "Code only with valid codes. Do not invent. If in doubt, leave empty.",
  "target_language": "es-ES",
  "metadata": {
    "encounter_type": "primary_care",
    "site": "Health Center North District"
  }
}

Response

{
  "data": {
    "diags": ["J18.1"],
    "procs": ["0B9D0ZX"]
  },
  "run_id": "run_abc123"
}

Structured Clinical Note

JSON Schema

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "clinical_note/v1",
  "type": "object",
  "required": ["chief_complaint", "history_present_illness", "treatment_plan"],
  "properties": {
    "current_date": { "type": "string" },
    "next_appointment": { "type": "string" },
    "chief_complaint": { "type": "string" },
    "summary": { "type": "string" },
    "history_present_illness": { "type": "string" },
    "comments_observations": { "type": "string" },
    "treatment_plan": { "type": "string" },
    "orders": { "type": "string" },
    "vital_signs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": { "type": "string" },
          "value": { "type": "string" },
          "unit": { "type": "string" },
          "timestamp": { "type": "string", "format": "date-time" }
        }
      }
    }
  }
}

Complete Request

{
  "input": "29-year-old female patient with odynophagia, fever 38.5°C for 2 days. Examination: tonsillar plaques, tender cervical lymphadenopathy, no exanthem. Treatment: ibuprofen and rest. Antigen test suggested.",
  "json_schema": {
    "$ref": "./clinical-note.schema.json"
  },
  "configure": "Extract concise text and do not invent data not present.",
  "target_language": "en-US"
}

Response

{
  "data": {
    "current_date": "2025-10-19T09:45:00Z",
    "next_appointment": "",
    "chief_complaint": "Sore throat and fever for 2 days",
    "summary": "Probable pharyngotonsillitis; ibuprofen started, rest and hydration; consider antigen test.",
    "history_present_illness": "Pharyngeal pain, fever 38.5°C, odynophagia. Tonsillar plaques, cervical lymphadenopathy.",
    "comments_observations": "Good general condition, no exanthem.",
    "treatment_plan": "Ibuprofen 400 mg every 8h for 3 days; rest; hydration.",
    "orders": "Rapid streptococcal antigen test if available.",
    "vital_signs": [
      {
        "name": "temperature",
        "value": "38.5",
        "unit": "°C",
        "timestamp": "2025-10-19T09:40:00Z"
      }
    ]
  },
  "run_id": "run_def789"
}

Next Steps

  1. API quickstart
  2. More API examples
  3. Request and response reference
  4. Interactive API playground