Why loading LOINC into HAPI FHIR starts with the canonical URL
Teams that need LOINC codes validated and observation value sets expanded on a self-hosted HAPI FHIR JPA server start by loading the LOINC distribution as a code system on that server. Once it is loaded, the server can answer terminology operations such as validating a code or expanding a value set against it. Loading is not a one-time file copy, though. The server stores the content under a canonical URL and a version string, and every later lookup, validation or expansion has to name that identity correctly. If the URL or version used at upload does not match what clients send in their requests, a valid LOINC code can be reported as unknown, and the failure looks like a data problem when it is really an identity problem.
This capability matters when observations are coded with LOINC and the server must check those codes, filter them by a LOINC-based value set, or give other systems a shared terminology source. Teams usually need it when they first stand up a FHIR server for laboratory or clinical data, when they bring in observation value sets from an implementation guide, or when they must keep older LOINC versions available while a newer one is adopted. Before the upload, confirm with the documentation for the HAPI FHIR version in use how the server expects the code system to be supplied, which upload tool or operation applies, and how the canonical URL and version are set. Those steps change between releases, so the exact procedure should be checked against the docs for your version rather than copied from older examples.
Decide the canonical URL and version convention before the first load, and record it with the team that owns the value sets and the client systems. Every value set, ConceptMap and client query that refers to LOINC will depend on that choice, and changing it later means reloading and re-pointing references. Confirm how your LOINC license terms apply to the distribution you plan to host and who in your organization accepts them. The rest of this topic covers the upload itself, value set expansion, and what to do when a new LOINC version is released.
Which loading approach fits your team
This table compares three ways to get a LOINC distribution into a HAPI FHIR JPA server: a command-line upload, a REST upload operation, and an automated pipeline job. Read each row against your own team's staffing, release cadence and audit needs, then choose the path your operators can repeat for every new LOINC version. Confirm exact commands, flags and operation names in the HAPI FHIR documentation for the release you run.
| Approach | Who runs it and how it repeats | How it is audited and when it fits |
|---|---|---|
| Command-line upload with hapi-fhir-cli | A platform engineer runs the CLI from an admin host against the server's database and base URL. Each new LOINC release is a manual run that a runbook must repeat with the same version label and canonical URL. | Audit depends on your own records: the shell history, change ticket and run log. Fits small teams with one or two releases a year and a clear owner who can follow a runbook exactly. |
| REST upload through the server's code system operations | An administrator or integration account calls the server's upload operation over HTTPS with the distribution files. Repeats through the same API call, so the request can be scripted with the same parameters each release. | Server logs and the resource history record who uploaded what, but confirm how your server version records the upload. Fits teams that already manage the server through its API and want one access path. |
| Automated job in the deployment pipeline | A pipeline job, triggered by a new release or a version change in a configuration repository, loads the distribution into a non-production server first and then promotes the change. Repeats without manual steps, but the pipeline owner must maintain credentials and file access. | Pipeline logs, approvals and version-controlled configuration give an assessor a traceable record of each load. Fits organizations with several environments and frequent releases, and that need consistent evidence for change control. |
| Manual check before any approach | Whichever path you choose, a reviewer confirms the LOINC version, the canonical URL and the value set expansion results on a test server before production loading. | Keep the check result with the change record. Without it, a wrong version label can silently change how observation codes validate. |
How a LOINC release moves from file to validated code system
The flow starts with the team obtaining the LOINC distribution under its license terms, then preparing the files before anything reaches the server. The upload hands the release to the HAPI FHIR JPA server with an explicit version, which stores the code system in the database. Before clients rely on it, the team checks the stored version. From there, the server answers $lookup, $validate-code and value set expansion requests, and the team decides whether the previous version is kept side by side or retired.
Stages from the licensed LOINC release to the version clients query.
How to load a LOINC release and check the result
This sequence takes a LOINC release from a verified download to a loaded, versioned code system that the team has tested with lookups and observation code checks. The output is a test-environment load with a written record of the version, canonical URL, load log and check results.
Confirm the server version and JDK
The platform engineer confirms that the HAPI FHIR version chosen for the server fits the Java runtime before anything else. The HAPI FHIR versions page lists the JDK requirement for each release, and HAPI FHIR 8.2.0 requires JDK 17. Run
java -versioninside the image or on the host that runs the server, then compare the output with the requirement for your release. The step is done when the server starts and the version it reports matches the release you planned to load against.Enable terminology services in the JPA server
The engineer confirms that the JPA server configuration turns on the terminology services described in the JPA server documentation for the release. Configuration usually lives in the starter's application configuration, so review that file in the deployment repository and check each key against the docs for your version rather than an older example. Use PostgreSQL or Microsoft SQL Server for this test, because the starter defaults to embedded H2 and supports those two databases for production. The step is done when the server restarts cleanly and its capability statement, returned by the metadata interaction, lists the terminology operations such as $lookup and $validate-code.
Obtain the LOINC distribution and licence
The terminology owner downloads the LOINC distribution for the release to be loaded from LOINC's official distribution source. Access may require an account and acceptance of LOINC's license terms, so confirm the access steps on LOINC's site before starting. Compliance or legal staff should read the terms and confirm they allow the intended use, including whether the data will be shared with other internal systems or external parties. Store the archive in a controlled location and record its release name and checksum in the change ticket. The step is done when the team holds a verified copy and a written note that the licence terms were reviewed.
Set the version identifier and canonical URL
The terminology owner fixes the canonical URL and version identifier that name this LOINC release on the server. The canonical URL identifies the code system, and the version identifier identifies the release, so clients can reference one release while another remains loaded. Confirm the exact URL and version convention in the documentation for your HAPI FHIR release and in LOINC's release notes, then write both into the load plan. The step is done when the plan lists the URL, the version and the value set canonical URLs that will reference them, and each value matches the convention that was reviewed.
Upload the release in a test environment
A platform engineer runs the upload that the documentation describes for the chosen release against a test server backed by a copy of the production-type database. Confirm the tool, the command and its arguments in the documentation for that release before running anything, since upload tooling can change between versions. Watch the server and tool logs, record how long the load took on your hardware, and keep the log with the change record. The step is done when the job reports success, the CodeSystem resource for the planned version can be read back, and the log shows no unresolved errors.
Verify codes with lookups
The engineer checks that loaded codes match the source files by calling $lookup on the versioned LOINC system for a sample of codes. Choose the sample from the distribution itself, including codes with several properties and any codes the file marks as deprecated or replaced in this release. For each call, compare the code, display and properties with the source row, and pass the version parameter so the result comes from the release under test. The step is done when every sampled code returns the expected display and properties, and any differences are logged and resolved before the next step.
Check observation codes against value sets
The engineer confirms that observation codes validate against the LOINC value set the team uses, by calling $validate-code. Load or reference the value set so that it points to the versioned LOINC system, then send a known-good LOINC code from a test Observation and expect success. Send a code that is not in the value set and expect a failure, which shows the check is active. For large value sets where expansion is slow, the sibling topic on ValueSet pre-expansion covers that behavior. The step is done when both expected results occur and the test cases are saved with the release record.
How a new LOINC release sits beside the previous one
Keeping more than one LOINC version on the same HAPI FHIR server lets you pin observation value sets to a version that has already been checked, while the next release is loaded and tested without touching live validation. The decision you face is whether to replace the existing LOINC code system or load the new version alongside it. Replacing is simpler to operate but removes the known-good baseline the moment the upload finishes. Loading alongside costs more storage and a larger version list to manage, but it lets clinical informatics and laboratory teams compare expansions, check changed or deprecated codes, and roll the pin forward on their own schedule. For most production observation sets, the side-by-side approach is the safer default, and you should confirm the storage and index impact of each loaded version in your own environment before you commit to it.
The version string is part of the canonical reference. A LOINC CodeSystem loaded with a version identifier is addressed as its base URL followed by a pipe and that version, so a ValueSet that includes codes from it carries the same suffix in version on the include. Your team should agree on the version naming convention before the first upload, because renaming a version later means rewriting every ValueSet and client reference that depends on it. Check the exact LOINC version identifier printed in the distribution's release notes, and record it in your change log next to the upload date and the file checksum.
Value sets that do not pin a version are the usual source of surprise. When such a ValueSet is expanded or validated, the server resolves the code system to its current or latest loaded version, so uploading a new LOINC release can change which codes validate and which display text is returned, even though no client or ValueSet resource was edited. Audit your observation ValueSets for missing version pins before a release is loaded, and treat any unpinned reference as a defect to fix. The same risk is discussed in the versioning and rollout topics for the wider terminology service, which cover how operations select a version and how to move a pin in stages, so this section only asks you to find the unpinned references first.
Canonical URL and version mistakes that break observation validation
Most failed observation validation against LOINC traces back to a few upload and naming decisions made before any value set is tested. Each error below shows up first as a client symptom, and each has a specific check that would have caught it before go-live.
Canonical URL mismatch with value sets
The LOINC code system is uploaded under one canonical URL, while the observation value sets you imported or wrote reference a different one. The server then has no code system to check the codes against, so validation calls return that the code is unknown or the value set cannot be expanded. Before loading, list every canonical URL referenced by your profiles and value sets, and confirm the uploaded CodeSystem uses exactly that string, including the version segment if you use one.
JPA server docsMissing version causes wrong-release lookups
When a CodeSystem is uploaded without a version, later $lookup and $validate-code calls that omit a version resolve to whichever release the server treats as current. A client that validated an observation against one LOINC release can then receive display text or status from another, and the difference appears only when a code was deprecated or renamed between releases. Require an explicit version on every upload and on every client request that depends on code meaning.
Mixing LOINC releases in one code system
Loading a second LOINC distribution on top of the first, under the same canonical URL and version, merges concepts from two releases into one code system. Codes retired in the newer release can remain present, and display names can flip depending on which upload wrote last. The symptom is intermittent: the same code validates on one server restart and not on another after a re-index. Keep each LOINC release under its own version and compare concept counts and a sample of codes against the release notes before publishing.
Assuming uploads reach dependent value sets
Uploading a new CodeSystem does not automatically rebuild value sets that were expanded against an earlier version, and pre-expanded value sets may keep serving old membership. Observation panels that pin a value set version can therefore accept codes that the new release has changed, while newly added codes are rejected. After each upload, run $expand on the value sets your observation profiles use and compare the result with the expected code list for that release.
Unpinned value set references
A value set that includes LOINC codes without a version in its compose.include element follows whatever CodeSystem version the server selects at expansion time. Two environments loaded at different times can then validate the same observation differently, and a test server may pass while production rejects the same message. Pin the system version in each include, and check the expansion result for the version string the server actually used.
Profiles and code system versions drifting apart
Observation profiles, the value sets they bind to and the LOINC CodeSystem version are often maintained by different teams and updated on different schedules. A profile can be updated to a newer LOINC version while the server still holds the older one, or the reverse, and the validator reports errors that look like bad client data. Keep a single record of the LOINC version each profile was tested against, and run your observation validation test suite after every terminology upload.
Who does what when a new LOINC version arrives
The terminology administrator owns the load itself. They take the LOINC distribution from the source that your organization is licensed to use, confirm which release it is, and load it into the HAPI FHIR server as a new code system version under its versioned canonical URL. The administrator keeps a release record that states the LOINC version, the source file set, the load date, the canonical URL used, and the outcome of the load, so later reviewers can reconstruct what the server held at any point.
- Input: the LOINC release files, the release notes and the license terms that apply to your organization.
- Work: load the release under its versioned canonical URL, confirm the CodeSystem resource is present with the expected version string, and check that a sample of known codes returns from
$lookup. - Output: a release record and a server state in which the new version exists alongside the prior version, with the prior version still active.
- Handoff: the record and the loaded version identifier go to the integration engineer, with the list of any load errors or skipped files.
- Confirm: the exact load procedure, file names and command syntax for your HAPI FHIR version in the official documentation before running it in production.
The administrator should not switch the default version. That decision waits until the other two roles have signed off.
The integration engineer checks that everything that depends on LOINC still resolves once the new version is present. That covers observation value sets that reference LOINC codes, client mappings from local laboratory or device codes to LOINC, and any application that sends a version-specific canonical URL. The engineer runs validation and expansion against the new version in a non-production environment and records which codes now fail, which are retired or renamed, and which need a mapping change.
- Input: the release record and loaded version from the administrator, plus the inventory of value sets and client mappings that reference LOINC.
- Work: re-expand the observation value sets against the new version, validate a representative set of client-sent codes, and compare results with the prior version.
- Output: a difference report listing added, removed and changed codes per value set, and a list of mapping changes needed in client systems.
- Handoff: the difference report and proposed mapping changes go to the clinical informatics lead, with a clear statement of which items block approval.
- Confirm: how your clients pin versions. Some send an unversioned URL that resolves to the server default, which changes behavior when the default moves.
The engineer should also test one full path from a client submission to a stored observation, because a value set can expand correctly while a client still sends a code the server no longer accepts.
The clinical informatics or quality lead decides whether the new version can be used for clinical and reporting purposes. They review the difference report with attention to codes whose meaning, scope or status changed, because those affect the interpretation of stored results, quality measures and decision support. The lead approves, approves with conditions, or defers the version, and records the decision and its rationale so that the approval is traceable.
- Input: the difference report, proposed mapping changes and the list of blocking items from the integration engineer.
- Work: review changed and retired codes that appear in active observation value sets, confirm that quality measures and reports use the intended codes, and decide on any conditions such as a transition period.
- Output: a signed approval record that names the approved version, the scope of use, the conditions and the date.
- Handoff: the approval releases the administrator to set the new version as the server default or as the version used by named value sets, and tells the engineer which client changes must ship first.
- Confirm: your internal governance rules for who may approve, and whether any external reporting program requires a specific code version.
Without a recorded approval, the new version stays loaded but inactive, which keeps the rollout reversible.
Access, licence terms and audit for terminology uploads
Decide who may upload code systems before the first LOINC file reaches the server. A LOINC load changes the terminology every validation and expansion call relies on, so the uploading role should be narrow, usually a small group of platform or terminology administrators, and separate from the people who build or query value sets. HAPI FHIR does not provide a single security layer that decides this for you. It offers building blocks such as authentication interceptors, the AuthorizationInterceptor, and BALP audit logging, and you assign them to roles yourself. Map each upload operation to a named role, confirm which FHIR operations and endpoints your chosen authorization rules can restrict, and test that a non-administrator client receives a denial when it attempts an upload.
Record every upload and review the record after each LOINC release. BALP audit logging captures access to the server, so confirm with your security team that it covers the terminology upload calls you use and that the entries include the user identity, the time and the resource affected. Store the audit output outside the FHIR database where the terminology administrators cannot edit it, and set a review step that compares each load against the change request that approved it. The record should show which LOINC version was loaded, under whose approval, and the canonical URL it was registered under.
Confirm the LOINC licence terms before any distribution, and do not treat a successful load as proof that the use is permitted. The terms depend on how you use LOINC, which downstream systems receive the codes, and whether you share the content outside your organization, so check each use and each downstream system with your legal or compliance team and record the outcome. The server does not evaluate licence compliance on its own, and it will expand and serve the codes it holds regardless of what your licence allows. Keep the licence decision in the same change record as the upload approval, and ask the team to re-check it when a new LOINC release or a new downstream consumer is added.
What to confirm in your environment before loading LOINC
Most LOINC load problems trace back to decisions made before the first upload: which HAPI FHIR release and JDK you run, which database you commit to, and how your licence and URLs are set up. Confirm these six points first, then the load itself is a repeatable step.
HAPI FHIR version and JDK
Pick the HAPI FHIR release you will run, then confirm the JDK it needs on the servers and build images you control. HAPI FHIR 8.2.0 requires JDK 17, and later releases may raise that requirement, so check the version page for the exact release you plan to deploy. Record the version in the load runbook, because terminology upload behavior and tooling can change between releases.
HAPI FHIR versionsProduction database platform
Confirm which database your organization will operate for production. The JPA starter defaults to an embedded H2 database, which is not a production choice, and it supports PostgreSQL and Microsoft SQL Server for production while not supporting MySQL. Ask your DBA team whether they can provision and back up the chosen platform, since the LOINC code system tables will sit in the same database as your other FHIR data.
JPA starter repositoryLOINC licence position
Ask your legal or compliance owner whether your intended use of LOINC content is covered by the licence terms that apply to your organization, including internal use, sharing with partners and any hosting of the terms through a terminology server. Confirm who holds the licence agreement and who will accept updated terms when LOINC releases a new version. Do not load the distribution until this answer is documented.
Canonical URL convention
Decide how your value sets, profiles and client applications will reference LOINC, including the code system canonical URL and the version string you attach to it. Check whether your existing FHIR implementation guides or interfaces already fix a URL pattern. Changing the pattern after value sets are published forces a rewrite of every reference, so agree the convention with the teams that author and consume these resources.
Storage headroom for code system tables
Estimate how much additional database space the LOINC code system and its concepts will need, and confirm the storage limits and growth alerts on the database instance. Ask the DBA team to size for at least one more LOINC release alongside the current one, because keeping several versions side by side adds rows and index space. Confirm the backup window also covers the larger database.
How clients pin versions
Confirm whether each client system references LOINC with a specific version or with the unversioned URL, and who owns that setting. Clients that fetch the latest version can see different codes after a load, so agree which systems pin and which follow the default. Test a sample of observation requests against both the pinned and default version before you announce the new release to consuming teams.
Questions teams ask before loading LOINC into HAPI FHIR
How much effort does loading LOINC into HAPI FHIR take?
The load itself is usually the smaller part. Effort comes from preparing the server, choosing the canonical URL and version scheme, confirming how your licence terms apply to the LOINC files you distribute internally, and checking that the observation value sets you need resolve correctly afterward. The main drivers are how many LOINC code systems and value sets you load, whether you use LOINC content inside other terminology services, how many systems depend on the codes, and how much validation testing your data needs. Ask any partner for a quote that lists each of these as a separate line item, with the environments and test cases included.
Can an internal team load LOINC into HAPI FHIR without a partner?
Yes, if your team already runs a HAPI FHIR JPA server and has someone comfortable with FHIR terminology operations such as CodeSystem, ValueSet and the $lookup and $validate-code operations. The HAPI FHIR JPA server documentation covers terminology services, so the technical path is documented. What an internal team often lacks is time for verification against its own observation data, a tested process for new releases, and the experience to spot silent mismatches in value set content. A partner can take on any of these as a fixed-scope piece while your team keeps ownership of the server.
What does the work need from our side?
You need to provide the target environment, the HAPI FHIR version and JDK in use, a database such as PostgreSQL or Microsoft SQL Server (the starter does not support MySQL), and access rules for who may upload terminology content. You also need the LOINC licence position confirmed for your use, a list of the observation value sets and interfaces that depend on LOINC codes, and sample data from your laboratory or clinical systems for testing. Name a clinical or informatics owner who can decide which codes and value sets are in scope.
How long does a load and verification cycle take in our environment?
No duration is fixed for this work. The cycle length depends on the size of the LOINC content you load, the database and hardware you run it on, the number of environments you promote through (for example a test server before production), and how many verification rounds your clinical and integration teams need. Measure a test load in your own environment first, then ask for a fixed-scope timeline in a written quote that names the environments, test sets and sign-off steps.
How do we handle new LOINC releases over time?
Treat each LOINC release as a new versioned code system rather than an overwrite of the old one, so existing observations and value sets keep resolving against the version they were built on. Each release needs a load into a test environment, a comparison of added, changed and deprecated codes against your value sets, and a decision on when to move your default version. Budget this as a recurring task. Ask any partner whether the release routine is included in the quote or sold as a retainer.
What changes if we later move to a managed terminology service?
The FHIR interfaces may stay similar, but the operational responsibilities move. A managed service typically takes over hosting, uptime and some update handling, while your team still needs to confirm licensing for the code systems it serves, map your canonical URLs and versions, and retest every system that calls the terminology endpoints. Plan the migration as a versioned cutover: export your value sets and code system versions, confirm the new service returns the same results for your test codes, and keep the old server running until your consumers are verified. Confirm the exact export and import options with the managed provider before committing.
How DeployOpen scopes and delivers LOINC loading on HAPI FHIR
DeployOpen plans, builds and documents LOINC loading on a HAPI FHIR JPA server running in infrastructure you control. Engagements are fixed-scope, so the code systems, versions, value sets and handover materials are agreed in writing before any loading work begins.
How we scope
- Confirm which LOINC distribution files, versions and release cadence your organization needs to load.
- Agree the canonical URL and version naming convention for the LOINC code system and its value sets.
- Define which observation value sets and LOINC-based validation rules your systems depend on.
How we build
- Load the chosen LOINC release into a non-production HAPI FHIR JPA server and record the upload steps.
- Test $lookup, $validate-code and value set expansion against sample observations from your systems.
- Document the repeatable procedure for loading each new LOINC version without breaking existing validation.
How we hand over
- Deliver the loading runbook, configuration files, test cases and version register in your repository.
- Walk your platform and terminology teams through the procedure and the verification checks they will run.
- Record the license terms and usage conditions you must confirm for LOINC content with its publisher.
How we support
- Offer ongoing support, upgrades and continuous testing as a retainer after handover.
- Review each new LOINC release against your value sets before it is promoted to production.
- Confirm support boundaries, response expectations and change handling in the written scope.

