Generating International Patient Summary documents with HAPI FHIR: when teams need it
A health organization that stores structured patient data in a HAPI FHIR JPA server needs a standard patient summary when a patient moves between care settings or when records must travel across a border. The HAPI FHIR JPA server answers that need with the $summary operation, which generates an International Patient Summary (IPS) document from the resources already stored in the server. The IPS is specified in EN 17269 and ISO 27269, and the IPS implementation guide in FHIR provides the profiles that the generated document follows. Teams should treat the generator as a starting point. The output reflects only what is stored, how it is coded and how completely it is recorded, so a summary built from sparse or inconsistently coded data will be thin no matter how the generator is configured.
The generator runs through an extensible engine. The default strategy, DefaultJpaIpsGenerationStrategy, is one implementation of the IIpsGenerationStrategy interface and includes all standard IPS sections with their narrative templates. Before building on it, the team should confirm which sections its own data can populate, which resources carry the codes the sections expect (allergies, medications, problems, immunizations, procedures) and whether clinicians record those items as structured data or only as free text. Those checks decide whether customization is needed at all. Each gap found at this stage is a data quality or mapping question, and it is cheaper to answer before the strategy code is written than after the first documents reach a receiving clinician.
Cross-border and care transition uses add requirements beyond the document itself. The receiving party needs to know which patient records were matched to the summary, who may request one, and how the exchange is logged. Those controls sit around the $summary endpoint, in the server's authorization and audit configuration, and in the agreements that govern the exchange. Teams subject to frameworks such as HIPAA or the EU's health data rules should confirm early which obligations apply to the summaries they produce, because the generator itself does not decide who may receive them.
How the default generation strategy works
The HAPI FHIR JPA server ships with a strategy class named DefaultJpaIpsGenerationStrategy, which implements the IIpsGenerationStrategy interface. The interface is the extension point the $summary operation calls to assemble an IPS Bundle, so the default class is the starting behavior for any server that has IPS generation enabled. It reads resources from the server's own database and includes all standard IPS sections, and it supplies the narrative templates that produce the human-readable text in each section. Teams that want to see what the server produces before changing anything should run $summary against a set of test patients and review the output.
- Section coverage: The default covers the standard IPS sections, so you can check which ones populate for your records before deciding whether any are missing.
- Narrative output: The bundled templates generate the text that a clinician or receiving system reads, so review it with clinical staff early.
- Data dependence: A section appears only when matching resources exist, so sparse records produce sparse summaries.
- Server configuration: The default depends on the server version and enabled modules, so record the version you tested.
- Version alignment: Confirm the IPS guide version the default follows against your receiving systems' requirements.
Before relying on the default output, confirm which sections it produces against your own data and the IPS guide version your exchange partners expect.
Adjusting the default keeps the same generation path while changing what it includes or how it describes the content. This is the middle option: you keep the standard section logic and narrative templates but make local decisions, such as which data elements count as current, how a section is worded, or whether a section should be emitted for a particular population. Changes are made by extending or configuring the strategy, not by rewriting the $summary pipeline, so the work stays bounded to the sections and templates you need to change.
- Section scope: Decide which resource types feed each section and which status or date filters apply, and document each choice.
- Narrative templates: Edit the templates that render section text so wording matches your clinical conventions and language requirements.
- Clinical review: Have clinicians sign off on any change that alters what a receiving clinician sees.
- Regression tests: Keep a fixed set of test patients and compare summaries after each template or filter change.
- Upgrade impact: Track local changes so they can be reapplied when the HAPI FHIR version changes.
Before you change a section or template, confirm with your clinical and interoperability leads that the change does not remove content a receiving system requires.
Replacing the strategy means writing your own class that implements IIpsGenerationStrategy and registering it in place of the default. This is the option for organizations whose summary logic cannot be expressed through the default's section and template model, for example when content must come from sources outside the local database or when the output structure differs from the default. It carries the highest build and maintenance cost, because your class must produce conformant output and must be retested whenever the server or the IPS guide changes.
- Interface contract: Implement the full interface and confirm how the server calls it, including inputs and expected return types, against the current HAPI FHIR documentation.
- Conformance testing: Validate every generated Bundle against the IPS profiles your partners use before any exchange.
- Ownership: Assign a named team to maintain the class through server upgrades and IPS guide updates.
- Fallback behavior: Define what happens when your strategy fails or lacks data, so partial summaries are not sent silently.
- Reuse: Start from the default's source to keep logic that already works and replace only the parts that differ.
Before committing to a custom strategy, confirm that the default cannot meet the requirement through configuration or template changes, since a replacement becomes your code to test and support.
Configuration options and when each fits
This table compares the four configuration choices for IPS generation: the default strategy, a custom strategy class, custom narrative templates, and on-demand versus stored summaries. Read each row for when the option fits, what it changes in the output, and what your team must maintain afterward. Exact configuration keys and class names should be confirmed in the HAPI FHIR IPS documentation before you commit to a design.
| Option | When it fits | What it changes in the output | What your team must maintain |
|---|---|---|---|
| Default strategy (DefaultJpaIpsGenerationStrategy) | Your first build, or a use case where the standard IPS sections meet the exchange partner's needs | Includes all standard IPS sections with the default narrative templates | Confirm the default version matches the IPS release your partners expect, and retest after each HAPI FHIR upgrade |
| Custom strategy class implementing IIpsGenerationStrategy | A local or cross-border requirement adds or removes sections, or changes which resources feed a section | Section set and resource selection change; the output may no longer match the standard IPS structure | Java code, build and release process, regression tests for each section, and review against partner expectations |
| Custom narrative templates | Receiving systems or clinicians need wording, language or layout that the default narrative does not provide | Changes the human-readable text in each section; coded data is unchanged | Template files, translation or clinical review of wording, and a test that rendered text stays accurate as data changes |
| On-demand $summary generation | Summaries are needed at the moment of request and the source data changes often | Each call builds the document from current stored data, so output reflects the latest record | Server capacity for generation load, access control on the operation, and audit logging of who requested each summary |
| Stored summaries as Bundle resources | Partners need a fixed snapshot, or you want a retained copy for review or dispute handling | Output is frozen at generation time and can be retrieved without rebuilding it | Retention, regeneration rules when source data is corrected, and controls on who can read stored Bundles |
Setting up IPS generation on a HAPI FHIR server
This sequence takes a team from a supported Java runtime and a production database to a HAPI FHIR JPA server that returns International Patient Summary documents from the $summary operation. Each step closes with a check that shows whether the server is ready for the next one.
Confirm the JDK and HAPI FHIR version
The platform engineering team picks the HAPI FHIR release it will run and confirms the Java runtime that release requires. HAPI FHIR 8.2.0 requires JDK 17, and the team should check the versions page for the release it intends to use before building the image or application server. Record the chosen version and JDK in the deployment plan so that later upgrades start from a known baseline. The step is done when a test build on the target JDK completes without errors.
Deploy the JPA server starter with production storage
The infrastructure team deploys the hapi-fhir-jpaserver-starter in the environment the organization controls, using one of the supported methods such as the hapiproject/hapi Docker image, Docker Compose or the Helm chart on Kubernetes. The starter defaults to an embedded H2 database, so the team must point it at PostgreSQL or Microsoft SQL Server before loading any clinical data, because MySQL is not supported. The step is done when the server answers a capability request and the database schema has been created without errors.
Load representative test Patient data
The implementation team loads synthetic or de-identified Patient data that covers the situations the IPS must handle, such as allergies, medications, problems, immunizations, procedures and results, plus records with missing or partial sections. Test data should exercise the codes and references the local source systems actually use, since the summary is only as complete as the stored resources. The step is done when a direct search for each resource type returns the expected records for the test patients, and the team has a written list of the cases covered.
Enable and call the $summary operation
The team enables the IPS generator on the server and calls the $summary operation for a test Patient, following the HAPI FHIR IPS documentation for the configuration keys that apply to the chosen release. The default strategy, DefaultJpaIpsGenerationStrategy, includes all standard IPS sections and supplies the narrative templates, so the first call tests the stock behavior before any customization. The step is done when the operation returns a Bundle with a Composition for the patient and the team can see each expected section in the response.
Build and register a custom strategy if needed
Only if the default output does not match local requirements, a developer writes a class implementing IIpsGenerationStrategy, changes the sections or narrative templates it uses, and registers it with the server. Changes should be limited to what the default strategy cannot provide, and each override should be reviewed by a clinical informaticist who can confirm the content is correct. The step is done when the custom strategy is registered, the $summary call uses it, and a comparison against the default output shows only the intended differences.
Validate output against the IPS structure
The quality team runs the generated Bundles through a FHIR validator configured with the International Patient Summary implementation guide, and checks the Composition sections, required entries and narrative text against that guide. Validation should be repeated after every strategy change and server upgrade, since small changes in section content can break conformance. The team should also confirm the output against the IPS specification with its own reviewers, because a validator confirms structure, not clinical accuracy. The step is done when test Bundles pass validation with no errors and the results are archived with the version of the server and strategy that produced them.
Customizing sections and narrative templates safely
Editing sections or narrative in the HAPI FHIR IPS generator changes what a receiving clinician or foreign system sees, so treat every change as a clinical content decision, not a code tweak. The generation strategy is a class implementing IIpsGenerationStrategy. The included DefaultJpaIpsGenerationStrategy already includes all standard IPS sections and supplies the narrative templates, so a custom strategy replaces that behavior for every summary your server produces. Before changing anything, confirm which resources feed each section, which codes and status values are included or excluded, and how the narrative is assembled from the structured data. A change to a section filter can add or remove allergies, medications or problems from a document that another organization will rely on for care.
The main trade-off is richness against disclosure. A fuller summary helps a receiving clinician act on current information, but every additional section, resource type or narrative field is data the receiving party may not need for that encounter. Confirm the purpose of each cross-border exchange with the clinical and privacy owners, and check whether the applicable data protection rules and any agreements with the receiving party limit what may be shared. Narrative templates deserve the same scrutiny, because free text can carry details, such as free-text notes or identifiers, that structured filters would otherwise exclude. Ask the terminology owner to confirm that the codes used in the summary come from the code systems your organization has approved and loaded on the server.
Put a written review step in front of every change. Clinical owners should sign off on section contents and narrative wording, terminology owners should confirm code systems and value sets, and privacy or compliance staff should approve any change that widens the data leaving the organization. Keep a version of the strategy and templates under source control, test each change against representative sample patients, and record which version produced which documents. Changes should be retested after every HAPI FHIR upgrade, because generator defaults and template behavior can change between releases. The HAPI FHIR IPS documentation linked on this page describes the extension points, but it does not decide what your summary should contain, and that decision belongs to your owners.
Security and privacy controls around IPS exports
HAPI FHIR gives you building blocks for protecting the $summary operation, not a finished security layer. The cards below cover the controls you assemble around IPS generation and the legal obligations that attach to each generated document, not only to the stored record.
Access control on the $summary operation
Decide who may call $summary and against which patient before you expose the endpoint. The operation reads the full clinical record for one patient, so it deserves the same authorization rules as a direct Patient read plus every resource type it pulls in. Test with a clinician account, a service account and an unrelated Patient to confirm that out-of-scope requests return an error rather than a partial summary.
AuthorizationInterceptor rules
The AuthorizationInterceptor lets you write rules by operation, resource type and compartment, so you can allow $summary only for the patient in the request context. Write the rules for the IPS operation explicitly rather than relying on general read rules to cover it. Verify the behavior with automated tests, because a rule that covers Patient reads may not cover the resources the generator collects.
Consent and search narrowing
Consent interceptors and search narrowing can exclude records a patient has restricted or that a requester has no reason to see. Confirm with your privacy office which categories of data, such as mental health or reproductive health notes, must be withheld from a summary by default. Then test that the generated Bundle reflects those exclusions and that excluded resources do not leak through the narrative text.
Audit logging with BALP
BALP audit logging records who accessed which patient data and for what purpose, so an IPS export is traceable after the fact. Make sure the audit entries capture each $summary call, including the requester identity, the patient and the time. Send these logs to storage that your security team controls and that retains them for the period your policies require.
Minimum necessary data per exchange
Each exchange should carry only what the receiving party needs. The default strategy includes all standard IPS sections, so a custom strategy may be needed to trim sections for a specific cross-border or payer request. Document the data set for each recipient, and confirm with your legal team whether the HIPAA minimum necessary standard, GDPR data minimization or EHDS requirements apply to that exchange.
Obligations on the generated document
A generated IPS is protected health information or personal data in its own right once it leaves the server. HIPAA safeguards, GDPR Article 32 security and the EHDS framework apply to the document, its storage, its transmission and its copies, not only to the database. Ask your compliance team to classify the output, set retention for exported summaries, and confirm that no formal HIPAA certification is required, since none exists.
How a $summary request flows through the server
A $summary request starts with the requesting system, which sits outside the trust boundary. The request passes the authentication and authorization interceptors before the $summary operation hands the patient to the IIpsGenerationStrategy, which reads stored resources from the JPA database and assembles the IPS Bundle that goes back to the caller. The audit log records the request on a separate branch. Check that the authorization step runs before any read, and that the audit branch is active in your deployment.
Path of a $summary request across the server trust boundary, with the audit log as a side branch.
Where cross-border exchange raises extra questions
A patient summary that leaves one country is only useful if the receiving system and clinician can trust its structure, language and legal basis. The cards below cover the decisions that sit between a generated IPS document and a safe handover across a border.
Choosing the national or regional profile
The IPS generator produces a document that follows the International Patient Summary specification, but receiving countries often layer their own profiles, required sections and identifier rules on top. Before generation, confirm which profile the receiving country or region expects and whether the default DefaultJpaIpsGenerationStrategy output needs an adjusted strategy to match it. Do not assume that an IPS valid for one country passes validation in another.
IPS generator docsTerminology the receiver can read
Coded entries such as conditions, medications and allergies depend on code systems that the receiving system recognizes. Check which terminologies the destination accepts, whether local codes must be mapped to international codes, and who owns that mapping. Terminology loading and mapping on your HAPI FHIR server should be verified against the receiving country's requirements, not assumed from the source system.
Narrative language and translation
The human-readable narrative is what many clinicians read first, and the templates supplied with the default strategy are written in one language. Decide which languages each receiving party needs, who approves translated templates, and whether coded data alone is enough for the receiving workflow. Translated narrative must stay consistent with the coded content it describes.
Consent and lawful basis
Sending a patient summary across a border needs a documented legal basis in both the originating and receiving jurisdictions, and it may depend on the patient's consent or purpose of use. The HAPI FHIR server does not decide this for you. Confirm with counsel which basis applies, how it is recorded, and how the AuthorizationInterceptor and consent interceptors restrict which summaries leave the system. Regulation (EU) 2025/327 on the European Health Data Space is relevant context to review with counsel, not a technical specification.
EHDS regulation textValidation on the receiving side
Receiving systems should validate an incoming IPS Bundle before accepting it into a record, and the sending server should validate its own output first. Agree on the validation profile, the tooling and the behavior when a bundle fails, such as rejecting it, quarantining it or accepting it with a warning. Test with sample bundles from both sides before live exchange begins.
Sending clinical data abroad
A summary built from one organization's records may reach a foreign care team, a traveler's home system or a national health data service, and each route adds a party with its own obligations. Map every recipient and transfer path, record where each summary was sent, and confirm the contractual and security terms with those parties before enabling automated $summary exchange.
Questions buyers ask before generating IPS documents
What drives the cost of a custom IPS generation strategy?
The main driver is how far your data model departs from the default. The included DefaultJpaIpsGenerationStrategy already covers all standard IPS sections and supplies narrative templates, so cost rises when you add sections, change which resources feed each section, or change the narrative wording. A custom strategy implements the IIpsGenerationStrategy interface, so the work is mapping your stored data to IPS content, testing edge cases such as missing allergies or conflicting medication statements, and reviewing output with clinical owners. Costs come from two places: the partner's engineering and testing time, and your clinical and terminology staff time. Ask any quote to list each custom section, each template, the test data sets used for verification, and the review rounds included. Quotes follow from the written scope.
How long does a first working IPS generator take to scope?
Scoping depends on the data you hold and how many sections you need beyond the defaults. Start with a written scope that names the sections, the source resources, the narrative templates, the target FHIR version, and the environment where the server runs. The HAPI FHIR JPA server supports FHIR DSTU2, DSTU3, R4, R4B and R5, so confirm the version your partners and receiving systems use before design begins. Build time follows from that scope and from the review cycles with clinicians. DeployOpen does not publish timelines, so the timeline in your written scope is the figure to plan against.
What must our team provide before the build starts?
Three inputs decide whether the generator produces useful documents:
- Clinical owners who can approve which conditions, medications, allergies, immunizations and results belong in each section, and who review sample output.
- Terminology mappings that connect your local codes to the standard code systems the IPS content uses, including any gaps in your local catalog.
- Sample data, ideally de-identified or synthetic, covering common cases and known edge cases such as incomplete records, duplicate entries and superseded statements.
Ask your partner to confirm in writing who signs off on clinical content and who owns the mappings after handover.
Can our internal team build an IPS generator without a partner?
Yes, if you have engineers who know Java and the HAPI FHIR JPA server, and clinicians who can review output. The HAPI FHIR documentation describes the $summary operation and the strategy interface, so a capable team can start from the default strategy. The harder parts are usually clinical review, terminology work and testing against realistic records, not the Java code. Check three things before you decide: whether the team can maintain the strategy after upgrades, whether they can test it in a supported Java runtime (HAPI FHIR 8.2.0 requires JDK 17), and whether they have time for review cycles. A partner is a reasonable choice when those capacities are missing.
What ongoing work recurs after the generator goes live?
Expect recurring work in four areas: upgrades of HAPI FHIR and the server runtime, retesting of the custom strategy after each upgrade, updates to narrative templates and terminology when clinical content changes, and periodic review of generated documents against current clinical guidance. The HAPI FHIR releases page lists each version, so track the release you run and plan upgrade testing before moving versions. Ask whether a support retainer covers upgrades, regression tests and template changes, and what happens when a vendor release changes an interface your strategy depends on.
Does generating IPS documents create compliance obligations for us?
Generating IPS documents from stored patient data means you handle electronic health information, so privacy and security obligations apply to the system. In the United States, the HIPAA Security Rule applies to covered entities and business associates for all ePHI they create, receive, maintain or transmit. HIPAA has no certification, so ask any partner for evidence of controls and test results rather than a certificate. Your compliance team should confirm which regimes apply in each country where documents are exchanged, and the controls around access, audit logging and document transmission should be designed with them from the start.
What does a quote for this work need to include?
A useful quote lists the sections in scope, the source resources and terminology systems, the narrative templates, the test data and acceptance criteria, the clinical review rounds, the deployment environment, handover documentation and the post-go-live support terms. DeployOpen works from a written scope and prepares quotes from that scope, so the more precise the scope, the more precise the quote. Ask every bidder to state what is one-time work and what recurs, and who is responsible for each open decision.
How DeployOpen works on this
DeployOpen plans, implements, customizes, documents and supports self-hosted open-source platforms inside your own infrastructure. For IPS generation, that means scoping the HAPI FHIR server, the strategy and narrative work and the cross-border exchange path in a written agreement before any build starts.
How we scope
- Engagements are fixed-scope, with the IPS sections, narrative templates and data sources agreed in writing before work starts.
- We confirm which stored resources feed each IPS section and which data quality gaps the team must close first.
- We confirm where the server runs, which identity provider and audit controls apply, and who approves the exchange path.
How we build
- We deploy the HAPI FHIR JPA server in your cloud accounts, data centers or air-gapped network, using the deployment method your teams choose.
- We configure the $summary operation and implement any custom IIpsGenerationStrategy agreed in the scope, with version control.
- We test generated documents against sample records, including narrative output, missing data and access restrictions, before sign-off.
How we hand over
- We deliver configuration, custom strategy code, test results and a runbook your engineers can operate without us.
- We document which sections are included, how narrative templates are maintained and how changes are reviewed.
- We walk your security and compliance teams through the evidence they need to review the setup independently.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers after handover.
- Retainers can cover HAPI FHIR version upgrades, template changes when clinical content requirements shift and periodic retesting.
- Support terms, response expectations and included hours are set in the written agreement, so ask for them in your quote.

