piidetectionapi.com
Home
Solutions - Fundamentals
What Is PII Detection? NER vs Regex vs Rules Accuracy, Precision & Recall PII in Test Data
Solutions - Compliance
GDPR Personal Data HIPAA PHI Detection CCPA / CPRA PCI DSS Card Data
Solutions - AI & LLM Safety
LLM Guardrails Chatbot PII Filtering RAG Pipelines
Solutions - Data Discovery & DLP
Data Loss Prevention Log File Scanning Support Tickets Email Scanning Documents & PDFs Database Discovery ETL & Streaming Pipelines
Industries - Financial
Banking Fintech Insurance
Industries - Healthcare
Healthcare Pharma & Clinical Trials Telehealth
Industries - Public Sector & Legal
Government & FOIA Law Enforcement Law Firms & eDiscovery Education (FERPA)
Industries - Technology
SaaS Platforms Cybersecurity & IR Telecommunications Gaming & Platforms
Industries - Other
HR & Recruiting Retail & E-commerce Call Centers & BPO Real Estate Travel & Hospitality Marketing & AdTech
How-to Guides - Identity & Contact
Detect Names Detect Email Addresses Detect Phone Numbers Detect Physical Addresses Detect Dates of Birth
How-to Guides - IDs & Financial
Detect SSNs Detect Passport Numbers Detect Drivers Licenses Detect Credit Card Numbers Detect Bank Accounts & IBAN
How-to Guides - Technical & Health
Detect IP & Device IDs Detect Medical Records & PHI
Resources
Pricing API Docs Supported Entities Languages About Contact Sign In Try the Live Demo Get Started
Pharma & Clinical Trials

PII Detection for Pharma & Clinical Trials

Anonymize clinical study reports, patient narratives, and adverse event reports at scale. AI-powered detection of patient and investigator identifiers built for EMA Policy 0070, Health Canada PRCI, and pharmacovigilance workflows — with redaction as the optional next step.

EMA Policy 0070 Health Canada PRCI ICH E3 / E2B 150+ entity types GDPR-native

The Transparency Mandate Meets Patient Privacy

Pharmaceutical companies now operate under a double bind. Regulators and journals demand unprecedented disclosure — clinical study reports published by the EMA, redacted submissions released by Health Canada, trial results shared with independent researchers, plain-language summaries for participants. At the same time, GDPR, HIPAA, and trial consent language demand that the people inside those documents remain unidentifiable. A single Phase III CSR can run tens of thousands of pages, and its patient narratives, listings, and appendices are saturated with names, dates, subject IDs, and site details.

Manual redaction teams — the historical answer — read documents line by line with highlighters and PDF tools. The approach is slow (months per submission), expensive, and inconsistent: two reviewers rarely mark the same spans, and a missed initial or verbatim date in one narrative can undo an entire anonymization exercise. As transparency obligations expand from marketing authorizations to routine data-sharing requests, the volume simply outgrows human-only review.

Our PII Detection API automates the discovery layer. Context-aware NER models scan protocol text, narratives, and safety reports, returning every personal identifier with its type, exact character offsets, and a confidence score — plus an optionally masked copy via mask_mode in the same call. Redaction teams shift from finding identifiers to verifying them, cutting review cycles from months to weeks while producing the span-level audit trail regulators expect.

Detection first, redaction second

The API returns structured entities (type, matched text, start/end offsets, confidence) that slot directly into redaction tooling, anonymization reports, and risk calculations. Produce proposal-stage highlights for reviewer QC, then apply mask_mode for the final package. See the API documentation for the contract and the entity catalog for all 150+ types.

The Clinical Transparency Regulatory Landscape

Each disclosure regime defines what must be published and what must be protected — detection is how you reconcile the two at scale

EMA Policy 0070 & CTR 536/2014

The EMA publishes clinical reports supporting marketing authorization applications, and the Clinical Trials Regulation makes CTIS the public window into EU trials. Sponsors must submit anonymized report packages plus an anonymization report justifying every technique used. EMA guidance favors anonymization over crude redaction where re-identification risk can be shown to be low — which requires exactly the entity-level inventory the API produces: what identifiers existed, where, and how each was transformed.

