Loading documentation

Access required

Your account doesn't have access to the documentation. Contact your administrator.

Sign out
Skip to main content

Risk Magnitude

Status: stable Category: composite Added: 2026-06-03 Last reviewed: 2026-06-03

Summary

The standalone "how much" readout. /magnitude/compute accepts the same permissive input as /cdri/compute (any subset of the 14 instruments plus optional demographics) and returns just the magnitude block — the seven phenotype-named severities, an overall_magnitude, and a ranked ordering — plus confidence and any red_flags. It does not return a cdri_score, a phenotype distribution, or per-finding detail.

Use it when you want the per-pattern severity vector without the full composite envelope — for example to drive a dashboard that charts the seven magnitudes, or to rank which pattern is strongest for a subject.

⚠ Not a clinical diagnosis

Magnitudes are risk severities, not diagnoses. See the CDRI disclaimer.

Endpoint

FieldValue
MethodPOST
Path/api/magnitude/compute
Full URLhttps://engine.tripod-health.com/api/magnitude/compute
AuthenticationAPI key (required)
Request bodyapplication/json
Rate-limitedYes

Request

Headers, query parameters (recommend, audience), body shape (instruments + optional demographics), partial-instrument handling, ORT sex-conditioning, and the de-identification filter are identical to /cdri/compute. This endpoint does not take situation/onset (that is the acuity endpoint).

{
"instruments": {
"depression_screen": { "responses": { "item_1": 3, "item_2": 3, "item_3": 2, "item_4": 3, "item_5": 2, "item_6": 3, "item_7": 2, "item_8": 1, "item_9": 1 } },
"orebro": { "responses": { "item_1": 4, "item_2": 5, "item_3": 4, "item_4": 6, "item_5": 6, "item_6": 4, "item_7": 5, "item_8": 6, "item_9": 6, "item_10": 4, "item_11": 6, "item_12": 6, "item_13": 4, "item_14": 5, "item_15": 4, "item_16": 6, "item_17": 6, "item_18": 4, "item_19": 4, "item_20": 5, "item_21": 4 } }
},
"demographics": { "age_bracket": "35-44", "sex": "female", "occupation_class": "office", "region": "CA" }
}

Response

Success — 200 OK

Live capture against production with ?recommend=rules (a psychosocially-loaded subject). Real engine output.

{
"composite_id": "magnitude",
"magnitudes": {
"pain_dominant": 0.5,
"psychosocial_dominant": 0.731,
"fear_avoidance_dominant": 0.5,
"rtw_barrier": 0.5,
"multi_domain_catastrophic": 0.65,
"iatrogenic_escalation": 0.5,
"established_chronicity": 0.62
},
"overall_magnitude": 0.731,
"ranked": [
"psychosocial_dominant",
"multi_domain_catastrophic",
"established_chronicity",
"fear_avoidance_dominant",
"iatrogenic_escalation",
"pain_dominant",
"rtw_barrier"
],
"matrix_version": "2026-06-02-first-pass",
"red_flags": [
{
"code": "complex_case_review",
"severity": "urgent",
"rule_id": "rec.escalation.multi_domain_catastrophic_top2",
"rule_version": "1.0.0",
"detail": "Phenotype 'multi_domain_catastrophic' appears in the top-two of the classifier's distribution.",
"triggers": {
"phenotype.top_name": "psychosocial_dominant",
"phenotype.second_name": "multi_domain_catastrophic"
}
},
{
"code": "suicide_risk_assessment",
"severity": "urgent",
"rule_id": "rec.escalation.phq9_item9_suicidality",
"rule_version": "1.0.0",
"detail": "PHQ-9 item 9 response is at or above the positive threshold. Widely-used screening frameworks treat any non-zero item-9 response as a trigger for follow-up risk assessment regardless of total PHQ-9 score.",
"triggers": { "depression_screen.item_9": 1 }
}
],
"confidence": {
"overall": 0.5547,
"tier": "medium",
"breakdown": {
"input_completeness": 0.5,
"imputation_variance": 1,
"model_certainty": 0.1825
}
},
"recommendations": {
"engine_version": "1.0.0",
"ruleset_version": "1.0.0",
"disclaimer": "The Trinity Engine is a decision-support tool. Output is not medical advice, not a diagnosis, not a prescription, and not a benefits determination. The calling organization is responsible for clinical governance and for the interpretation and use of these suggestions.",
"ai_summary": null,
"items": [ "... see /cdri/compute for the recommendation item shape ..." ],
"suppressed": [],
"cardinality_cap": null
},
"depth": "full",
"catalog_version": "0.13.0",
"request_id": "docs-magnitude",
"timestamp": "2026-06-03T04:21:42.866684+00:00"
}

The recommendations.items payload is shown in full on the CDRI doc; the item shape is identical here. This capture had two urgent escalations, also surfaced in red_flags.

Response fields

FieldTypeDescription
composite_idstringAlways "magnitude".
magnitudesobjectSeven phenotype-named severities (0.01.0). Same semantics as CDRI magnitudes.
overall_magnitudenumber | nullThe peak of the seven magnitudes.
rankedarray<string>The seven phenotype names ordered highest-magnitude first. A convenience ordering so callers do not have to sort magnitudes themselves.
matrix_versionstring | nullOpaque version tag for the active scoring configuration. Do not pin.
red_flagsarraySafety escalations. Same shape as CDRI red flags. Independent of ?recommend=.
confidenceobjectSame shape as CDRI confidence.
recommendationsobject | nullSame shape and modes as CDRI recommendations; null under ?recommend=off.
depthstringAlways "full".
catalog_versionstringCatalog version served.
request_idstringCorrelation ID.
timestampstring (ISO 8601 UTC)Server time.

There is no findings, phenotype, or cdri_score in this response. Reach for /cdri/compute when you need those.

Examples

curl

curl -sS -X POST "https://engine.tripod-health.com/api/magnitude/compute?recommend=rules" \
-H "apikey: $ENGINE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"instruments": {
"depression_screen": { "responses": { "item_1": 3, "item_2": 3, "item_3": 2, "item_4": 3, "item_5": 2, "item_6": 3, "item_7": 2, "item_8": 1, "item_9": 1 } },
"orebro": { "responses": { "item_1": 4, "item_2": 5, "item_3": 4, "item_4": 6, "item_5": 6, "item_6": 4, "item_7": 5, "item_8": 6, "item_9": 6, "item_10": 4, "item_11": 6, "item_12": 6, "item_13": 4, "item_14": 5, "item_15": 4, "item_16": 6, "item_17": 6, "item_18": 4, "item_19": 4, "item_20": 5, "item_21": 4 } }
},
"demographics": { "age_bracket": "35-44", "sex": "female", "occupation_class": "office", "region": "CA" }
}'

Python (requests)

# Uses the call() helper from quickstart.md.
result = call("POST", "/api/magnitude/compute?recommend=rules", body)
print(f"strongest pattern: {result['ranked'][0]} ({result['overall_magnitude']})")
for name in result["ranked"]:
print(f" {name:26} {result['magnitudes'][name]:.3f}")

Status codes

Same as /cdri/compute.

Change history

DateChange
2026-06-03Initial publication (Risk Magnitude split out as a standalone surface).