Skip to main content

jpomop

jpomop converts Japanese DPC inpatient data to the OMOP Common Data Model v5.4. It reads two DPC files: Form 1 (様式1) and the EF file (入院EF統合ファイル).

I wrote jpomop using the public DPC specification from the Ministry of Health, Labour and Welfare. This repository has no hospital data or code masters.

Status

jpomop is in early development. It can read and check the two files and write eight CDM tables. I tested it with synthetic data and the examples in the specification. I have not tried it with real hospital data or measured mapping rates with a full Athena vocabulary yet.

I plan to release v0.1 at the end of November 2026.

Try it

pip install jpomop
jpomop synth --n 100 --out synth/
jpomop validate --yoshiki1 synth/yoshiki1.txt --ef synth/ef.txt
jpomop convert --yoshiki1 synth/yoshiki1.txt --ef synth/ef.txt --out cdm.duckdb
jpomop report --cdm cdm.duckdb

synth makes fake data for 100 patients, and you can change the number with --n.

validate checks the files against the FY2026 specification and lists the problems it finds.

Without --vocab, the concept IDs for diagnoses and drugs are 0. The original codes stay in the source value columns. To map diagnoses and drugs, build a vocabulary first:

jpomop vocab build --athena athena/ --drug-master y_ALL20261001.csv \
    --kimura rxnorm_mapping.tsv --out vocab.duckdb
jpomop convert ... --vocab vocab.duckdb

You need the following three sources, and you must download them yourself.

Walkthrough

examples/walkthrough_en.ipynb runs every step on 100 invented patients. It shows the input files, the checks and each CDM table for one patient. A Japanese version is in examples/walkthrough_ja.ipynb.

How each part is converted

DPC CDM table Notes
Form 1, one form per stay person, visit_occurrence, observation_period Patient IDs are hashed. Some form types are counted but not converted. See below.
EF, ward code for each day visit_detail One row for each run of days on the same ward.
Form 1, diagnoses (ICD-10) condition_occurrence Form 1 has no date for each diagnosis, so the start date is the admission date. Suspected diagnoses (modifier 8002) are left out and counted.
EF, codes that start with 6 drug_exposure Mapped through the NHI drug price code. Drugs that patients bring from home are left out.
EF, codes that start with 1 procedure_occurrence The concept ID is 0 for now. The DPC code stays as the source value. Room and meal charges are left out.
Form 1, discharge outcome 6 or 7 death The death date is the discharge date.

Form 1 has several form types, and jpomop uses the form for the whole stay. It uses the day-90 interim form only when the stay has no whole-stay form yet. It counts the ward-group forms and the readmission forms, but it does not convert them. These forms cover the same days as the whole-stay forms (specification p42 and p125).

Code masters are not included

The code masters (基本マスター) come from 医療情報基盤・診療報酬審査支払機構. The website terms say that its documents may not be used or copied without permission. So this repository does not include the masters. Please download them from https://www.hpdx.or.jp/seikyushiharai/tensuhyo/kihonmasta/index.html.

Sources

Each field in the specification files shows the document, the version and the page. See PROVENANCE.md.

Licence

The code uses the Apache-2.0 licence. Mapping tables made by this project use CC BY 4.0. See LICENSE-DATA.


日本語

厚生労働省が公開している DPC 調査の仕様(様式1・入院EF統合ファイル)だけを元に、DPC データを OMOP CDM v5.4 へ変換する Python のプログラムです。病院の実データとマスターは含みません。動作の確認には、このリポジトリで作る架空データと、仕様書の記載例だけを使っています。

読み込み・仕様の確認・8つの表への変換までできています。病院の実データでの確認と、Athena の語彙一式での変換率の測定はこれからです。

架空の患者 100 人のデータで最初から最後まで動かした例を、examples/walkthrough_ja.ipynb に置いています。

マスターは、医療情報基盤・診療報酬審査支払機構のサイトから各自でダウンロードしてください。

Metadata

Release files for jpomop 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jpomop 0.0.1
File Size Uploaded Provenance Actions
jpomop-0.0.1.tar.gz 79.9 kB Without provenance Details for jpomop-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jpomop 0.0.1
File Interpreter ABI Platform Actions
jpomop-0.0.1-py3-none-any.whl Python 3 none any Details for jpomop-0.0.1-py3-none-any.whl

Total release size: 122.3 kB

Release files / jpomop-0.0.1.tar.gz

Download URL jpomop-0.0.1.tar.gz
Size 79.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d7e91cb0860dcad6374ac53ccfb4d78cca182e00bbeefdadcb6ad2a5769cd070
BLAKE2b-256 checksum
How to use checksums
10c8062e5f7094212c66459e42bade915dfdd244d65771a0beb48315a63d5350
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / jpomop-0.0.1-py3-none-any.whl

Download URL jpomop-0.0.1-py3-none-any.whl
Size 42.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
063443c88bb98897bfa3eef24b1039e54d7ffc116016a2150751f27c8c66197f
BLAKE2b-256 checksum
How to use checksums
5476750fbefa79a1a5c0ea9c5d8278ac69bbd80d437d92c7f6ba57bda6949dd3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for jpomop 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page