I need some help with custom module development. Based on the previous #OpenEMR Modules video posted on OpenEMR, we have learned about module development and gained knowledge about creating and testing modules to ensure they work fine.
Now, we want to add a module for core modification in the OpenEMR core files without directly altering the core coding files. For example, if I install and enable the module, the code should be appended to the core file. Similarly, if I disable the module, the code should be removed.
Have you ever tried this, and is it possible in OpenEMR?
So the only way to respond to core functionality is via the Events system. You can replace rendered template files via the twig templating events, but as far as core object code, that’s currently not possible. There is not a way to append / replace core PHP files if you are thinking of something similar to Ruby’s or other language’s duck typing of classes / objects.
Perhaps in the future that may be added but for now, its not possible. That said, the current event system can get you very far. We have several examples of modules that have done modifications of core code workflow bundled into the latest OpenEMR module. If you are missing an event that you want to react to (or change the execution workflow) into for the core code, PRs are very much appreciated. If you need more training/consulting on your specific requirements, the professional support vendors, or even myself could consult with you on this.
For anything having to do with advancing module support, folks should remember the maintainers who provide and upgrade module capability and not vendors.
We need those monies to advance OpenEMR for all the community!
Hi @adunsulag this post is already 1 year ago :-), Is this still not possible now? I am currently developing a custom module that needs to modified some core files in the Open EMR, like adding some new field and save it to the custom table we created.
As much as possible i don’t want to alter any core files, to avoid any headache during patching and version update.
Hi @adunsulag one of the modification we need to implement is under the prescription template and other is on the demographics, as much as possible i dont want to make some modification of the core files since it will overwritten once there is a new version or patch. One of the modification i am working on right now under the demographics field to have a condition selection. This will be implemented on the address field of the patient, the logic will be first it will ask the region, then based on the selected region it will show the specific city under that region. That’s one of the enhancement we need to implement.
in case it helps: admin->forms->layouts lets one change the demographics, if one clicks the ‘?’ at the end of the row it lets one add conditionality, and one can designate a field to be a drop down menu, specifying a list to use for the values (admin->forms->lists)