When a custom OpenEMR module is the right way to add a feature
A custom module is the right tool when a practice needs a workflow OpenEMR does not ship and the need cannot be met by configuration alone. Before writing any code, the team should decide whether the feature belongs in core, in a module, or in something lighter. Editing core files makes every future upgrade a merge exercise, so a module that loads through OpenEMR's own extension mechanism is usually the safer default for a feature only one practice needs. OpenEMR is licensed under the GNU GPL v3.0 and its source is in an open GitHub repository, so the team can read the code it extends and check how the core behaves. Recent releases require PHP 8.3 or later and a MySQL- or MariaDB-compatible database, and Docker deployment is offered. Confirm which PHP and database versions your target release needs in the release notes before you choose a base image or hosting platform.
A module fits better than a layout form, a clinical decision rule or a configuration change when the logic needs its own pages, its own database tables, a custom server-side action or an integration with an outside system. If the need is to capture a few fields in a new encounter note, a layout-based form is faster to build and easier to maintain. If the need is to alert a provider when a lab value crosses a threshold, a decision rule may already do it. A setting in the administration screens often solves the rest. Ask the practice to describe the workflow step by step, then test each step against those three options before you accept the cost of a module, which includes code review, testing against every target release and ongoing maintenance.
A module is not a security review, and it does not produce compliance evidence. Every custom module adds code that handles patient data, so it needs the same scrutiny as any other change: authentication and access checks, input handling, logging and a documented owner. The Securing OpenEMR guide is a useful baseline for the platform around the module, but it does not test your code. Plan an independent security test of the module before go-live, and confirm with your compliance lead which records of testing, change approval and access review your HIPAA risk analysis will require.
Which build approach fits the requirement
A custom module lives inside the OpenEMR module structure and runs in the same PHP process as the application. It can add screens, menu entries, database tables and behavior that the core product does not provide, while leaving the core source tree unedited. Because it runs inside OpenEMR, the module is tied to the internal hooks and file layout of the release it was written against, so the maintenance burden sits with whoever owns the code.
- Who maintains it: your development team or partner owns the code, the tests and every upgrade of the module against new releases.
- What it touches in core: it registers with the application through the module mechanism rather than editing core files, but it still depends on internal APIs, database schema and templates.
- What breaks at upgrade time: renamed or removed hooks, changed database tables, altered templates and deprecated functions can all stop a module from loading or behaving correctly.
- Packaging and rollout: the module must be installed, enabled and tested in the same Docker or host setup that runs production, so each release needs a staging rebuild.
- Security scope: the module runs with the application's privileges, so its input handling and data access are part of your OpenEMR security review.
Before committing to this path, confirm the exact module hooks and extension points in the release you run, and check the project repository for changes between releases.",
Many workflow requests can be met without code by using features OpenEMR already provides, such as Layout Based Forms, clinical decision rules and access control groups. Configuration is stored as data in the application, so it does not add a separate codebase. The trade-off is that it only covers what the built-in tools can express, and the design choices still need to be reviewed when the release changes.
- Who maintains it: an administrator or clinical informatics lead owns the configuration, with change review kept in your own records.
- What it touches in core: nothing in the source tree. It uses the administrative screens and the data those screens write.
- What breaks at upgrade time: configuration usually survives upgrades, but options, field types and rule behavior can change between releases, so each form, rule and group should be retested after an upgrade.
- Cost profile: the work is mostly design, testing and governance rather than development, and it recurs only when workflows change.
- Limits: if the requirement needs new data flows, custom logic or external calls, configuration alone will not meet it.
Before choosing this path, list the features the requirement needs and confirm in the release you run that each one exists, is configurable and can be exported for backup and review.
A separate service runs outside OpenEMR and reads or writes data through the FHIR API. The FHIR API implements FHIR R4, US Core 8.0 and SMART on FHIR v2.2.0 with OAuth 2.0, OpenID Connect, PKCE for public apps and granular scopes. This keeps custom logic out of the OpenEMR codebase, so core upgrades do not directly change the service, but the service must track API behavior, scopes and resource coverage across releases.
- Who maintains it: your integration team owns the service, its deployment, its secrets and its client registration.
- What it touches in core: only the API surface. It does not load code into OpenEMR, and it authenticates through the configured authorization server.
- What breaks at upgrade time: changes to resource support, scope definitions, token behavior or endpoint paths can break the service, so confirm the API version and resource coverage for each release.
- Data scope: the service can only read or write what the granted scopes allow, which makes least-privilege design a central control.
- Coverage gaps: features that the API does not expose, such as some administrative screens, may still need a module or configuration.
Before building, confirm in the FHIR documentation for your release which resources, operations and scopes your requirement needs, and test them against a non-production instance.
Configuration options and when each fits
This table compares four ways to add a feature OpenEMR does not ship: an in-core edit, a custom module, a Layout Based Forms configuration and an external app over the FHIR API. Read each row against your upgrade cadence, the data the feature needs and who will own it after go-live. The main takeaway is that the lighter the option, the less code you carry through upgrades, but the less control you have over behavior.
| Option | Upgrade risk | Data access and maintenance owner | When it is the wrong choice |
|---|---|---|---|
| In-core edit | High: changes to core files can conflict with each upgrade and must be reapplied or re-tested on every release | Full access to internal code and database paths; your team owns every line after the change | When the same result can be built as a module or form, or when no one on staff will track core changes across releases |
| Custom module | Moderate: isolated from core files, but it must be re-tested against each new release and PHP requirement | Uses OpenEMR's module hooks and APIs; your team or partner owns the code, packaging and compatibility | When the need is only a form layout or a data view, or when the module would duplicate a supported configuration option |
| Layout Based Forms configuration | Low: built through the admin interface, so there is no custom code to merge during upgrades | Form data stays in OpenEMR; the practice's administrators maintain fields and groups | When the logic needs server-side processing, external calls or behavior beyond field layout and display |
| External app over the FHIR API | Low to moderate: depends on the FHIR API and SMART on FHIR scopes remaining stable across versions you adopt | Accesses data through FHIR R4 resources with OAuth 2.0 scopes; the app's team owns hosting, tokens and changes | When the feature must write into internal workflows that the FHIR API does not expose, or when latency and offline use cannot be met over the API |
How the module is built, registered and packaged
This sequence takes a feature request from a confirmed OpenEMR release target to a module that installs, enables and ships inside a Docker image without touching core files. Each step ends with a check that the team can record before moving on.
Confirm the target release and PHP version
Before writing any code, record the OpenEMR release the practice runs now and the release it plans to move to, along with the PHP version that release requires. Recent 8.x releases require PHP 8.3 or later, but the team should confirm the exact requirement for its chosen target in the release notes on the OpenEMR releases page. The developer and the practice's application owner sign off on this pair together. The check is a written compatibility note that names both versions and the database engine in use, which the rest of the sequence refers back to.
Create the module outside the core tree
The developer creates the module in its own directory, separate from the OpenEMR core source, so that the module lives in version control as its own project. The module's files should contain only its own code, its manifest and its database changes, and should not overwrite or patch any file under the core application. Keeping the module in its own repository lets the team review, test and version it independently of core upgrades. The check is a repository that holds the module alone, and a diff against a clean copy of the core release that shows no changes to core files.
Build and test against a staging instance
The developer implements the module and installs it on a staging OpenEMR instance built from the target release, using the same PHP and database versions as production. Tests should cover install, enable, disable and uninstall, plus the module's own screens and permissions. Where the module reads or writes patient data, the team should use synthetic or de-identified records on staging, not live patient data. The check is a test log showing a clean install, enable and disable cycle on the target release, with no errors in the web server or PHP logs.
Verify on a copy of production data
Before the module goes anywhere near production, restore a recent copy of the production database to an isolated environment running the same OpenEMR release and enable the module there. The team should confirm the module's database changes apply to the real schema, that existing records are not altered, and that the module can be disabled and removed cleanly. Handling a copy of production data requires the same access controls and encryption expectations as production itself. The check is a written result confirming the module appears in Manage Modules, enables without errors, and leaves core data and core files unchanged.
Register the module in Manage Modules
An administrator registers the module through the Manage Modules screen in OpenEMR, which lists available modules and lets an authorized user install and enable them. The administrator should confirm that the module shows the expected name and version, that its settings page loads, and that access to its functions follows the practice's access control groups. Enabling the module should be a logged change, and the team should record who enabled it and when. The check is a screen capture or change record showing the module in the list with the correct status and the access groups assigned.
Package the module for the Docker image
Add the module directory to the build context of the Docker image so that building the image includes the module, and confirm the Dockerfile copies it into the location OpenEMR loads modules from. The build should pin the base OpenEMR image to the target release rather than a floating tag, so that the module and the core version stay matched. The developer should document the build command and the image tag in the module's repository. The check is a rebuilt image whose container shows the module in Manage Modules after startup, with no manual file copying into the running container.
Confirm the image rebuilds cleanly from source
Run the image build from a clean checkout on a separate build host, not on the developer's workstation, to confirm nothing depends on local state. The team should start the container against a test database, check that the module is present and enables, and confirm that the core files inside the image match the upstream release apart from the intended module addition. Recording the image digest and the module version together makes later rollbacks and upgrades traceable. The check is a build log, a recorded image digest and a successful start-up test from the clean build.
How to keep a custom module working across OpenEMR releases
A custom module sits outside core, so every OpenEMR release can change the code it depends on. The practices below work together: pin what you tested, watch the releases, prove the module still works, keep its code and dependencies traceable, and know how to go back. Upgrade paths themselves are covered on a separate page.
Pin the tested release
Record the exact OpenEMR version, PHP version and database version your module was tested against, and do not move production until that combination has passed. For Docker deployments, pin the image tag rather than tracking a floating tag, so a rebuild does not pull a newer core without your review. Confirm the PHP requirement for the target release before scheduling an upgrade, since recent releases require PHP 8.3 or later.
OpenEMR releasesTrack 8.x releases and security fixes
Subscribe to the release feed and read each release note for changes to hooks, database schema and the areas your module touches. Security fixes need faster attention than feature releases. The 8.3.0 and 8.4.0 releases fixed vulnerabilities in FHIR APIs, the patient portal, billing, the fax and SMS module and the fee sheet, so a module that extends any of those areas needs a retest soon after each release. Assign one owner to read the notes.
- Latest release in facts
- 8.4.1
Run regression tests before upgrading
Keep a test suite that covers the module's forms, menu entries, database writes, reports and any API endpoints it exposes. Run it against a staging copy of production data, with the candidate OpenEMR version and the module installed, before any production change. Record which tests are automated and which are manual walkthroughs, so the reviewer knows what has been proven and what has not.
Version control for module code
Keep the module in its own repository, separate from the OpenEMR core checkout, and tag each release of the module with the OpenEMR versions it supports. Core files should never be edited in place, because an upgrade will overwrite them and the change will be lost without a record. Store the Docker build definition in the same repository so the image that runs in production can be rebuilt from a known commit.
Document the module's dependencies
List every core class, hook, global setting, database table and third-party library the module relies on, with the OpenEMR version where each was last confirmed. Undocumented dependencies are the most common cause of silent breakage after an upgrade. Include the PHP extensions, the database engine and any external service such as a fax or SMS gateway, so the next maintainer can judge the impact of each release note.
Plan the rollback
Before an upgrade, take a database backup and a copy of the module code and container image in use, and write down the steps to restore both. Test the restore on staging, because a rollback that has never been run is an assumption. Decide in advance who can approve a rollback and how long the team will wait for a fix before reverting. Ask any upgrade partner to show the rollback procedure as part of the written scope.
How the module, core and Docker image fit together
The diagram starts in the custom module directory, which sits beside an unchanged OpenEMR core. The module is registered through Manage Modules, bundled into a Docker image build, and promoted from staging to production. The trust boundary runs between module code and core, and access control and audit logging apply at the point where module code touches patient data in the database. Check that the module only calls documented core APIs and that both environments run the same image.
Custom module code, core, Docker image and the promotion path to production.
Security and data handling for custom module code
Custom module code runs with the same access to patient data as OpenEMR core. A module that reads encounters, writes to the database or serves files has no separate security boundary, so it inherits every exposure the core application has. Before a custom module is registered in Manage Modules, the team should confirm that the host it runs on already meets the baseline in the Securing OpenEMR guide: HTTPS only (with consideration of opening only port 443), the setup script and other admin scripts removed after installation, and direct web access to sites/*/documents blocked. A module can undo any of these at the web server layer, so the check should run after every module deployment, not just once at install.
Upload handling deserves specific attention because custom modules often add file fields. The Securing OpenEMR guide points to the upload file white list and the option to encrypt items stored on drive. Confirm which file types your module can accept, that the white list covers any new extensions it introduces, and where its files land on disk. Ask whether encrypted storage is enabled for those paths. For Docker deployments, the same checks apply inside the container image and any mounted volumes.
HIPAA Security Rule obligations follow the ePHI your module creates, receives, maintains or transmits. If a covered entity or business associate uses the module with patient data, the rule applies to that module's data flows, including its access controls, audit trail and transmission security, as set out in 45 CFR 164.302. Map each table, file and API response the module touches to a risk assessment entry before go-live. DeployOpen can prepare the test results, configuration evidence and control mapping that a compliance team needs for review, but DeployOpen does not certify compliance. HIPAA has no certification, and an assessor's view is the one that matters for your organization.
Security and operational risks to review before go-live
A custom module runs inside OpenEMR with the same privileges as the application, so it inherits every exposure the core system has. The cards below cover the risks that most often surface after a module reaches production, and each one names the control to verify before go-live.
Unreviewed code handling ePHI
A module that reads or writes patient data is part of the application's ePHI boundary, even though a developer wrote it outside the core codebase. Ask for a code review of every query, file write, export and outbound call before the module reaches production. Confirm that the review covers third-party libraries the module pulls in, and that a named owner approves each release. Keep a record of who reviewed what and when, because that record supports the risk analysis a covered entity must maintain under the HIPAA Security Rule.
Security Rule textModule code bypassing access control
OpenEMR enforces access through its own ACL checks, and a module that queries patient tables directly can skip them. Verify that every module screen and API route calls the same authorization checks the core modules use, and test with a user who lacks the relevant permission. Confirm that the module respects the care team's need to know rather than only the user's login. A quick test with two accounts, one with the permission and one without, will reveal most gaps.
Securing OpenEMR guideSecrets baked into the Docker image
Database passwords, API keys and signing keys placed in a module's files or Dockerfile end up in every image layer and every registry copy. Check that the image contains no credentials, that the module reads secrets from environment variables or a secrets store at runtime, and that the build pipeline does not print them to logs. Rotate any secret that has ever been committed. Ask whether the registry is private and who can pull the image.
Dependencies left behind after a security release
OpenEMR security releases fix vulnerabilities in core areas such as the FHIR API, the patient portal and billing, and the module may depend on the same libraries or on a PHP version that changes. Record every dependency and its version in the module, and make a named person responsible for checking each OpenEMR release notes page. Test the module against the new release in a staging environment before the production image is rebuilt, and budget for that retest as a recurring cost.
- Latest release checked
- 8.4.1
Module lost on image rebuild
A module added by hand to a running container disappears when the image is rebuilt from the upstream OpenEMR image, which is a common cause of outages after an upgrade. Confirm that the module lives in version control, that the Dockerfile copies it into the image at build time, and that the module's registration in Manage Modules survives a fresh deployment. Test a full rebuild from scratch on a staging host, then verify that the module is enabled and working.
No audit trail for module actions
If a module creates, changes or exports patient records without writing to the audit log, the practice cannot show who did what, which is a gap that auditors and HIPAA reviewers test for. Confirm that each module action that touches ePHI writes an entry through OpenEMR's logging, including reads and exports, not only saves. Check that log entries record the user, the patient, the action and the time, and that the logs are retained and reviewed according to the practice's policy.
Questions buyers ask before building a custom OpenEMR module
What drives the cost of a custom OpenEMR module?
Scope, the number of integrations, the amount of testing and the number of upgrades the module must survive drive most of the cost. A module that only adds a screen to an existing workflow costs far less than one that reads and writes billing data, calls an outside service and must be retested against each OpenEMR release. Cost has two parts: one-time build work (design, coding, packaging, documentation and handover) and recurring work (compatibility checks at each upgrade, security patching of dependencies and support). Ask any quote to separate these lines and to state which upgrades and PHP versions are covered. DeployOpen does not publish prices; a quote follows from the written scope.
Can our in-house team build a custom OpenEMR module?
Often yes, if the team knows PHP well enough to work with OpenEMR's codebase, can run the application in Docker or on a test server, and has someone who understands the clinical workflow being changed. OpenEMR is licensed under the GNU GPL v3.0, so the team can read and modify the source. The harder parts are rarely the code itself: they are keeping the module compatible across releases, writing tests that cover patient data paths, and documenting the module so the next person can maintain it. Before deciding, confirm that someone on staff will own the module after launch, because a module without an owner tends to break at the next upgrade.
How long does a custom OpenEMR module take to build?
Duration depends on the scope agreed in writing, the number of integrations, how much clinical review the workflow needs and how long testing takes in your environment. No duration is given here because none is supported by a researched source for this topic. A simple, self-contained module with no external integrations usually moves faster than one that touches billing, the patient portal or the FHIR API, because those areas need broader regression testing. Ask for a timeline broken into design, build, test, documentation and handover phases, and ask which milestones depend on your staff, such as access approvals or sign-off.
What does the practice need to provide for the build?
Most delays come from the practice side, so agree these items before work starts:
- A named clinical owner who can approve the workflow and the screens
- Test data that resembles real encounters without exposing real patient records, or a documented process for using de-identified data in a non-production environment
- Access to a staging OpenEMR instance, source repository and deployment pipeline, with accounts scoped to the work
- A decision maker for scope changes and a contact for security questions
For any module that handles protected health information, confirm how the HIPAA Security Rule obligations of your organization and any business associate contract apply to the build team's access to data.
Will a custom OpenEMR module survive upgrades?
A module survives upgrades when it uses OpenEMR's documented extension points, stays out of core files and is tested against each target release before it reaches production. Editing core files is the usual cause of breakage, because the next upgrade overwrites those changes. Plan for compatibility checks at every upgrade, including the PHP version that the release requires. Recent OpenEMR releases require PHP 8.3 or later, and the 8.4.0 and 8.3.0 releases fixed security issues in FHIR APIs, the patient portal, billing, the fax and SMS module and the fee sheet, so a module touching those areas needs retesting after patch releases too. Ask how the build will be tested against your upgrade path before you commit.
How does DeployOpen scope a custom OpenEMR module in writing?
Most DeployOpen engagements are fixed-scope, so the scope, deliverables and timeline are agreed in writing before work starts. For a custom module, the written scope usually states the workflow the module supports, the OpenEMR versions it targets, the integrations in and out of scope, the test cases that define done, the packaging format for Docker, the documentation delivered and the handover process. It should also name what the practice provides and what is excluded, such as future upgrades. Ongoing compatibility work, upgrades and continuous testing are available as retainers, which keeps recurring costs separate from the build. Ask for the written scope to list each recurring item as its own line.
Does the module need a security review before go-live?
Yes, for any module that touches patient data, authentication or access control, a review before go-live is the practical choice. The OpenEMR Securing OpenEMR guidance covers HTTPS-only access, removing setup scripts after installation, blocking direct web access to the documents directory and enabling multi-factor authentication and strong password policies. A custom module should not weaken any of these. DeployOpen runs security testing for applications and APIs, which can cover a custom module's endpoints and permissions. Confirm with your compliance lead which evidence the module must produce, since DeployOpen prepares evidence but does not issue audit reports or certifications.
Official OpenEMR sources to read before you start
Before you write any code, read the OpenEMR GitHub repository and its OpenEMR releases page. The repository holds the source tree, including the module directories under interface/modules where custom modules live and the code paths your module will hook into. The releases page shows what changed in each version, and the 8.3.0 and 8.4.0 notes flag security fixes in areas such as the FHIR APIs, the patient portal, billing and the fee sheet. Any of those areas can affect a module that touches the same code, so read the notes for every release between your current version and your target before you commit to a design.
Next, read the Securing OpenEMR guide. It tells you what your module must not weaken, including that only HTTPS should be allowed, that setup.php and other admin scripts should be removed after installation, and that direct web access to sites/*/documents should be blocked. A module that writes files or exposes new endpoints has to respect those settings. Confirm with your security team which of these controls apply to your deployment before you add routes or upload handling.
Finally, read the Administration Globals wiki page. Many module behaviors depend on global settings, such as authentication, password rules and file handling, so your module should read those settings rather than assume defaults. Treat all three sources as the baseline, and check the module documentation for the exact release you run in production, because setting names and behavior can change between versions. Record the release number and the date you reviewed each source so your team can repeat the check at each upgrade.
How DeployOpen scopes, builds and supports custom OpenEMR modules
DeployOpen treats a custom OpenEMR module as a planned project with a written scope, a build that stays outside OpenEMR core, and handover documents your team can run. Engagements are fixed-scope, and ongoing support is available as a retainer once the module is in production.
How we scope
- We confirm which workflow gap the module closes and why existing OpenEMR features do not cover it.
- The written scope lists the module's screens, data tables, roles, hooks into core and the PHP version and database it targets.
- We agree in writing which upgrade and Docker test environments the module must pass before go-live.
How we build
- We build the module in its own directory so that OpenEMR core files stay unmodified and upgradable.
- Each module is registered and enabled through Manage Modules, and we test install, enable, disable and removal paths.
- We test access control, input handling and audit logging against the roles defined in your scope before release.
How we hand over
- You receive the module source, packaging for your Docker image and a record of every core extension point used.
- Documentation covers installation, configuration keys, role requirements and the steps to test the module on a new OpenEMR release.
- We walk your administrators and developers through the upgrade checklist so the next release is a planned task, not a rebuild.
How we support
- Ongoing support covers compatibility checks when new OpenEMR releases, such as the 8.x line, are published.
- We review the module after each security release affecting core areas it touches, such as billing or the fee sheet.
- Support is available as a retainer, and the scope for it is agreed in writing like the build itself.

