Encounter status Has an Invalid Code
Encounter.status is bound to a required value set: planned, arrived, triaged, in-progress, onleave, finished, cancelled. Other values are rejected.
FHIR · Error
The error
Encounter status must be one of the encounter-status codesWhy it happens
Using completed instead of finished, active instead of in-progress, or a local workflow status that was never mapped to the FHIR codes.
How to fix it
Map the workflow state to a valid code. A completed visit is finished, an ongoing visit is in-progress. Note these differ from other resources (Encounter uses finished, not completed).
Example
The snippet below triggers the error:
{
"resourceType": "Encounter",
"status": "completed",
"class": { "code": "AMB" }
}The corrected version:
{
"resourceType": "Encounter",
"status": "finished",
"class": { "code": "AMB" }
}Frequently asked questions
Why is it finished and not completed?
Each FHIR resource has its own status value set. Encounter uses finished for a concluded visit, while Observation and MedicationRequest use completed. Reusing the wrong one is a frequent mistake.
Related
- Open the FHIR Validator
- All validation errors
- resourceType Is Required
- Unknown FHIR R4 Resource Type
- Required Element Is Missing for This Resource
- gender Must Be male, female, other, or unknown
- birthDate Must Be YYYY, YYYY-MM, or YYYY-MM-DD
- instant Must Include a Timezone
- Resource id Has an Invalid Format
- subject Must Be a Reference Object, Not a String