NCP Step 2 — nutrition diagnosis (PES statement)
POST /fhir/Condition/$diagnose · API key required
Validates and shapes clinician-supplied PES statements (problem, etiology, signs/symptoms) into Condition resources. Does not choose the diagnosis. problemCode values like NI-5.2 are resolved against the NCP diagnostic terminology in Supabase (503 if the terminology is not loaded). The PES statement is stored as components (`pes-statement` extension: statement, coded problem, etiologies, signs with evidence references) as well as text. Optional `etiologyItem` / `signItem` parts add coded components and evidence: a `signItem` can hold an inline `observation` (validated like $nutrition-assessment, returned in the Bundle and linked from Condition.evidence) or `evidence` references to existing Observations; `additionalCoding` adds ICD-10/SNOMED CT beside the NCP term. With `author` (and optional `source`, `asserter`, `encounter`) the Conditions get recorder/encounter and one Provenance per diagnosis. Stateless: nothing is stored. Body is a FHIR Parameters resource; success is a Bundle of Conditions (plus evidence Observations and Provenance); errors are OperationOutcomes listing every problem. See the API README, "NCP operations". Access: this operation needs a Bearer credential carrying the scope `system/Condition.write`. A missing credential returns 401, a missing scope 403 (both as OperationOutcome).
Request body
Content type: application/json
Responses
200- FHIR Bundle400- FHIR OperationOutcome — malformed or incomplete input401- Missing or invalid credential403- Credential lacks the required FHIR scope422- FHIR OperationOutcome — valid input, unsupported case (e.g. a child sent to the adult assessment)429