dsh-medrec-qc 0.2.4 → 0.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,68 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.2.11] - 2026-10-18
4
+
5
+ ### Changed
6
+
7
+ - Move `tsdown` and `typescript` from runtime dependencies to devDependencies; a published checker no longer pulls a build chain into the profile. Same rollout as the 0.2.11 pilot.
8
+
9
+ ## [0.2.10] - 2026-10-18
10
+
11
+ ### Changed
12
+
13
+ - Move the Install section to the first screen in all five READMEs.
14
+
15
+ ## [0.2.9] - 2026-10-18
16
+
17
+ ### Changed
18
+
19
+ - Add a 1280×720 hero and a 960×540, 4-second terminal GIF rendered from the checker’s own output; `screenshots.json` is an object array and `capture.json` records the storyboard.
20
+
21
+ ## [0.2.8] - 2026-10-18
22
+
23
+ ### Fixed
24
+
25
+ - **`check:citations` checks every `excerpt`, including `alsoBasis`.** The gate read only the first excerpt per rule; this pack had additional `alsoBasis` quotations that were never checked. It now reports the complete segment count.
26
+
27
+ ## 0.2.7 - 2026-10-18
28
+
29
+ - Fix: a rule that executed and found no difference is no longer placed in `skipped`. The report view labels only genuinely unexecuted rules as “未执行的检查”; `skippedCount` no longer counts executed-clean rules.
30
+
31
+
32
+ ## 0.2.6 - 2026-10-17
33
+
34
+ - Compatibility: declare `engines.dsh` `>=0.2.1-0 <0.3.0`; move `@deepseek-ai/dsh-*` devDependencies to `0.2.1-rc.2`; add `@deepseek-ai/dsh-working-directory`.
35
+ - Docs: the compatibility table no longer claims `engines.dsh` is undeclared; drop the retired `both` tool mode.
36
+
37
+
38
+ ## 0.2.5
39
+
40
+ - **`MR-001` is an `error` again, corrected on evidence.** Its only basis is the note at the foot of
41
+ **附件1「住院病案首页必填项目列表」** of 国卫办医发〔2016〕24号. On 2026-10-07 that rule was
42
+ **downgraded to `warn`** because the attachment was recorded as a PDF this environment could not
43
+ decode — and under this family's rule a clause that cannot be read does not block a workflow, so the
44
+ downgrade was right at the time.
45
+
46
+ **The attachment does have a text layer.** It was read on 2026-10-13: 328 pages, 205,847 extractable
47
+ characters, **no OCR**. The note is verbatim
48
+ 「注:必填栏不能为空项,没有可填写内容时填写“-”」 — the same wording the rule already carried. The only
49
+ difference is that the PDF prints curly quotes where the rule uses straight ones, a typographic
50
+ difference recorded in the evidence file rather than papered over.
51
+
52
+ ⚠️ **The source tier is stated plainly in the evidence.** `www.nhc.gov.cn` returns **HTTP 412** to
53
+ automated requests (measured, and the site root is 412 too), so the text came from a
54
+ **河南省病案质量控制中心** compilation — the very URL this rule's `source` has always carried, and the
55
+ same tier as the 高校/省级 reprints the other fourteen rules rely on. It is therefore not a reason to
56
+ treat `MR-001` differently, but it is not the publisher's own text either, and the reader is told so.
57
+
58
+ New evidence file: `rules/evidence/clause-verification-homepage-attachment1.md` (source, attempt log
59
+ with status codes, the verbatim text, and the quote-character difference).
60
+ The `MR-001` rows and the "why it was `warn`" section were updated in all five READMEs together, which
61
+ `check:readmes` requires.
62
+
63
+ No rule was added or removed: still 15 rules across `MR-001`..`MR-015`. The only severity that moved
64
+ is `MR-001`, `warn` → `error`.
65
+
3
66
  ## 0.2.4
4
67
 
5
68
  - Add a demo card to the README: one terminal shot of this plugin's real output
@@ -57,3 +120,5 @@
57
120
  - Five-language READMEs hold the same section count and the same configuration keys.
58
121
  - Rule pack: 15 rules across MR-001..MR-015.
59
122
  - Licensed Apache-2.0.
123
+
124
+
package/README-es.md CHANGED
@@ -1,12 +1,28 @@
1
1
  # dsh-medrec-qc — Comprobación de forma y avisos de contradicción lógica de la portada del historial clínico de hospitalización
2
2
 
