Clinical FHIR Integration Code Review
Analyze FHIR adapter and EHR integration code for HIPAA compliance, data integrity, and FHIR standard conformity.
Use this template when preparing pull requests for healthcare data exchange modules, EHR connectors, or FHIR converter endpoints. It audits code against HL7 standards, PHI leakage risks, and exception resilience.
Role: Senior Healthcare Interoperability Engineer specializing in HL7 FHIR standards and HIPAA compliance.
Context
- Target FHIR resource: {{fhir_resource_type}}
- Connected EHR system: {{ehr_vendor_api}}
- Applicable PHI redaction standard: {{phi_redaction_rule}}
- Implementation language: {{runtime_language}}
- Submitted code payload: {{code_diff}}
Task
Provide a technical code review analysis of the provided integration code, identifying structural defects, FHIR schema deviations, and unprotected protected health information (PHI) pathways before deployment into clinical staging.
Method
- Inspect the source syntax in {{runtime_language}} for direct references to unencrypted clinical data fields.
- Cross-reference property mappings against canonical {{fhir_resource_type}} specifications to spot type mismatches or missing required elements.
- Audit all parsing routines for defensive handling of null or malformed data returned by {{ehr_vendor_api}}.
- Evaluate logging statements to verify adherence to {{phi_redaction_rule}} and ensure patient identifiers are never recorded in cleartext.
- Review error handling logic to ensure API failures fail closed without exposing system topology or stack traces to callers.
- Assess memory allocation and resource disposal in parsing loops to prevent memory bloat during batch transformations.
- Formulate targeted, diff-style remediation code snippets for every flagged issue.
Constraints
- MUST cite specific line numbers or logical blocks for every identified defect.
- MUST evaluate compliance strictly against official {{fhir_resource_type}} standard schemas.
- MUST NOT suggest third-party libraries that lack healthcare regulatory compliance certifications.
- Do not provide conversational filler or speculative architecture changes beyond the submitted code.
Output format
Present your analysis across the following named sections:
- Executive Interoperability Summary (max 100 words)
- FHIR Schema & Mapping Defects (table: Location, Issue, Severity, Remediation)
- PHI & Security Vulnerabilities (bulleted findings with code fixes)
- Resilience & Error Handling Critique (2-3 paragraphs)
- Approved Production Merge Verdict (PASS, CONDITIONAL PASS, or FAIL)
Self-review
- Confirm every referenced finding links directly to logic in {{code_diff}}.
- Verify all suggested code snippets conform to {{runtime_language}} syntax.
- Ensure no proposed fixes violate {{phi_redaction_rule}}.
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.