pylantir 0.0.8__tar.gz → 0.0.9__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.0.8 → pylantir-0.0.9}/PKG-INFO +2 -2
- {pylantir-0.0.8 → pylantir-0.0.9}/pyproject.toml +2 -2
- {pylantir-0.0.8 → pylantir-0.0.9}/src/pylantir/models.py +4 -1
- {pylantir-0.0.8 → pylantir-0.0.9}/src/pylantir/redcap_to_db.py +13 -1
- {pylantir-0.0.8 → pylantir-0.0.9}/LICENSE +0 -0
- {pylantir-0.0.8 → pylantir-0.0.9}/README.md +0 -0
- {pylantir-0.0.8 → pylantir-0.0.9}/src/pylantir/.env +0 -0
- {pylantir-0.0.8 → pylantir-0.0.9}/src/pylantir/__init__.py +0 -0
- {pylantir-0.0.8 → pylantir-0.0.9}/src/pylantir/cli/__init__.py +0 -0
- {pylantir-0.0.8 → pylantir-0.0.9}/src/pylantir/cli/run.py +0 -0
- {pylantir-0.0.8 → pylantir-0.0.9}/src/pylantir/config/mwl_config.json +0 -0
- {pylantir-0.0.8 → pylantir-0.0.9}/src/pylantir/db_setup.py +0 -0
- {pylantir-0.0.8 → pylantir-0.0.9}/src/pylantir/mwl_server.py +0 -0
- {pylantir-0.0.8 → pylantir-0.0.9}/src/pylantir/populate_db.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pylantir
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.9
|
|
4
4
|
Summary: Python - DICOM Modality WorkList
|
|
5
5
|
Author-email: Milton Camacho <miltoncamachoicc@gmail.com>
|
|
6
6
|
Requires-Python: >=3.11.1
|
|
@@ -31,7 +31,7 @@ Requires-Dist: flake8-formatter_junit_xml ; extra == "test"
|
|
|
31
31
|
Requires-Dist: flake8 ; extra == "test"
|
|
32
32
|
Requires-Dist: flake8-pyproject ; extra == "test"
|
|
33
33
|
Requires-Dist: pre-commit==3.3.1 ; extra == "test"
|
|
34
|
-
Requires-Dist: pylint==
|
|
34
|
+
Requires-Dist: pylint==3.3.6 ; extra == "test"
|
|
35
35
|
Requires-Dist: pylint_junit ; extra == "test"
|
|
36
36
|
Requires-Dist: pytest-cov==4.0.0 ; extra == "test"
|
|
37
37
|
Requires-Dist: pytest-mock<3.10.1 ; extra == "test"
|
|
@@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "pylantir"
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.9"
|
|
8
8
|
authors = [
|
|
9
9
|
{name = "Milton Camacho", email = "miltoncamachoicc@gmail.com"},
|
|
10
10
|
]
|
|
@@ -50,7 +50,7 @@ test = [
|
|
|
50
50
|
"flake8",
|
|
51
51
|
"flake8-pyproject",
|
|
52
52
|
"pre-commit==3.3.1",
|
|
53
|
-
"pylint==
|
|
53
|
+
"pylint==3.3.6",
|
|
54
54
|
"pylint_junit",
|
|
55
55
|
"pytest-cov==4.0.0",
|
|
56
56
|
"pytest-mock<3.10.1",
|
|
@@ -37,7 +37,10 @@ class WorklistItem(Base):
|
|
|
37
37
|
procedure_description = Column(String(200))
|
|
38
38
|
protocol_name = Column(String(100))
|
|
39
39
|
station_name = Column(String(100))
|
|
40
|
-
|
|
40
|
+
try:
|
|
41
|
+
hisris_coding_designator = Column(String(100))
|
|
42
|
+
except:
|
|
43
|
+
lgr.warning("Could not get hisris_coding_designator check models.py ")
|
|
41
44
|
performed_procedure_step_status = Column(String, default="SCHEDULED")
|
|
42
45
|
|
|
43
46
|
|
|
@@ -107,6 +107,7 @@ def sync_redcap_to_db(
|
|
|
107
107
|
|
|
108
108
|
if not redcap2wl:
|
|
109
109
|
lgr.error("No field mapping (redcap2wl) provided for syncing.")
|
|
110
|
+
return
|
|
110
111
|
|
|
111
112
|
session = Session()
|
|
112
113
|
|
|
@@ -133,7 +134,8 @@ def sync_redcap_to_db(
|
|
|
133
134
|
ses_id = record.get("mri_instance")
|
|
134
135
|
|
|
135
136
|
PatientName = f"cpip-id-{study_id}^fa-{family_id}"
|
|
136
|
-
PatientID = f"
|
|
137
|
+
PatientID = f"sub_{study_id}_ses_{ses_id}_fam_{family_id}_site_{site_id}"
|
|
138
|
+
PatientID_ = f"sub-{study_id}_ses-{ses_id}_fam-{family_id}_site-{site_id}"
|
|
137
139
|
|
|
138
140
|
if not PatientID:
|
|
139
141
|
lgr.warning("Skipping record due to missing Study ID.")
|
|
@@ -149,8 +151,18 @@ def sync_redcap_to_db(
|
|
|
149
151
|
.first()
|
|
150
152
|
)
|
|
151
153
|
|
|
154
|
+
existing_entry_ = (
|
|
155
|
+
session.query(WorklistItem)
|
|
156
|
+
.filter_by(patient_id=PatientID_)
|
|
157
|
+
.first()
|
|
158
|
+
)
|
|
152
159
|
if existing_entry:
|
|
153
160
|
logging.debug(f"Updating existing worklist entry for PatientID {PatientID}")
|
|
161
|
+
elif existing_entry_:
|
|
162
|
+
logging.debug(f"Updating existing worklist entry for PatientID {PatientID_}")
|
|
163
|
+
existing_entry = existing_entry_
|
|
164
|
+
|
|
165
|
+
if existing_entry:
|
|
154
166
|
existing_entry.patient_name = PatientName
|
|
155
167
|
existing_entry.patient_id = PatientID
|
|
156
168
|
existing_entry.patient_birth_date = record.get("youth_dob_y", "19000101")
|
|
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
|