Health Canada PRCI

Public Release of Clinical Information requires anonymized CSRs and clinical summaries within tight timelines after a regulatory decision, following Health Canada's quantitative guidance that re-identification risk stay below the 0.09 reference threshold. Meeting that bar means measuring identifiers, not just hiding them — direct identifiers removed, quasi-identifiers like dates, ages, and geography inventoried and transformed with documented rationale.

ICH E3 & FDA Submissions

ICH E3 defines CSR structure — including Section 12 safety narratives and Section 16 appendices where patient-level detail concentrates. FDA submissions and any later FOIA-driven release trigger redaction of patient and commercially confidential information. Scanning E3-structured documents section by section lets teams apply stricter rules to narrative-heavy sections while leaving statistical methodology untouched.

GDPR & HIPAA in Research

Trial data on EU subjects remains personal data until anonymized to GDPR's standard — pseudonymized subject IDs alone do not suffice when narratives carry dates and clinical detail. US sites feeding real-world evidence programs must satisfy HIPAA de-identification before data leaves the covered entity. Both frameworks reduce to the same operational task: find every identifier, then prove you did. See our GDPR guide and HIPAA 18-identifiers guide.

Why Manual-Only Redaction No Longer Scales

A typical Policy 0070 package spans thousands of pages across CSR body, narratives, and appendices; PRCI adds recurring waves as decisions publish. Vendor teams quote weeks per thousand pages, and every quality-control cycle repeats a share of that effort. Worse, manual work produces no reusable data: the next submission starts from zero, and consistency across documents — the same subject's initials caught in narrative 14 but missed in appendix 16.2 — depends entirely on reviewer stamina.

Automated detection inverts the economics. The API pre-annotates every candidate identifier with type, offsets, and confidence, so human experts review proposals instead of hunting raw text. Confidence scores let teams auto-accept high-certainty spans and route borderline ones to review, and the resulting span inventory becomes the quantitative backbone of the anonymization report — the artifact EMA and Health Canada actually evaluate.

Where Identifiers Hide in Trial Documentation

From first-in-human safety reports to post-marketing surveillance, every document class has its own identifier profile

Document / Data Source Typical Identifiers Found Disclosure Context Recommended Entity Filter
CSR body & ICH E3 Section 12 narratives Subject initials and IDs, verbatim dates, ages, sites, investigator names EMA Policy 0070, Health Canada PRCI PERSON_NAME, DATE_OF_BIRTH, AGE, MEDICAL_RECORD_NUMBER, ADDRESS, CITY
Patient safety narratives Full demographic detail, hospital names, treating physician names, event dates Transparency packages, PSUR/DSUR appendices PERSON_NAME, AGE, GENDER, DIAGNOSIS (retain), TREATMENT (retain), ADDRESS
Adverse event reports (E2B/ICSR) Reporter names and contacts, patient initials, DOB, lab values with dates Pharmacovigilance databases, partner exchange, literature reporting PERSON_NAME, EMAIL_ADDRESS, PHONE_NUMBER, DATE_OF_BIRTH, MEDICAL_RECORD_NUMBER
Trial datasets (SDTM/ADaM comment fields) Free-text comments carrying names, verbatim dates, site references Secondary research, data-sharing platforms (Vivli, YODA-style requests) PERSON_NAME, DATE_OF_BIRTH, CITY, ZIP_CODE, PHONE_NUMBER
Investigator & site files (1572s, CVs, delegation logs) Investigator names, emails, phone numbers, site addresses, license numbers Submission redaction, CCI review, audit sharing PERSON_NAME, EMAIL_ADDRESS, PHONE_NUMBER, ADDRESS, DRIVERS_LICENSE_NUMBER
Medical information & call-center logs Consumer names, contact details, HCP identifiers, product complaints with health context PV intake, quality systems, CRM minimization All entities (default), tuned with threshold and custom_instruction
Subject IDs are pseudonyms, not anonymization

