跳到正文

D014 临床数据质量检查

独立核查隐私、处理阶段、来源关系、人工复核、FHIR 结构及 OMOP 数据一致性,输出通过、复核或阻止的逐项证据。

个人 Skill知识加工20 个文件浏览次数 0
开始使用

下载前阅读 SKILL.md 中的使用条件,并确认所用工具支持对应能力。

输入资料
A finalized D013 manifest:Example:Optional:Multiple --extra-manifest arguments are allowed. 阅读本节完整说明
  1. 获取完整包,保留配套文件的目录结构。
  2. 按照原文准备所需工具、依赖与输入资料。
  3. 阅读对应使用步骤与输入输出说明,在自己的环境中验证结果。

使用提示摘自原文,配套文件保留来源版本;实际运行条件以各包说明为准。

正文

获取原文件

SKILL.md

v0.2.1 发布合同(优先于历史版本说明)

隐私检测对合法形状UUID内数字样式保留不可忽略的REVIEW,和已有长哈希疑似规则一致,不将其当确定泄漏,也不直接PASS。普通字段/正文完整手机号/邮箱仍BLOCKED。

详见 references/repair-v0.2.1.md。完整替换D001–D014并重新生成中间产物,不混用历史伪ID、清单或staging编号。测试通过不表示临床生产批准。

v0.2.0 修复合同(优先于旧版说明)

独立检查实际文件,不只信 summary。缺主键、无效日历、错 Type Concept、错映射边、计划/排除转阳性、Bundle 内容不一致、一对多丢行和时间倒置等为不可关闭阻断。流式隐私扫描记录所有缺失/超限/不支持项;未扫描不得 PASS。检查证据与路径使用摘要;输出附自身文件完整性。PASS 只针对当前范围和策略,不是完整临床/匿名化认证。

具体运行界限见 references/repair-v0.2.md;任何自测通过都不等于临床生产批准。

Mission

D014 is the final independent gate for D001-D013.

It does not modify clinical data.

It answers:

Can this package be released for its intended downstream use?

with exactly one decision:

PASS
REVIEW
BLOCKED

Quality model

D014 borrows the systematic data-quality organization used by OHDSI DataQualityDashboard:

  • Conformance
  • Completeness
  • Plausibility

and adds three D-series-specific categories:

  • Privacy
  • Lineage
  • Review Closure

Each check result records:

check_id
category
context
severity
status
numerator
denominator
rate
message
evidence_refs

No raw PHI value is copied into a D014 report.

Decision semantics

BLOCKED

Use for integrity or safety failures such as:

  • high-confidence PHI leakage;
  • missing required transform coverage;
  • duplicate primary keys;
  • broken person references;
  • FHIR minimum structural failure;
  • OMOP Standard Concept routed to the wrong domain table;
  • non-standard/nonexistent nonzero OMOP concept ID;
  • planned events staged as completed OMOP events;
  • refuted/negative conditions staged as positive OMOP occurrences;
  • unresolved blocking review state;
  • temporal inversion that survived upstream;
  • OMOP source-value overflow that would violate the staged target field contract.

REVIEW

Use when data can still be useful but needs human/local-policy approval, for example:

  • an accepted unresolved terminology mapping;
  • OMOP _CONCEPT_ID = 0;
  • missing OMOP type concept policy;
  • coarse-time facts withheld from OMOP;
  • heuristic medium-confidence privacy hit;
  • incomplete discovery of the full D001-D013 manifest graph;
  • other non-blocking high/medium warnings.

PASS

Requires:

  • zero blocking findings;
  • zero review findings under the active policy;
  • all required stages discovered;
  • all required checks completed.

Required input

A finalized D013 manifest:

overall_status = ready_for_quality_gate

Example:

python "$SKILL_DIR/scripts/run_quality_gate.py" \
  --d013-manifest /path/to/d013/fhir_omop_transform_manifest.json \
  --output-root ./runs/haonan-d014

Optional:

--policy /path/to/quality_policy.json
--extra-manifest /path/to/another/upstream_manifest.json

Multiple --extra-manifest arguments are allowed.

Manifest graph discovery

D014 follows only local JSON paths found in manifest fields whose keys contain:

manifest

It never follows arbitrary raw-data paths.

Automatic discovery is best-effort.

For a formal full-pipeline release, the default policy requires stages:

D001-D013

to be discoverable before PASS.

Missing stages cause REVIEW, not silent acceptance.

Privacy scan

D014 scans only declared downstream text artifacts from D003-D013.

It does not scan:

  • pre-D003 raw source packages;
  • private keys;
  • binary images;
  • archives;
  • executables.

High-confidence patterns include:

  • email addresses;
  • U.S. SSN pattern;
  • Chinese national ID pattern;
  • Chinese mobile number pattern.

Medium-confidence patterns include labeled patient-name/address remnants.

Reports contain only:

  • rule ID;
  • artifact path;
  • line number;
  • hash of the matched token.

The raw matched value is never written to D014 output.

This is a leak detector, not a proof of anonymization.

FHIR checks

D014 independently verifies D013 output for:

  • unique resource IDs;
  • local Patient reference integrity;
  • Bundle type collection;
  • Bundle/resource coverage;
  • minimum required fields for supported R4 resources.

It does not claim full official FHIR profile validation.

OMOP checks

D014 verifies:

  • table is supported;
  • deterministic PK exists and is unique;
  • person_id resolves through person_key_map;
  • event date exists where required;
  • nonzero Standard Concept exists in the local vocabulary index;
  • nonzero Standard Concept is standard_concept = S;
  • Standard Concept domain matches the staged table;
  • one-to-many expansion survives;
  • no planned event appears as a completed clinical occurrence;
  • no refuted/negative condition appears as positive CONDITION_OCCURRENCE;
  • source values do not exceed the staging target contract;
  • unmapped concept_id 0 and type concept 0 rates are characterized.

D014 does not connect to an OMOP database.

Terminology checks

D014 verifies D012 release state and characterizes:

  • verified mappings;
  • accepted unresolved mappings;
  • blocking unresolved mappings;
  • one-to-many mappings;
  • mapping-ledger coverage.

Any ordinary unresolved mapping is blocking.

Accepted unresolved mappings default to REVIEW.

Temporal checks

D014 verifies D011 release state and checks that:

temporal_inversion_relation_count = 0
unreviewed_time_fact_count = 0

when these counters are available.

Coarse time is not itself an error.

Loss of OMOP coverage caused by coarse time is characterized for review.

Review closure

Any discovered upstream manifest with a status such as:

blocked
needs_*
review_required

is blocking unless the later-stage contract explicitly demonstrates closure.

For D012/D013 the finalized ready states are required.

Policy

Default policy:

assets/default_quality_policy.json

Important defaults:

  • any high-confidence PHI hit -> BLOCKED;
  • any FHIR/OMOP structural integrity failure -> BLOCKED;
  • any accepted unresolved terminology -> REVIEW;
  • any OMOP concept_id 0 -> REVIEW;
  • any missing OMOP type concept -> REVIEW;
  • full D001-D013 discovery required for PASS.

Rate thresholds can be customized locally.

Outputs

quality_check_results.jsonl
quality_metrics.json
quality_gate_report.json
quality_gate_report.md
release_manifest.json
privacy_findings.jsonl
quality_gate_policy.json

Validation

python "$SKILL_DIR/scripts/validate_quality_gate.py" \
  --report /path/to/d014/quality_gate_report.json

Safety

D014:

  • is local-only;
  • does not install packages;
  • does not call network services;
  • does not execute source code;
  • does not repair data;
  • does not suppress failed checks;
  • does not include raw PHI matches in reports;
  • does not write FHIR/OMOP production systems.

Final handoff

D014 is the end of the v0.1 D-series pipeline.

A package is release-ready under the active policy only when:

decision = PASS

CONTACT HAONAN

联系haonan

医疗 AI · 产品与独立开发

刘浩南

关注医疗 AI 从 demo 到真实落地,聚焦产品化、商业化与院内工作流效率提升。

12年医疗产研经验,大湾区头部医疗AI公司前产品总监,独立开发者

医疗 AI 产品化医疗 AI 商业化院内工作流效率
刘浩南的微信联系二维码
微信扫一扫,联系 haonan