pylantir 0.0.8__py3-none-any.whl → 0.0.9__py3-none-any.whl

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/models.py CHANGED
@@ -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
- hisris_coding_designator = Column(String(100))
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
 
pylantir/redcap_to_db.py CHANGED
@@ -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"sub-{study_id}_ses-{ses_id}_fam-{family_id}_site-{site_id}"
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")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pylantir
3
- Version: 0.0.8
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==2.17.4 ; extra == "test"
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"
@@ -1,15 +1,15 @@
1
1
  pylantir/.env,sha256=qU4xxA3iOy2DQGT78CQG05ljTsFwKzgF2wXdnBpg8xQ,56
2
2
  pylantir/__init__.py,sha256=kl2Et644PvUIvziU4BTxiTD1W4_g7E0xBYCHgPE6RZc,363
3
3
  pylantir/db_setup.py,sha256=KTILsRrH7V5EaPqbCfOYYECM9mUB-AvOdjqjMM2H1n0,1333
4
- pylantir/models.py,sha256=7oK3NEl6Q-Q2kOFNXBsZaGn0rXfSpJY39CNXjKLt8Bg,1676
4
+ pylantir/models.py,sha256=bKgI0EN1VSYanPTOvEhEY2Zzqa0gDYLpVnE_KNQ6PEc,1780
5
5
  pylantir/mwl_server.py,sha256=GMJDcK0u_KM3oa6UqQ87NxMVye2pvG2cdkcI9k_iExg,10338
6
6
  pylantir/populate_db.py,sha256=KIbkVA-EAuTlDArXMFOHkjMmVfjlsTApj7S1wpUu1bM,2207
7
- pylantir/redcap_to_db.py,sha256=l21SXfVQjFDyatrkY1xcIWK2bUP5xu3BSbKZIecoI4E,9153
7
+ pylantir/redcap_to_db.py,sha256=cZam71uUOhkiO8z20pMEE9ExEOZEdisytYbVVlQhIZY,9589
8
8
  pylantir/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  pylantir/cli/run.py,sha256=vqb7kbKsf39tI8-xjDceS4j5V-YJSaC_k0Lu6vlajmo,10072
10
10
  pylantir/config/mwl_config.json,sha256=1Ma2guYAEAXQh1z7959aZadAn3ORjBqnDDibSLcwv_g,851
11
- pylantir-0.0.8.dist-info/entry_points.txt,sha256=vxaxvfGppLqRt9_4sqNDdP6b2jlgpcHIwP7UQfrM1T0,50
12
- pylantir-0.0.8.dist-info/licenses/LICENSE,sha256=ws_MuBL-SCEBqPBFl9_FqZkaaydIJmxHrJG2parhU4M,1141
13
- pylantir-0.0.8.dist-info/WHEEL,sha256=_2ozNFCLWc93bK4WKHCO-eDUENDlo-dgc9cU3qokYO4,82
14
- pylantir-0.0.8.dist-info/METADATA,sha256=Xg83-Nc9PFki3yLJmgU4bvn1yrkWUOCi5lvq1ogp7dA,7175
15
- pylantir-0.0.8.dist-info/RECORD,,
11
+ pylantir-0.0.9.dist-info/entry_points.txt,sha256=vxaxvfGppLqRt9_4sqNDdP6b2jlgpcHIwP7UQfrM1T0,50
12
+ pylantir-0.0.9.dist-info/licenses/LICENSE,sha256=ws_MuBL-SCEBqPBFl9_FqZkaaydIJmxHrJG2parhU4M,1141
13
+ pylantir-0.0.9.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
14
+ pylantir-0.0.9.dist-info/METADATA,sha256=70OdtHOBFhTtJNiA7rqQiDIud4BCfzccSNlIyqVLa8c,7174
15
+ pylantir-0.0.9.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: flit 3.11.0
2
+ Generator: flit 3.12.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any