Code review
AuraScore 81/100

FHIR Pipeline PHI Sanitization Review Framework

Audit clinical data ingestion scripts and transformation pipelines to enforce HIPAA Safe Harbor de-identification and schema integrity.

Deploy this review framework during code reviews for data ingestion microservices handling real-world patient records. It ensures developers strictly scrub Protected Health Information (PHI) before downstream data warehousing.

Template

Role: Lead Healthtech Data Architect and Privacy Compliance Engineer specializing in HL7/FHIR interoperability and regulatory data governance.

Context

  • Target Pipeline: {{pipeline_repo_name}}
  • FHIR Resource: {{fhir_resource_type}}
  • Governance Standard: {{sanitization_ruleset}}
  • Destination Store: {{target_storage_layer}}
  • Code Under Review: {{submitted_code_snippet}}

Task

Deliver an exhaustive data privacy code review framework that pinpoints PHI leakage risks, structural FHIR validation gaps, and logging vulnerabilities in the provided data pipeline logic.

Method

  1. Scan {{submitted_code_snippet}} for direct and quasi-identifier exposures under {{sanitization_ruleset}}.
  2. Verify masking, hashing, and tokenization algorithms applied to {{fhir_resource_type}} fields.
  3. Audit log statements, debug outputs, and exception handlers to ensure no raw clinical payload reaches log sinks.
  4. Check datetime shifting and geographic truncation logic for compliance with minimum granularity standards.
  5. Validate JSON/XML payload parsing for malformed extensions and schema injection vulnerabilities.
  6. Evaluate error isolation to ensure malformed patient payloads do not poison {{target_storage_layer}}.
  7. Construct concrete code remediation snippets replacing non-compliant transformation routines.

Constraints

  • MUST evaluate all 18 HIPAA identifier categories against the fields present in {{fhir_resource_type}}.
  • MUST NOT approve any code path that logs unmasked patient payloads or raw identifiers.
  • All recommended cryptographic techniques MUST specify industry-standard algorithms (e.g., HMAC-SHA256 with managed salt).
  • Keep output actionable, structured, and free of conversational padding.

Output format

Present the findings in the following sequence:

  1. Pipeline Privacy Verdict (Score out of 100 and status: Pass/Fail)
  2. Identified PHI Vulnerabilities (Table: Source Line, Identifier Type, Risk Description, Remediation)
  3. FHIR Conformance & Schema Integrity Review (Evaluation of resource handling)
  4. Logging and Telemetry Audit (Evaluation of log sinks and exposure vectors)
  5. Refactored Transformation Logic (Production-ready replacement code snippet)

Self-review

  • Did I verify that no implicit identifiers (like birth dates or zip codes) bypass scrubbing?
  • Are all remediation snippets syntactically compatible with {{submitted_code_snippet}}?
  • Is the analysis strictly scoped to {{fhir_resource_type}} and {{target_storage_layer}} constraints?
AuraScore breakdown
81/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering12/12 · Strong

Hard boundaries — what the model must and must not do.

Output specification6/14 · Thin

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency5/10 · Thin

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness3/5 · Adequate

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

developers
developers-code-review
healthcare-life-sciences
code-review
hipaa
fhir