API ReferenceapiclinicalPOST /v1/red-flags/evaluate

POST /v1/red-flags/evaluate

Service: clinical · operationId: (none)

Required scopes

(no scope declared — review service config)

Request body

{
  "type": "object",
  "properties": {
    "patient_id": {
      "type": "string",
      "minLength": 1
    },
    "brand_id": {
      "type": "string",
      "minLength": 1
    },
    "biomarker_ids": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "patient_id",
    "brand_id"
  ]
}

Responses

200 Red flag evaluation completed

{
  "type": "object",
  "properties": {
    "patient_id": {
      "type": "string"
    },
    "brand_id": {
      "type": "string"
    },
    "flags_detected": {
      "type": "number"
    },
    "flags": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "patient_id": {
            "type": "string"
          },
          "brand_id": {
            "type": "string"
          },
          "rule_id": {
            "type": "string"
          },
          "rule_name": {
            "type": "string"
          },
          "severity": {
            "type": "string",
            "enum": [
              "urgent",
              "warn",
              "info"
            ]
          },
          "biomarker_code": {
            "type": "string"
          },
          "biomarker_id": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "acknowledged": {
            "type": "boolean"
          },
          "detected_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "patient_id",
          "brand_id",
          "rule_id",
          "rule_name",
          "severity",
          "biomarker_code",
          "biomarker_id",
          "message",
          "acknowledged",
          "detected_at"
        ]
      }
    }
  },
  "required": [
    "patient_id",
    "brand_id",
    "flags_detected",
    "flags"
  ]
}

412 Precondition failed (no biomarkers for patient)

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

Example

curl -X POST https://clinical.platform.loop.health/v1/red-flags/evaluate \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'