open-dpc-jp 0.1.0__tar.gz
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.
- open_dpc_jp-0.1.0/.gitignore +9 -0
- open_dpc_jp-0.1.0/CHANGELOG.md +10 -0
- open_dpc_jp-0.1.0/CITATION.cff +18 -0
- open_dpc_jp-0.1.0/LICENSE +21 -0
- open_dpc_jp-0.1.0/MIRAI-ID-CCI-PROVENANCE.md +27 -0
- open_dpc_jp-0.1.0/NOTICE.md +21 -0
- open_dpc_jp-0.1.0/PKG-INFO +54 -0
- open_dpc_jp-0.1.0/README.md +36 -0
- open_dpc_jp-0.1.0/README_ja.md +36 -0
- open_dpc_jp-0.1.0/RELEASE-CHECKLIST.md +27 -0
- open_dpc_jp-0.1.0/build_site.py +40 -0
- open_dpc_jp-0.1.0/conformance/legacy-api-inventory.json +65 -0
- open_dpc_jp-0.1.0/conformance/legacy-v1.json +5096 -0
- open_dpc_jp-0.1.0/conformance/legacy.py +61 -0
- open_dpc_jp-0.1.0/conformance/run.py +33 -0
- open_dpc_jp-0.1.0/docs/about/license-citation.md +7 -0
- open_dpc_jp-0.1.0/docs/getting-started/installation.md +16 -0
- open_dpc_jp-0.1.0/docs/index.md +15 -0
- open_dpc_jp-0.1.0/docs/methods/cci.md +9 -0
- open_dpc_jp-0.1.0/docs/reference/python-api.md +11 -0
- open_dpc_jp-0.1.0/docs/specifications/dpc-files.md +7 -0
- open_dpc_jp-0.1.0/docs/specifications/patient-list.md +22 -0
- open_dpc_jp-0.1.0/docs/tools/dpc-extraction.md +11 -0
- open_dpc_jp-0.1.0/docs/tools/patient-list-generator-guide.md +7 -0
- open_dpc_jp-0.1.0/docs/usage/python.md +23 -0
- open_dpc_jp-0.1.0/extraction/README.md +11 -0
- open_dpc_jp-0.1.0/extraction/dpc_extractor.py +745 -0
- open_dpc_jp-0.1.0/extraction/dpc_extractor_fast.ps1 +758 -0
- open_dpc_jp-0.1.0/pyproject.toml +36 -0
- open_dpc_jp-0.1.0/spec/dpc/base/2014.json +993 -0
- open_dpc_jp-0.1.0/spec/dpc/base/2015.json +993 -0
- open_dpc_jp-0.1.0/spec/dpc/base/2016.json +1256 -0
- open_dpc_jp-0.1.0/spec/dpc/base/2017.json +1256 -0
- open_dpc_jp-0.1.0/spec/dpc/base/2018.json +1447 -0
- open_dpc_jp-0.1.0/spec/dpc/base/2019.json +1443 -0
- open_dpc_jp-0.1.0/spec/dpc/base/2020.json +1453 -0
- open_dpc_jp-0.1.0/spec/dpc/base/2021.json +1453 -0
- open_dpc_jp-0.1.0/spec/dpc/base/2022.json +1527 -0
- open_dpc_jp-0.1.0/spec/dpc/base/2023.json +1527 -0
- open_dpc_jp-0.1.0/spec/dpc/base/2024-20240601.json +1732 -0
- open_dpc_jp-0.1.0/spec/dpc/base/2025.json +1743 -0
- open_dpc_jp-0.1.0/spec/dpc/base/legacy-mixed-v1.json +700 -0
- open_dpc_jp-0.1.0/spec/dpc/changes/2024-20240401.json +105 -0
- open_dpc_jp-0.1.0/spec/dpc/changes/2026-20260401.json +112 -0
- open_dpc_jp-0.1.0/spec/dpc/changes/2026-20260717.json +67 -0
- open_dpc_jp-0.1.0/spec/dpc/changes/2026.json +1055 -0
- open_dpc_jp-0.1.0/spec/dpc/registry.json +140 -0
- open_dpc_jp-0.1.0/spec/dpc/source_ledger.json +293 -0
- open_dpc_jp-0.1.0/spec/semantics/mirai-id-cci-v1.json +437 -0
- open_dpc_jp-0.1.0/spec/semantics/quan-2005.json +406 -0
- open_dpc_jp-0.1.0/src/open_dpc/__init__.py +3 -0
- open_dpc_jp-0.1.0/src/open_dpc/discovery.py +78 -0
- open_dpc_jp-0.1.0/src/open_dpc/disease_master.py +188 -0
- open_dpc_jp-0.1.0/src/open_dpc/ef.py +294 -0
- open_dpc_jp-0.1.0/src/open_dpc/ff1_all_payloads.py +478 -0
- open_dpc_jp-0.1.0/src/open_dpc/master_archive.py +30 -0
- open_dpc_jp-0.1.0/src/open_dpc/medication_periods.py +168 -0
- open_dpc_jp-0.1.0/src/open_dpc/parsing.py +267 -0
- open_dpc_jp-0.1.0/src/open_dpc/references/__init__.py +92 -0
- open_dpc_jp-0.1.0/src/open_dpc/references/disease.py +47 -0
- open_dpc_jp-0.1.0/src/open_dpc/schemas/__init__.py +128 -0
- open_dpc_jp-0.1.0/src/open_dpc/schemas/compiled/dpc-2014-20140501.json +993 -0
- open_dpc_jp-0.1.0/src/open_dpc/schemas/compiled/dpc-2015-20150402.json +993 -0
- open_dpc_jp-0.1.0/src/open_dpc/schemas/compiled/dpc-2016-20160401.json +1256 -0
- open_dpc_jp-0.1.0/src/open_dpc/schemas/compiled/dpc-2017-20170401.json +1256 -0
- open_dpc_jp-0.1.0/src/open_dpc/schemas/compiled/dpc-2018-20180406.json +1447 -0
- open_dpc_jp-0.1.0/src/open_dpc/schemas/compiled/dpc-2019-20190401.json +1443 -0
- open_dpc_jp-0.1.0/src/open_dpc/schemas/compiled/dpc-2020-20200330.json +1453 -0
- open_dpc_jp-0.1.0/src/open_dpc/schemas/compiled/dpc-2021-20210401.json +1453 -0
- open_dpc_jp-0.1.0/src/open_dpc/schemas/compiled/dpc-2022-20220401.json +1527 -0
- open_dpc_jp-0.1.0/src/open_dpc/schemas/compiled/dpc-2023-20230401.json +1527 -0
- open_dpc_jp-0.1.0/src/open_dpc/schemas/compiled/dpc-2024-20240401.json +1530 -0
- open_dpc_jp-0.1.0/src/open_dpc/schemas/compiled/dpc-2024-20240601.json +1732 -0
- open_dpc_jp-0.1.0/src/open_dpc/schemas/compiled/dpc-2025-20250530.json +1743 -0
- open_dpc_jp-0.1.0/src/open_dpc/schemas/compiled/dpc-2026-20260401.json +1745 -0
- open_dpc_jp-0.1.0/src/open_dpc/schemas/compiled/dpc-2026-20260601.json +1648 -0
- open_dpc_jp-0.1.0/src/open_dpc/schemas/compiled/dpc-2026-20260717.json +1648 -0
- open_dpc_jp-0.1.0/src/open_dpc/schemas/compiled/legacy-mixed-v1.json +700 -0
- open_dpc_jp-0.1.0/src/open_dpc/schemas/compiled/registry.json +140 -0
- open_dpc_jp-0.1.0/src/open_dpc/schemas/compiled/source_ledger.json +293 -0
- open_dpc_jp-0.1.0/src/open_dpc/semantics/__init__.py +3 -0
- open_dpc_jp-0.1.0/src/open_dpc/semantics/classification.py +45 -0
- open_dpc_jp-0.1.0/src/open_dpc/semantics/comorbidity/__init__.py +183 -0
- open_dpc_jp-0.1.0/src/open_dpc/semantics/comorbidity/definitions/mirai-id-cci-v1.json +437 -0
- open_dpc_jp-0.1.0/src/open_dpc/semantics/comorbidity/definitions/quan-2005.json +406 -0
- open_dpc_jp-0.1.0/src/open_dpc/semantics/comorbidity/definitions/registry.json +14 -0
- open_dpc_jp-0.1.0/src/open_dpc/semantics/diagnosis.py +91 -0
- open_dpc_jp-0.1.0/src/open_dpc/semantics/drugs.py +6 -0
- open_dpc_jp-0.1.0/src/open_dpc/semantics/procedures.py +6 -0
- open_dpc_jp-0.1.0/src/open_dpc/variables.py +10 -0
- open_dpc_jp-0.1.0/src/open_dpc_jp/__init__.py +18 -0
- open_dpc_jp-0.1.0/tests/standalone.py +68 -0
- open_dpc_jp-0.1.0/tests/test_charlson.py +62 -0
- open_dpc_jp-0.1.0/tests/test_diagnosis_certainty.py +78 -0
- open_dpc_jp-0.1.0/tests/test_disease_snapshot.py +47 -0
- open_dpc_jp-0.1.0/tests/test_extraction_contract.py +91 -0
- open_dpc_jp-0.1.0/tests/test_extraction_powershell.ps1 +22 -0
- open_dpc_jp-0.1.0/tests/test_mirai_cci.py +86 -0
- open_dpc_jp-0.1.0/tests/test_public_namespace.py +20 -0
- open_dpc_jp-0.1.0/tests/test_quan_table1.py +54 -0
- open_dpc_jp-0.1.0/tests/test_references_semantics.py +37 -0
- open_dpc_jp-0.1.0/tests/test_schema_compiler_guards.py +46 -0
- open_dpc_jp-0.1.0/tests/test_schema_parsing.py +313 -0
- open_dpc_jp-0.1.0/tools/audit_sources.py +58 -0
- open_dpc_jp-0.1.0/tools/benchmark.py +56 -0
- open_dpc_jp-0.1.0/tools/compile_schemas.py +181 -0
- open_dpc_jp-0.1.0/tools/report_annual_schemas.py +73 -0
- open_dpc_jp-0.1.0/tools/verify_annual_source_tables.py +207 -0
- open_dpc_jp-0.1.0/web/app.mjs +183 -0
- open_dpc_jp-0.1.0/web/csv.mjs +138 -0
- open_dpc_jp-0.1.0/web/index.html +74 -0
- open_dpc_jp-0.1.0/web/style.css +4 -0
- open_dpc_jp-0.1.0/zensical.toml +10 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0 — first public release
|
|
4
|
+
|
|
5
|
+
- Publish the `open_dpc_jp` import namespace with a compatibility path to the pre-public `open_dpc` implementation.
|
|
6
|
+
- Include versioned structural DPC schemas, explicit reference annotation, Quan 2005 and MIRAI-ID CCI definitions.
|
|
7
|
+
- Include separately documented extraction utilities and a browser-only Patient List Generator.
|
|
8
|
+
- Publish Japanese Zensical documentation and a normative Patient List CSV specification.
|
|
9
|
+
|
|
10
|
+
The private development candidates numbered 0.2.0 and 0.3.0 were not PyPI releases. Package, schema, contract and CCI definition versions are independent.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
message: "Cite the software version and schema/definition hashes used; cite the original DPC specification and Quan et al. when applicable."
|
|
3
|
+
title: "Open DPC JP"
|
|
4
|
+
type: software
|
|
5
|
+
version: 0.1.0
|
|
6
|
+
date-released: 2026-09-26
|
|
7
|
+
license: MIT
|
|
8
|
+
url: "https://github.com/sy-wada/open-dpc-jp"
|
|
9
|
+
repository-code: "https://github.com/sy-wada/open-dpc-jp"
|
|
10
|
+
authors:
|
|
11
|
+
- family-names: Wada
|
|
12
|
+
given-names: Shoya
|
|
13
|
+
orcid: "https://orcid.org/0000-0001-7055-1009"
|
|
14
|
+
references:
|
|
15
|
+
- type: article
|
|
16
|
+
title: "Coding algorithms for defining comorbidities in ICD-9-CM and ICD-10 administrative data"
|
|
17
|
+
doi: "10.1097/01.mlr.0000182534.19832.83"
|
|
18
|
+
year: 2005
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 OpenDPC-JP contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# MIRAI-ID Charlson Comorbidity Definition v1
|
|
2
|
+
|
|
3
|
+
`mirai-id-cci@1` is a complete, standalone ICD-10 Charlson definition for
|
|
4
|
+
MIRAI-ID (Multicenter Innovative Research Alliance In Infectious Diseases).
|
|
5
|
+
It uses the 17 conditions, original weights and three severity suppression
|
|
6
|
+
relations of the [Quan et al. 2005 Table 1 algorithm](https://pubmed.ncbi.nlm.nih.gov/16224307/),
|
|
7
|
+
with exactly three added prefixes:
|
|
8
|
+
|
|
9
|
+
| Condition | Added prefix | Rationale |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| `aids_hiv` | B23 | The current Japanese ICD-10 B23.0, B23.1, B23.2 and B23.8 subcategories explicitly describe HIV disease. |
|
|
12
|
+
| `malignancy` | C86 | The current classification identifies specified T/NK-cell lymphomas. |
|
|
13
|
+
| `malignancy` | D45 | Polycythaemia vera was included by the historical C. koseri definition. The Japanese classification notes its malignant classification in ICD-O-3 while retaining D45 in ICD-10. |
|
|
14
|
+
|
|
15
|
+
The classification sources are the Japanese Ministry of Health, Labour and
|
|
16
|
+
Welfare's [infectious-disease table](https://www.mhlw.go.jp/toukei/sippei/dl/naiyou01.pdf)
|
|
17
|
+
and [neoplasm table](https://www.mhlw.go.jp/toukei/sippei/dl/naiyou02.pdf).
|
|
18
|
+
The choice to apply Charlson weights to these additional codes is a MIRAI-ID
|
|
19
|
+
research decision, not a validation of the extended definition's predictive
|
|
20
|
+
performance. `quan-2005@1` remains the immutable published-reference snapshot.
|
|
21
|
+
|
|
22
|
+
Use `definition="mirai-id-cci", version="1"` in a research run. Retain the
|
|
23
|
+
returned definition id/version/SHA-256 and algorithm id/version in derivation
|
|
24
|
+
metadata. Changing code membership, weights or suppression requires a new
|
|
25
|
+
definition version; changing the evaluator procedure requires a new algorithm
|
|
26
|
+
version. An unversioned `latest` request resolves through the package registry,
|
|
27
|
+
so it is convenient for exploration but should not be used for publication runs.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Scope and third-party source register
|
|
2
|
+
|
|
3
|
+
MIT applies to project-owned OpenDPC-JP code, independently authored schema
|
|
4
|
+
transcriptions, documentation and synthetic tests in this distribution. It does
|
|
5
|
+
not license Curator, third-party source publications, clinical data, official
|
|
6
|
+
master files or third-party dependencies. Source PDFs and official master data
|
|
7
|
+
are not included. The maintainer confirmed the rights and permissions for the
|
|
8
|
+
included material on 2026-09-26.
|
|
9
|
+
|
|
10
|
+
| Source | Use | Distribution in this project | Rights and distribution status |
|
|
11
|
+
|---|---|---|---|
|
|
12
|
+
| MHLW 2025 DPC description, 2025-05-30 | FF1/EF structural facts and source page references | Independent structured transcription only; no PDF | Maintainer confirmed applicable source terms and transcription rights |
|
|
13
|
+
| 2026 DPC description, 2026-07-17, PRRISM; March/July change records | FF1/EF structural facts and revision comparison | Independent structured transcription only; no PDF | Maintainer confirmed applicable source terms and transcription rights |
|
|
14
|
+
| Quan et al., Medical Care 2005;43:1130–1139, DOI 10.1097/01.mlr.0000182534.19832.83, Table 1 | ICD-10 prefix definitions | Machine-readable independent transcription; no article/table image | Maintainer confirmed rights for the included coding definitions |
|
|
15
|
+
| Existing project Python core | Contract-1 implementation | Source included | Maintainer confirmed institutional and contributor permissions |
|
|
16
|
+
| Official disease/drug/procedure masters | Optional user-supplied runtime data | Not included | Users must follow the terms of datasets they supply |
|
|
17
|
+
| Curator research classification tables and executable profiles | Application policy | Not included | Separate study specification and release review |
|
|
18
|
+
|
|
19
|
+
Source URLs and exact downloaded SHA-256 values are embedded in the schema and
|
|
20
|
+
definition resources. A hash identifies the bytes reviewed; it does not establish
|
|
21
|
+
copyright ownership, clinical validity or permission to redistribute.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: open-dpc-jp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: DPC FF1/EF readers, versioned schemas, and research algorithms for Japan
|
|
5
|
+
Project-URL: Homepage, https://github.com/sy-wada/open-dpc-jp
|
|
6
|
+
Project-URL: Documentation, https://open-dpc-jp.pages.dev/
|
|
7
|
+
Project-URL: Repository, https://github.com/sy-wada/open-dpc-jp
|
|
8
|
+
Project-URL: Issues, https://github.com/sy-wada/open-dpc-jp/issues
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
16
|
+
Requires-Python: >=3.12
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
|
|
19
|
+
[日本語 README](README_ja.md)
|
|
20
|
+
|
|
21
|
+
# Open DPC JP
|
|
22
|
+
|
|
23
|
+
**Open Diagnosis Procedure Combination for Japan** is a Python library for structurally reading Japanese DPC FF1 and EF data with explicit year and revision profiles. It also provides versioned Charlson Comorbidity Index definitions. The first public release is `0.1.0`.
|
|
24
|
+
|
|
25
|
+
## Scope
|
|
26
|
+
|
|
27
|
+
The core interface is a library API. DPC extraction scripts are separate utilities in this repository. The browser-only Patient List Generator creates the CSV those scripts consume. The library does not include clinical patient data, official master files, CaseCurator application rules, storage, or REDCap exports. Structural parsing is not a complete DPC submission or clinical validity check.
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
30
|
+
|
|
31
|
+
Python 3.12 or newer is required.
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
python -m pip install open-dpc-jp
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Quick start
|
|
38
|
+
|
|
39
|
+
```python
|
|
40
|
+
from pathlib import Path
|
|
41
|
+
from open_dpc_jp.parsing import parse_ef, parse_ff1
|
|
42
|
+
|
|
43
|
+
ef = parse_ef(Path("EFn.txt"), source_kind="efn", dataset_year=2025)
|
|
44
|
+
ff1 = parse_ff1(Path("FF1.txt"), schema_id="dpc-2025-20250530")
|
|
45
|
+
print(ef["diagnostics"], ff1["schema"])
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Supported data and documentation
|
|
49
|
+
|
|
50
|
+
Versioned structural profiles cover DPC years 2014–2026, with explicit revisions where needed. Source coverage and limits are recorded in `spec/dpc/source_ledger.json`. See the [Japanese documentation](https://open-dpc-jp.pages.dev/) for usage, methods, supported inputs, extraction, and the Patient List CSV contract. The [documentation source](docs/index.md) is also available in this repository.
|
|
51
|
+
|
|
52
|
+
## License and citation
|
|
53
|
+
|
|
54
|
+
Project-owned code is offered under [MIT](LICENSE). See [NOTICE](NOTICE.md) for its scope and third-party sources. Third-party publications, official DPC data and master files are not relicensed. See [CITATION.cff](CITATION.cff) for citation metadata and cite the original methods and DPC specification where applicable.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
[日本語 README](README_ja.md)
|
|
2
|
+
|
|
3
|
+
# Open DPC JP
|
|
4
|
+
|
|
5
|
+
**Open Diagnosis Procedure Combination for Japan** is a Python library for structurally reading Japanese DPC FF1 and EF data with explicit year and revision profiles. It also provides versioned Charlson Comorbidity Index definitions. The first public release is `0.1.0`.
|
|
6
|
+
|
|
7
|
+
## Scope
|
|
8
|
+
|
|
9
|
+
The core interface is a library API. DPC extraction scripts are separate utilities in this repository. The browser-only Patient List Generator creates the CSV those scripts consume. The library does not include clinical patient data, official master files, CaseCurator application rules, storage, or REDCap exports. Structural parsing is not a complete DPC submission or clinical validity check.
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
Python 3.12 or newer is required.
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
python -m pip install open-dpc-jp
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Quick start
|
|
20
|
+
|
|
21
|
+
```python
|
|
22
|
+
from pathlib import Path
|
|
23
|
+
from open_dpc_jp.parsing import parse_ef, parse_ff1
|
|
24
|
+
|
|
25
|
+
ef = parse_ef(Path("EFn.txt"), source_kind="efn", dataset_year=2025)
|
|
26
|
+
ff1 = parse_ff1(Path("FF1.txt"), schema_id="dpc-2025-20250530")
|
|
27
|
+
print(ef["diagnostics"], ff1["schema"])
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Supported data and documentation
|
|
31
|
+
|
|
32
|
+
Versioned structural profiles cover DPC years 2014–2026, with explicit revisions where needed. Source coverage and limits are recorded in `spec/dpc/source_ledger.json`. See the [Japanese documentation](https://open-dpc-jp.pages.dev/) for usage, methods, supported inputs, extraction, and the Patient List CSV contract. The [documentation source](docs/index.md) is also available in this repository.
|
|
33
|
+
|
|
34
|
+
## License and citation
|
|
35
|
+
|
|
36
|
+
Project-owned code is offered under [MIT](LICENSE). See [NOTICE](NOTICE.md) for its scope and third-party sources. Third-party publications, official DPC data and master files are not relicensed. See [CITATION.cff](CITATION.cff) for citation metadata and cite the original methods and DPC specification where applicable.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
[English README](README.md)
|
|
2
|
+
|
|
3
|
+
# Open DPC JP
|
|
4
|
+
|
|
5
|
+
**Open Diagnosis Procedure Combination for Japan** は、日本の DPC FF1/EF データを年度・改訂別 profile に基づき構造的に読み込む Python ライブラリです。版付き Charlson Comorbidity Index 定義も提供します。公開初版は `0.1.0` です。
|
|
6
|
+
|
|
7
|
+
## 範囲
|
|
8
|
+
|
|
9
|
+
core の入口は library API です。DPC 抽出 script は同じ repository の別 utility として公開します。ブラウザ専用 Patient List Generator は抽出用 CSV を作成します。臨床患者データ、公式マスタ、CaseCurator の研究別規則・保存・REDCap export は含みません。構造的読込は DPC 提出や臨床妥当性の完全な検証ではありません。
|
|
10
|
+
|
|
11
|
+
## 導入
|
|
12
|
+
|
|
13
|
+
Python 3.12 以降が必要です。
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
python -m pip install open-dpc-jp
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## 最小例
|
|
20
|
+
|
|
21
|
+
```python
|
|
22
|
+
from pathlib import Path
|
|
23
|
+
from open_dpc_jp.parsing import parse_ef, parse_ff1
|
|
24
|
+
|
|
25
|
+
ef = parse_ef(Path("EFn.txt"), source_kind="efn", dataset_year=2025)
|
|
26
|
+
ff1 = parse_ff1(Path("FF1.txt"), schema_id="dpc-2025-20250530")
|
|
27
|
+
print(ef["diagnostics"], ff1["schema"])
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## 対応データと文書
|
|
31
|
+
|
|
32
|
+
2014–2026 年の構造的 profile を収録し、必要な年度は改訂を区別します。出典と制約は `spec/dpc/source_ledger.json` に記録しています。使い方、方法、入力仕様、抽出、Patient List CSV 契約は[日本語ドキュメント](https://open-dpc-jp.pages.dev/)を参照してください。[ドキュメントの原稿](docs/index.md)も repository で公開しています。
|
|
33
|
+
|
|
34
|
+
## ライセンスと引用
|
|
35
|
+
|
|
36
|
+
project-owned code は [MIT](LICENSE) で提供します。適用範囲と第三者資料は [NOTICE](NOTICE.md) を参照してください。第三者の論文、公式 DPC データ、マスタを再ライセンスしません。引用情報は [CITATION.cff](CITATION.cff) を参照し、必要に応じて原著と DPC 仕様も引用してください。
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Open DPC JP 0.1.0 release gate
|
|
2
|
+
|
|
3
|
+
The maintainer confirmed publication rights and reviewed the candidate on 2026-09-26. The repository remains private until the final release steps below are performed.
|
|
4
|
+
|
|
5
|
+
## Owner decisions and external setup
|
|
6
|
+
|
|
7
|
+
- [x] Maintainer attested on 2026-09-26 that institutional and contributor permission for the extracted Python core, extraction scripts, DPC/CCI definitions, and synthetic fixtures under MIT has been confirmed. This is the maintainer's attestation, not an independent legal opinion.
|
|
8
|
+
- [x] Set citation author to Shoya Wada, ORCID 0000-0001-7055-1009, and intended repository owner to `sy-wada` as confirmed by the maintainer.
|
|
9
|
+
- [x] Maintainer confirmed the candidate files and third-party source terms; `NOTICE.md` records the distribution scope.
|
|
10
|
+
- [x] Set the author, ORCID, and repository URL in `CITATION.cff`.
|
|
11
|
+
- [ ] Add `date-released` to `CITATION.cff` on the actual release date, then rebuild and recheck the distributions before tagging.
|
|
12
|
+
- [x] Create private `sy-wada/open-dpc-jp` without importing the private `casecurator-research` Git history.
|
|
13
|
+
- [x] Use the `testpypi` environment and Trusted Publisher to upload `0.1.0`, then verify a clean TestPyPI install. Do not try to upload that version to TestPyPI again.
|
|
14
|
+
- [ ] Confirm the production PyPI Trusted Publisher uses owner `sy-wada`, repository `open-dpc-jp`, workflow `release.yml`, and GitHub environment `pypi`. No repository token or environment secret is needed for OIDC.
|
|
15
|
+
- [x] Configure Cloudflare Pages with build command `python -m pip install zensical==0.0.63 && python build_site.py`, output `site`, holding production branch `pages-hold`, and `main` previews. The maintainer confirmed the candidate preview, including the CSP and CSV download.
|
|
16
|
+
|
|
17
|
+
## Technical checks before release
|
|
18
|
+
|
|
19
|
+
- [x] Run Python 3.12/3.13/3.14 on Windows, macOS and Linux, plus the browser CSV and Windows PowerShell extraction tests. The maintainer confirmed the corrected Actions run passed.
|
|
20
|
+
- [x] Build the documentation and inspect the `main` preview, browser utility, scoped CSP, and CSV download. Record the exact preview URL in the private handoff log if available.
|
|
21
|
+
- [x] Build and check wheel/sdist, run conformance, and verify a clean TestPyPI install of `0.1.0`.
|
|
22
|
+
- [x] Add the repository and documentation URLs to README and package metadata.
|
|
23
|
+
- [ ] Review the final `PUBLICATION-MANIFEST.json` and distribution hashes after the release-date edit.
|
|
24
|
+
- [ ] Compare release tag `v0.1.0`, package metadata, CHANGELOG, CITATION, GitHub Release and deployed docs version. Make the repository public and publish only after the owner confirms the final release commit.
|
|
25
|
+
- [ ] After publishing, install from production PyPI in a clean environment, import `open_dpc_jp`, run a minimal API call, and verify README rendering and links.
|
|
26
|
+
|
|
27
|
+
The [official Zensical build instructions](https://zensical.org/docs/usage/build/), [PyPI Trusted Publishing guide](https://docs.pypi.org/trusted-publishers/using-a-publisher/), and [Cloudflare Pages build configuration](https://developers.cloudflare.com/pages/configuration/build-configuration/) should be rechecked at the time of release.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"""Build Zensical docs and copy the browser-only generator into the site tree."""
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
import shutil
|
|
4
|
+
import subprocess
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
ROOT = Path(__file__).resolve().parent
|
|
8
|
+
WEB = ROOT / "web"
|
|
9
|
+
DESTINATION = ROOT / "site" / "tools" / "patient-list-generator"
|
|
10
|
+
ASSETS = ("index.html", "style.css", "app.mjs", "csv.mjs")
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def stage() -> None:
|
|
14
|
+
DESTINATION.mkdir(parents=True, exist_ok=True)
|
|
15
|
+
for name in ASSETS:
|
|
16
|
+
source = WEB / name
|
|
17
|
+
if source.is_symlink() or not source.is_file():
|
|
18
|
+
raise ValueError(f"invalid browser asset: {name}")
|
|
19
|
+
shutil.copyfile(source, DESTINATION / name)
|
|
20
|
+
(ROOT / "site" / "_headers").write_text(
|
|
21
|
+
"/tools/patient-list-generator/*\n"
|
|
22
|
+
" Content-Security-Policy: default-src 'self'; script-src 'self'; style-src 'self'; "
|
|
23
|
+
"img-src 'self' data:; connect-src 'none'; form-action 'none'; base-uri 'none'; "
|
|
24
|
+
"object-src 'none'; frame-ancestors 'none'\n"
|
|
25
|
+
" Referrer-Policy: no-referrer\n"
|
|
26
|
+
" X-Content-Type-Options: nosniff\n"
|
|
27
|
+
" X-Frame-Options: DENY\n"
|
|
28
|
+
" Permissions-Policy: camera=(), microphone=(), geolocation=()\n",
|
|
29
|
+
encoding="utf-8",
|
|
30
|
+
)
|
|
31
|
+
print(f"Site ready: {ROOT / 'site'}")
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def build() -> None:
|
|
35
|
+
subprocess.run(["zensical", "build", "--strict"], cwd=ROOT, check=True)
|
|
36
|
+
stage()
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
if __name__ == "__main__":
|
|
40
|
+
build()
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"__init__.py": [],
|
|
3
|
+
"discovery.py": [
|
|
4
|
+
"classify_dpc_file",
|
|
5
|
+
"discover_dpc_files_for_case"
|
|
6
|
+
],
|
|
7
|
+
"disease_master.py": [
|
|
8
|
+
"normalize_icd10",
|
|
9
|
+
"DiseaseMasterEntry",
|
|
10
|
+
"DiagnosisCodeResolution",
|
|
11
|
+
"DiseaseMaster",
|
|
12
|
+
"load_disease_master"
|
|
13
|
+
],
|
|
14
|
+
"ef.py": [
|
|
15
|
+
"normalize_ef_date",
|
|
16
|
+
"ef_period_end_date",
|
|
17
|
+
"is_ef_parent_row",
|
|
18
|
+
"is_comment_row",
|
|
19
|
+
"is_efg_diagnosis_row",
|
|
20
|
+
"split_ef17",
|
|
21
|
+
"normalize_ef_record",
|
|
22
|
+
"read_ef_file"
|
|
23
|
+
],
|
|
24
|
+
"ff1_all_payloads.py": [
|
|
25
|
+
"is_header_row",
|
|
26
|
+
"payload",
|
|
27
|
+
"format_date",
|
|
28
|
+
"maybe_date",
|
|
29
|
+
"maybe_int",
|
|
30
|
+
"maybe_float",
|
|
31
|
+
"join_non_empty",
|
|
32
|
+
"base_record",
|
|
33
|
+
"add_raw_payloads",
|
|
34
|
+
"generic_payload_extractor",
|
|
35
|
+
"diagnosis_extractor",
|
|
36
|
+
"split_child_pugh",
|
|
37
|
+
"A000010",
|
|
38
|
+
"A000020",
|
|
39
|
+
"A000030",
|
|
40
|
+
"A000031",
|
|
41
|
+
"A000040",
|
|
42
|
+
"A001010",
|
|
43
|
+
"A006010",
|
|
44
|
+
"A006020",
|
|
45
|
+
"A006030",
|
|
46
|
+
"A006031",
|
|
47
|
+
"A006040",
|
|
48
|
+
"A006050",
|
|
49
|
+
"A006060",
|
|
50
|
+
"M120010",
|
|
51
|
+
"M060010",
|
|
52
|
+
"extract_one_record",
|
|
53
|
+
"extract_info_from_dpc_ff1",
|
|
54
|
+
"extract_info_from_dpc_ff1_flat"
|
|
55
|
+
],
|
|
56
|
+
"master_archive.py": [
|
|
57
|
+
"read_disease_archive"
|
|
58
|
+
],
|
|
59
|
+
"medication_periods.py": [
|
|
60
|
+
"derive_medication_period",
|
|
61
|
+
"medication_period_is_positionable",
|
|
62
|
+
"merge_medication_periods"
|
|
63
|
+
],
|
|
64
|
+
"variables.py": []
|
|
65
|
+
}
|