WIP Fixes #6800,#6799 fhir/std api sort/pagination #6801
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #6800
Fixes #6799
Add common _sort parameter that can be used in the _rest_routes
Add date,_offset,_limit query parameters to the /api/patient route
Added helper method QueryUtils::escapeLimit for escaping limit parameters in SQL queries.
Changed standard api to return the links parameters if there are paginated responses for the search (someone searched with the _limit/_offset parameters).
Added to FhirPatientService the _lastUpdated search parameter that can be used.
Changed FHIR api to support in the base service the ability to do a searchForOpenEMRRecordsWithConfig method that will allow more customized configuration options in the future in addition to the basic search parameters. It currently supports pagination and sort order. Right now only the patient service supports the options.
I modified the ResourceServiceSearchTrait to be able to handle the _sort,_limit,_count parameters and put them all in a _config property that is handled in the FhirServiceBase class to generate the search config and pass it down to services that implement the searchForOpenEMRRecordsWithConfig method.
This is a work in progress commit as the FHIR links in the bundles still need to be populated. Also need to do more extensive testing with the FHIR api on the sort order and _offset/_limit parameters.
Not sure I like seperating out the clause builder for the where clause and having a separate functionality for the orderby / pagination pieces. It might make sense to have it all in one central function governed by the search parameters. Not sure if I like the centralization, or if it violates the Separation of Concerns principle. Still thinking it through but this is an initial stab at things. I really wish we had done doctrine back when we started all of this as it feels very much like we're getting further and further into reproducing all of the goodies of the doctrine ORM. That'd be a major overhaul that would require a good bit of funding unfortunately.