Randomization numbers and subject IDs merely pseudonymize. Under GDPR and EMA guidance, data remains personal while narratives retain rare-event dates, unusual ages, or site geography that could re-identify. Detection of quasi-identifiers — AGE, DATE_OF_BIRTH, CITY, ZIP_CODE — is what feeds a defensible residual-risk calculation.

Patient and Investigator Identifiers the API Detects

Direct identifiers to remove, quasi-identifiers to transform, and clinical content to preserve — each a distinct entity type

PERSON_NAME
Subjects, investigators, reporters
DATE_OF_BIRTH
Verbatim DOBs in narratives
AGE / GENDER
Quasi-identifiers to offset
MEDICAL_RECORD_NUMBER
Hospital MRNs in source docs
HEALTH_INSURANCE_ID
Payer IDs in RWE sources
DIAGNOSIS / TREATMENT
Retain for scientific value
PRESCRIPTION
Concomitant medications
ADDRESS / CITY / ZIP
Site & subject geography
EMAIL / PHONE
Reporter & HCP contacts
SSN / NATIONAL_ID
Source documents, RWE feeds
EMPLOYMENT
Occupational AE context
BIOMETRIC_DATA / DEVICE_ID
Wearables, trial devices

Tuned for the Language of Clinical Research

Safety narratives are written in a compressed clinical dialect: "A 67-year-old female (Subject 0402-0117) experienced Grade 3 neutropenia on Day 14; Dr. Keller discontinued study drug." A detector has to know that "Keller" is an investigator name to protect, that "neutropenia" is scientific content to keep, that "67-year-old" is a quasi-identifier to generalize, and that "0402-0117" is a subject identifier whose treatment depends on your anonymization method. Pattern matching cannot make those distinctions; context-aware models can.

The API's configuration mirrors that nuance. Use entities to target only what your anonymization plan removes, exclude_entities to protect scientific terms like DIAGNOSIS and PRESCRIPTION from masking, and custom_instruction for study-specific rules — for example, "treat tokens matching 0402-XXXX as subject identifiers" or "do not flag sponsor staff names on title pages". Confidence scores let validation teams quantify performance per document class, following the approach in our accuracy measurement guide.

Global trials also mean global text: narratives arrive from sites in dozens of countries, and PV intake spans consumer emails in any language. Detection works across 60+ languages — see the supported languages list. For scanned legacy CSRs and faxed CIOMS forms, OCR the pages first and scan the extracted text per our document and PDF scanning guide.

Pharma PII Detection Use Cases

Where sponsors, CROs, and pharmacovigilance teams deploy the API today

1

CSR Redaction for Policy 0070 / PRCI

Batch-scan CSR sections and appendices to pre-annotate every personal identifier before reviewer QC. High-confidence spans flow straight into the proposal package; borderline detections queue for human decision. The span inventory doubles as the quantitative annex of the anonymization report.

Input
Subject 0402-0117 (M. Keller, DOB 03 May 1957) was hospitalized at St. Vincent's, Dublin.
Detected & Masked
Subject 0402-0117 ([PERSON_NAME], DOB [DATE_OF_BIRTH]) was hospitalized at [ADDRESS].
2

Patient Narrative Anonymization

Section 12 narratives concentrate the most identifying prose in a submission. Scan each narrative with clinical entities excluded from masking, so demographics and geography are transformed while event descriptions, causality assessments, and outcomes remain scientifically intact for reviewers and researchers.

Input
A 92-year-old retired miner from Katowice developed rash after dose 2.
Detected & Masked
A [AGE] retired [EMPLOYMENT] from [CITY] developed rash after dose 2.
3

Adverse Event Intake & E2B Processing

Spontaneous reports arrive by email, call transcript, and web form, stuffed with reporter and patient contact details. Scanning at intake classifies identifiers before cases enter the safety database, and produces minimized versions of the narrative (E2B field B.5) for partner exchange and literature summaries.

