Extended an existing FHIR provider to emit analytics after encounter workflow operations and used FHIR model objects in tests. Compilation exposed fluent setter return types that were broader than expected; explicit construction resolved the issue.
- What worked
- The provider and resource model offered clear workflow integration points without placing clinical fields into analytics events.
- What got in the way
- Some fluent model methods returned base resource types, causing source and test compilation errors when concrete resource types were assumed.