medrecords 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.
- medrecords-0.1.0/PKG-INFO +198 -0
- medrecords-0.1.0/README.md +166 -0
- medrecords-0.1.0/medrecords/__init__.py +268 -0
- medrecords-0.1.0/medrecords/evaluation/__init__.py +74 -0
- medrecords-0.1.0/medrecords/evaluation/_run.py +192 -0
- medrecords-0.1.0/medrecords/evaluation/analytic.py +785 -0
- medrecords-0.1.0/medrecords/evaluation/catalogue/__init__.py +47 -0
- medrecords-0.1.0/medrecords/evaluation/catalogue/attributes.py +456 -0
- medrecords-0.1.0/medrecords/evaluation/catalogue/quality.py +254 -0
- medrecords-0.1.0/medrecords/evaluation/catalogue/structure.py +146 -0
- medrecords-0.1.0/medrecords/evaluation/document.py +168 -0
- medrecords-0.1.0/medrecords/evaluation/evaluation.py +207 -0
- medrecords-0.1.0/medrecords/evaluation/group.py +498 -0
- medrecords-0.1.0/medrecords/evaluation/report.py +1865 -0
- medrecords-0.1.0/medrecords/evaluation/results.py +160 -0
- medrecords-0.1.0/medrecords/evaluation/template/Inter-LICENSE.txt +92 -0
- medrecords-0.1.0/medrecords/evaluation/template/InterVariable-Italic.ttf +0 -0
- medrecords-0.1.0/medrecords/evaluation/template/InterVariable.ttf +0 -0
- medrecords-0.1.0/medrecords/evaluation/template/logo.svg +9 -0
- medrecords-0.1.0/medrecords/evaluation/template/report.typ +808 -0
- medrecords-0.1.0/medrecords/medrecord.py +923 -0
- medrecords-0.1.0/medrecords/omop.py +656 -0
- medrecords-0.1.0/medrecords/plugin.py +762 -0
- medrecords-0.1.0/medrecords.egg-info/PKG-INFO +198 -0
- medrecords-0.1.0/medrecords.egg-info/SOURCES.txt +31 -0
- medrecords-0.1.0/medrecords.egg-info/dependency_links.txt +1 -0
- medrecords-0.1.0/medrecords.egg-info/requires.txt +5 -0
- medrecords-0.1.0/medrecords.egg-info/top_level.txt +1 -0
- medrecords-0.1.0/pyproject.toml +180 -0
- medrecords-0.1.0/setup.cfg +4 -0
- medrecords-0.1.0/tests/test_medrecord.py +463 -0
- medrecords-0.1.0/tests/test_omop.py +777 -0
- medrecords-0.1.0/tests/test_plugin.py +157 -0
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: medrecords
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: MedModels MedRecords Package
|
|
5
|
+
Project-URL: Repository, https://github.com/medmodels/medrecords
|
|
6
|
+
Project-URL: Documentation, https://www.medmodels.de/docs/medrecords/latest/index.html
|
|
7
|
+
Classifier: Development Status :: 3 - Alpha
|
|
8
|
+
Classifier: Intended Audience :: Developers
|
|
9
|
+
Classifier: Intended Audience :: Healthcare Industry
|
|
10
|
+
Classifier: Intended Audience :: Science/Research
|
|
11
|
+
Classifier: Operating System :: MacOS :: MacOS X
|
|
12
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
13
|
+
Classifier: Operating System :: POSIX
|
|
14
|
+
Classifier: Operating System :: Unix
|
|
15
|
+
Classifier: Programming Language :: Python
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
22
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
23
|
+
Classifier: Topic :: Scientific/Engineering
|
|
24
|
+
Classifier: Topic :: Software Development
|
|
25
|
+
Classifier: Typing :: Typed
|
|
26
|
+
Requires-Python: >=3.10
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
Requires-Dist: graphrecords>=0.7.0
|
|
29
|
+
Requires-Dist: polars>=1.6.0
|
|
30
|
+
Provides-Extra: pdf
|
|
31
|
+
Requires-Dist: typst>=0.15.0; extra == "pdf"
|
|
32
|
+
|
|
33
|
+
<div align="center">
|
|
34
|
+
<img alt="Python Versions" src="https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue">
|
|
35
|
+
<a href="https://github.com/medmodels/medrecords/actions/workflows/testing.yml">
|
|
36
|
+
<img src="https://github.com/medmodels/medrecords/actions/workflows/testing.yml/badge.svg?branch=main" alt="Tests">
|
|
37
|
+
</a>
|
|
38
|
+
<a href="https://pypi.org/project/medrecords/">
|
|
39
|
+
<img src="https://img.shields.io/pypi/v/medrecords" alt="PyPI Version">
|
|
40
|
+
</a>
|
|
41
|
+
<a href="https://github.com/astral-sh/ruff">
|
|
42
|
+
<img alt="Code Style" src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json">
|
|
43
|
+
</a>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
# MedRecords
|
|
47
|
+
|
|
48
|
+
MedRecords is an opinionated wrapper around [GraphRecords](https://github.com/medmodels/graphrecords) for medical data. It puts a graph record to work in a medical context and makes it the input medical analyses and products run on.
|
|
49
|
+
|
|
50
|
+
## Installation
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pip install medrecords
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Rendering a report to PDF needs the `pdf` extra:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
pip install medrecords[pdf]
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Building a Record
|
|
63
|
+
|
|
64
|
+
Every call returns a new record:
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
import medrecords as mr
|
|
68
|
+
|
|
69
|
+
medrecord = (
|
|
70
|
+
mr.MedRecord()
|
|
71
|
+
.add_nodes_in_group(
|
|
72
|
+
[
|
|
73
|
+
("p1", {"gender": "F", "age": 71}),
|
|
74
|
+
("p2", {"gender": "M", "age": 64}),
|
|
75
|
+
("p3", {"gender": "F", "age": 38}),
|
|
76
|
+
],
|
|
77
|
+
"Patient",
|
|
78
|
+
)
|
|
79
|
+
.add_nodes_in_group(
|
|
80
|
+
[("I10", {"label": "Essential hypertension"})],
|
|
81
|
+
"Diagnosis",
|
|
82
|
+
)
|
|
83
|
+
.add_edges_in_group(
|
|
84
|
+
[("p1", "I10", {"year": 2019}), ("p2", "I10", {"year": 2021})],
|
|
85
|
+
"Patient_Diagnosis",
|
|
86
|
+
)
|
|
87
|
+
)
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
`add_nodes` and `add_edges` do the same without a group. Polars DataFrames work as a source, naming the index columns: `add_nodes((frame, "patient_id"))`, `add_edges((frame, "patient_id", "diagnosis_id"))`.
|
|
91
|
+
|
|
92
|
+
## Reading a Record
|
|
93
|
+
|
|
94
|
+
```python
|
|
95
|
+
medrecord.node_count() # 4
|
|
96
|
+
medrecord.group_indices() # ['Patient', 'Diagnosis', 'Patient_Diagnosis']
|
|
97
|
+
medrecord.group("Patient").nodes() # ['p1', 'p2', 'p3']
|
|
98
|
+
|
|
99
|
+
patient = medrecord.node("p1")
|
|
100
|
+
patient.attributes() # {'gender': 'F', 'age': 71}
|
|
101
|
+
patient.groups() # ['Patient']
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Querying
|
|
105
|
+
|
|
106
|
+
`mr.nodes()` and `mr.edges()` start an expression tied to no record. `medrecord.nodes()` binds one to a record, which makes it a series. A series runs when you call `evaluate()`.
|
|
107
|
+
|
|
108
|
+
```python
|
|
109
|
+
older = medrecord.nodes().filter(
|
|
110
|
+
mr.nodes().in_group("Patient") & (mr.nodes().attribute("age") > 60)
|
|
111
|
+
)
|
|
112
|
+
list(older.evaluate()) # ['p1', 'p2']
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
```python
|
|
116
|
+
diagnosed = (
|
|
117
|
+
medrecord.edges().filter(mr.edges().in_group("Patient_Diagnosis")).source_node()
|
|
118
|
+
)
|
|
119
|
+
list(diagnosed.evaluate()) # ['p1', 'p2']
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
```python
|
|
123
|
+
medrecord.nodes().filter(mr.nodes().in_group("Patient")).attribute("age").mean().evaluate()
|
|
124
|
+
# 57.666666666666664
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
`medrecord.query(expression)` binds a free expression the same way.
|
|
128
|
+
|
|
129
|
+
## Evaluations
|
|
130
|
+
|
|
131
|
+
An analytic is a class with one `compute` that returns one value. Analytics go into groups, groups into an evaluation:
|
|
132
|
+
|
|
133
|
+
```python
|
|
134
|
+
from typing import Union
|
|
135
|
+
|
|
136
|
+
from medrecords.evaluation import Analytic, Evaluation, EvaluationGroup, read
|
|
137
|
+
from medrecords.evaluation.catalogue import AttributeCounts, AttributeMean, ElementCount
|
|
138
|
+
|
|
139
|
+
PATIENTS = mr.nodes().filter(mr.nodes().in_group("Patient"))
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
class OldestPatient(Analytic[mr.MedRecord]):
|
|
143
|
+
"""The age of the oldest patient."""
|
|
144
|
+
|
|
145
|
+
def compute(self, medrecord: mr.MedRecord) -> Union[mr.Value, mr.QueryError]:
|
|
146
|
+
return read(medrecord.query(PATIENTS).attribute("age").max().evaluate(), int)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
evaluation = (
|
|
150
|
+
Evaluation[mr.MedRecord]("Practice snapshot")
|
|
151
|
+
.add_group(
|
|
152
|
+
"Demographics",
|
|
153
|
+
EvaluationGroup[mr.MedRecord]()
|
|
154
|
+
.add_analytic("Patients", ElementCount(PATIENTS))
|
|
155
|
+
.add_analytic("Mean age", AttributeMean("age", PATIENTS))
|
|
156
|
+
.add_analytic("Sex", AttributeCounts("gender", PATIENTS)),
|
|
157
|
+
)
|
|
158
|
+
.add_analytic("Oldest", OldestPatient())
|
|
159
|
+
)
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
The report is read by name:
|
|
163
|
+
|
|
164
|
+
```python
|
|
165
|
+
report = evaluation.report(medrecord)
|
|
166
|
+
|
|
167
|
+
report.group("Demographics").analytic("Patients").result # 3
|
|
168
|
+
report.group("Demographics").analytic("Mean age").result # 57.666666666666664
|
|
169
|
+
report.analytic("Oldest").result # 71
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
A result is a number or a string, or one of `Table`, `Plot`, `Measurement`, `Assessment` and `Distribution`. `report.group("Demographics").analytic("Sex").result.to_polars()` gives
|
|
173
|
+
|
|
174
|
+
```
|
|
175
|
+
┌───────┬───────┬──────────┐
|
|
176
|
+
│ value ┆ count ┆ share │
|
|
177
|
+
╞═══════╪═══════╪══════════╡
|
|
178
|
+
│ F ┆ 2 ┆ 0.666667 │
|
|
179
|
+
│ M ┆ 1 ┆ 0.333333 │
|
|
180
|
+
└───────┴───────┴──────────┘
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
`medrecords.evaluation.catalogue` holds analytics for counts, attribute statistics, completeness, ranges and uniqueness. `add_group_over` and `add_group_over_each` run a group against something derived from the record, a cohort or one part per attribute value.
|
|
184
|
+
|
|
185
|
+
JSON and PDF are exports:
|
|
186
|
+
|
|
187
|
+
```python
|
|
188
|
+
from medrecords.evaluation import Document, Report
|
|
189
|
+
|
|
190
|
+
report.to_json("report.json")
|
|
191
|
+
Report.from_json("report.json")
|
|
192
|
+
|
|
193
|
+
Document(report).to_pdf("report.pdf") # needs the pdf extra
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## Documentation
|
|
197
|
+
|
|
198
|
+
- [Documentation](https://www.medmodels.de/docs/medrecords/latest/index.html)
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img alt="Python Versions" src="https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue">
|
|
3
|
+
<a href="https://github.com/medmodels/medrecords/actions/workflows/testing.yml">
|
|
4
|
+
<img src="https://github.com/medmodels/medrecords/actions/workflows/testing.yml/badge.svg?branch=main" alt="Tests">
|
|
5
|
+
</a>
|
|
6
|
+
<a href="https://pypi.org/project/medrecords/">
|
|
7
|
+
<img src="https://img.shields.io/pypi/v/medrecords" alt="PyPI Version">
|
|
8
|
+
</a>
|
|
9
|
+
<a href="https://github.com/astral-sh/ruff">
|
|
10
|
+
<img alt="Code Style" src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json">
|
|
11
|
+
</a>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
# MedRecords
|
|
15
|
+
|
|
16
|
+
MedRecords is an opinionated wrapper around [GraphRecords](https://github.com/medmodels/graphrecords) for medical data. It puts a graph record to work in a medical context and makes it the input medical analyses and products run on.
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pip install medrecords
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Rendering a report to PDF needs the `pdf` extra:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pip install medrecords[pdf]
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Building a Record
|
|
31
|
+
|
|
32
|
+
Every call returns a new record:
|
|
33
|
+
|
|
34
|
+
```python
|
|
35
|
+
import medrecords as mr
|
|
36
|
+
|
|
37
|
+
medrecord = (
|
|
38
|
+
mr.MedRecord()
|
|
39
|
+
.add_nodes_in_group(
|
|
40
|
+
[
|
|
41
|
+
("p1", {"gender": "F", "age": 71}),
|
|
42
|
+
("p2", {"gender": "M", "age": 64}),
|
|
43
|
+
("p3", {"gender": "F", "age": 38}),
|
|
44
|
+
],
|
|
45
|
+
"Patient",
|
|
46
|
+
)
|
|
47
|
+
.add_nodes_in_group(
|
|
48
|
+
[("I10", {"label": "Essential hypertension"})],
|
|
49
|
+
"Diagnosis",
|
|
50
|
+
)
|
|
51
|
+
.add_edges_in_group(
|
|
52
|
+
[("p1", "I10", {"year": 2019}), ("p2", "I10", {"year": 2021})],
|
|
53
|
+
"Patient_Diagnosis",
|
|
54
|
+
)
|
|
55
|
+
)
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
`add_nodes` and `add_edges` do the same without a group. Polars DataFrames work as a source, naming the index columns: `add_nodes((frame, "patient_id"))`, `add_edges((frame, "patient_id", "diagnosis_id"))`.
|
|
59
|
+
|
|
60
|
+
## Reading a Record
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
medrecord.node_count() # 4
|
|
64
|
+
medrecord.group_indices() # ['Patient', 'Diagnosis', 'Patient_Diagnosis']
|
|
65
|
+
medrecord.group("Patient").nodes() # ['p1', 'p2', 'p3']
|
|
66
|
+
|
|
67
|
+
patient = medrecord.node("p1")
|
|
68
|
+
patient.attributes() # {'gender': 'F', 'age': 71}
|
|
69
|
+
patient.groups() # ['Patient']
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Querying
|
|
73
|
+
|
|
74
|
+
`mr.nodes()` and `mr.edges()` start an expression tied to no record. `medrecord.nodes()` binds one to a record, which makes it a series. A series runs when you call `evaluate()`.
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
older = medrecord.nodes().filter(
|
|
78
|
+
mr.nodes().in_group("Patient") & (mr.nodes().attribute("age") > 60)
|
|
79
|
+
)
|
|
80
|
+
list(older.evaluate()) # ['p1', 'p2']
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
```python
|
|
84
|
+
diagnosed = (
|
|
85
|
+
medrecord.edges().filter(mr.edges().in_group("Patient_Diagnosis")).source_node()
|
|
86
|
+
)
|
|
87
|
+
list(diagnosed.evaluate()) # ['p1', 'p2']
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
```python
|
|
91
|
+
medrecord.nodes().filter(mr.nodes().in_group("Patient")).attribute("age").mean().evaluate()
|
|
92
|
+
# 57.666666666666664
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
`medrecord.query(expression)` binds a free expression the same way.
|
|
96
|
+
|
|
97
|
+
## Evaluations
|
|
98
|
+
|
|
99
|
+
An analytic is a class with one `compute` that returns one value. Analytics go into groups, groups into an evaluation:
|
|
100
|
+
|
|
101
|
+
```python
|
|
102
|
+
from typing import Union
|
|
103
|
+
|
|
104
|
+
from medrecords.evaluation import Analytic, Evaluation, EvaluationGroup, read
|
|
105
|
+
from medrecords.evaluation.catalogue import AttributeCounts, AttributeMean, ElementCount
|
|
106
|
+
|
|
107
|
+
PATIENTS = mr.nodes().filter(mr.nodes().in_group("Patient"))
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
class OldestPatient(Analytic[mr.MedRecord]):
|
|
111
|
+
"""The age of the oldest patient."""
|
|
112
|
+
|
|
113
|
+
def compute(self, medrecord: mr.MedRecord) -> Union[mr.Value, mr.QueryError]:
|
|
114
|
+
return read(medrecord.query(PATIENTS).attribute("age").max().evaluate(), int)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
evaluation = (
|
|
118
|
+
Evaluation[mr.MedRecord]("Practice snapshot")
|
|
119
|
+
.add_group(
|
|
120
|
+
"Demographics",
|
|
121
|
+
EvaluationGroup[mr.MedRecord]()
|
|
122
|
+
.add_analytic("Patients", ElementCount(PATIENTS))
|
|
123
|
+
.add_analytic("Mean age", AttributeMean("age", PATIENTS))
|
|
124
|
+
.add_analytic("Sex", AttributeCounts("gender", PATIENTS)),
|
|
125
|
+
)
|
|
126
|
+
.add_analytic("Oldest", OldestPatient())
|
|
127
|
+
)
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
The report is read by name:
|
|
131
|
+
|
|
132
|
+
```python
|
|
133
|
+
report = evaluation.report(medrecord)
|
|
134
|
+
|
|
135
|
+
report.group("Demographics").analytic("Patients").result # 3
|
|
136
|
+
report.group("Demographics").analytic("Mean age").result # 57.666666666666664
|
|
137
|
+
report.analytic("Oldest").result # 71
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
A result is a number or a string, or one of `Table`, `Plot`, `Measurement`, `Assessment` and `Distribution`. `report.group("Demographics").analytic("Sex").result.to_polars()` gives
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
┌───────┬───────┬──────────┐
|
|
144
|
+
│ value ┆ count ┆ share │
|
|
145
|
+
╞═══════╪═══════╪══════════╡
|
|
146
|
+
│ F ┆ 2 ┆ 0.666667 │
|
|
147
|
+
│ M ┆ 1 ┆ 0.333333 │
|
|
148
|
+
└───────┴───────┴──────────┘
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
`medrecords.evaluation.catalogue` holds analytics for counts, attribute statistics, completeness, ranges and uniqueness. `add_group_over` and `add_group_over_each` run a group against something derived from the record, a cohort or one part per attribute value.
|
|
152
|
+
|
|
153
|
+
JSON and PDF are exports:
|
|
154
|
+
|
|
155
|
+
```python
|
|
156
|
+
from medrecords.evaluation import Document, Report
|
|
157
|
+
|
|
158
|
+
report.to_json("report.json")
|
|
159
|
+
Report.from_json("report.json")
|
|
160
|
+
|
|
161
|
+
Document(report).to_pdf("report.pdf") # needs the pdf extra
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Documentation
|
|
165
|
+
|
|
166
|
+
- [Documentation](https://www.medmodels.de/docs/medrecords/latest/index.html)
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
from graphrecords import (
|
|
2
|
+
DEFAULT_TRUNCATE_DETAILS,
|
|
3
|
+
AddEdges,
|
|
4
|
+
AddEdgesInGroup,
|
|
5
|
+
AddEdgesToGroup,
|
|
6
|
+
AddGroup,
|
|
7
|
+
AddNodes,
|
|
8
|
+
AddNodesInGroup,
|
|
9
|
+
AddNodesToGroup,
|
|
10
|
+
Any,
|
|
11
|
+
ArgumentMissingError,
|
|
12
|
+
ArrowTables,
|
|
13
|
+
AttributeDataType,
|
|
14
|
+
AttributeName,
|
|
15
|
+
AttributeOverview,
|
|
16
|
+
Attributes,
|
|
17
|
+
AttributeType,
|
|
18
|
+
Bool,
|
|
19
|
+
CastTarget,
|
|
20
|
+
Change,
|
|
21
|
+
Changes,
|
|
22
|
+
Clear,
|
|
23
|
+
DataType,
|
|
24
|
+
DateTime,
|
|
25
|
+
DivisionByZeroError,
|
|
26
|
+
Drop,
|
|
27
|
+
DuplicateExpandedChildIndexError,
|
|
28
|
+
DuplicateIndexError,
|
|
29
|
+
Duration,
|
|
30
|
+
EdgeBatch,
|
|
31
|
+
EdgeCollector,
|
|
32
|
+
EdgeDirection,
|
|
33
|
+
EdgeEndpointRole,
|
|
34
|
+
EdgeGroupOverview,
|
|
35
|
+
EdgeIndex,
|
|
36
|
+
EdgeSource,
|
|
37
|
+
EdgeView,
|
|
38
|
+
EmptySplitDelimiterError,
|
|
39
|
+
EvaluationCacheGraphRecordMismatchError,
|
|
40
|
+
Expression,
|
|
41
|
+
ExternalError,
|
|
42
|
+
FailureKind,
|
|
43
|
+
Float,
|
|
44
|
+
FreezeSchema,
|
|
45
|
+
GraphRecordError,
|
|
46
|
+
GroupedResult,
|
|
47
|
+
GroupIndex,
|
|
48
|
+
GroupOverview,
|
|
49
|
+
GroupSchema,
|
|
50
|
+
GroupView,
|
|
51
|
+
Identifier,
|
|
52
|
+
IncomparableIndicesError,
|
|
53
|
+
IncomparableValuesAtError,
|
|
54
|
+
IncomparableValuesError,
|
|
55
|
+
Int,
|
|
56
|
+
IntegerOverflowError,
|
|
57
|
+
InvalidCastError,
|
|
58
|
+
InvalidClipBoundsError,
|
|
59
|
+
InvalidMedianValueError,
|
|
60
|
+
InvalidPaddingCharacterError,
|
|
61
|
+
InvalidPartitionBucketArityError,
|
|
62
|
+
InvalidRegexPatternError,
|
|
63
|
+
InvalidStandardDeviationValueError,
|
|
64
|
+
InvalidStringSliceError,
|
|
65
|
+
InvalidTransitionError,
|
|
66
|
+
InvalidVarianceValueError,
|
|
67
|
+
MissingAttributeError,
|
|
68
|
+
MissingGroupAggregateError,
|
|
69
|
+
MissingGroupBucketError,
|
|
70
|
+
MissingTraversedAttributeError,
|
|
71
|
+
ModuloByZeroError,
|
|
72
|
+
NegativeSquareRootError,
|
|
73
|
+
NoChildIndexError,
|
|
74
|
+
NodeBatch,
|
|
75
|
+
NodeCollector,
|
|
76
|
+
NodeGroupOverview,
|
|
77
|
+
NodeIndex,
|
|
78
|
+
NodeSource,
|
|
79
|
+
NodeView,
|
|
80
|
+
NonIntegerValueError,
|
|
81
|
+
NonNumericValueError,
|
|
82
|
+
NonPositiveLogarithmError,
|
|
83
|
+
NonStringValueError,
|
|
84
|
+
Null,
|
|
85
|
+
OnConflict,
|
|
86
|
+
Option,
|
|
87
|
+
Overview,
|
|
88
|
+
PluginName,
|
|
89
|
+
PolarsFrames,
|
|
90
|
+
QueryError,
|
|
91
|
+
Raise,
|
|
92
|
+
RaisedFailuresError,
|
|
93
|
+
RecordBatch,
|
|
94
|
+
RemoveEdgeAttributes,
|
|
95
|
+
RemoveEdges,
|
|
96
|
+
RemoveEdgesFromGroup,
|
|
97
|
+
RemoveGroups,
|
|
98
|
+
RemoveNodeAttributes,
|
|
99
|
+
RemoveNodes,
|
|
100
|
+
RemoveNodesFromGroup,
|
|
101
|
+
Replace,
|
|
102
|
+
ReplaceEdgeAttributes,
|
|
103
|
+
ReplaceNodeAttributes,
|
|
104
|
+
ResultConsumedError,
|
|
105
|
+
ResultView,
|
|
106
|
+
RonFile,
|
|
107
|
+
Schema,
|
|
108
|
+
SchemaType,
|
|
109
|
+
Series,
|
|
110
|
+
SetEdgeAttributes,
|
|
111
|
+
SetNodeAttributes,
|
|
112
|
+
SetSchema,
|
|
113
|
+
String,
|
|
114
|
+
StringLengthOverflowError,
|
|
115
|
+
StringPaddingOverflowError,
|
|
116
|
+
UncoveredIndicesError,
|
|
117
|
+
UnfreezeSchema,
|
|
118
|
+
Union,
|
|
119
|
+
UnresolvedBucketFailuresError,
|
|
120
|
+
UnresolvedGroupKeyFailuresError,
|
|
121
|
+
UnresolvedIndexError,
|
|
122
|
+
UnsupportedValueRoleError,
|
|
123
|
+
Value,
|
|
124
|
+
ValueTarget,
|
|
125
|
+
Writer,
|
|
126
|
+
edges,
|
|
127
|
+
groups,
|
|
128
|
+
nodes,
|
|
129
|
+
querying,
|
|
130
|
+
)
|
|
131
|
+
|
|
132
|
+
from medrecords.medrecord import MedRecord
|
|
133
|
+
from medrecords.omop import OmopPlugin
|
|
134
|
+
from medrecords.plugin import Plugin
|
|
135
|
+
|
|
136
|
+
__all__ = [
|
|
137
|
+
"DEFAULT_TRUNCATE_DETAILS",
|
|
138
|
+
"AddEdges",
|
|
139
|
+
"AddEdgesInGroup",
|
|
140
|
+
"AddEdgesToGroup",
|
|
141
|
+
"AddGroup",
|
|
142
|
+
"AddNodes",
|
|
143
|
+
"AddNodesInGroup",
|
|
144
|
+
"AddNodesToGroup",
|
|
145
|
+
"Any",
|
|
146
|
+
"ArgumentMissingError",
|
|
147
|
+
"ArrowTables",
|
|
148
|
+
"AttributeDataType",
|
|
149
|
+
"AttributeName",
|
|
150
|
+
"AttributeOverview",
|
|
151
|
+
"AttributeType",
|
|
152
|
+
"Attributes",
|
|
153
|
+
"Bool",
|
|
154
|
+
"CastTarget",
|
|
155
|
+
"Change",
|
|
156
|
+
"Changes",
|
|
157
|
+
"Clear",
|
|
158
|
+
"DataType",
|
|
159
|
+
"DateTime",
|
|
160
|
+
"DivisionByZeroError",
|
|
161
|
+
"Drop",
|
|
162
|
+
"DuplicateExpandedChildIndexError",
|
|
163
|
+
"DuplicateIndexError",
|
|
164
|
+
"Duration",
|
|
165
|
+
"EdgeBatch",
|
|
166
|
+
"EdgeCollector",
|
|
167
|
+
"EdgeDirection",
|
|
168
|
+
"EdgeEndpointRole",
|
|
169
|
+
"EdgeGroupOverview",
|
|
170
|
+
"EdgeIndex",
|
|
171
|
+
"EdgeSource",
|
|
172
|
+
"EdgeView",
|
|
173
|
+
"EmptySplitDelimiterError",
|
|
174
|
+
"EvaluationCacheGraphRecordMismatchError",
|
|
175
|
+
"Expression",
|
|
176
|
+
"ExternalError",
|
|
177
|
+
"FailureKind",
|
|
178
|
+
"Float",
|
|
179
|
+
"FreezeSchema",
|
|
180
|
+
"GraphRecordError",
|
|
181
|
+
"GroupIndex",
|
|
182
|
+
"GroupOverview",
|
|
183
|
+
"GroupSchema",
|
|
184
|
+
"GroupView",
|
|
185
|
+
"GroupedResult",
|
|
186
|
+
"Identifier",
|
|
187
|
+
"IncomparableIndicesError",
|
|
188
|
+
"IncomparableValuesAtError",
|
|
189
|
+
"IncomparableValuesError",
|
|
190
|
+
"Int",
|
|
191
|
+
"IntegerOverflowError",
|
|
192
|
+
"InvalidCastError",
|
|
193
|
+
"InvalidClipBoundsError",
|
|
194
|
+
"InvalidMedianValueError",
|
|
195
|
+
"InvalidPaddingCharacterError",
|
|
196
|
+
"InvalidPartitionBucketArityError",
|
|
197
|
+
"InvalidRegexPatternError",
|
|
198
|
+
"InvalidStandardDeviationValueError",
|
|
199
|
+
"InvalidStringSliceError",
|
|
200
|
+
"InvalidTransitionError",
|
|
201
|
+
"InvalidVarianceValueError",
|
|
202
|
+
"MedRecord",
|
|
203
|
+
"MissingAttributeError",
|
|
204
|
+
"MissingGroupAggregateError",
|
|
205
|
+
"MissingGroupBucketError",
|
|
206
|
+
"MissingTraversedAttributeError",
|
|
207
|
+
"ModuloByZeroError",
|
|
208
|
+
"NegativeSquareRootError",
|
|
209
|
+
"NoChildIndexError",
|
|
210
|
+
"NodeBatch",
|
|
211
|
+
"NodeCollector",
|
|
212
|
+
"NodeGroupOverview",
|
|
213
|
+
"NodeIndex",
|
|
214
|
+
"NodeSource",
|
|
215
|
+
"NodeView",
|
|
216
|
+
"NonIntegerValueError",
|
|
217
|
+
"NonNumericValueError",
|
|
218
|
+
"NonPositiveLogarithmError",
|
|
219
|
+
"NonStringValueError",
|
|
220
|
+
"Null",
|
|
221
|
+
"OmopPlugin",
|
|
222
|
+
"OnConflict",
|
|
223
|
+
"Option",
|
|
224
|
+
"Overview",
|
|
225
|
+
"Plugin",
|
|
226
|
+
"PluginName",
|
|
227
|
+
"PolarsFrames",
|
|
228
|
+
"QueryError",
|
|
229
|
+
"Raise",
|
|
230
|
+
"RaisedFailuresError",
|
|
231
|
+
"RecordBatch",
|
|
232
|
+
"RemoveEdgeAttributes",
|
|
233
|
+
"RemoveEdges",
|
|
234
|
+
"RemoveEdgesFromGroup",
|
|
235
|
+
"RemoveGroups",
|
|
236
|
+
"RemoveNodeAttributes",
|
|
237
|
+
"RemoveNodes",
|
|
238
|
+
"RemoveNodesFromGroup",
|
|
239
|
+
"Replace",
|
|
240
|
+
"ReplaceEdgeAttributes",
|
|
241
|
+
"ReplaceNodeAttributes",
|
|
242
|
+
"ResultConsumedError",
|
|
243
|
+
"ResultView",
|
|
244
|
+
"RonFile",
|
|
245
|
+
"Schema",
|
|
246
|
+
"SchemaType",
|
|
247
|
+
"Series",
|
|
248
|
+
"SetEdgeAttributes",
|
|
249
|
+
"SetNodeAttributes",
|
|
250
|
+
"SetSchema",
|
|
251
|
+
"String",
|
|
252
|
+
"StringLengthOverflowError",
|
|
253
|
+
"StringPaddingOverflowError",
|
|
254
|
+
"UncoveredIndicesError",
|
|
255
|
+
"UnfreezeSchema",
|
|
256
|
+
"Union",
|
|
257
|
+
"UnresolvedBucketFailuresError",
|
|
258
|
+
"UnresolvedGroupKeyFailuresError",
|
|
259
|
+
"UnresolvedIndexError",
|
|
260
|
+
"UnsupportedValueRoleError",
|
|
261
|
+
"Value",
|
|
262
|
+
"ValueTarget",
|
|
263
|
+
"Writer",
|
|
264
|
+
"edges",
|
|
265
|
+
"groups",
|
|
266
|
+
"nodes",
|
|
267
|
+
"querying",
|
|
268
|
+
]
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
from medrecords.evaluation._run import OnFailure, ProgressArgs, ProgressHandler
|
|
2
|
+
from medrecords.evaluation.analytic import (
|
|
3
|
+
Analytic,
|
|
4
|
+
Assessment,
|
|
5
|
+
Bin,
|
|
6
|
+
Derivation,
|
|
7
|
+
DerivedType,
|
|
8
|
+
Detail,
|
|
9
|
+
Distribution,
|
|
10
|
+
Figure,
|
|
11
|
+
InputsType,
|
|
12
|
+
Measurement,
|
|
13
|
+
Plot,
|
|
14
|
+
ReportValue,
|
|
15
|
+
Table,
|
|
16
|
+
)
|
|
17
|
+
from medrecords.evaluation.document import Company, Document
|
|
18
|
+
from medrecords.evaluation.evaluation import Evaluation
|
|
19
|
+
from medrecords.evaluation.group import EvaluationGroup
|
|
20
|
+
from medrecords.evaluation.report import (
|
|
21
|
+
AnalyticEntry,
|
|
22
|
+
DerivationEntry,
|
|
23
|
+
Entry,
|
|
24
|
+
EntryPath,
|
|
25
|
+
Failure,
|
|
26
|
+
GroupEntry,
|
|
27
|
+
InputEntry,
|
|
28
|
+
Report,
|
|
29
|
+
)
|
|
30
|
+
from medrecords.evaluation.results import (
|
|
31
|
+
ItemType,
|
|
32
|
+
KeyType,
|
|
33
|
+
ValueKindType,
|
|
34
|
+
read,
|
|
35
|
+
read_each,
|
|
36
|
+
read_pairs,
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
__all__ = [
|
|
40
|
+
"Analytic",
|
|
41
|
+
"AnalyticEntry",
|
|
42
|
+
"Assessment",
|
|
43
|
+
"Bin",
|
|
44
|
+
"Company",
|
|
45
|
+
"Derivation",
|
|
46
|
+
"DerivationEntry",
|
|
47
|
+
"DerivedType",
|
|
48
|
+
"Detail",
|
|
49
|
+
"Distribution",
|
|
50
|
+
"Document",
|
|
51
|
+
"Entry",
|
|
52
|
+
"EntryPath",
|
|
53
|
+
"Evaluation",
|
|
54
|
+
"EvaluationGroup",
|
|
55
|
+
"Failure",
|
|
56
|
+
"Figure",
|
|
57
|
+
"GroupEntry",
|
|
58
|
+
"InputEntry",
|
|
59
|
+
"InputsType",
|
|
60
|
+
"ItemType",
|
|
61
|
+
"KeyType",
|
|
62
|
+
"Measurement",
|
|
63
|
+
"OnFailure",
|
|
64
|
+
"Plot",
|
|
65
|
+
"ProgressArgs",
|
|
66
|
+
"ProgressHandler",
|
|
67
|
+
"Report",
|
|
68
|
+
"ReportValue",
|
|
69
|
+
"Table",
|
|
70
|
+
"ValueKindType",
|
|
71
|
+
"read",
|
|
72
|
+
"read_each",
|
|
73
|
+
"read_pairs",
|
|
74
|
+
]
|