Input
Reporter: Dr. A. Novak, [email protected], +48 22 555 0134. Patient J.K., DOB 2/9/1984, took 10mg...
Detected & Masked
Reporter: [PERSON_NAME], [EMAIL_ADDRESS], [PHONE_NUMBER]. Patient [PERSON_NAME], DOB [DATE_OF_BIRTH], took 10mg...
4

Trial Datasets for Secondary Research

Data-sharing requests require de-identified datasets, and the risk hides in free-text columns — comment fields, verbatim terms, deviation descriptions. Scan those columns with mask_mode: "hash" so identifiers disappear while consistent tokens preserve within-subject linkage across visits and domains.

Input
COVAL: "pt called Dr. Ryan on 14-Mar, missed visit, lives near Cork site"
Detected & Masked
COVAL: "pt called [HASH:a91f] on 14-Mar, missed visit, lives near [HASH:22c7] site"
5

Investigator & CCI Submission Review

Transparency rules protect personal data of investigators and staff too — 1572 forms, CVs, and delegation logs are dense with names, emails, and site addresses. Detection sweeps submission modules to flag personal identifiers for the redaction matrix, keeping the personal-data pass separate from commercially-confidential review.

Input
PI: Prof. Elena Rossi, [email protected], Site 0402, Via Festa 12, Milan
Detected & Masked
PI: [PERSON_NAME], [EMAIL_ADDRESS], Site 0402, [ADDRESS]
6

Medical Information & PV Call Centers

Product inquiry and complaint transcripts mix consumer identity with health information — a combination most CRM and analytics systems should never store raw. Inline detection masks identity before transcripts reach quality systems, trend analytics, or LLM-based summarization. See our support ticket PII guide for the pattern.

Input
Caller Marta Silva, 555-014-2287, reports dizziness since starting Product X.
Detected & Masked
Caller [PERSON_NAME], [PHONE_NUMBER], reports dizziness since starting Product X.
150+
Entity Types Detected
60+
Languages Supported
<200ms
Typical Response Time
50k
Chars per Request

Integrate Detection into Clinical & Safety Systems

One JSON endpoint. Send text, get back classified entities with offsets and confidence — plus an optional anonymized copy

cURL — Scan an Adverse Event Narrative

# Detect identifiers in a spontaneous AE report before it enters the safety database
curl -X POST https://piidetectionapi.com/api/moderate.php \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "YOUR_API_KEY",
    "api_type": "pii_detection",
    "text": "Reporter Dr. Anna Novak ([email protected], +48 22 555 0134) states patient J. Kowalski, DOB 02/09/1984, developed severe rash 3 days after starting 10mg dose. Patient hospitalized in Warsaw.",
    "entities": ["PERSON_NAME", "EMAIL_ADDRESS", "PHONE_NUMBER", "DATE_OF_BIRTH", "CITY"],
    "mask_mode": "replace",
    "threshold": 0.6
  }'
# Response
{
  "detected_entities": [
    {"type": "PERSON_NAME", "text": "Dr. Anna Novak", "start": 9, "end": 23, "confidence": 0.97},
    {"type": "EMAIL_ADDRESS", "text": "[email protected]", "start": 25, "end": 46, "confidence": 0.99},
    {"type": "PHONE_NUMBER", "text": "+48 22 555 0134", "start": 48, "end": 63, "confidence": 0.98},
    {"type": "PERSON_NAME", "text": "J. Kowalski", "start": 80, "end": 91, "confidence": 0.93},
    {"type": "DATE_OF_BIRTH", "text": "02/09/1984", "start": 97, "end": 107, "confidence": 0.95},
    {"type": "CITY", "text": "Warsaw", "start": 180, "end": 186, "confidence": 0.92}
  ],
  "anonymized_text": "Reporter [PERSON_NAME] ([EMAIL_ADDRESS], [PHONE_NUMBER]) states patient [PERSON_NAME], DOB [DATE_OF_BIRTH], developed severe rash 3 days after starting 10mg dose. Patient hospitalized in [CITY].",
  "entities_detected": 6,
  "processing_time_ms": 178,
  "mask_mode_used": "replace",
  "status": 200
}

