Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat openemr b11 7742 decision support interventions (openemr#7743)
* CDR rules refactor, PSR-4, testability Refactored the CDR rules editing engine to be in the source tree so we can have PSR-4 autoloading of the files. Refactored the CDR controllers to be able to use Request/Response objects for PSR-7 compatability and to make it possible to unit test without having to do guzzle or curl requests. This is prep work to be able to edit some of the interface to support our onc b11 requirements. * Moved template files fixed template bugs Moved the template files to be in the templates directory to better align with OpenEMR coding standards. Eventually it would be nice to move these to all be twig files. Leaving them alone for now. Removed the undecorated template file as its not used anywhere. Removed the edit/helper/common.php file and moved its elements into the RuleTemplateExtension where the hope is to eventually have these be twig functions. * Refactored AJAX code for rules to centralize code Made the AJAX code for the CDR rules to be centralized using the same controller logic that the rest of the rule engine uses for consistency and access control. * Cleaned up Frontend Controller includes Removed the common, header, and ui files that were being included in the index.php and moved all of the logic into the src folder tree. * DSI additional source attributes Added the additional ONC required dsi source attributes for our existing CDR engine. This includes the display and editing for those attributes. Following attributes are added - patient race usage - patient ethnicity usage - patient language usage - patient sexual orientation usage - patient sex usage - patient dob usage - patient health status assessments usage - patient social determinants of health usage * Initial prototype of b11 View rules Put in the foundation for the b11 viewing of predictive dsi attributes. Right now it shows as a questionnaire, but may switch this to a regular form. I'll have to play around and see what I like better here. * WIP b11 Source Attributes Predictive DSI Added predictive source attributes into the list options to give admin's the ability to add custom attributes. Added new table dsi_source_attributes for tracking the source attribute information on an oauth_clients entity. Added a field to oauth_clients table to track if the client is a predictive or evidence based api client. At some point we want a many to one relationship here, but for now we treat api clients as a 1:1 relationship for evidence based / predictive ai clients. Refactored a great deal of the api client admin interface to use twig to modernize the codebase and add twig files for the external-cdr pieces. This is a foundational work to support in the future the CDS Hooks standard. Also did code style fixes on the class * Style fixes for clinical decision rules refactor * Fix db/dsi type mismatch, helper links on client Fixed a mismatch between the database comments for the dsi type and what the code constants in client entity were. Fixed the helper links on the client. * Implement source attribute dialog display Implemented the display of the source attributes from the smart launch screen for displaying Decession Support Interventions Source Information. * Add CSRF token to attribute saves. * b11 DSI api client registration Added the registration pieces to the smart app client registration page. Added the dsi_type and dsi_source_attributes metadata attributes to the registration endpoint. Only existing attributes configured in the system can be configured and supported. * Remove hyphens from dsi attribute definitions * Add dsi information to introspection endpoint Added the dsi information to the api endpoint that is retrieved from the introspection. Note there is another outstanding PR that this work depends on in order for the endpoint to execute due to some pathing issues. So this commit will not be useuable without bringing in PR openemr#7741. * Implement evidence based rules for external cdr. * Fix no-dsi api clients not loading * Display source attribute info on cdr rule info Added a dialog info box that shows the cdr rule information when you click on the help icon for a cdr evidence based rule. Added a new review controller to handle this. Moved ACL checks into the router controller. Opened up the review controller to regular permissions. I don't see any security check that needs to happen on read only basis here. * Cleaned up cdr demographics tool tip Now that source attributes are showing up in a dialog, we don't need the tooltip to show a bunch of stuff on the rule tooltip. Fixed width constraints on the source attribute editing as 50 characters was not correct when it should be 255 characters. Fixed the web reference not showing up in the edit/details view of the CDR rules. * Inserting feedback on evidence based CDR Made it so that feedback gets inserted into the alert logs. Users can provide feedback on the action taken in the CDR for user development. * Implement feedback in cdr_log Made it so the cdr log will show the feedback and allow you to export the CDR evidence based feedback in a CSV download. Refactored the CDR_Log process to leverage the same controller infrastructure as the CDR admin controllers and dialog viewer. Trying to centralize the code more in order to improve cohesion and maintenance. I kept the existing view infrastructure as it'd be too major of a refactor right now to switch to twig. Fixed some style issues as well. * Added facility for location tracking * Change column size, sync database.sql Made the database.sql have the changes that were put in the sql patch. Changed the column size to be text instead of varchar * Fix escaping issue. * Change sequence on list_options for more flexibility * Fix escaping * Fix style changes * Fix dsi_type if its not provided Needed to fix the dsi type if the client does not provide one in the registration. Fixed some other errors showing up on the logs if data was not provided. * Fix registration with predictive dsi Prior commit was breaking the registration ouch. * Fix broken unit tests Routing controllers needed more DI service injectors to handle the unit testing changes. Removed the list test and added a save test on the external cdr. Fixed some other broken unit tests. * Fix thrown warnings with vital forms test * Hide cdr link if no services enabled. * Default unknown text if source attribute missing Made it so an unknown text is showing on details view of CDR rules and DSI smart app source attributes per ONC requirements. * Fix style issues. * See if we can fix the styles. Not sure why the auto-corrector isn't catching this, but trying this again. * Fix sql text datatype, improve source descriptions. Made the source descriptions clearer. Changed the SQL text datatype to remove not null attribute, fixed php code to support nullable attributes. * Direct edit links to simplify UX/testing Added a direct edit button if you are an admin to the CDR rules and to the smart 3rd party DSI attributes. This simplifies the UX testing and allows users to go right from the dialog popups to editing the attributes. I don't have deep back links supported which would be a bigger change but this is good enough to get from viewing to editing. I'm using a one time message passing via postMessage to communicate between the dialogs and the pages. At some point it'd be nice to generalize this, but that's an exercise for another day.
- Loading branch information