FHIR API Integration Code Quality Review
Evaluate FHIR resource parsers, endpoints, and validation logic for healthcare interoperability and error resilience.
Use this template when preparing code reviews for EHR integration modules and FHIR data adapters. It ensures strict conformance to healthcare data exchange standards and robust fault handling.
Role: Principal Health Informatics Engineer specializing in HL7 FHIR US Core and EHR interoperability pipelines.
Context
- EHR Integration Partner: {{ehr_vendor}}
- FHIR Resource Scope: {{fhir_resource_scope}}
- Implementation Code Diff: {{source_code_diff}}
- Interoperability Standard: {{compliance_standard}}
- Target Deployment Tier: {{target_environment}}
Task
Produce a technical FHIR Integration Code Review Report that analyzes the submitted source code against resource validation rules, error handling resilience, and interoperability conformance to prevent ingestion failures.
Method
- Inspect the incoming FHIR payload parsing logic in {{source_code_diff}} against {{fhir_resource_scope}} schema definitions.
- Evaluate cardinalities, mandatory fields, and binding strengths specified by {{compliance_standard}}.
- Audit external REST invocation patterns and error handling for timeouts or throttling from {{ehr_vendor}}.
- Examine serialization logic to confirm that null or unknown extensions do not cause runtime panics or data corruption.
- Review patient identifier reconciliation mechanisms across {{target_environment}} boundaries.
- Trace sanitization routines that scrub Protected Health Information (PHI) from unhandled exception traces and application logs.
- Formulate specific code refactoring recommendations paired with corrected snippet examples.
Constraints
- MUST cite specific FHIR resource paths and lines of code for every identified defect.
- MUST NOT recommend third-party libraries that lack explicit HIPAA or BAA support documentation.
- Findings must categorize severity into Critical, Moderate, and Low.
- The review must cover both parsing ingress and serialization egress.
- Remediation advice must preserve backward compatibility with {{compliance_standard}}.
Output format
Structure the report with the following exact sections:
- Executive Interoperability Summary (under 150 words)
- Schema & Resource Conformance Table (columns: Resource, Element, Conformance Status, Issue)
- Critical & Moderate Code Findings (detailed bullet points with code snippets)
- Resilience & Error-Handling Assessment (1-2 paragraphs)
- Remediation Action Checklist (numbered checklist)
Self-review
- Confirm all 5 context variables are evaluated in the text.
- Verify that no PHI leaks are overlooked in logging analysis.
- Check that all line-level code suggestions are syntactically valid.
Explicit role, a named task, and discrete steps the model can follow.
Background, inputs and variables the model needs before it starts.
Hard boundaries — what the model must and must not do.
A named, field-level shape for the response.
Ordered work items that force analysis before an answer.
Length and structure that travel across frontier models.
Signal density — instruction weight without padding.
Documented variables so the scaffold adapts to new inputs.
Quality bar, assumptions and behaviour when inputs are thin.
How much real usage the template has behind it.