Python — Batch-Process CSR Sections

import requests

API_URL = "https://piidetectionapi.com/api/moderate.php"

BASE = {
    "api_key": "YOUR_API_KEY",
    "api_type": "pii_detection",
    # keep scientific content, transform identifiers
    "exclude_entities": ["DIAGNOSIS", "TREATMENT",
                         "PRESCRIPTION", "MEDICAL_DATA"],
    "mask_mode": "replace",
    "threshold": 0.5,   # low threshold: recall first, QC later
    "custom_instruction": (
        "Treat codes like 0402-0117 as subject identifiers; "
        "do not flag sponsor company names."
    ),
}

def annotate_csr(sections):
    """sections: [(section_id, text <= 50k chars), ...]"""
    proposal = []
    for sec_id, text in sections:
        r = requests.post(API_URL, json={**BASE, "text": text},
                          timeout=30)
        r.raise_for_status()
        data = r.json()
        # auto-accept >=0.85; queue the rest for reviewer QC
        auto = [e for e in data["detected_entities"]
                if e["confidence"] >= 0.85]
        review = [e for e in data["detected_entities"]
                  if e["confidence"] < 0.85]
        proposal.append({"section": sec_id,
                         "auto_redact": auto,
                         "needs_review": review,
                         "masked": data["anonymized_text"]})
    return proposal

JavaScript — Minimize a PV Intake Feed

// Node.js: strip reporter/patient identity before case routing
async function minimizeCaseNarrative(narrative) {
  const res = await fetch(
    "https://piidetectionapi.com/api/moderate.php",
    {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({
        api_key: process.env.PII_API_KEY,
        api_type: "pii_detection",
        text: narrative,
        entities: ["PERSON_NAME", "EMAIL_ADDRESS",
                   "PHONE_NUMBER", "DATE_OF_BIRTH",
                   "ADDRESS", "CITY"],
        mask_mode: "hash",  // same reporter → same token
        threshold: 0.6
      })
    }
  );
  const data = await res.json();

  return {
    narrativeForPartners: data.anonymized_text,
    identifierCount: data.entities_detected,
    // entity types only — feeds the PV quality metrics dashboard
    typesFound: [...new Set(
      data.detected_entities.map(e => e.type))]
  };
}
Choosing a mask mode for trial data

"replace" yields reviewer-readable placeholders for proposal packages; "redact" removes spans outright for minimal-disclosure releases; "hash" keeps consistent tokens so one subject or reporter maps to one value across an entire submission — the property that keeps longitudinal narratives analyzable. Full reference in the API documentation; experiment with a sample narrative in the live demo.

A Submission Redaction Workflow That Scales

Step 1 — Segment and scan. Split the submission along its ICH E3 structure — body sections, Section 12 narratives, Section 16 appendices — and chunk each part under the 50,000-character request limit. Run detection with a deliberately low threshold (0.5) so recall is maximized; at this stage a false positive costs a reviewer seconds, while a false negative costs a re-submission.

Step 2 — Propose and review. Auto-accept high-confidence detections, route the remainder to reviewers with surrounding context, and record every accept/reject decision. Because the API returns exact offsets, accepted spans map losslessly onto the source document for highlighting in your redaction tool — and rejected spans build a study-specific exception list you encode into custom_instruction for the next batch.

Step 3 — Transform and document. Generate the final package with the mask strategy your anonymization plan prescribes, then compile the anonymization report from the span inventory: identifier categories found, counts per section, transformation applied to each, and residual quasi-identifier statistics feeding the re-identification risk calculation. What was once a narrative justification becomes a data-backed appendix. Teams typically validate the approach on one historical narrative set via a free API key before scaling to full submissions on a usage-based plan.

GxP, Validation, and Data Integrity Considerations

