API Reference

Get diagnostic study

Returns a single Cortex diagnostic study — typically a lab result ingested from in-clinic analyzers (ASTM, HL7, DICOM, POCT1-A) via the Vetigen Cortex daemon, or manual entry. ### What Is Cortex? **Vetigen Cortex** is an on-premises Go daemon running on clinic computers that interfaces with lab instruments and imaging modalities, normalizes results, and pushes them to the Vetigen API. Each result creates a `CortexDiagnosticStudy` entity. See the [Diagnostics Guide](/docs/guides/lab-results) for integration details. ### Modalities `HEMATOLOGY` · `BIOCHEMISTRY` · `URINALYSIS` · `RADIOLOGY` · `ULTRASOUND` · `ENDOSCOPY` ### Result Flags Each analyte entry includes a `flag` field — `normal` / `low` / `high` / `critical` — computed against the patient's species-specific reference range at the time of acquisition.

GET
/api/v1/cortex/diagnostics/{fp}

Authorization

JWT-auth
AuthorizationBearer <token>

API key issued from the Vetigen Developer Portal. Pass as Authorization: Bearer YOUR_API_KEY.

In: header

Path Parameters

fp*string

Diagnostic study fingerprint (cds_{ULID}).

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -H "Authorization: Bearer $VETIGEN_API_KEY" \  https://api.vetigen.com/api/v1/cortex/diagnostics/cds_01JABC
{
  "success": true,
  "data": {
    "fp": "cds_01JABC...",
    "patient_fp": "patient_01JABC...",
    "modality": "HEMATOLOGY",
    "device_name": "IDEXX ProCyte Dx",
    "status": "COMPLETED",
    "acquired_at": "2026-04-10T11:22:08.000Z",
    "results": [
      {
        "analyte": "WBC",
        "value": 12.4,
        "unit": "10^9/L",
        "reference_range": "6.0–17.0",
        "flag": "normal"
      },
      {
        "analyte": "HCT",
        "value": 38.1,
        "unit": "%",
        "reference_range": "37.0–55.0",
        "flag": "normal"
      },
      {
        "analyte": "PLT",
        "value": 165,
        "unit": "10^9/L",
        "reference_range": "200–500",
        "flag": "low"
      }
    ]
  }
}
{
  "success": false,
  "error": {
    "code": "AUTH.UNAUTHORIZED",
    "message": "Authentication required.",
    "severity": "error"
  }
}
{
  "success": false,
  "error": {
    "code": "AUTH.FORBIDDEN",
    "message": "Insufficient permissions.",
    "severity": "error"
  }
}
{
  "success": false,
  "error": {
    "code": "PATIENT.NOT_FOUND",
    "message": "Patient with fingerprint patient_01JABC does not exist.",
    "severity": "error",
    "details": {}
  }
}
{
  "success": false,
  "error": {
    "code": "AUTH.RATE_LIMITED",
    "message": "Rate limit exceeded. Retry in 42 seconds.",
    "severity": "warning"
  }
}
{
  "success": false,
  "error": {
    "code": "PATIENT.NOT_FOUND",
    "message": "Patient with fingerprint patient_01JABC does not exist.",
    "severity": "error",
    "details": {}
  }
}

Get SOAP record

Returns a single SOAP (Subjective / Objective / Assessment / Plan) examination record by fingerprint. ### Ownership & Visibility SOAP records are global entities — multiple clinics may view the same record via the patient's `CustomerClinicConnection`, but only the clinic matching `performed_by_clinic_fp` can modify it. This endpoint is **read-only** and respects visibility only. ### Status State Machine - `DRAFT` → `IN_PROGRESS` → `SIGNED` → `LOCKED` - A `SIGNED` record is immutable; corrections require a new amendment record. ### Plan Items The `plan` field contains free-text summary. Structured plan items (medications, labs, vaccines, follow-up appointments, todos) live in a separate polymorphic `plan_items` collection not returned here — fetch via the upcoming `/api/v1/soap/{fp}/plan-items` endpoint.

List inventory items

Returns a paginated list of inventory items for the clinic associated with your API key. ### Clinic-Scoped Unlike patients and medical records, inventory is **clinic-specific** — each clinic maintains its own stock. The `clinic_fp` is inferred from your API key and never accepted as a parameter. ### Pricing & Currency - `unit_price_cents` is an integer in the smallest currency unit (e.g. kurus for TRY, cents for USD). Divide by 100 for display. - `currency` uses ISO 4217 codes. Clinics may operate in TRY, USD, EUR, or GBP. ### Virtual Items `is_virtual: true` marks items that don't track physical stock — consultation fees, procedures, service charges. Stock operations (reserve, decrement, return) fail silently on virtual items. ### Stock Allocation Strategy When items are consumed through sales or treatments, allocation follows: - **Medications & vaccines:** FEFO (First Expiry, First Out) — batches with nearest `expiry_date` used first - **Other categories:** FIFO (First In, First Out) — oldest batches first