Hi HAPI FHIR community,
We’re evaluating HAPI FHIR to implement FHIR-based payer connectivity at our organization, and we’ve run into a pragmatic interoperability issue that I’d like feedback on before proposing a PR.
From a payer JSON response payload sample, we’re receiving a ClaimResponse resource with:
In HAPI this currently fails during parsing - specifically in the enum mapping fromCode method where the incoming string is matched using a direct string equality comparison (so "Active" does not map to active).
So far, I’ve only observed this particular case on ClaimResponse.status, but it feels like a “canary in a coal mine”: once we start integrating broadly, we expect to encounter similar capitalization issues on other enum-coded fields.
We absolutely agree the correct fix is for partners to send conformant FHIR. We also understand why HAPI should remain strict by default, accepting nonconformant content can hide data quality issues and reduce pressure on implementers.
In our case, we would still treat this as a partner defect and push for correction; the goal is to avoid blocking connectivity while remediation is in progress.
Would the community be open to a configurable (opt-in) feature that allows case-insensitive matching when parsing known enum-backed code values, so that "Active" maps to the existing enum value active?
Key goals:
A strawman name might be something like:
enableCaseInsensitiveEnumCodeMatching (name totally negotiable).
Before I write code, I’d love community/maintainer input on scope and design direction:
Would an opt-in “case-insensitive enum code parsing” feature be acceptable in principle?
If yes, what scope would be most appropriate?
Where would you prefer this configuration to live (high-level guidance is enough):
If this direction is acceptable, I’m prepared to:
If helpful, I can provide a minimal reproducible example (resource + current exception/failure location) and a proposed test case layout.
Thanks in advance for any guidance, and for all the work you all do on HAPI FHIR.
-- Donald Wheeler
--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/hapi-fhir/fd9f061d-a357-405f-a168-03151dd2b673n%40googlegroups.com.
Hi James,
Thank you; I really appreciate the thoughtful take, and the comparison to other places where HAPI is already pragmatically lenient.
I’m going to look closely at your suggested approach in ParserState.PrimitiveState#attributeValue (detect rejection → confirm enum → find same-but-different-case value → recover). That makes sense and fits the existing “recoverable parse error” pattern you described.
That said, I’d like to counter‑propose an even more direct option:
Loosen the enum matching at the source, i.e., in the generated fromCode(String) methods where we currently do direct string equality.
Two options:
Why I like this approach:
If you think enum-level relaxation is acceptable, I can put together a small PR with tests showing strict behavior isn’t impacted beyond this casing tolerance.
Happy to follow the IParserErrorHandler recovery approach if that’s the preferred direction; I just wanted to float this simpler alternative first.
Cheers,
Donald Wheeler
To view this discussion visit https://groups.google.com/d/msgid/hapi-fhir/3f7d2984-db23-4a96-a469-9b36e62416d3n%40googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/hapi-fhir/acbf6fc7-ee1d-4f6e-a674-13e816785cf3n%40googlegroups.com.