Well here I am again wanting to contribute new development and finding I need to add structural change to OpenEMR!
Some may not know that I introduced our current R4 support classes and while I could implement new questionnaire endpoints using R4, the R5 version has some great improvements to the resources, especially forms and SDC making building easier.
Another reason for implementing R5 resource endpoints is that since my recent lforms(already implemented throughout) upgrade to the latest version, both R4B and R5 are now supported. How cool is that?
We already know how we need to implement the new endpoints based on our FHIR structure for current endpoints however the introduction of R5 requires some careful planning.
The already generated R5 classes are available from the same project I manually generated the R4 classes however, the pre generated classes offered have a different namespace and dir. tree structure which are meant for a composer include. I opted not to do a composer include with R4 because I didn’t want to rely on that dependency and generated classes from available xsd and configured to openemrs namespace. I also trimmed out some unneeded classes. When I made this decision nobody really cared about FHIR and was left up to me. Not so with R5 where I’m looking for input concerning this implementation. Some questions are:
- Do we need to maintain the same structure as current R4?
- Do we want to simply include with composer?
Since the answers to those questions will impact how we implement routing and rest endpoint support classes we have new questions such as:
- For routing do we add a version to our API URI such as
https://localhost/apis/default/fhir/v5/
or maybe or a simpler implementation likehttps://localhost/apis/default/fhirr5/
or similar. We still maintain unchanged current R4 routes. My preference is add the /v5. - Do we want to implement a middleware of some sort to arbitrate versions and still utilizing current endpoints. I don’t want to write that piece, do you?
- Do we simply move and refactor current to new version structure in our name space like:
OpenEMR\RestControllers\FHIRR5
orOpenEMR\RestControllers\FHIR\R5
? My preference.
While I’ll do the generation to use the same namespace and dir. structure of R4 if this is preferred(takes at least4-6hours of work), I’d like to take the projects pre-generated and refactor the namespaces and include as FHIR/R5. or we can include as a vendor resource via composer. I can argued either way but I seek the community developers preference.
Some links:
- Generator: GitHub - dcarbone/php-fhir: Tools for consuming data from a FHIR server with PHP
- Pre- generated: php-fhir-generated/src/DCarbone/PHPFHIRGenerated at main · dcarbone/php-fhir-generated · GitHub
- FHIR: Index - FHIR v5.0.0
- Resources: Questionnaire - FHIR v5.0.0 and QuestionnaireResponse - FHIR v5.0.0
I do hope that since I’m taking this on that I’m not left hanging because this is an important upgrade to openemr. Not only preparing for future R5 requirements and along with my intended questionnaire form responses CDR integration, this will complete a very powerful end to end questionnaire feature. Think potential assessments with some smarts.
That’s all I can think of at this time.