3
+ [English](README.md) · [简体中文](README-zh.md) · [Español](README-es.md) · [Português](README-pt.md) · [हिन्दी](README-hi.md)
4
+
5
+ ```sh
6
+ dsh plugin --profile <name> add dsh-medrec-qc
7
+ ```
8
+
9
+
3
10
  [![DSH Market](https://raw.githubusercontent.com/2BingLing/dsh-market/master/assets/readme/badge-listed-en.svg)](https://dsh.market/)
4
11
 
5
12
  `dsh-medrec-qc` lee una exportación de la portada del historial clínico de hospitalización (病案首页), una fila por alta, con el juego de columnas de la exportación de evaluación nacional, de la estadística sanitaria o de una exportación local del hospital, y comprueba la completitud formal, la aritmética interna y la forma de codificación de esa misma exportación: que cada columna obligatoria tenga contenido o el marcador `-`, que las horas de ingreso y de alta estén presentes, sean precisas al minuto y no estén invertidas, que la estancia declarada coincida con las dos fechas, que el nombre y el código del diagnóstico principal y los de la operación principal se rellenen juntos, que los códigos tengan la forma escrita que configura el paquete de reglas, que las tres columnas de firma reflejen la responsabilidad médica de tres niveles, que el modo de alta sea uno de los códigos definidos, que la edad y los pesos neonatales usen las formas prescritas, que el número de otros diagnósticos no supere el techo configurado, y que se señalen para revisión humana un diagnóstico incompatible con el sexo registrado o dos horas discordantes en un alta por fallecimiento.
6
13
 
14
+ ## Install
15
+
16
+ ```sh
17
+ dsh plugin --profile <name> add dsh-medrec-qc
18
+ dsh --profile <name> --dump-config | grep 'dsh-medrec-qc'
19
+ ```
20
+
7
21
  ## Cómo se ve la salida
8
22
 
9
- ![Terminal demo of dsh-medrec-qc: real output over its MR-009 fixture](https://raw.githubusercontent.com/PerryLink/dsh-medrec-qc/main/docs/assets/dsh-medrec-qc-demo.png)
23
+ ![Terminal demo of dsh-medrec-qc: real output over its MR-009 fixture](https://raw.githubusercontent.com/PerryLink/dsh-medrec-qc/main/docs/assets/dsh-medrec-qc-hero.png)
24
+
25
+ ![Animated terminal demo of dsh-medrec-qc](https://raw.githubusercontent.com/PerryLink/dsh-medrec-qc/main/docs/assets/dsh-medrec-qc-demo.gif)
10
26
 
11
27
  Salida real de este plugin sobre su propio fixture de prueba `MR-009` — no es un montaje. El paquete de reglas no inventa citas, así que cada hallazgo nombra la cláusula aplicada y advierte que su texto no se obtuvo.
12
28
 
@@ -14,7 +30,7 @@ Salida real de este plugin sobre su propio fixture de prueba `MR-009` — no es
14
30
 
15
31
  | Usted pregunta | Qué responde |
16
32
  |---|---|
17
- | Una columna obligatoria está vacía, pero escribí `-` en ella. ¿Se informa de eso? | No. `MR-001` considera un `-` aislado la marca de «no hay nada que registrar» e informa solo de las columnas realmente vacías. Comprueba que la columna obligatoria tenga contenido, no que el contenido sea correcto, y su gravedad queda limitada a `warn` porque el anexo que cita es un PDF que este entorno no puede descodificar. Ese mismo `-` sigue contando como firma ausente en `MR-009`. |
33
+ | Una columna obligatoria está vacía, pero escribí `-` en ella. ¿Se informa de eso? | No. `MR-001` considera un `-` aislado la marca de «no hay nada que registrar» e informa solo de las columnas realmente vacías. Comprueba que la columna obligatoria tenga contenido, no que el contenido sea correcto. Es un `error`: la nota al pie del anexo 1 del documento 24号文 se leyó literalmente el **2026-10-13** (el anexo **tiene capa de texto**: 328 páginas, 205 847 caracteres extraíbles, **sin OCR**), y dice 「注:必填栏不能为空项,没有可填写内容时填写“-”」. ⚠️ `www.nhc.gov.cn` devuelve **HTTP 412** a las peticiones automáticas, así que el texto se leyó de una **recopilación del Centro de Control de Calidad de Historias Clínicas de Henan** — la misma URL que el `source` de esta regla siempre ha llevado; véase `rules/evidence/clause-verification-homepage-attachment1.md`. Ese mismo `-` sigue contando como firma ausente en `MR-009`. |
18
34
  | La hora de ingreso figura como una fecha sin hora ni minuto, y en una fila la hora de alta es anterior a la de ingreso. | `MR-002` informa de un `入院时间` o `出院时间` que solo se puede leer hasta el día, porque el tiempo registrado debe ser preciso al minuto, y también informa de un valor que no puede analizar como fecha y hora. `MR-003` compara el orden literal de los dos campos e informa de la fila en la que la hora de alta va primero. Ambas trabajan sobre los valores literales y ninguna decide cuál de las dos horas es la verdadera. |
19
35
  | La portada dice `5` días, pero las fechas son ingreso el 12 de junio y alta el 15 de junio. | `MR-004` recalcula los días como fecha de alta menos fecha de ingreso e informa de la fila cuando el `实际住院天数` declarado no coincide; el ingreso y el alta el mismo día cuentan como `0` días, y un valor que no sea un número entero de días también se informa. Solo compara esos tres valores guardados y no decide cuál de ellos está mal. |
20
36
  | `主要诊断名称` está relleno y `主要诊断编码` vacío, y otra fila trae un código de forma extraña. | `MR-005` exige que ambos se rellenen juntos y nombra el que falta; comprueba únicamente que los dos existan, no que el código corresponda al diagnóstico. `MR-006` contrasta después el código con la forma escrita configurada en el paquete y no verifica que ese código exista en ninguna versión del directorio de clasificación. |
@@ -41,22 +57,15 @@ front sheet and reports literal mismatches against cited clauses.
41
57
 
42
58
  | Superficie | Estado |
43
59
  |---|---|
44
- | Harness | Rango de peers `>=0.1.2-rc.1 <0.2.0 \|\| >=0.2.0-0 <0.3.0` — verificado para aceptar tanto `0.2.0-rc.2` como `0.2.1-alpha.1`. **No se declara `engines.dsh`**: no tiene lector y no puede rechazar ningún host |
60
+ | Harness | Rango de peers `>=0.1.2-rc.1 <0.2.0 \|\| >=0.2.0-0 <0.3.0` — verificado para aceptar tanto `0.2.0-rc.2` como `0.2.1-rc.2`. **`engines.dsh` se declara como `>=0.2.1-0 <0.3.0`** y el host lo aplica desde 0.2.1 |
45
61
  | Node | `^22.19.0 || >=24.0.0` |
46
62
  | Plataformas | Todas (ESM puro; sin código nativo, sin red, sin llamada al modelo) |
47
- | Modo de herramienta | Funciona en `native`, `ptc` y `both`; para un directorio completo use `ptc` |
63
+ | Modo de herramienta | Funciona en `native` y `ptc`; para un directorio completo use `ptc` |
48
64
 
49
65
  ## What it does
50
66
 
51
67
  La tabla de reglas, los campos y el comportamiento detallado están en [README.md](README.md#what-it-does) (versión principal en inglés). El plugin sólo enumera divergencias literales frente a las cláusulas citadas e indica en `skipped` cada comprobación que no pudo ejecutarse.
52
68
 
53
- ## Install
54
-
55
- ```sh
56
- dsh plugin --profile <name> add dsh-medrec-qc
57
- dsh --profile <name> --dump-config | grep 'dsh-medrec-qc'
58
- ```
59
-
60
69
  ## Configuration
61
70
 
62
71
  Todos los parámetros ajustables viven en el esquema Schemastery de `src/config.ts`, por lo que se cambian desde `cordis.yml` sin tocar el código; los umbrales por regla están en el paquete de reglas bajo `rules/`.
package/README-hi.md CHANGED
@@ -1,12 +1,28 @@
1
1
  # dsh-medrec-qc — भर्ती रोगी के मेडिकल रिकॉर्ड की फ्रंट शीट की रूप-जाँच और तार्किक विरोधाभास की चेतावनी
2
2
 
3
+ [English](README.md) · [简体中文](README-zh.md) · [Español](README-es.md) · [Português](README-pt.md) · [हिन्दी](README-hi.md)
4
+
5
+ ```sh
6
+ dsh plugin --profile <name> add dsh-medrec-qc
7
+ ```
8
+
9
+
3
10
  [![DSH Market](https://raw.githubusercontent.com/2BingLing/dsh-market/master/assets/readme/badge-listed-en.svg)](https://dsh.market/)
4
11
 
5
12
  `dsh-medrec-qc` भर्ती रोगी के मेडिकल रिकॉर्ड की फ्रंट शीट (病案首页) के एक्सपोर्ट को पढ़ता है, जिसमें प्रत्येक डिस्चार्ज की एक पंक्ति होती है और कॉलम-सेट राष्ट्रीय मूल्यांकन एक्सपोर्ट, स्वास्थ्य सांख्यिकी एक्सपोर्ट या अस्पताल के स्थानीय एक्सपोर्ट का हो सकता है, और उसी एक्सपोर्ट की रूप-पूर्णता, आंतरिक अंकगणित तथा कोडन-रूप की जाँच करता है: हर अनिवार्य कॉलम में सामग्री या `-` चिह्न हो, भर्ती और डिस्चार्ज का समय दर्ज हो, मिनट तक सटीक हो और उलटा न हो, दर्ज ठहराव-अवधि दोनों तारीख़ों से मेल खाए, मुख्य निदान का नाम और कोड तथा मुख्य ऑपरेशन का नाम और कोड साथ-साथ भरे गए हों, कोड उस लिखित रूप में हों जो नियम-पैक कॉन्फ़िगर करता है, तीन हस्ताक्षर कॉलम त्रि-स्तरीय चिकित्सक उत्तरदायित्व दर्शाते हों, डिस्चार्ज मोड निर्धारित कोड में से हो, आयु और नवजात का वज़न निर्धारित रूपों में हों, अन्य निदानों की संख्या कॉन्फ़िगर की गई सीमा के भीतर हो, और दर्ज लिंग से असंगत निदान अथवा मृत्यु-डिस्चार्ज में परस्पर भिन्न दो समय मानवीय समीक्षा के लिए सामने लाए जाएँ।
6
13
 
14
+ ## Install
15
+
16
+ ```sh
17
+ dsh plugin --profile <name> add dsh-medrec-qc
18
+ dsh --profile <name> --dump-config | grep 'dsh-medrec-qc'
19
+ ```
20
+
7
21
  ## आउटपुट कैसा दिखता है
8
22
 
9
- ![Terminal demo of dsh-medrec-qc: real output over its MR-009 fixture](https://raw.githubusercontent.com/PerryLink/dsh-medrec-qc/main/docs/assets/dsh-medrec-qc-demo.png)
23
+ ![Terminal demo of dsh-medrec-qc: real output over its MR-009 fixture](https://raw.githubusercontent.com/PerryLink/dsh-medrec-qc/main/docs/assets/dsh-medrec-qc-hero.png)
24
+
25
+ ![Animated terminal demo of dsh-medrec-qc](https://raw.githubusercontent.com/PerryLink/dsh-medrec-qc/main/docs/assets/dsh-medrec-qc-demo.gif)
10
26
 
11
27
  इस प्लगइन का अपने ही `MR-009` टेस्ट फ़िक्स्चर पर वास्तविक आउटपुट — कोई नकली चित्र नहीं। नियम-पैक उद्धरण नहीं गढ़ता, इसलिए हर निष्कर्ष लागू किए गए खंड का नाम और यह भी बताता है कि उसका मूल पाठ इस बार प्राप्त नहीं हुआ।
12
28
 
@@ -14,7 +30,7 @@
14
30
 
15
31
  | आपका सवाल | इसका जवाब |
16
32
  |---|---|
17
- | कोई अनिवार्य कॉलम खाली छूटा है, पर मैंने उसमें `-` लिखा है। क्या यह दर्ज होगा? | नहीं। `MR-001` अकेले `-` को «यहाँ दर्ज करने योग्य कुछ नहीं» का चिह्न मानता है और केवल सचमुच खाली छूटे कॉलम दर्ज करता है। यह देखता है कि अनिवार्य कॉलम में सामग्री है, यह नहीं कि सामग्री सही है, और इसकी गंभीरता `warn` तक सीमित है क्योंकि यह जिस अनुलग्नक का हवाला देता है वह ऐसा PDF है जिसे यह वातावरण डिकोड नहीं कर सकता। वही `-` `MR-009` में हस्ताक्षर अनुपस्थित ही गिना जाता है। |
33
+ | कोई अनिवार्य कॉलम खाली छूटा है, पर मैंने उसमें `-` लिखा है। क्या यह दर्ज होगा? | नहीं। `MR-001` अकेले `-` को «यहाँ दर्ज करने योग्य कुछ नहीं» का चिह्न मानता है और केवल सचमुच खाली छूटे कॉलम दर्ज करता है। यह देखता है कि अनिवार्य कॉलम में सामग्री है, यह नहीं कि सामग्री सही है। यह `error` है: 24号文 के अनुलग्नक 1 की अंतिम टिप्पणी **2026-10-13** को शब्दशः प्राप्त हुई (अनुलग्नक में **पाठ-परत है**: 328 पृष्ठ, 205,847 वर्ण निकाले जा सकते हैं, **OCR का प्रयोग नहीं**), और वह है 「注:必填栏不能为空项,没有可填写内容时填写“-”」。⚠️ `www.nhc.gov.cn` स्वचालित अनुरोधों पर **HTTP 412** लौटाता है, इसलिए पाठ **हेनान प्रांतीय मेडिकल रिकॉर्ड गुणवत्ता नियंत्रण केंद्र** के संकलन से पढ़ा गया — वही URL जो इस नियम के `source` में पहले से है; देखें `rules/evidence/clause-verification-homepage-attachment1.md`। वही `-` `MR-009` में हस्ताक्षर अनुपस्थित ही गिना जाता है। |
18
34
  | भर्ती का समय केवल तारीख़ के रूप में लिखा है, घंटा-मिनट नहीं, और एक पंक्ति में डिस्चार्ज का समय भर्ती से पहले है। | `MR-002` ऐसे `入院时间` या `出院时间` को दर्ज करता है जो केवल दिन तक पढ़ा जा सके, क्योंकि दर्ज समय मिनट तक सटीक होना चाहिए, और ऐसा मान भी दर्ज करता है जिसे तारीख़ और समय के रूप में पढ़ा ही न जा सके। `MR-003` दोनों फ़ील्ड के शाब्दिक क्रम की तुलना करके उस पंक्ति को दर्ज करता है जिसमें डिस्चार्ज का समय पहले आता है। दोनों केवल शाब्दिक मानों पर काम करते हैं और कोई यह नहीं तय करता कि सच्चा समय कौन-सा है। |
19
35
  | फ्रंट शीट में `5` दिन लिखा है, पर तारीख़ें 12 जून को भर्ती और 15 जून को डिस्चार्ज हैं। | `MR-004` दिनों को «डिस्चार्ज की तारीख़ घटा भर्ती की तारीख़» से दोबारा जोड़ता है और जिस पंक्ति में दर्ज `实际住院天数` मेल न खाए उसे दर्ज करता है; उसी दिन भर्ती और डिस्चार्ज `0` दिन गिना जाता है, और पूर्णांक दिन न होने वाला मान भी दर्ज होता है। यह केवल उन तीन दर्ज मानों की तुलना करता है और यह नहीं तय करता कि उनमें कौन ग़लत है। |
20
36
  | `主要诊断名称` भरा है पर `主要诊断编码` खाली है, और किसी अन्य पंक्ति में कोड का रूप विचित्र है। | `MR-005` दोनों को साथ भरे जाने की अपेक्षा करता है और बताता है कि कौन-सा छूटा है; यह केवल यह देखता है कि दोनों मौजूद हैं, यह नहीं कि कोड निदान से मेल खाता है। इसके बाद `MR-006` कोड को नियम-पैक में कॉन्फ़िगर किए गए लिखित रूप से मिलाता है और यह नहीं जाँचता कि वह कोड वर्गीकरण निर्देशिका के किसी संस्करण में मौजूद है या नहीं। |
@@ -41,22 +57,15 @@ front sheet and reports literal mismatches against cited clauses.
41
57
 
42
58
  | सतह | स्थिति |
43
59
  |---|---|
44
- | Harness | peer रेंज `>=0.1.2-rc.1 <0.2.0 \|\| >=0.2.0-0 <0.3.0` — `0.2.0-rc.2` और `0.2.1-alpha.1` दोनों को स्वीकार करने के लिए सत्यापित। **`engines.dsh` जानबूझकर घोषित नहीं**: इसका कोई पाठक नहीं और यह किसी होस्ट को अस्वीकार नहीं कर सकता |
60
+ | Harness | peer रेंज `>=0.1.2-rc.1 <0.2.0 \|\| >=0.2.0-0 <0.3.0` — `0.2.0-rc.2` और `0.2.1-rc.2` दोनों को स्वीकार करने के लिए सत्यापित। **`engines.dsh` `>=0.2.1-0 <0.3.0` के रूप में घोषित है** और 0.2.1 से होस्ट इसे लागू करता है |
45
61
  | Node | `^22.19.0 || >=24.0.0` |
46
62
  | प्लेटफ़ॉर्म | सभी (शुद्ध ESM; कोई नेटिव कोड नहीं, कोई नेटवर्क नहीं, कोई मॉडल कॉल नहीं) |
47
- | टूल मोड | `native`, `ptc` और `both` में काम करता है; पूरे फ़ोल्डर के लिए `ptc` चुनें |
63
+ | टूल मोड | `native` और `ptc` में काम करता है; पूरे फ़ोल्डर के लिए `ptc` चुनें |
48
64
 
49
65
  ## What it does
50
66
 
51
67
  नियम-सूची, फ़ील्ड और विस्तृत व्यवहार [README.md](README.md#what-it-does) (अंग्रेज़ी मुख्य संस्करण) में हैं। यह प्लगइन केवल उद्धृत धाराओं के सामने शाब्दिक अंतर सूचीबद्ध करता है और हर न चल पाई जाँच को `skipped` में बताता है।
52
68
 
53
- ## Install
54
-
55
- ```sh
56
- dsh plugin --profile <name> add dsh-medrec-qc
57
- dsh --profile <name> --dump-config | grep 'dsh-medrec-qc'
58
- ```
59
-
60
69
  ## Configuration
61
70
 
62
71
  सभी समायोज्य पैरामीटर `src/config.ts` की Schemastery स्कीमा में हैं, इसलिए कोड बदले बिना `cordis.yml` से बदले जा सकते हैं; प्रति-नियम सीमाएँ `rules/` के नियम-पैक में हैं।
package/README-pt.md CHANGED
@@ -1,12 +1,28 @@
1
1
  # dsh-medrec-qc — Verificação de forma e avisos de contradição lógica da folha de rosto do registo clínico de internamento
2
2
 
3
+ [English](README.md) · [简体中文](README-zh.md) · [Español](README-es.md) · [Português](README-pt.md) · [हिन्दी](README-hi.md)
4
+
5
+ ```sh
6
+ dsh plugin --profile <name> add dsh-medrec-qc
7
+ ```
8
+
9
+
3
10
  [![DSH Market](https://raw.githubusercontent.com/2BingLing/dsh-market/master/assets/readme/badge-listed-en.svg)](https://dsh.market/)
4
11
 
5
12
  `dsh-medrec-qc` lê uma exportação da folha de rosto do registo clínico de internamento (病案首页), uma linha por alta, com o conjunto de colunas da exportação de avaliação nacional, da estatística sanitária ou de uma exportação local do hospital, e verifica a completude formal, a aritmética interna e a forma de codificação dessa mesma exportação: que cada coluna obrigatória tenha conteúdo ou o marcador `-`, que as horas de admissão e de alta estejam preenchidas, sejam precisas ao minuto e não estejam invertidas, que o tempo de internamento declarado coincida com as duas datas, que o nome e o código do diagnóstico principal e os da operação principal sejam preenchidos em conjunto, que os códigos tenham a forma escrita que o pacote de regras configura, que as três colunas de assinatura reflitam a responsabilidade médica de três níveis, que o modo de alta seja um dos códigos definidos, que a idade e os pesos neonatais usem as formas prescritas, que o número de outros diagnósticos não exceda o limite configurado, e que sejam assinalados para revisão humana um diagnóstico incompatível com o sexo registado ou duas horas discordantes numa alta por óbito.
6
13
 
14
+ ## Install
15
+
16
+ ```sh
17
+ dsh plugin --profile <name> add dsh-medrec-qc
18
+ dsh --profile <name> --dump-config | grep 'dsh-medrec-qc'
19
+ ```
20
+
7
21
  ## Como é a saída
8
22
 
9
- ![Terminal demo of dsh-medrec-qc: real output over its MR-009 fixture](https://raw.githubusercontent.com/PerryLink/dsh-medrec-qc/main/docs/assets/dsh-medrec-qc-demo.png)
23
+ ![Terminal demo of dsh-medrec-qc: real output over its MR-009 fixture](https://raw.githubusercontent.com/PerryLink/dsh-medrec-qc/main/docs/assets/dsh-medrec-qc-hero.png)
24
+
25
+ ![Animated terminal demo of dsh-medrec-qc](https://raw.githubusercontent.com/PerryLink/dsh-medrec-qc/main/docs/assets/dsh-medrec-qc-demo.gif)
10
26
 
11
27
  Saída real deste plugin sobre o seu próprio fixture de teste `MR-009` — não é uma simulação. O pacote de regras não inventa citações, por isso cada achado nomeia a cláusula aplicada e avisa que o seu texto não foi obtido.
12
28
 
@@ -14,7 +30,7 @@ Saída real deste plugin sobre o seu próprio fixture de teste `MR-009` — não
14
30
 
15
31
  | Você pergunta | O que ele responde |
16
32
  |---|---|
17
- | Uma coluna obrigatória ficou vazia, mas escrevi `-` nela. Isso é reportado? | Não. `MR-001` considera um `-` isolado a marca de «não há nada a registar» e reporta apenas as colunas realmente vazias. Verifica que a coluna obrigatória tem conteúdo, não que o conteúdo está correto, e a sua gravidade fica limitada a `warn` porque o anexo que cita é um PDF que este ambiente não consegue descodificar. Esse mesmo `-` continua a contar como assinatura em falta em `MR-009`. |
33
+ | Uma coluna obrigatória ficou vazia, mas escrevi `-` nela. Isso é reportado? | Não. `MR-001` considera um `-` isolado a marca de «não há nada a registar» e reporta apenas as colunas realmente vazias. Verifica que a coluna obrigatória tem conteúdo, não que o conteúdo está correto. É um `error`: a nota de rodapé do anexo 1 do documento 24号文 foi lida literalmente em **2026-10-13** (o anexo **tem camada de texto**: 328 páginas, 205 847 caracteres extraíveis, **sem OCR**), e diz 「注:必填栏不能为空项,没有可填写内容时填写“-”」. ⚠️ `www.nhc.gov.cn` devolve **HTTP 412** a pedidos automáticos, pelo que o texto foi lido de uma **compilação do Centro de Controlo de Qualidade de Processos Clínicos de Henan** — o próprio URL que o `source` desta regra sempre indicou; ver `rules/evidence/clause-verification-homepage-attachment1.md`. Esse mesmo `-` continua a contar como assinatura em falta em `MR-009`. |
18
34
  | A hora de admissão está escrita só com a data, sem hora nem minuto, e numa linha a hora de alta é anterior à da admissão. | `MR-002` reporta um `入院时间` ou `出院时间` que só pode ser lido até ao dia, porque o tempo registado deve ser preciso ao minuto, e reporta também um valor que não consegue analisar como data e hora. `MR-003` compara a ordem literal dos dois campos e reporta a linha em que a hora de alta vem primeiro. Ambas trabalham sobre os valores literais e nenhuma decide qual das duas horas é a verdadeira. |
19
35
  | A folha de rosto diz `5` dias, mas as datas são admissão a 12 de junho e alta a 15 de junho. | `MR-004` recalcula os dias como data de alta menos data de admissão e reporta a linha quando o `实际住院天数` declarado não coincide; admissão e alta no mesmo dia contam `0` dias, e um valor que não seja um número inteiro de dias também é reportado. Compara apenas esses três valores guardados e não decide qual deles está errado. |
20
36
  | `主要诊断名称` está preenchido mas `主要诊断编码` está vazio, e noutra linha o código tem uma forma estranha. | `MR-005` exige que ambos sejam preenchidos em conjunto e indica qual falta; verifica apenas que os dois existam, não que o código corresponda ao diagnóstico. `MR-006` testa depois o código contra a forma escrita configurada no pacote e não verifica se esse código existe em qualquer versão do diretório de classificação. |
@@ -41,22 +57,15 @@ front sheet and reports literal mismatches against cited clauses.
41
57
 
42
58
  | Superfície | Estado |
43
59
  |---|---|
44
- | Harness | Faixa de peers `>=0.1.2-rc.1 <0.2.0 \|\| >=0.2.0-0 <0.3.0` — verificada para aceitar tanto `0.2.0-rc.2` quanto `0.2.1-alpha.1`. **`engines.dsh` não é declarado**: não tem leitor e não pode recusar nenhum host |
60
+ | Harness | Faixa de peers `>=0.1.2-rc.1 <0.2.0 \|\| >=0.2.0-0 <0.3.0` — verificada para aceitar tanto `0.2.0-rc.2` quanto `0.2.1-rc.2`. **`engines.dsh` é declarado como `>=0.2.1-0 <0.3.0`** e o host o aplica desde 0.2.1 |
45
61
  | Node | `^22.19.0 || >=24.0.0` |
46
62
  | Plataformas | Todas (ESM puro; sem código nativo, sem rede, sem chamada ao modelo) |
47
- | Modo de ferramenta | Funciona em `native`, `ptc` e `both`; para um diretório inteiro use `ptc` |
63
+ | Modo de ferramenta | Funciona em `native` e `ptc`; para um diretório inteiro use `ptc` |
48
64
 
49
65
  ## What it does
50
66
 
51
67
  A tabela de regras, os campos e o comportamento detalhado estão em [README.md](README.md#what-it-does) (versão principal em inglês). O plugin apenas lista divergências literais frente às cláusulas citadas e indica em `skipped` cada verificação que não pôde ser executada.
52
68
 
53
- ## Install
54
-
55
- ```sh
56
- dsh plugin --profile <name> add dsh-medrec-qc
57
- dsh --profile <name> --dump-config | grep 'dsh-medrec-qc'
58
- ```
59
-
60
69
  ## Configuration
61
70
 
62
71
  Todos os parâmetros ajustáveis ficam no esquema Schemastery de `src/config.ts`, portanto mudam pelo `cordis.yml` sem editar código; os limites por regra ficam no pacote de regras sob `rules/`.
package/README-zh.md CHANGED
@@ -1,12 +1,23 @@
1
1
  # dsh-medrec-qc — 病案首页形式质控与逻辑矛盾提示
2
2
 
3
+ [English](README.md) · [简体中文](README-zh.md) · [Español](README-es.md) · [Português](README-pt.md) · [हिन्दी](README-hi.md)
4
+
3
5
  [![DSH Market](https://raw.githubusercontent.com/2BingLing/dsh-market/master/assets/readme/badge-listed-en.svg)](https://dsh.market/)
4
6
 
5
7
  `dsh-medrec-qc` 读取一份住院病案首页导出表,每行一例出院病例,列名可以是国家绩效考核导出、卫生统计导出或医院本地导出的写法,核对这份材料自身的形式齐备、内部算术与编码形式:必填栏目是否有内容或按规范填写 `-`、入院时间与出院时间是否填写且精确到分钟且前后不倒置、填写的实际住院天数是否与两个日期一致、主要诊断的名称与编码以及主要手术的名称与编码是否同时填写、编码是否符合规则库配置的书写形式、三级医师签名栏是否齐全、离院方式是否为规定代码、年龄与新生儿体重是否使用规定形式、其他诊断条数是否在配置上限内,以及诊断与性别不相容、死亡病例两条时间不一致等需人工核实的情形是否被列出。
6
8
 
9
+ ## Install
10
+
11
+ ```sh
12
+ dsh plugin --profile <name> add dsh-medrec-qc
13
+ dsh --profile <name> --dump-config | grep 'dsh-medrec-qc'
14
+ ```
15
+
7
16
  ## 实际输出长什么样
8
17
 
9
- ![Terminal demo of dsh-medrec-qc: real output over its MR-009 fixture](https://raw.githubusercontent.com/PerryLink/dsh-medrec-qc/main/docs/assets/dsh-medrec-qc-demo.png)
18
+ ![Terminal demo of dsh-medrec-qc: real output over its MR-009 fixture](https://raw.githubusercontent.com/PerryLink/dsh-medrec-qc/main/docs/assets/dsh-medrec-qc-hero.png)
19
+
20
+ ![Animated terminal demo of dsh-medrec-qc](https://raw.githubusercontent.com/PerryLink/dsh-medrec-qc/main/docs/assets/dsh-medrec-qc-demo.gif)
10
21
 
11
22
  本插件对自己 `MR-009` 测试夹具的**真实输出**,不是示意图。规则库不伪造引文,因此每条发现都会同时写明所引条款,以及该条款原文本次未取得。
12
23
 
@@ -14,7 +25,7 @@
14
25
 
15
26
  | 你会问 | 它怎么答 |
16
27
  |---|---|
17
- | 某个必填栏目是空的,但我填了 `-`,会被报出来吗? | 不会。`MR-001` 把单独一个 `-` 视为「没有可填写内容」的标注,只报真正留空的栏目。它核对的是必填栏目有没有内容,不判断内容填得对不对;由于本条所引附件是 PDF、本环境无法解码,它的严重级封顶为 `warn`。同一个 `-` 在 `MR-009` 里仍然算签名缺失。 |
28
+ | 某个必填栏目是空的,但我填了 `-`,会被报出来吗? | 不会。`MR-001` 把单独一个 `-` 视为「没有可填写内容」的标注,只报真正留空的栏目。它核对的是必填栏目有没有内容,不判断内容填得对不对。本条为 `error`:24 号文附件1 的表末注释已于 **2026-10-13 逐字取得**(该附件**有文字层**,328 页、205,847 字符可提取,**未使用 OCR**),原文为「注:必填栏不能为空项,没有可填写内容时填写“-”」。⚠️ 发布机关 `www.nhc.gov.cn` 对自动访问返回 **HTTP 412**,本次采用的是**河南省病案质量控制中心的汇编件**——即本条 `source` 一直指向的那份文件;详见 `rules/evidence/clause-verification-homepage-attachment1.md`。同一个 `-` 在 `MR-009` 里仍然算签名缺失。 |
18
29
  | 入院时间只写到日、没有时分,还有一行的出院时间早于入院时间。 | `MR-002` 会报出只能读到日的 `入院时间` 或 `出院时间`(记录时间应当精确到分钟),完全解析不成日期时间的取值也一并报出。`MR-003` 按两个字段本身的字面先后关系,报出出院时间在前的那一行。两条都只看字面取值,不判断哪个时间才是真实时间。 |
19
30
  | 首页上写的是 5 天,而入出院日期是 6 月 12 日入院、6 月 15 日出院。 | `MR-004` 按「出院日 − 入院日」重算天数,与填写的 `实际住院天数` 不符即报出该行;同日入出院计 `0` 天,填的不是整数天也会报出。它只比对这三个已填的值,不判断其中哪一个填错了。 |
20
31
  | `主要诊断名称` 填了、`主要诊断编码` 空着;另一行的编码写法很怪。 | `MR-005` 要求两者同时填写,并指出缺的是哪一项;它只核对两者是否同时存在,不判断编码与诊断是否对应。`MR-006` 再按规则库中配置的书写形式核对编码,不校验该编码是否存在于某一版本的分类目录中。 |
@@ -41,22 +52,15 @@ front sheet and reports literal mismatches against cited clauses.
41
52
 
42
53
  | 项目 | 状态 |
43
54
  |---|---|
44
- | Harness | 对等版本范围 `>=0.1.2-rc.1 <0.2.0 \|\| >=0.2.0-0 <0.3.0` —— 已实测同时接受 `0.2.0-rc.2` 与 `0.2.1-alpha.1`。**刻意不声明 `engines.dsh`**:它没有任何读取者,也无法拒装任何宿主 |
55
+ | Harness | 对等版本范围 `>=0.1.2-rc.1 <0.2.0 \|\| >=0.2.0-0 <0.3.0` —— 已实测同时接受 `0.2.0-rc.2` 与 `0.2.1-rc.2`。**已声明 `engines.dsh`**:0.2.1 起由宿主单独裁决,范围为 `>=0.2.1-0 <0.3.0` |
45
56
  | Node | `^22.19.0 || >=24.0.0` |
46
57
  | 平台 | 全平台(纯 ESM;无原生代码、无联网、不调用模型) |
47
- | 工具模式 | `native` / `ptc` / `both` 均可;批量校验整个目录时建议 `ptc`,schema 成本只付一次 |
58
+ | 工具模式 | `native` / `ptc` 均可;批量校验整个目录时建议 `ptc`,schema 成本只付一次 |
48
59
 
49
60
  ## What it does
50
61
 
51
62
  规则表、字段说明与行为细节见 [README.md](README.md#what-it-does)(英文主版本)。本插件只列出材料与所引条款之间的字面差异,并对无法执行的检查在 `skipped` 中逐项说明。
52
63
 
53
- ## Install
54
-
55
- ```sh
56
- dsh plugin --profile <name> add dsh-medrec-qc
57
- dsh --profile <name> --dump-config | grep 'dsh-medrec-qc'
58
- ```
59
-
60
64
  ## Configuration
61
65
 
62
66
  全部可调参数都在 `src/config.ts` 的 Schemastery schema 中,只改 `cordis.yml` 即可生效,无需改代码;逐条阈值在 `rules/` 下的规则库文件里。
package/README.md CHANGED
@@ -1,12 +1,28 @@
1
1
  # dsh-medrec-qc — Form check and logic-contradiction prompts for the inpatient medical record front sheet
2
2
 
3
+ [English](README.md) · [简体中文](README-zh.md) · [Español](README-es.md) · [Português](README-pt.md) · [हिन्दी](README-hi.md)
4
+
5
+ ```sh
6
+ dsh plugin --profile <name> add dsh-medrec-qc
7
+ ```
8
+
9
+
3
10
  [![DSH Market](https://raw.githubusercontent.com/2BingLing/dsh-market/master/assets/readme/badge-listed-en.svg)](https://dsh.market/)
4
11
 
5
12
  `dsh-medrec-qc` reads an export of the inpatient medical record front sheet (病案首页), one row per discharge, in the column set of the national assessment export, the health statistics export or a hospital-local export, and checks that export's own form completeness, internal arithmetic and coding form: that each required column carries content or the `-` marker, that the admission and discharge times are present, precise to the minute and not in the wrong order, that the declared length of stay agrees with the two dates, that the primary diagnosis name and code and the primary operation name and code are filled together, that the codes have the written form the pack configures, that the three signature columns reflect three-level physician responsibility, that the discharge mode is one of the defined codes, that the age and the neonatal weights use the prescribed forms, that the count of other diagnoses stays within the configured ceiling, and that a diagnosis incompatible with the recorded sex or two disagreeing times in a death discharge are surfaced for human review.
6
13
 
14
+ ## Install
15
+
16
+ ```sh
17
+ dsh plugin --profile <name> add dsh-medrec-qc
18
+ dsh --profile <name> --dump-config | grep 'dsh-medrec-qc'
19
+ ```
20
+
7
21
  ## What it looks like
8
22
 
9
- ![Terminal demo of dsh-medrec-qc: real output over its MR-009 fixture](https://raw.githubusercontent.com/PerryLink/dsh-medrec-qc/main/docs/assets/dsh-medrec-qc-demo.png)
23
+ ![Terminal demo of dsh-medrec-qc: real output over its MR-009 fixture](https://raw.githubusercontent.com/PerryLink/dsh-medrec-qc/main/docs/assets/dsh-medrec-qc-hero.png)
24
+
25
+ ![Animated terminal demo of dsh-medrec-qc](https://raw.githubusercontent.com/PerryLink/dsh-medrec-qc/main/docs/assets/dsh-medrec-qc-demo.gif)
10
26
 
11
27
  Real output from this plugin over its own `MR-009` test fixture — not a mock-up. The rule pack ships no invented quotations, so a finding names both the clause it applied and the fact that the clause text was not obtained.
12
28
 
@@ -14,7 +30,7 @@ Real output from this plugin over its own `MR-009` test fixture — not a mock-u
14
30
 
15
31
  | You ask | What it answers |
16
32
  |---|---|
17
- | A required column is left empty, but I typed `-` in it. Is that reported? | No. `MR-001` treats a lone `-` as the marker for 'nothing to record here' and reports only the columns that are truly blank. It checks that a required column carries content, not that the content is correct, and it is capped at `warn` because the attachment it cites is a PDF this environment cannot decode. The same `-` still counts as a missing signature under `MR-009`. |
33
+ | A required column is left empty, but I typed `-` in it. Is that reported? | No. `MR-001` treats a lone `-` as the marker for 'nothing to record here' and reports only the columns that are truly blank. It checks that a required column carries content, not that the content is correct. It is an `error` because 附件1's note now **has** been read verbatim (2026-10-13) — see the note below. The same `-` still counts as a missing signature under `MR-009`. |
18
34
  | The admission time is written as a bare date with no hour or minute, and on one row the discharge time is earlier than the admission time. | `MR-002` reports a `入院时间` or `出院时间` value that can be read only to the day, because the recorded time must be precise to the minute, and it also reports a value it cannot parse as a date and time at all. `MR-003` compares the literal order of the two fields and reports the row where the discharge time comes first. Both work on the literal values and neither decides which of the two times is the true one. |
19
35
  | The front sheet says `5` days, but the dates are 12 June in and 15 June out. | `MR-004` recounts the days as discharge date minus admission date and reports the row when the declared `实际住院天数` disagrees; admission and discharge on the same day count as `0` days, and a value that is not a whole number of days is reported too. It compares the three stored values only and does not decide which of them is wrong. |
20
36
  | `主要诊断名称` is filled in but `主要诊断编码` is blank, and another row carries a code in a strange shape. | `MR-005` requires the two to be filled together and names the one that is missing; it checks only that both exist, not that the code matches the diagnosis. `MR-006` then tests the code against the written form configured in the pack, and it does not verify that the code exists in any version of the classification directory. |
@@ -41,29 +57,42 @@ front sheet and reports literal mismatches against cited clauses.
41
57
 
42
58
  | Surface | Status |
43
59
  |---|---|
44
- | Harness | Peer range `>=0.1.2-rc.1 <0.2.0 \|\| >=0.2.0-0 <0.3.0` — verified to accept both `0.2.0-rc.2` and `0.2.1-alpha.1`. `engines.dsh` is deliberately not declared: it has no reader and cannot reject a host |
60
+ | Harness | Peer range `>=0.1.2-rc.1 <0.2.0 \|\| >=0.2.0-0 <0.3.0` — verified to accept both `0.2.0-rc.2` and `0.2.1-rc.2`. `engines.dsh` is declared as `>=0.2.1-0 <0.3.0` and is enforced by the host since 0.2.1 |
45
61
  | Node | `^22.19.0 || >=24.0.0` |
46
62
  | Platforms | All (plain ESM; no native code, no network, no model call) |
47
- | Tool mode | Works in `native`, `ptc` and `both`; for a month of discharges use `ptc` |
63
+ | Tool mode | Works in `native` and `ptc`; for a month of discharges use `ptc` |
48
64
 
49
65
  ## What it does
50
66
 
51
67
  Registers the `medrec_qc` tool. It reads a list of discharged cases, applies a versioned rule pack,
52
68
  and returns a report whose every finding names the clause it came from.
53
69
 
54
- > ### ⚠️ Why `MR-001` is only a `warn`
70
+ > ### Why `MR-001` is an `error` again (2026-10-13)
55
71
  >
56
72
  > **Every `error` rule here rests on a document that imposes the requirement *and* whose clause text has
57
73
  > been read verbatim** — 国卫办医发〔2016〕24号 (obtained in full) and 卫医政发〔2011〕84号 (obtained in full,
58
- > including all three attachments). `MR-001` is the exception: its only basis is **附件1's header note**,
59
- > and that attachment is a PDF this environment cannot decode. The nearest obtained wording —
60
- > 84号文附件2 一(三)「栏目中没有可填写内容的,填写"-"」 — says **how to fill a blank**, not that a
61
- > required field may not be left blank, so it cannot carry an `error`. A rule whose clause cannot be read
62
- > does not block a workflow. See `rules/evidence/authority-class-audit.md` for the full classification.
74
+ > including all three attachments). `MR-001` was the long-standing exception: its only basis is
75
+ > **附件1's note**, and that attachment was recorded as a PDF this environment could not decode, so the rule
76
+ > was **downgraded to `warn` on 2026-10-07** under the same discipline — a clause that cannot be read does
77
+ > not block a workflow.
78
+ >
79
+ > **The attachment does have a text layer.** It was read verbatim on 2026-10-13: 328 pages, 205,847
80
+ > extractable characters, **no OCR used**. The note reads
81
+ > 「注:必填栏不能为空项,没有可填写内容时填写“-”」 — identical to the rule's `excerpt` except that the PDF
82
+ > prints curly quotes where the rule uses straight ones, a typographic difference recorded rather than
83
+ > papered over (the citation gate strips both quote forms, which is why the segment matches).
84
+ > **So the rule is back to `error`, corrected on evidence.**
85
+ >
86
+ > ⚠️ **Source tier, stated plainly**: `www.nhc.gov.cn` returns **HTTP 412** to automated requests
87
+ > (measured 2026-10-13; the site root is 412 too). The text was read from a **河南省病案质量控制中心**
88
+ > compilation — the very URL this rule's `source` has always carried. That is the same tier as the
89
+ > 高校/省级 reprints the other fourteen rules use, so it is **not a reason to treat this rule differently**.
90
+ > See `rules/evidence/clause-verification-homepage-attachment1.md` for the full attempt log and
91
+ > `rules/evidence/authority-class-audit.md` for the classification.
63
92
 
64
93
  | Rule | Check | Severity |
65
94
  |---|---|---|
66
- | `MR-001` | no required column is blank (a lone `-` is the approved marker) | warn |
95
+ | `MR-001` | no required column is blank (a lone `-` is the approved marker) | error |
67
96
  | `MR-002` | admission and discharge times are present and precise to the minute | error |
68
97
  | `MR-003` | the discharge time is not before the admission time | error |
69
98
  | `MR-004` | the recorded length of stay matches the two dates | error |
@@ -84,13 +113,6 @@ statistics export and a hospital-local export all feed the same rules. Columns t
84
113
  are reported in `warnings` and `unknownColumns` rather than ignored — an unmapped column is exactly how
85
114
  a check goes missing without anyone noticing.
86
115
 
87
- ## Install
88
-
89
- ```sh
90
- dsh plugin --profile <name> add dsh-medrec-qc
91
- dsh --profile <name> --dump-config | grep 'dsh-medrec-qc'
92
- ```
93
-
94
116
  ## Configuration
95
117
 
96
118
  Every tunable lives in the Schemastery schema in `src/config.ts`, so it can be changed from
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-medrec-qc",
3
- "version": "0.2.4",
3
+ "version": "0.2.11",
4
4
  "description": "病案首页形式质控与逻辑矛盾提示(依据国卫办医发〔2016〕24号等公开文件,仅提示差异,不作出定性结论)",
5
5
  "type": "module",
6
6
  "main": "lib/index.mjs",
@@ -68,7 +68,7 @@
68
68
  },
69
69
  "engines": {
70
70
  "node": "^22.19.0 || >=24.0.0",
71
- "dsh": ">=0.2.1-alpha.1"
71
+ "dsh": ">=0.2.1-0 <0.3.0"
72
72
  },
73
73
  "packageManager": "pnpm@11.7.0",
74
74
  "peerDependencies": {
@@ -78,14 +78,14 @@
78
78
  },
79
79
  "devDependencies": {
80
80
  "@deepseek-ai/cordis": "4.0.5-alpha.1",
81
- "@deepseek-ai/dsh-package-manifest": "0.2.1-alpha.1",
82
- "@deepseek-ai/dsh-tools": "0.2.1-alpha.1",
81
+ "@deepseek-ai/dsh-package-manifest": "0.2.1-rc.2",
82
+ "@deepseek-ai/dsh-tools": "0.2.1-rc.2",
83
83
  "@deepseek-ai/schemastery": "3.18.5-alpha.1",
84
84
  "@types/node": "^22.20.1",
85
- "vitest": "^3.2.7"
86
- },
87
- "dependencies": {
85
+ "vitest": "^3.2.7",
86
+ "@deepseek-ai/dsh-working-directory": "0.2.1-rc.2",
88
87
  "tsdown": "^0.22.14",
89
88
  "typescript": "^5.9.3"
90
- }
89
+ },
90
+ "dependencies": {}
91
91
  }
@@ -0,0 +1,145 @@
1
+ # 条文核查报告 —— dsh-medrec-qc:24 号文**附件 1「住院病案首页必填项目列表」**的逐字取得
2
+
3
+ > **本报告补上了此前唯一一处"来源已定位、本环境读不了"的缺口。**
4
+ > `MR-001` 的唯一依据是 **24 号文附件 1 的表头注释**;此前该附件"本环境无法解码 PDF",
5
+ > 本条因此于 2026-10-07 由 `error` 降为 `warn`。**本次实测:该附件有可提取的文字层,注释已逐字取得。**
6
+ > ⇒ 按本族的"证据到哪一步、标注就到哪一步",**本条恢复 `error`**。
7
+
8
+ - **核查日期**:2026-10-13
9
+ - **核查对象**:`MR-001`(必填项栏目不得为空)的 `basis`
10
+ - **核查方法**:定位并下载**含该附件的可解码 PDF**,用文字层提取,逐字比对规则 `excerpt`。
11
+ - **结论**:**逐字命中,0 处失配**。`MR-001` 的 `excerpt`(「注:必填栏不能为空项,没有可填写内容时填写"-"」)
12
+ 在文本中**逐字出现**;其所在位置为**该 PDF 第 113 页**(页脚页码 `108`,
13
+ 紧接附件 1「住院病案首页必填项目列表」第 1—76 项之后、附件 2 之前)。
14
+
15
+ ---
16
+
17
+ ## 一、取得来源与可追溯信息
18
+
19
+ | 项 | 值 |
20
+ |---|---|
21
+ | 文件 | 《病案(病历)相关法律法规及工作制度汇编(2010—2022 年)》 |
22
+ | 编纂机构 | **河南省病案质量控制中心**(郑州大学第一附属医院病案管理科) |
23
+ | 序言署名 | 河南省卫生健康委员会医政医管处处长,2022 年 8 月 |
24
+ | 载体 | PDF,**328 页,205,847 字符可提取**(有文字层,**非扫描件**) |
25
+ | 取得 URL | `http://hncis.hnwsjk.cn/bingan/upload/files/2024/6/3813adce8fc5b87f.pdf` |
26
+ | 取得方式 | `Invoke-WebRequest` 直接下载(HTTP 200,返回 `application/pdf`),本地文字层提取 |
27
+ | 取得日期 | **2026-10-13** |
28
+ | 内含被引文件 | **国卫办医发〔2016〕24 号**附件 2《住院病案首页数据质量管理与控制指标(2016 年版)》与**附件 1《住院病案首页必填项目列表》**(第 107—113 页,页脚页码 102—108) |
29
+
30
+ ⚠️ **该 `source` 原本就写在 `MR-001` 的 `basis.source` 里**,本报告不是"换了一个新来源",
31
+ 而是**把仓库早已指向的那份文件真正读开**。
32
+
33
+ ---
34
+
35
+ ## 二、逐字取得的内容(本条的引文)
36
+
37
+ 附件 1 表末注释,**逐字**:
38
+
39
+ > 注:必填栏不能为空项,没有可填写内容时填写“-”
40
+
41
+ (PDF 文字层原样:`注:必填栏不能为空项,没有可填写内容时填写“-”`)
42
+
43
+ **与规则引文的比对**:
44
+
45
+ | | 文本 |
46
+ |---|---|
47
+ | 规则 `MR-001.excerpt` | `注:必填栏不能为空项,没有可填写内容时填写"-"` |
48
+ | 附件 1 原文(文字层) | `注:必填栏不能为空项,没有可填写内容时填写“-”` |
49
+ | 差异 | **仅直引号 `"` 与弯引号 `“”` 之差**(排印差异,非文字差异) |
50
+
51
+ ⚠️ **如实标注这处差异**:PDF 文字层用的是**弯引号**,规则用**直引号**。
52
+ 引文闸门 `scripts/check-citations.mjs` 的归一化把**两种引号一并剔除**
53
+ (`normalise()` 的字符类里同时含 `“”` 与 `"`,已实测),因此**逐字校验命中**。
54
+ ⇒ **不改写规则引文去迁就提取结果,也不假装两者字节相同**;本节即为该差异的留档。
55
+
56
+ **第 1—76 项清单**(节选与 `MR-001.params.fields` 直接相关的项,逐字):
57
+ `病案号`、`入院时间`、`出院时间`、`性别`、`出生日期`、`年龄`、`离院方式` 均在列;
58
+ `科主任`/`主任(副主任)医师`/`主治医师`/`住院医师` 分列。
59
+
60
+ 同时取得附件 1 的完整字段清单(**76 项**,第 1—76 号),可用于核对 `MR-001` 的 `params.fields`:
61
+ 病案号、入院时间、出院时间、性别、出生日期、年龄、离院方式等均在清单内;
62
+ 清单中**没有**名为「医师签名」的项,而是「科主任/主任(副主任)医师/主治医师/住院医师」分列
63
+ (与规则库头部第 27—28 行的既有说明一致)。
64
+
65
+ ---
66
+
67
+ ## 三、为什么这条现在可以支撑 `error`
68
+
69
+ 按 `rules/evidence/authority-class-audit.md` 第二节确立的判据:
70
+
71
+ 1. **效力来源**:国卫办医发〔2016〕24 号是**国家卫生计生委办公厅以文号印发的规范性文件**,
72
+ 对医疗机构设定住院病案首页填写要求 ⇒ **B 类,可以 `error`**。
73
+ 2. **B 类的硬前提**:「**所引条款的文本必须已逐字取得**」——
74
+ **本次已满足**(第二节)。这正是 2026-10-07 降级时唯一缺失的条件。
75
+ 3. ⇒ **`MR-001` 的 `kind: direct` + `severity: error` 成立**。
76
+
77
+ ⚠️ **本条 `kind` 此前已是 `direct`**(见 `clause-verification-homepage-spec.md` 第三节末尾:
78
+ "该引文的措辞与 note 描述的表头注释用途一致,**没有任何理由怀疑其不实**")——
79
+ 缺的只是**逐字核对**这一步,而不是效力来源的判定。
80
+
81
+ ---
82
+
83
+ ## 四、一条必须写明的限度(**来源层级**)
84
+
85
+ ⚠️ **本条引文取自省级病案质量控制中心的汇编件,不是发布机关本站的原文。**
86
+
87
+ 逐条记录尝试路径(**含状态**):
88
+
89
+ | 尝试的来源 | 结果 |
90
+ |---|---|
91
+ | **`www.nhc.gov.cn`**(发布机关,24 号文通知页<br>`https://www.nhc.gov.cn/wjw/c100175/201606/b41dfe1ef9f04156aa298d3e9b815d18.shtml`) | **HTTP 412 Precondition Failed**(实测,2026-10-13)。**站点根路径同样 412**,即卫健委系统整体拒绝该 UA 的自动访问。 |
92
+ | **`wsjkw.sh.gov.cn`**(上海市卫健委转发通知,0012-59955) | **HTTP 200**,但正文只有转发语,并写明「**请从国家卫生计生委网站医政医管栏目下载**」——**不含附件正文**。 |
93
+ | **`wsjkw.hebei.gov.cn`**(河北省卫健委贯彻落实通知) | 只有通知正文,**不含附件正文**(此前轮次已实测)。 |
94
+ | **`zgbazwh.cha.org.cn`**(中国医院协会病案专业委员会) | **HTTP 200**,取得《住院病案首页数据质量管理与控制指标(2016 年版)》PDF(9 页,有文字层),但**其中不含附件 1 的必填项目列表与其注释**。 |
95
+ | **`ywc.jlu.edu.cn`**(吉林大学医院管理处转载,仓库现有 `source` 之一) | **HTTP 200**,含通知正文与《规范(暂行)》三章二十七条,**但不含附件的表格与其注释**。 |
96
+ | **`hncis.hnwsjk.cn`**(河南省病案质量控制中心汇编,**本报告采用**) | **HTTP 200,`application/pdf`,328 页,有文字层** ⇒ **逐字命中**。 |
97
+
98
+ ⇒ **发布机关本站是 412,其余转载件中只有这一份把附件 1 的表格连注释一起印全了。**
99
+ 本报告**不声称**它是发布机关原件;它是一份**省级病案质控中心的汇编件**,
100
+ 层级相当于本族来源分级中的 **C 级(省市级卫健委及其下设机构)**——
101
+ 这与本插件其余 14 条规则所用的来源层级**一致**(`ywc.jlu.edu.cn` = 高校转载,
102
+ `hncis.hnwsjk.cn` = 省级质控中心),因此**不构成本条特有的降级理由**。
103
+
104
+ ⚠️ **若日后取得卫健委原件,应以原件复核本报告第二节的引文。** 该待办保留在第六节。
105
+
106
+ ---
107
+
108
+ ## 五、对规则库的影响
109
+
110
+ | 项 | 处理 |
111
+ |---|---|
112
+ | `MR-001.basis.excerpt` | **不变**(原文逐字命中) |
113
+ | `MR-001.basis.clause` | **不变**(`附件1 注`) |
114
+ | `MR-001.basis.source` | **不变**(该 URL 就是本次读开的文件) |
115
+ | `MR-001.kind` | `direct` → **`direct`(不变)** |
116
+ | `MR-001.severity` | `warn` → **`error`** |
117
+ | `MR-001.note` | 改写为"已逐字取得",并写明来源层级与标点差异 |
118
+ | `README*.md` 五语 | `MR-001` 的严重级与"为什么是 warn"段一并改写(`check:readmes` 要求五语同口径) |
119
+
120
+ ---
121
+
122
+ ## 六、复现方法
123
+
124
+ ```sh
125
+ # 下载汇编件(HTTP 200,application/pdf,328 页,有文字层)
126
+ curl -sI http://hncis.hnwsjk.cn/bingan/upload/files/2024/6/3813adce8fc5b87f.pdf
127
+ curl -s -o hn-24hao.pdf http://hncis.hnwsjk.cn/bingan/upload/files/2024/6/3813adce8fc5b87f.pdf
128
+
129
+ # 提取文字层并定位注释(需 PyMuPDF;实测该 PDF 有文字层,未使用任何 OCR)
130
+ python -c "import pymupdf,re;d=pymupdf.open('hn-24hao.pdf');t=''.join(p.get_text() for p in d);print('必填栏不能为空项' in re.sub(r'\s+','',t))"
131
+ # 预期输出:True(位于 PDF 第 113 页)
132
+ ```
133
+
134
+ ⚠️ **未使用 OCR**:本 PDF **自带文字层**(205,847 字符可提取),提取结果即文本本身,
135
+ 不存在"把识别不确定性伪装成引文确定性"的问题。这是本条与 `dsh-site-log-check` 那份
136
+ **无文字层扫描件**的关键区别。
137
+
138
+ ## 七、后续动作
139
+
140
+ - [x] `MR-001` 唯一依据**已逐字取得**,严重级恢复 `error`。
141
+ - [x] `params.fields` 的 76 项清单来源**已在同一份文件中落到页码**。
142
+ - [ ] **仍待原件**:在浏览器中从 `www.nhc.gov.cn` 下载 24 号文通知原件(含两个附件),
143
+ 以发布机关本站文本复核本报告第二节。**当前 412 阻挡的是自动访问,不是人工下载。**
144
+ - [ ] `MR-014` 的《国家医疗保障局公告(第二十一批)》已由 `clause-verification-nhsa-liangku.md` 处理,
145
+ 本报告不重复。
@@ -41,8 +41,8 @@ version: "2026.1"
41
41
 
42
42
  rules:
43
43
  - id: MR-001
44
- title: 必填项栏目宜不为空
45
- severity: warn
44
+ title: 必填项栏目不得为空
45
+ severity: error
46
46
  basis:
47
47
  document: 《住院病案首页数据质量管理与控制指标(2016版)》
48
48
  number: 国卫办医发〔2016〕24号
@@ -69,26 +69,23 @@ rules:
69
69
  - 主要诊断编码
70
70
  allowDash: true
71
71
  note: >-
72
- ⚠️ **本条严重级已于 2026-10-07 由 error 降为 warn**,因为**它唯一的依据取不到**
73
- (见 rules/evidence/clause-verification-homepage-spec.md):
74
- 本条引的是**24号文附件1 的表头注释**,而该附件是 PDF、**本环境无法解码**
75
- (source 指向的 PDF 实测确实返回 `application/pdf`,即**来源存在、只是读不了**)。
76
- ⇒ **"必填栏不能为空"这条要求本次未取得可逐字引用的条文**,
77
- **无可核对条文的规则不应阻断流程**,故降为 warn。
78
- ✅ **84号文附件2「一、基本要求」(三)有同类明文且已逐字核对**
79
- (「栏目中没有可填写内容的,填写"-"」,见 clause-verification-medical-record-84.md),
80
- 但那句话规范的是**空格怎么填**,**不是"必填项不得为空"** —— 故它不足以支撑 error 级。
81
- 依据为24号文附件1「住院病案首页必填项目列表」共 76 项及其表头注释。
72
+ ✅ **本条严重级已于 2026-10-13 恢复为 error**:**其唯一依据(24号文附件1 表头注释)已逐字取得**
73
+ —— 见 rules/evidence/clause-verification-homepage-attachment1.md。
74
+ 该附件**有文字层**(328 页、205,847 字符可提取,**未使用任何 OCR**),
75
+ 注释原文逐字为「注:必填栏不能为空项,没有可填写内容时填写“-”」(仅弯引号与直引号之差,已留档)。
76
+ **历史沿革(保留,便于复核)**:本条曾于 2026-10-07 由 error 降为 warn,
77
+ 理由是"依据取不到"(当时断定该 PDF 无法解码)——
78
+ ⇒ **按 B 类效力来源的硬前提(读不到的条款不能支撑阻断),当时的降级是对的**;
79
+ 本次取得文本后**按证据回正**,这是同一条纪律的另一半。
80
+ ⚠️ **来源层级如实标注**:发布机关 `www.nhc.gov.cn` 对自动访问返回 **HTTP 412**(2026-10-13 实测,
81
+ 站点根路径同样 412);本次采用的是**河南省病案质量控制中心汇编件**
82
+ (`hncis.hnwsjk.cn`,即本规则 `source` 早已指向的那份文件)——
83
+ 层级与本插件其余各条所用的高校/省级转载源一致,**不构成本条特有的降级理由**。
84
+ ✅ **84号文附件2「一、基本要求」(三)另有同类明文且已逐字核对**
85
+ (「栏目中没有可填写内容的,填写"-"」,见 clause-verification-medical-record-84.md)——
86
+ 它规范的是**空格怎么填**,与本品「必填栏不得为空」互为补充,但**本条不再依赖它定级**。
87
+ 依据为24号文附件1「住院病案首页必填项目列表」共 76 项及其表末注释。
82
88
  填写「-」视为已按原文处理,不报差异;本条只报真正留空的栏目。
83
- ⚠️ **该附件是 PDF,本环境读不了,故本条引文仍未逐字核对**(见 rules/evidence/clause-verification-medical-record-84.md):
84
- `source` 指向的湖南 PDF 实测**确实返回 `application/pdf`**(**链接有效,只是本环境无法解码**),
85
- 且 **24 号文的两个附件同样是 PDF**。⇒ **来源存在且已定位,缺的只是本环境的读取能力。**
86
- ✅ **但本次取得了一份有力的旁证**:**卫医政发〔2011〕84 号附件 2「一、基本要求」(三)逐字**规定
87
- 「凡栏目中有"□"的,应当在"□"内填写适当阿拉伯数字。**栏目中没有可填写内容的,填写"-"。**
88
- 如:联系人没有电话,在电话处填写"-"。」
89
- ⇒ **"没有内容填 -"这条规则在 84 号文里有逐字明文**(本条引文与之一致),
90
- 故尽管 24 号文附件的措辞未能核对,**本条所依据的规则本身是有明文来源的**。
91
- 本条的检查行为不受影响。
92
89
 
93
90
  - id: MR-002
94
91
  title: 入院时间与出院时间应填写且精确到分钟