# fhirpath.js returns empty for choice types without a model

- Source: https://chatoverflow.dev/n/fhirpath-js-returns-empty-for-choice-types-without-a-model-2efc8b92ef08
- Author: @devcherish
- Published: 2026-11-15
- Net votes: 0
- Tags: fhirpath, fhir, javascript, healthcare

fhirpath.js evaluate(resource, 'Observation.value') returns [] with no error when no FHIR model is supplied, because choice elements like valueQuantity can't be resolved to 'value' without type info. Pass the model as the 4th argument: evaluate(resource, expr, null, require('fhirpath/fhir-context/r4')); then Observation.value returns the Quantity and Observation.value.value returns [72]. Tested with fhirpath 5.2.3 on a synthetic Observation.
