pylantir 0.3.0__tar.gz → 0.3.1__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.
- {pylantir-0.3.0 → pylantir-0.3.1}/PKG-INFO +14 -13
- {pylantir-0.3.0 → pylantir-0.3.1}/README.md +13 -12
- {pylantir-0.3.0 → pylantir-0.3.1}/pyproject.toml +1 -1
- {pylantir-0.3.0 → pylantir-0.3.1}/LICENSE +0 -0
- {pylantir-0.3.0 → pylantir-0.3.1}/src/pylantir/__init__.py +0 -0
- {pylantir-0.3.0 → pylantir-0.3.1}/src/pylantir/api_server.py +0 -0
- {pylantir-0.3.0 → pylantir-0.3.1}/src/pylantir/auth_db_setup.py +0 -0
- {pylantir-0.3.0 → pylantir-0.3.1}/src/pylantir/auth_models.py +0 -0
- {pylantir-0.3.0 → pylantir-0.3.1}/src/pylantir/auth_utils.py +0 -0
- {pylantir-0.3.0 → pylantir-0.3.1}/src/pylantir/cli/__init__.py +0 -0
- {pylantir-0.3.0 → pylantir-0.3.1}/src/pylantir/cli/run.py +0 -0
- {pylantir-0.3.0 → pylantir-0.3.1}/src/pylantir/config/calpendo_config_example.json +0 -0
- {pylantir-0.3.0 → pylantir-0.3.1}/src/pylantir/config/config_example_with_cors.json +0 -0
- {pylantir-0.3.0 → pylantir-0.3.1}/src/pylantir/config/mwl_config.json +0 -0
- {pylantir-0.3.0 → pylantir-0.3.1}/src/pylantir/data_sources/__init__.py +0 -0
- {pylantir-0.3.0 → pylantir-0.3.1}/src/pylantir/data_sources/base.py +0 -0
- {pylantir-0.3.0 → pylantir-0.3.1}/src/pylantir/data_sources/calpendo_plugin.py +0 -0
- {pylantir-0.3.0 → pylantir-0.3.1}/src/pylantir/data_sources/redcap_plugin.py +0 -0
- {pylantir-0.3.0 → pylantir-0.3.1}/src/pylantir/db_concurrency.py +0 -0
- {pylantir-0.3.0 → pylantir-0.3.1}/src/pylantir/db_setup.py +0 -0
- {pylantir-0.3.0 → pylantir-0.3.1}/src/pylantir/models.py +0 -0
- {pylantir-0.3.0 → pylantir-0.3.1}/src/pylantir/mwl_server.py +0 -0
- {pylantir-0.3.0 → pylantir-0.3.1}/src/pylantir/populate_db.py +0 -0
- {pylantir-0.3.0 → pylantir-0.3.1}/src/pylantir/redcap_to_db.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pylantir
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: Python - DICOM Modality WorkList with Optional API
|
|
5
5
|
Author-email: Milton Camacho <miltoncamachoicc@gmail.com>
|
|
6
6
|
Requires-Python: >=3.11.1
|
|
@@ -64,9 +64,9 @@ Provides-Extra: test
|
|
|
64
64
|
<img src="pylantir.png" alt="Pylantir" width="50%">
|
|
65
65
|
</div>
|
|
66
66
|
|
|
67
|
-
This project's goal is to significantly reduce the number of human-related errors when
|
|
67
|
+
This project's goal is to significantly reduce the number of human-related errors when manually registering participants for medical imaging procedures.
|
|
68
68
|
|
|
69
|
-
It effectively provides a python based DICOM Modality Worklist Server (SCP) and Modality Performed Procedure Step (SCP) able to receive requests from medical imaging
|
|
69
|
+
It effectively provides a python based DICOM Modality Worklist Server (SCP) and Modality Performed Procedure Step (SCP) able to receive requests from medical imaging equipment based on DICOM network communication (e.g., C-FIND, N-CREATE, N-SET requests).
|
|
70
70
|
|
|
71
71
|
It will build/update a database based on the information entered in the study-related REDCap database using a REDCap API (You will require to have API access to the study).
|
|
72
72
|
|
|
@@ -150,7 +150,7 @@ cd pylantir/tests
|
|
|
150
150
|
Query the worklist database to check that you have some entries using:
|
|
151
151
|
|
|
152
152
|
```bash
|
|
153
|
-
python
|
|
153
|
+
python tests/query_db.py
|
|
154
154
|
```
|
|
155
155
|
|
|
156
156
|
Then, you can get a StudyUID from one of the entries to test the MPPS workflow. For example: 1.2.840.10008.3.1.2.3.4.55635351412689303463019139483773956632
|
|
@@ -158,19 +158,19 @@ Then, you can get a StudyUID from one of the entries to test the MPPS workflow.
|
|
|
158
158
|
Take this and run a create action to mark the worklist Procedure Step Status as IN_PROGRESS
|
|
159
159
|
|
|
160
160
|
```bash
|
|
161
|
-
python
|
|
161
|
+
python tests/mpps_tester.py --AEtitle MWL_SERVER --mpps_action create --callingAEtitle MWL_TESTER --ip 127.0.0.1 --port 4242 --study_uid 1.2.840.10008.3.1.2.3.4.55635351412689303463019139483773956632
|
|
162
162
|
```
|
|
163
163
|
|
|
164
|
-
You can verify that this in fact modified your database re-running:
|
|
164
|
+
You can verify that this in fact modified your database by re-running:
|
|
165
165
|
|
|
166
166
|
```bash
|
|
167
|
-
python
|
|
167
|
+
python tests/query_db.py
|
|
168
168
|
```
|
|
169
169
|
|
|
170
|
-
Finally, you can also simulate the
|
|
170
|
+
Finally, you can also simulate the procedure completion, effectively updating the Procedure Step Status to COMPLETED or DISCONTINUED:
|
|
171
171
|
|
|
172
172
|
```bash
|
|
173
|
-
python
|
|
173
|
+
python tests/mpps_tester.py --AEtitle MWL_SERVER --mpps_action set --mpps_status COMPLETED --callingAEtitle MWL_TESTER --ip 127.0.0.1 --port 4242 --study_uid 1.2.840.10008.3.1.2.3.4.55635351412689303463019139483773956632 --sop_uid 1.2.840.10008.3.1.2.3.4.187176383255263644225774937658729238426
|
|
174
174
|
```
|
|
175
175
|
|
|
176
176
|
## Usage
|
|
@@ -281,7 +281,7 @@ The new configuration format uses a `data_sources` array to define one or more d
|
|
|
281
281
|
- **`config`**: Source-specific configuration
|
|
282
282
|
- For REDCap: `site_id`, `protocol`, and optional API credentials
|
|
283
283
|
- **`field_mapping`**: Maps source fields to DICOM worklist fields
|
|
284
|
-
- **`window_mode`** (Calpendo optional): `rolling` (default) or `
|
|
284
|
+
- **`window_mode`** (Calpendo optional): `rolling` (default) or `today`
|
|
285
285
|
- **`daily_window`** (Calpendo optional): `{"start_time": [h, m], "end_time": [h, m]}`
|
|
286
286
|
|
|
287
287
|
### Multiple Data Sources Example
|
|
@@ -432,7 +432,7 @@ export CALPENDO_PASSWORD=<your_calpendo_password>
|
|
|
432
432
|
- **`timezone`** (optional, default: `"America/Edmonton"`): Timezone for booking timestamps
|
|
433
433
|
- **`resource_modality_mapping`** (optional): Map resource names to DICOM modality codes
|
|
434
434
|
- **`field_mapping`** (at data source root): Maps Calpendo fields to worklist fields
|
|
435
|
-
- **`window_mode`** (optional): `rolling` (default) or `
|
|
435
|
+
- **`window_mode`** (optional): `rolling` (default) or `today`
|
|
436
436
|
- **`daily_window`** (optional): `{"start_time": [h, m], "end_time": [h, m]}`
|
|
437
437
|
- Use **`_extract`** for regex-based field extraction:
|
|
438
438
|
- **`pattern`**: Regular expression pattern (use `\\` for escaping in JSON)
|
|
@@ -488,6 +488,7 @@ Common patterns for extracting information from Calpendo booking titles:
|
|
|
488
488
|
### Workflow Notes
|
|
489
489
|
|
|
490
490
|
- MPPS status updates are owned by N-CREATE/N-SET; sync operations do not overwrite existing `performed_procedure_step_status` values.
|
|
491
|
+
- Calpendo booking times are interpreted in the configured local timezone and stored in the legacy formats `YYYY-MM-DD` (date) and `HH:MM` (time).
|
|
491
492
|
|
|
492
493
|
For more details, see the [Calpendo plugin quickstart](specs/002-calpendo-plugin/quickstart.md).
|
|
493
494
|
|
|
@@ -544,7 +545,7 @@ This is particularly useful for production deployments with frequent synchroniza
|
|
|
544
545
|
|
|
545
546
|
## FastAPI REST API (Optional)
|
|
546
547
|
|
|
547
|
-
|
|
548
|
+
Pylantir now includes an optional REST API for programmatic access to worklist data and user management.
|
|
548
549
|
|
|
549
550
|
### Installation with API Support
|
|
550
551
|
|
|
@@ -862,7 +863,7 @@ Control Cross-Origin Resource Sharing (CORS) for web frontend integration:
|
|
|
862
863
|
|
|
863
864
|
## Clean Stop of the MWL and Database Sync
|
|
864
865
|
|
|
865
|
-
To cleanly stop the MWL server and ensure the database
|
|
866
|
+
To cleanly stop the MWL server and ensure the database synchronization properly, press `Ctrl + C` (you might need to press it twice).
|
|
866
867
|
|
|
867
868
|
To stop the API server, use `Ctrl + C` in the terminal where it's running.
|
|
868
869
|
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
<img src="pylantir.png" alt="Pylantir" width="50%">
|
|
6
6
|
</div>
|
|
7
7
|
|
|
8
|
-
This project's goal is to significantly reduce the number of human-related errors when
|
|
8
|
+
This project's goal is to significantly reduce the number of human-related errors when manually registering participants for medical imaging procedures.
|
|
9
9
|
|
|
10
|
-
It effectively provides a python based DICOM Modality Worklist Server (SCP) and Modality Performed Procedure Step (SCP) able to receive requests from medical imaging
|
|
10
|
+
It effectively provides a python based DICOM Modality Worklist Server (SCP) and Modality Performed Procedure Step (SCP) able to receive requests from medical imaging equipment based on DICOM network communication (e.g., C-FIND, N-CREATE, N-SET requests).
|
|
11
11
|
|
|
12
12
|
It will build/update a database based on the information entered in the study-related REDCap database using a REDCap API (You will require to have API access to the study).
|
|
13
13
|
|
|
@@ -91,7 +91,7 @@ cd pylantir/tests
|
|
|
91
91
|
Query the worklist database to check that you have some entries using:
|
|
92
92
|
|
|
93
93
|
```bash
|
|
94
|
-
python
|
|
94
|
+
python tests/query_db.py
|
|
95
95
|
```
|
|
96
96
|
|
|
97
97
|
Then, you can get a StudyUID from one of the entries to test the MPPS workflow. For example: 1.2.840.10008.3.1.2.3.4.55635351412689303463019139483773956632
|
|
@@ -99,19 +99,19 @@ Then, you can get a StudyUID from one of the entries to test the MPPS workflow.
|
|
|
99
99
|
Take this and run a create action to mark the worklist Procedure Step Status as IN_PROGRESS
|
|
100
100
|
|
|
101
101
|
```bash
|
|
102
|
-
python
|
|
102
|
+
python tests/mpps_tester.py --AEtitle MWL_SERVER --mpps_action create --callingAEtitle MWL_TESTER --ip 127.0.0.1 --port 4242 --study_uid 1.2.840.10008.3.1.2.3.4.55635351412689303463019139483773956632
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
-
You can verify that this in fact modified your database re-running:
|
|
105
|
+
You can verify that this in fact modified your database by re-running:
|
|
106
106
|
|
|
107
107
|
```bash
|
|
108
|
-
python
|
|
108
|
+
python tests/query_db.py
|
|
109
109
|
```
|
|
110
110
|
|
|
111
|
-
Finally, you can also simulate the
|
|
111
|
+
Finally, you can also simulate the procedure completion, effectively updating the Procedure Step Status to COMPLETED or DISCONTINUED:
|
|
112
112
|
|
|
113
113
|
```bash
|
|
114
|
-
python
|
|
114
|
+
python tests/mpps_tester.py --AEtitle MWL_SERVER --mpps_action set --mpps_status COMPLETED --callingAEtitle MWL_TESTER --ip 127.0.0.1 --port 4242 --study_uid 1.2.840.10008.3.1.2.3.4.55635351412689303463019139483773956632 --sop_uid 1.2.840.10008.3.1.2.3.4.187176383255263644225774937658729238426
|
|
115
115
|
```
|
|
116
116
|
|
|
117
117
|
## Usage
|
|
@@ -222,7 +222,7 @@ The new configuration format uses a `data_sources` array to define one or more d
|
|
|
222
222
|
- **`config`**: Source-specific configuration
|
|
223
223
|
- For REDCap: `site_id`, `protocol`, and optional API credentials
|
|
224
224
|
- **`field_mapping`**: Maps source fields to DICOM worklist fields
|
|
225
|
-
- **`window_mode`** (Calpendo optional): `rolling` (default) or `
|
|
225
|
+
- **`window_mode`** (Calpendo optional): `rolling` (default) or `today`
|
|
226
226
|
- **`daily_window`** (Calpendo optional): `{"start_time": [h, m], "end_time": [h, m]}`
|
|
227
227
|
|
|
228
228
|
### Multiple Data Sources Example
|
|
@@ -373,7 +373,7 @@ export CALPENDO_PASSWORD=<your_calpendo_password>
|
|
|
373
373
|
- **`timezone`** (optional, default: `"America/Edmonton"`): Timezone for booking timestamps
|
|
374
374
|
- **`resource_modality_mapping`** (optional): Map resource names to DICOM modality codes
|
|
375
375
|
- **`field_mapping`** (at data source root): Maps Calpendo fields to worklist fields
|
|
376
|
-
- **`window_mode`** (optional): `rolling` (default) or `
|
|
376
|
+
- **`window_mode`** (optional): `rolling` (default) or `today`
|
|
377
377
|
- **`daily_window`** (optional): `{"start_time": [h, m], "end_time": [h, m]}`
|
|
378
378
|
- Use **`_extract`** for regex-based field extraction:
|
|
379
379
|
- **`pattern`**: Regular expression pattern (use `\\` for escaping in JSON)
|
|
@@ -429,6 +429,7 @@ Common patterns for extracting information from Calpendo booking titles:
|
|
|
429
429
|
### Workflow Notes
|
|
430
430
|
|
|
431
431
|
- MPPS status updates are owned by N-CREATE/N-SET; sync operations do not overwrite existing `performed_procedure_step_status` values.
|
|
432
|
+
- Calpendo booking times are interpreted in the configured local timezone and stored in the legacy formats `YYYY-MM-DD` (date) and `HH:MM` (time).
|
|
432
433
|
|
|
433
434
|
For more details, see the [Calpendo plugin quickstart](specs/002-calpendo-plugin/quickstart.md).
|
|
434
435
|
|
|
@@ -485,7 +486,7 @@ This is particularly useful for production deployments with frequent synchroniza
|
|
|
485
486
|
|
|
486
487
|
## FastAPI REST API (Optional)
|
|
487
488
|
|
|
488
|
-
|
|
489
|
+
Pylantir now includes an optional REST API for programmatic access to worklist data and user management.
|
|
489
490
|
|
|
490
491
|
### Installation with API Support
|
|
491
492
|
|
|
@@ -803,6 +804,6 @@ Control Cross-Origin Resource Sharing (CORS) for web frontend integration:
|
|
|
803
804
|
|
|
804
805
|
## Clean Stop of the MWL and Database Sync
|
|
805
806
|
|
|
806
|
-
To cleanly stop the MWL server and ensure the database
|
|
807
|
+
To cleanly stop the MWL server and ensure the database synchronization properly, press `Ctrl + C` (you might need to press it twice).
|
|
807
808
|
|
|
808
809
|
To stop the API server, use `Ctrl + C` in the terminal where it's running.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|