codedx 0.1.0__tar.gz → 0.2.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.
- {codedx-0.1.0 → codedx-0.2.0}/.gitignore +4 -2
- {codedx-0.1.0 → codedx-0.2.0}/PKG-INFO +10 -3
- {codedx-0.1.0 → codedx-0.2.0}/README.md +9 -2
- {codedx-0.1.0 → codedx-0.2.0}/hatch_build.py +2 -2
- {codedx-0.1.0 → codedx-0.2.0}/pyproject.toml +1 -1
- {codedx-0.1.0 → codedx-0.2.0}/src/codedx/__init__.py +1 -1
- {codedx-0.1.0 → codedx-0.2.0}/src/codedx/icd10se.py +6 -6
- {codedx-0.1.0 → codedx-0.2.0}/src/codedx/_core.py +0 -0
- {codedx-0.1.0 → codedx-0.2.0}/src/codedx/icd10cm.py +0 -0
- {codedx-0.1.0 → codedx-0.2.0}/src/codedx/icd10who.py +0 -0
- {codedx-0.1.0 → codedx-0.2.0}/src/codedx/ksh97p.py +0 -0
- {codedx-0.1.0 → codedx-0.2.0}/src/codedx/rehab.py +0 -0
|
@@ -10,8 +10,10 @@ wheels/
|
|
|
10
10
|
# Virtual environments
|
|
11
11
|
.venv
|
|
12
12
|
|
|
13
|
-
#
|
|
14
|
-
|
|
13
|
+
# environment file. may contain secrets.
|
|
14
|
+
.env
|
|
15
|
+
|
|
16
|
+
# agent config is not part of the project.
|
|
15
17
|
.claude
|
|
16
18
|
|
|
17
19
|
# Downloaded at build time — not committed
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codedx
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Swedish medical coding used for diagnosis codes
|
|
5
5
|
Author-email: Ludvig Hult <ludvig.hult@gmail.com>
|
|
6
6
|
Requires-Python: >=3.12
|
|
@@ -46,6 +46,13 @@ Dots are dropped throughout, matching what is typically found in databases: `A01
|
|
|
46
46
|
pip install codedx
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
Downloads data at install time from
|
|
49
|
+
Downloads data at install time from Ehälsomyndigheten, WHO, and CDC. Raw files are not redistributed due to licence restrictions.
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
## Changelog
|
|
52
|
+
|
|
53
|
+
### 0.2.0
|
|
54
|
+
- ICD-10-SE and history file now downloaded from Ehälsomyndigheten (replacing Socialstyrelsen URLs)
|
|
55
|
+
- Retired code lookup now uses the comprehensive history file (`historik-icd-10-se-1997-2026.xlsx`) covering all codes 1997–2026, instead of the partial inactivation list
|
|
56
|
+
|
|
57
|
+
### 0.1.0
|
|
58
|
+
- Initial release
|
|
@@ -36,6 +36,13 @@ Dots are dropped throughout, matching what is typically found in databases: `A01
|
|
|
36
36
|
pip install codedx
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
Downloads data at install time from
|
|
39
|
+
Downloads data at install time from Ehälsomyndigheten, WHO, and CDC. Raw files are not redistributed due to licence restrictions.
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
## Changelog
|
|
42
|
+
|
|
43
|
+
### 0.2.0
|
|
44
|
+
- ICD-10-SE and history file now downloaded from Ehälsomyndigheten (replacing Socialstyrelsen URLs)
|
|
45
|
+
- Retired code lookup now uses the comprehensive history file (`historik-icd-10-se-1997-2026.xlsx`) covering all codes 1997–2026, instead of the partial inactivation list
|
|
46
|
+
|
|
47
|
+
### 0.1.0
|
|
48
|
+
- Initial release
|
|
@@ -40,8 +40,8 @@ _MULTI_ZIPS = [
|
|
|
40
40
|
"icd10se_latest.zip",
|
|
41
41
|
"ICD-10-SE latest release (~15 MB)",
|
|
42
42
|
[
|
|
43
|
-
("icd-10-se.tsv", "https://
|
|
44
|
-
("
|
|
43
|
+
("icd-10-se.tsv", "https://samarbetsyta.ehalsomyndigheten.se/download/attachments/451267009/icd-10-se.tsv?api=v2"),
|
|
44
|
+
("historik-icd-10-se-1997-2026.xlsx", "https://samarbetsyta.ehalsomyndigheten.se/download/attachments/451267009/historik-icd-10-se-1997-2026%20%281%29.xlsx?api=v2"),
|
|
45
45
|
],
|
|
46
46
|
),
|
|
47
47
|
]
|
|
@@ -52,19 +52,19 @@ def _build_retired(work_dir: pathlib.Path) -> pl.DataFrame:
|
|
|
52
52
|
"Code": pl.Series([], dtype=pl.String),
|
|
53
53
|
"Titel": pl.Series([], dtype=pl.String),
|
|
54
54
|
})
|
|
55
|
-
|
|
56
|
-
if not
|
|
55
|
+
historik = work_dir / "historik-icd-10-se-1997-2026.xlsx"
|
|
56
|
+
if not historik.exists():
|
|
57
57
|
return _empty
|
|
58
58
|
try:
|
|
59
|
-
df = pl.read_excel(
|
|
59
|
+
df = pl.read_excel(historik)
|
|
60
60
|
except Exception:
|
|
61
61
|
return _empty
|
|
62
|
-
if "
|
|
62
|
+
if "Giltig till" not in df.columns:
|
|
63
63
|
return _empty
|
|
64
64
|
return (
|
|
65
|
-
df.filter(pl.col("
|
|
65
|
+
df.filter(pl.col("Giltig till").is_not_null() & (pl.col("Giltig till") != ""))
|
|
66
66
|
.select(
|
|
67
|
-
pl.col("
|
|
67
|
+
pl.col("Kod").str.replace_all("\\.", "").alias("Code"),
|
|
68
68
|
pl.col("Titel"),
|
|
69
69
|
)
|
|
70
70
|
.unique("Code")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|