Why FHIR profiles and validation in Medplum matter for your data
If your healthcare data arrives from several sources and reaches apps, analytics or partners without a shared quality bar, the problems surface downstream, where they are slower and more expensive to fix. A FHIR profile, expressed as a StructureDefinition, is the mechanism for stating that bar. It constrains a base FHIR resource by making elements required, restricting code sets, fixing cardinalities or requiring extensions, so that a Patient or Observation from one source can be checked against the same rules as one from another. Teams usually need this once data crosses an organizational boundary, feeds a regulated report, or must meet a third-party API's requirements such as US Core conformance.
Validation on write and after-the-fact checks answer different questions. Validation on write asks whether a resource may be stored at all, so non-conforming data is rejected at the point of entry. A periodic scan of existing data asks how much of what is already stored conforms, which is what you need for legacy loads and migrations. Medplum's FHIR R4 API is the entry point for both, and Medplum is released under the Apache 2.0 license, so you can read the server code that applies these checks. Exact behavior, including how profiles are loaded, which resources are checked on write and how errors are returned, must be confirmed against the current Medplum documentation and the version you have installed, since it changes between releases.
The deployment model changes who owns the answers. On Medplum Cloud, you rely on Medplum's documented behavior and its release cadence. On a self-hosted deployment, you own the server version, the StructureDefinitions loaded into it and the decision to change them, so you should confirm with your own environment which profiles are active and test any change before it reaches production. Ask Medplum and your team which validation settings apply to your plan and version, and document that answer alongside your profile set so reviewers can trace every rule to a decision.
Choosing between US Core, internal profiles and partner requirements
US Core is the interoperability baseline that many US healthcare APIs expect. It is a FHIR implementation guide with profiles for common resources, and it sets the minimum elements a server and its clients must support. Your organization does not usually write these rules. The guide's publisher owns the content and its versions, so your team's job is to decide which US Core version your data flows and partners depend on.
- Ownership: The publisher controls US Core content and release timing, so changes reach you on the publisher's schedule, not yours.
- Conflicts: When an internal rule is stricter than US Core, keep the stricter rule in a derived profile that references the US Core base, so exchanges still pass the base checks.
- Version alignment: Confirm which US Core version your partners test against and whether it matches the FHIR R4 release that your Medplum server version validates against.
- Package consistency: Confirm that every StructureDefinition and dependency you load comes from the same package version, or validation results will differ from your external test tools.
- Coverage: Confirm which resource types in your flows have US Core profiles before you write rules for the rest.
Before any US Core rule goes live, check the version pair with your partners and your Medplum release, using the Medplum authentication docs only for access-related questions and your own validation tests for profile behavior.
Internal profiles encode your organization's own data rules: required identifiers, local code systems, mandatory fields for intake, referral or billing workflows, and extensions that only your systems use. Clinical informatics or data governance teams usually define them, and platform engineers implement them in Medplum. Because these rules follow clinical workflows, they change more often than the US Core baseline, and each change needs a clear owner.
- Ownership: Name one owner who approves each profile change and records the reason, so rules do not drift between teams.
- Derived profiles: Build internal profiles as constraints on US Core where possible, so interoperable exchanges still pass the base rules.
- Conflicts: An internal rule that loosens a US Core requirement will fail interoperability checks that expect the base rule, so resolve the difference with the data owner before go-live.
- Version alignment: Record the FHIR release and the base profile versions each internal profile was written against, along with the Medplum release that loaded it.
- Terminology bindings: Confirm which value sets and code systems each profile binds to, since terminology changes are a common source of silent validation drift.
Before loading a new internal profile, confirm who approves changes and which base versions each profile was tested against, and keep that record with the profile in your version control.
Partners and payers impose requirements through their API specifications, implementation guides and conformance statements. Their teams own the rule text and its versions, and your team owns the mapping from your data to their rules and the evidence that the mapping works. These requirements often arrive as conformance statements and guides rather than complete profiles, so the first task is to turn them into testable rules that you can load and check.
- Ownership: The partner owns the rule text and version, while you own the mapping, the test evidence and the change process on your side.
- Conflicts: When a partner requirement conflicts with US Core or an internal profile, decide which rule governs that exchange only, and write the decision into the connection's specification.
- Scope of validation: Apply partner rules to the outbound payload or the specific exchange, so other consumers of the same data are not blocked by one partner's requirement.
- Version alignment: Ask the partner which implementation guide version and FHIR release their conformance statement targets, and confirm it matches what your Medplum deployment validates against.
- Change notice: Confirm how the partner announces version changes and how much lead time you receive, since an unannounced update can break a feed that previously passed.
Before building the mapping, get the partner's written version and conformance statement, and repeat the version check at every partner upgrade or Medplum upgrade.
Validation options and when each one fits
This table compares four places to enforce FHIR profile rules on Medplum: on write, warnings during onboarding, a batch job over existing data, and at the integration layer. Read each row for what the option protects, what it costs in throughput and developer time, and what your team must confirm about how Medplum reports failures to the calling system. Most teams combine two or three of these rather than choosing one.
| Option | What it protects | Cost in throughput and developer time | Confirm about failure reporting |
|---|---|---|---|
| Validate on write, hard rejection | Stops non-conforming resources from being stored, so every new record meets the profile at the moment it is saved | Adds validation work to every write; developers must handle rejected requests and map OperationOutcome errors back to source data | Confirm which HTTP status and OperationOutcome issues your client receives on rejection, and that your retry logic does not resend invalid payloads indefinitely |
| Validate with warnings only during onboarding | Lets teams load early or partial feeds while counting how often each rule fails, so profile gaps surface without blocking the pipeline | Low write friction, but warnings are easy to ignore; someone must review them and convert them to hard rules before go-live | Confirm where warnings are returned and whether your loader or integration engine reads them, since a success response may still carry issues |
| Batch validation over existing data | Finds legacy resources that fail current profiles, including data written before a StructureDefinition changed | Runs against the full dataset, so it adds compute and scheduling load on the database; results must be triaged by people who know the source systems | Confirm how your validation job reads results and whether it can page through resource types without relying on a single search that may be incomplete |
| Validate at the integration layer before data reaches Medplum | Keeps bad messages out of the platform entirely and lets you transform or quarantine them in the engine or pipeline you control | Requires duplicated rule logic in the interface engine or pipeline, which must stay in sync with profile versions; more moving parts to test | Confirm that the integration layer keeps its own error records and that failures from Medplum are routed back to the sender, not silently dropped |
Where profile checks sit in a write
A write starts in an external source or application, passes through an integration layer that maps data into FHIR resources, and reaches the Medplum FHIR API inside the self-hosted boundary. Profile validation against the loaded StructureDefinitions is the step to confirm in your target version: it decides whether the write is accepted or rejected with an error returned to the sender. Records that fail for remediation take a separate path into a review queue, so legacy data is held rather than silently dropped. Check where your deployment enforces validation and what it returns on failure.
Write path through profile validation, with rejected and held records split out.
Loading StructureDefinitions and enabling validation on write
This sequence moves FHIR profiles from a version-controlled package into Medplum one stage at a time, so each rule is proven against known-good and known-bad data before it can reject writes in production. The output is a documented, tested set of profiles with enforcement switched on per resource type.
Confirm the target Medplum version and FHIR behavior
Your platform or integration lead records the Medplum version you will run, from the release notes and self-hosting documentation for that version, and confirms it implements FHIR R4 as your profiles expect. Confirm which validation behavior, error formats and profile-related settings apply to that exact version, since these can change between releases. Done when the version, FHIR release and validation notes are written into the project's configuration record and approved by the team that owns the data standard.
Obtain and version-control the StructureDefinitions
Your informatics or data governance team collects each StructureDefinition the rules depend on, including US Core, internal profiles and any profiles a third-party API requires, along with the packages they reference. Store the exact files and package versions in a Git repository with a change log, a named owner and a review step for every update. Done when a clean checkout of the repository reproduces the same set of profile versions and a checksum comparison confirms no file has changed since approval.
Load profiles into a non-production project
Your platform engineers load the approved StructureDefinitions into a non-production Medplum project using the same procedure that production will use, so the loading steps are tested before they are needed. Check that every dependent package loads and that no profile is missing its base definition. Done when the project lists every expected profile with its version and a query for each profile returns the expected single result.
Test known-good and known-bad sample resources
Your informatics team and QA engineers build a fixed set of sample resources: conforming examples that must be accepted and deliberately broken examples that must be rejected, covering missing required elements, wrong value sets and invalid references. Write the expected outcome for each sample before running it. Done when every good sample is stored and every bad sample is rejected, and any mismatch is logged as a defect against the profile or the test.
Confirm rejection messages and error handling
Your integration developers check that each rejected write returns an error that names the failing element and profile, and that the calling application or interface engine can parse it and route it to a retry or review queue. Compare the messages against the expected text in your test set, noting that exact wording may differ by version and should be confirmed in your environment. Done when a developer can trace each sample rejection to a specific rule without reading server logs.
Enable enforcement per resource type
Your platform team turns on validation for one resource type at a time, starting with the types with the clearest rules and the lowest write volume, and runs the sample set again after each change. Record which types are enforced in the change log so the state of enforcement is always known. Done when the full test set still passes after each resource type is enabled and the enforced list matches the approved plan.
Roll out enforcement in stages to production
Your change owner moves the tested profiles and enforcement settings into production in stages, starting with the integrations that send the most conforming data, and monitors rejected writes for unexpected patterns. Confirm a rollback path for loaded profiles and settings before each stage. Done when production rejections match the expected categories in the test set and the owners of each source system have signed off on the stage.
Security and governance risks of profile rules
Profile rules decide which data a Medplum deployment accepts, so changes to them carry security and compliance weight. The cards below cover the risks that tend to surface when profiles move from a test project into production, and the control and check that address each one.
Silent integration breakage from profile changes
A tightened StructureDefinition can start rejecting writes that a partner feed has sent for months, and the failure often shows up as a queue backlog rather than an outage. Pair each profile change with a replay of recent sample traffic from every source system before it reaches production. Confirm which upstream senders use a profile version, and who gets notified when their writes start failing validation.
Medplum versions policyWho may load or change StructureDefinitions
Loading a StructureDefinition changes validation behavior for every client in the project, so it is a privileged action, not a routine data write. Limit profile loading to a named release role, and keep client applications and bots out of that role. Confirm how Medplum project administrators and access policies are assigned in your deployment, and who can approve a profile change before it is applied.
Error messages that expose PHI
Validation errors often echo the offending value, such as a patient name, identifier or date of birth, into logs, API responses or support tickets. That turns a data quality check into a disclosure path. Review what your validation responses return to clients and what your log pipeline stores, and confirm that error text is redacted or limited to element paths and codes where your policy requires it.
Validation settings that differ between environments
A profile enforced in staging but relaxed in production, or the reverse, makes test results misleading and lets bad data through on the path that matters. Keep profile versions and validation settings in version control, and promote them through the same pipeline as application code. Confirm which profile versions each environment runs, and check them as part of every upgrade and restore.
Audit trail for rule changes
Auditors and internal reviewers will ask who changed a validation rule, when, and why, and a rule change without a record is hard to defend. Medplum records history for resources it stores, but you still need a change record for the profile source files, the approval and the deployment time. Confirm where those change records live, how long they are kept, and who can read them.
Shared responsibility for compliance evidence
Medplum documents its compliance coverage as a shared responsibility with its customers, so a profile rule that you own is part of your evidence, not Medplum's. Medplum's documentation lists the frameworks it covers, but it does not show how your validation controls satisfy your own obligations. Confirm with your compliance team which profile controls they need to evidence, and which of them your self-hosted or cloud configuration must supply.
Medplum compliance docsHandling legacy data that fails the new rules
Existing records will fail newly enforced profiles, so triage comes before any rule is switched on for writes. Resources written before a US Core or internal profile was loaded were never checked against it, so enforcement turns a silent gap into a list of failures. Start by counting failures by resource type and by rule. Run validation against a copy of the database and group the results, for example Patient records missing a required identifier system or Observation records with an unmapped code. A count by rule shows which profile requirements cause most of the work, and a count by resource type shows which source feeds need attention. Record these counts before you change anything so you can measure progress later.
Next, separate failures that come from your own mapping or migration code from failures that come from the source system. A missing value that the source never captured cannot be fixed by a transformation, and inventing it to satisfy a rule creates false clinical or billing data. For each failure group, decide whether to backfill from a trusted source, quarantine the records so they stay readable but are flagged for review, or accept them under a documented exception that names the rule, the affected population and the owner who approved it. Confirm with your compliance and clinical leads which exceptions are acceptable, because that decision belongs to them and not to the platform team.
Avoid editing records in place without a plan for version history. Medplum versions every write, so a bulk correction becomes a new version of each affected resource, and large corrections can inflate storage and make audit trails harder to read. Prefer corrections that are traceable to a named job and a reason, and check how your team will explain a changed record during a dispute. Migrations over large datasets can run for a long time, so schedule them in a window, estimate duration from a timed run on a copy, and test every bulk correction on a copy first. Confirm with Medplum's documentation and your own environment how your deployment handles long-running jobs before you run one against production.
Limits to confirm in your environment
Profile enforcement on Medplum depends on details that vary by release, deployment model and write path. The cards below list what to verify against the current Medplum docs before you commit a validation design, and each check changes how far your rules actually reach.
FHIR and profile versions supported
Confirm which FHIR version and which US Core and other profile versions the release you install can validate against. A profile written for a newer IG than the server understands may load but not enforce as you expect. Pin the Medplum version and the StructureDefinition versions together in your change record, and retest the set after every minor upgrade, since the server must move through each minor version in sequence.
- Latest release at research
- 5.2.5
Validation coverage across write paths
Check whether profile validation runs on every write route: direct REST and GraphQL mutations, Bots, Subscriptions-triggered writes, the HL7 interface and bulk imports. A rule that blocks API writes but not batch loads will still let bad data in through the import job. Test each path with a deliberately invalid resource and record the response.
Performance on large batches
Ask how validation cost scales when a single transaction or import carries thousands of resources, and whether it can be turned off for a controlled load and re-enabled afterward. Measure throughput with your real profiles on production-sized hardware, because validation cost depends on profile depth, slicing and the number of extensions.
OperationOutcome format for integrators
Confirm how rejected writes are reported, including the OperationOutcome issue codes, the element paths and the message text. Integrators parsing these responses need stable fields, so verify them with each client team and document the expected shape. Some interface engines and partner APIs map validation failures to their own error codes, and that mapping needs its own test.
Packaging for custom profiles
Confirm the file format and packaging your custom StructureDefinitions, ValueSets and CodeSystems must use to load, and whether dependent profiles must be loaded in a particular order. Check how loading behaves when a dependency is missing, and how updates to a loaded profile affect resources already stored. Keep a source-controlled copy of every profile file with its version.
Cloud and self-hosted differences
Confirm whether the profile loading and validation settings available on Medplum Cloud match what your self-hosted server exposes, and when each change takes effect. Self-hosted teams own the server configuration, the upgrade timing and the rollback, so any behavior that differs between the two must be tested in your own environment. Medplum's compliance documentation also describes this split as a shared responsibility.
Compliance docsWhat do teams ask before enforcing FHIR profiles on Medplum?
What drives the effort of enforcing FHIR profiles on Medplum?
The effort grows with four things: the number of profiles you must enforce, the number of source systems feeding Medplum, the volume of legacy data that already exists, and the number of partner requirements each profile must satisfy. A single US Core based profile set fed by one well-understood source is a small job. Several internal profiles, a payer API with its own constraints, and years of historical records that fail the new rules multiply the work. Ask for a written inventory of profiles, sources and legacy record counts before agreeing on scope, because those three lists determine most of the cost and duration.
Can our team enforce FHIR profiles on Medplum without a partner?
Yes, for a bounded case. A team with in-house FHIR skills can load StructureDefinitions and enforce validation on one profile set fed by one source, especially if it already runs Medplum in its own infrastructure. The work gets harder with several sources, overlapping profiles, legacy data that must be triaged, and audit evidence that a compliance reviewer will ask to see. In those cases, the risk is less the technical build than the lack of a second reviewer for profile decisions and rule documentation. Decide early which parts you will own and which you will hand to a partner.
What does the work need from our side?
Three things block progress more than anything else. First, representative sample data from each source, including the messy records, so validation failures can be examined before rules go live. Second, written profile decisions: which US Core elements are required, which internal extensions apply, and how third-party API requirements map onto your resources. Third, a named business owner for each rule who can say whether a failure is a data defect, a rule defect or an accepted exception. Without that owner, failed records pile up with no one able to resolve them.
How long does it take to enforce FHIR profiles on Medplum?
Duration depends on the scope drivers above, so no fixed timeline applies across projects. A useful estimate starts from the profile inventory, the number of distinct sources, and the legacy triage plan. Ask any partner, including DeployOpen, to break the timeline into profile definition, loading and testing against samples, write-time validation rollout, legacy remediation and handover. Treat legacy remediation as the variable part, since it depends on how many records fail and how many need human review.
Can we roll out FHIR validation in warning mode first?
Yes, and it is a sensible first step on an existing dataset. The usual approach is to load the profiles, run validation against incoming writes and existing records, and log failures without rejecting writes. Teams then review the failure categories, fix rules that are too strict, and agree which failures should block writes. Confirm with your Medplum version and deployment how validation behaviour is configured and where the logs are kept, because the exact settings depend on the release you run. Keep the warning period time-boxed so it does not become permanent.
How do we maintain profiles when they change with new releases?
Profiles need the same change control as code. Medplum ships major versions annually, minor versions two to three times a year and patch versions weekly, so the Medplum platform changes often, and your profile definitions may change when US Core, an internal standard or a partner API is revised. Keep profiles in version control, test each change against a sample set before loading it, and record which profile version applied to which data. Schedule a recurring review with the business owners so that rule changes and Medplum upgrades are tested together rather than separately.
What should we check in a quote for profile enforcement?
Ask the quote to list the profile inventory, each source system, the sample data you will supply, the legacy record volume in scope, the validation rollout approach, and the handover to your team. It should also state which items are one-time (profile design, initial load, legacy triage) and which recur (profile maintenance on new releases and partner changes). Confirm whether the quote covers your own compliance evidence or only the technical controls, since assessors need documentation of the rules and their owners.
How DeployOpen works on this
DeployOpen plans, implements and hardens self-hosted open-source platforms inside your own infrastructure, including Medplum. For profile enforcement, we start by agreeing in writing which profiles, data sources and write paths are in scope, then build and test validation against those rules before handover.
How we scope
- Engagements are fixed-scope, with the profiles, StructureDefinitions and write paths agreed in writing before work starts.
- We inventory which resource types and external API requirements must pass validation, and which legacy records must be handled.
- The written scope names the Medplum version, deployment target and who signs off each profile, with ongoing support available as a retainer.
How we build
- We load agreed StructureDefinitions into your Medplum project and configure validation on write for each in-scope resource type.
- We test accepted and rejected payloads for each profile, including edge cases from your source systems and partner API specifications.
- We design the handling for legacy data that fails validation, so it is quarantined, corrected or reviewed rather than silently dropped.
How we hand over
- You receive the profile inventory, loading procedure, validation configuration and test cases as documented, reviewable artifacts.
- Runbooks explain how to add or change a profile, including the review steps and the rollback approach for a profile change.
- We walk your engineering and compliance teams through the evidence trail so they can review enforcement against their own controls.
How we support
- Retainers cover profile updates when US Core, internal profiles or partner requirements change between Medplum releases.
- Upgrade testing re-runs the validation suite against each planned Medplum version before your upgrade window opens.
- Continuous testing can re-check write paths after new integrations or data sources are added to the platform.