Anonymization tooling used in regulated processes falls under the sponsor's computerized-system governance. The API's deterministic contract makes that manageable: a fixed endpoint, versioned request parameters, and structured JSON responses that can be captured verbatim into your audit trail. Typical qualification follows a GAMP-style risk-based approach — document intended use, run an accuracy-and-consistency PQ on representative documents with known identifiers, and lock the parameter set (entities, threshold, mask_mode, custom_instruction) as controlled configuration.

Data integrity principles map cleanly onto detection telemetry. Every scan produces attributable, contemporaneous evidence: which document version was scanned, which entities were found at which offsets, which were accepted or overridden and by whom. Persist counts and decisions — never the raw matched text — and you satisfy ALCOA+ expectations without creating a new store of personal data. Human oversight remains part of the procedure: automated detection proposes, qualified reviewers dispose, and the SOP records both.

For organizations whose policies keep trial data inside a validated environment, the same engine deploys on-premise — a container in your qualified infrastructure with no external calls and an identical API contract, so scripts validated against the cloud endpoint carry over unchanged. Contact us to scope deployment and vendor-assessment documentation.

Pharma & Clinical Trials FAQ

Common questions from transparency, pharmacovigilance, and clinical data science teams

Does automated detection satisfy EMA Policy 0070 or Health Canada PRCI on its own?

No single tool does — both regimes require an anonymization methodology, human accountability, and a documented residual-risk assessment. What the API provides is the scalable discovery layer: a complete, span-level inventory of direct and quasi-identifiers that your reviewers verify and your anonymization report quantifies. Sponsors combine it with their risk-measurement methodology and QC procedure; the result is faster cycles with stronger documentation than manual-only review.

Can it distinguish patient identifiers from investigator and sponsor staff names?

All human names are detected as PERSON_NAME — appropriately, since transparency rules protect investigator personal data too. When your redaction matrix treats categories differently, use context to split them downstream (titles like "Dr." and section location are returned in the surrounding text via offsets) or add a custom_instruction such as "do not flag names appearing in the sponsor signature block". Validate the rule on your own documents in the demo.

How do you handle quasi-identifiers like ages, dates, and geography?

They are detected as their own entity types — AGE, DATE_OF_BIRTH, CITY, ZIP_CODE, EMPLOYMENT — so your pipeline can apply the transformation your anonymization plan prescribes: generalization, date-offsetting, or suppression. The per-type counts also feed re-identification risk models directly, which is how teams demonstrate compliance with Health Canada's quantitative threshold rather than merely asserting it.

Can we scan E2B XML or SDTM datasets directly?

The API accepts text, so extract free-text fields — the E2B narrative block, sender comments, SDTM/ADaM comment variables, verbatim terms — and scan those, writing results back by field. Structured coded fields (MedDRA codes, dates in ISO variables) are better handled by dataset-level rules; the API covers the unstructured remainder where rule-based tools are blind. Our ETL pipeline guide shows batch patterns that apply directly.

Is the service compatible with GxP validation and our vendor qualification process?

Yes — the deterministic request/response contract, GDPR-native audited infrastructure, and transient processing model support standard supplier assessments, and the on-premise option places the engine entirely inside your qualified environment when policy requires it. Most sponsors qualify the tool with a risk-based PQ on representative documents and control the parameter set as configuration. Contact us for assessment documentation.

What does it cost to process a full CSR package?

Pricing is usage-based on text volume. A typical CSR of a few thousand pages is on the order of tens of millions of characters — a few hundred to a few thousand API requests at 50,000 characters each, processed in parallel within hours. Compared with per-page manual redaction rates, teams generally report an order-of-magnitude cost reduction on the discovery pass. See pricing for volume tiers, and start with a free API key to benchmark on one narrative set.

Related Resources

Go deeper on the identifiers and regulations that matter most in clinical research

Anonymize Your Next Submission in Weeks, Not Months

Paste a sample safety narrative into the live demo and watch the API classify every patient and investigator identifier in under a second. Policy 0070 and PRCI ready, GDPR-ready, cloud or on-premise.