Openemr fhir smart bulk (#4582)
commit7ccdd2628e0303af653e4cfdb2fc6e47ef5a83b8
authorStephen Nielson <stephen@nielson.org>
Mon, 16 Aug 2021 20:06:32 +0000 (16 16:06 -0400)
committerGitHub <noreply@github.com>
Mon, 16 Aug 2021 20:06:32 +0000 (16 16:06 -0400)
tree1ff828612c37dde96d4fd1ffcbc1bfe48808e2ee
parent44f8e7cd3010b8641cb986fe39a76506cef5f590
Openemr fhir smart bulk (#4582)

* Added Device, disable system write permissions.

We definitely don't want to allow system write permissions until we
understand the ramifications better.

Made it so we support implantable device exports here.

* Removed phpseclib notice.

Had a phpseclib notice dumping to the screen if you tried to use EC384
instead of RS384 which screws up the JSON reporting back on the REST api
and leaks implementation details to outsiders we don't want.

* Implemented basic bulk export for Allergy Intolerance

* Fix Patient Bulk FHIR, Implement in Core Resources

Fixed language, and race elements with patient resources not validating correctly
according to US Core.

Added initial implementation for bulk fhir export to all US Core resources.

* Fix bulk export capability statement operations.

Fixed the reporting of the bulk export operations for the FHIR
capability statement.

* Refactored ServiceLocator to prepare provenance.

In order to grab all of the provenance data we need to use our service
locator.  For that to happen we need to loop through all the services.
Since we have an export service locator that does this we refactored the
service locator and pulled it out into its own class that allows us to
find FHIR services that implement a particular class or sub-class.

* Enforce access rights on document search operations

* Restrict PatientDocumentReference to patient docs

Had it so the patient doc reference was returning all documents instead
of just restricted to patient only.  This fixes a number of problems in
the bulk exporter.

However, system level documents (such as the exporter files themselves)
are not includes in the export now.  A future feature enhancement will
have to include these kinds of doc)

* Added some comments for future work.

* Bulk FHIR MedicationRequest,Encounter,Provenance

We implemented support for provenance and MedicationRequest.  Still
working on Encounter which needs a bunch of work.

* Added logger helper method to log function context

Got tired of writing class names & method names and wrote out a logger
function to do this.

* Implemented DAR for blood pressure.

We needed to support data absent reason for bpd/bps and so we had to
allow saving of '0' values which we now do and report on that.

* Implement Provenance Bulk FHIR export.

Had to use the service locator for bulk fhir provenance export.  Its a
slow query request due to using the capability statement.  Fortunately
Bulk FHIR is async but there's a lot of records exported here...

* Fix styles

* Fixing use statement together.

* Fix style.  Fix provenance getAll
35 files changed:
_rest_routes.inc.php
src/Common/Auth/OpenIDConnect/Grant/CustomClientCredentialsGrant.php
src/Common/Auth/OpenIDConnect/Repositories/ScopeRepository.php
src/Common/Forms/FormVitals.php
src/Common/Logging/SystemLogger.php
src/RestControllers/FHIR/FhirExportRestController.php
src/RestControllers/FHIR/FhirProvenanceRestController.php
src/RestControllers/RestControllerHelper.php
src/Services/DocumentService.php
src/Services/FHIR/DocumentReference/FhirPatientDocumentReferenceService.php
src/Services/FHIR/FhirAllergyIntoleranceService.php
src/Services/FHIR/FhirCarePlanService.php
src/Services/FHIR/FhirCareTeamService.php
src/Services/FHIR/FhirCodeSystemConstants.php
src/Services/FHIR/FhirConditionService.php
src/Services/FHIR/FhirDeviceService.php
src/Services/FHIR/FhirDiagnosticReportService.php
src/Services/FHIR/FhirDocumentReferenceService.php
src/Services/FHIR/FhirEncounterService.php
src/Services/FHIR/FhirExportServiceLocator.php
src/Services/FHIR/FhirGoalService.php
src/Services/FHIR/FhirImmunizationService.php
src/Services/FHIR/FhirLocationService.php
src/Services/FHIR/FhirMedicationRequestService.php
src/Services/FHIR/FhirObservationService.php
src/Services/FHIR/FhirOrganizationService.php
src/Services/FHIR/FhirPatientService.php
src/Services/FHIR/FhirPersonService.php
src/Services/FHIR/FhirPractitionerService.php
src/Services/FHIR/FhirProcedureService.php
src/Services/FHIR/FhirProvenanceService.php
src/Services/FHIR/Observation/FhirObservationVitalsService.php
src/Services/FHIR/Traits/BulkExportSupportAllOperationsTrait.php [new file with mode: 0644]
src/Services/FHIR/Traits/FhirBulkExportDomainResourceTrait.php [new file with mode: 0644]
src/Services/FHIR/Utils/FhirServiceLocator.php [copied from src/Services/FHIR/FhirExportServiceLocator.php with 66% similarity]