跳到正文

D002 数据结构与关联关系分析

分析医疗数据的字段、记录单位、主键质量与跨表关联,记录数据缺口及连接条件,为后续处理提供结构依据。

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

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

输入资料
Required: D001 source_manifest.json the exact local source file/directory that D001 inventoried Preferred invocation:D002 must verify that every profiled file resolves inside the declared input boundary.Supported determi… 阅读本节完整说明
交付内容
Always produce: schema_linkage_profile.json schema_linkage_report.md linkage_edges.csv Prefer:./runs/haonan-d002/<package-id>/The machine-readable contract is defined in assets/schema_linkage_profile.schema.json and expl… 阅读本节完整说明
  1. 获取完整包,保留配套文件的目录结构。
  2. 按照原文准备所需工具、依赖与输入资料。
  3. 阅读对应使用步骤与输入输出说明,在自己的环境中验证结果。

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

正文

获取原文件

references/schema-linkage-contract.md

SchemaLinkageProfile is D002's aggregate-only structural description of a medical-data package.

Sensitivity

The output is still restricted_local because table/column names and aggregate counts may reveal internal hospital system structure. It intentionally contains no sampled patient values.

Table object

Key fields:

  • table_ref: D002-local stable reference. Virtual tables may use file_ref#sheet, file_ref#sqlite_table, or file_ref#FHIRResourceType.
  • source_ref: original D001 file reference.
  • source_format: CSV/TSV/JSON/JSONL/XLSX/SQLite/FHIR JSON.
  • profile_status: complete | partial | skipped | error.
  • rows_profiled: number of rows whose values contributed to statistics.
  • row_count_observed: count observed by the profiler. When capped, it is the observed lower bound, not necessarily total rows.
  • row_count_complete: whether the observed count is a complete total.
  • columns: aggregate column profiles.
  • primary_key_candidates: single-column keys supported by observed uniqueness/null statistics.
  • composite_key_candidates: small plausible key combinations.
  • inferred_grain: structural grain hypothesis with confidence and rationale.
  • risks: table-local structural issues.

Column profile

A column profile may include:

  • name
  • normalized name
  • inferred type
  • non-null/null counts and rates
  • distinct count/rate where safe
  • identifier role
  • PHI-risk flag
  • time-field candidate flag
  • key suitability

No examples, top_values, min_string, max_string, or raw sample value fields are permitted.

Relationship object

A relationship is empirical unless constraint_source says a database FK was actually observed.

Coverage is based on tokenized distinct identifiers:

  • left_coverage = overlap / distinct_left
  • right_coverage = overlap / distinct_right

Cardinality is inferred from uniqueness on each side:

  • 1:1
  • 1:N
  • N:1
  • N:M_or_ambiguous

The result is a candidate relationship, not a clinical assertion.

Linkage graph

linkage_graph summarizes structural anchors:

  • patient anchors
  • encounter anchors
  • specimen/order anchors
  • disconnected tables

It must preserve ambiguity instead of forcing a single root.

CONTACT HAONAN

联系haonan

医疗 AI · 产品与独立开发

刘浩南

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

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

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