Open Keathley3M opened 8 years ago
Definitely! We have had several ideas in this area already. It's worthwile to pursue further. I will put it on the nearterm roadmap.
We are also considering to move to ASP.NET core and allow you to add your own custom FHIR middleware.
The middleware approach (owin etc.) was another road we were potentially going down if there was no other recourse. I can definitely see the abstraction of pure request/response tuning being a great one-size-fits-all solution for those who wish to stay outside of the spark/fhir lifecycle.
Thanks for the quick response.
We did quite a bit of refactoring here. Let's check how this changes this request.
I may not be alone in the need to modify the resource based on external systems. In order to do this with the highest performance possible (e.g. making external calls only when necessary), the ideal place would be right before the storage call is made. Right now the closest implementation of this is the way IServiceListener is used in FhirService, but it only response with the Inform method after the resource is saved.
Can a similar pattern be used to "inform" before the storage call?
https://github.com/furore-fhir/spark/blob/master/src/Spark.Engine/Service/IServiceListener.cs
https://github.com/furore-fhir/spark/blob/master/src/Spark.Engine/Service/FhirService.cs