{
  "contractVersion": "harness.catalyst-notebook.http-exchange.v1",
  "request": {
    "method": "POST",
    "path": "/v1/catalyst/workbench/versions/fdd4cd09-45b4-4efd-b585-9d4ad4d9e140/execute",
    "body": {
      "contractVersion": "catalyst.workbench.execute.request.v1",
      "versionId": "fdd4cd09-45b4-4efd-b585-9d4ad4d9e140",
      "queryDigest": "8ca32d51d32129b743610d1950cac3b802bc39c4c3fe0c5cbada67660d2f5425",
      "idempotencyKey": "harness-notebook-1259f203-0dcb-478c-a6e6-4c2b8aff9aaa"
    }
  },
  "response": {
    "httpStatus": 200,
    "body": {
      "contractVersion": "catalyst.workbench.execution.v1",
      "queryDigest": "8ca32d51d32129b743610d1950cac3b802bc39c4c3fe0c5cbada67660d2f5425",
      "idempotencyKey": "harness-notebook-1259f203-0dcb-478c-a6e6-4c2b8aff9aaa",
      "validationStatus": "valid",
      "query": {
        "sql": "SELECT\n  DATE_TRUNC('month', observed_at) AS observed_month,\n  COUNT(*) AS result_count,\n  COUNT(DISTINCT patient_id) AS distinct_patient_count,\n  PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY result_value) AS median_result_value\nFROM analytics.lab_result_fact_v1\nWHERE observed_at >= :start_date\n  AND result_value IS NOT NULL\nGROUP BY 1\nORDER BY 1",
        "parameters": [
          {
            "value": "2026-01-01",
            "type": "date",
            "name": "start_date",
            "source": "question"
          }
        ]
      },
      "statementTimeoutMs": 10000,
      "maxRows": 100,
      "replayed": false,
      "status": "succeeded",
      "result": {
        "columns": [
          {
            "ordinal": 0,
            "name": "observed_month",
            "databaseType": "timestamptz",
            "typeOid": 1184,
            "logicalType": "date-time"
          },
          {
            "ordinal": 1,
            "name": "result_count",
            "databaseType": "int8",
            "typeOid": 20,
            "logicalType": "integer"
          },
          {
            "ordinal": 2,
            "name": "distinct_patient_count",
            "databaseType": "int8",
            "typeOid": 20,
            "logicalType": "integer"
          },
          {
            "ordinal": 3,
            "name": "median_result_value",
            "databaseType": "float8",
            "typeOid": 701,
            "logicalType": "decimal"
          }
        ],
        "rows": [
          [
            {
              "type": "date-time",
              "value": "2026-01-01T00:00:00Z"
            },
            {
              "type": "integer",
              "value": 96
            },
            {
              "type": "integer",
              "value": 96
            },
            {
              "type": "decimal",
              "value": "3100.0"
            }
          ],
          [
            {
              "type": "date-time",
              "value": "2026-02-01T00:00:00Z"
            },
            {
              "type": "integer",
              "value": 1
            },
            {
              "type": "integer",
              "value": 1
            },
            {
              "type": "decimal",
              "value": "450.0"
            }
          ],
          [
            {
              "type": "date-time",
              "value": "2026-03-01T00:00:00Z"
            },
            {
              "type": "integer",
              "value": 349
            },
            {
              "type": "integer",
              "value": 61
            },
            {
              "type": "decimal",
              "value": "21.0"
            }
          ],
          [
            {
              "type": "date-time",
              "value": "2026-04-01T00:00:00Z"
            },
            {
              "type": "integer",
              "value": 516
            },
            {
              "type": "integer",
              "value": 96
            },
            {
              "type": "decimal",
              "value": "24.5"
            }
          ]
        ],
        "rowCount": {
          "returned": 4,
          "truncated": false,
          "truncationReason": null
        },
        "warnings": []
      },
      "durationMs": 6,
      "executionId": "435d3d61-51e8-4cf5-80cc-4e6268b95470",
      "sessionId": "9a400a49-9d9c-4faf-8d58-2547da9bcdbd",
      "versionId": "fdd4cd09-45b4-4efd-b585-9d4ad4d9e140",
      "ordinal": 2,
      "completedAt": "2026-08-04T21:19:02.695515Z"
    }
  },
  "elapsedMs": 20
}
