medicafe 0.250305.1__tar.gz → 0.250401.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.
Potentially problematic release.
This version of medicafe might be problematic. Click here for more details.
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediBot/MediBot_Crosswalk_Library.py +18 -8
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_API_v3.py +36 -11
- {medicafe-0.250305.1/medicafe.egg-info → medicafe-0.250401.0}/PKG-INFO +1 -1
- {medicafe-0.250305.1 → medicafe-0.250401.0/medicafe.egg-info}/PKG-INFO +1 -1
- {medicafe-0.250305.1 → medicafe-0.250401.0}/medicafe.egg-info/requires.txt +1 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/setup.py +2 -1
- {medicafe-0.250305.1 → medicafe-0.250401.0}/LICENSE +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MANIFEST.in +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediBot/MediBot.bat +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediBot/MediBot.py +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediBot/MediBot_Charges.py +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediBot/MediBot_Post.py +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediBot/MediBot_Preprocessor.py +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediBot/MediBot_Preprocessor_lib.py +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediBot/MediBot_UI.py +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediBot/MediBot_dataformat_library.py +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediBot/MediBot_docx_decoder.py +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediBot/PDF_to_CSV_Cleaner.py +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediBot/__init__.py +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediBot/update_json.py +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediBot/update_medicafe.py +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink.py +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_837p_encoder.py +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_837p_encoder_library.py +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_API_Generator.py +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_API_v2.py +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_APIs.py +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_Azure.py +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_ClaimStatus.py +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_ConfigLoader.py +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_DataMgmt.py +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_Decoder.py +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_Deductible.py +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_Down.py +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_Gmail.py +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_Mailer.py +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_Parser.py +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_Scan.py +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_Scheduler.py +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_UI.py +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_Up.py +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_batch.bat +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/Soumit_api.py +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/__init__.py +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/test.py +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/README.md +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/medicafe.egg-info/SOURCES.txt +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/medicafe.egg-info/dependency_links.txt +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/medicafe.egg-info/not-zip-safe +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/medicafe.egg-info/top_level.txt +0 -0
- {medicafe-0.250305.1 → medicafe-0.250401.0}/setup.cfg +0 -0
|
@@ -543,14 +543,24 @@ def update_crosswalk_with_new_payer_id(client, insurance_name, payer_id, config,
|
|
|
543
543
|
else:
|
|
544
544
|
selected_endpoint = current_endpoint # Use the existing valid endpoint
|
|
545
545
|
|
|
546
|
-
# Add the insurance ID to the payer ID entry
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
546
|
+
# Add the insurance ID to the payer ID entry - with error handling for the .add() operation
|
|
547
|
+
try:
|
|
548
|
+
if not isinstance(crosswalk['payer_id'][payer_id]['medisoft_id'], set):
|
|
549
|
+
# Convert to set if it's not already one
|
|
550
|
+
crosswalk['payer_id'][payer_id]['medisoft_id'] = set(crosswalk['payer_id'][payer_id]['medisoft_id'])
|
|
551
|
+
MediLink_ConfigLoader.log("Converted medisoft_id to set for payer ID {}.".format(payer_id), config, level="DEBUG")
|
|
552
|
+
|
|
553
|
+
crosswalk['payer_id'][payer_id]['medisoft_id'].add(str(medisoft_id_str)) # Ensure IDs are strings
|
|
554
|
+
MediLink_ConfigLoader.log(
|
|
555
|
+
"Added new insurance ID {} to payer ID {}.".format(medisoft_id_str, payer_id),
|
|
556
|
+
config,
|
|
557
|
+
level="INFO"
|
|
558
|
+
)
|
|
559
|
+
except AttributeError as e:
|
|
560
|
+
MediLink_ConfigLoader.log("AttributeError while adding medisoft_id: {}".format(e), config, level="ERROR")
|
|
561
|
+
print("Error adding medisoft_id for payer ID {}: {}".format(payer_id, e))
|
|
562
|
+
return False
|
|
563
|
+
|
|
554
564
|
# Fetch and store the payer name for the new payer ID
|
|
555
565
|
if fetch_and_store_payer_name(client, payer_id, crosswalk, config):
|
|
556
566
|
MediLink_ConfigLoader.log("Successfully fetched and stored payer name for new payer ID {}.".format(payer_id), config, level="INFO")
|
|
@@ -160,21 +160,35 @@ class APIClient(BaseAPIClient):
|
|
|
160
160
|
url = base_url + url_extension
|
|
161
161
|
|
|
162
162
|
try:
|
|
163
|
-
# Make the API call based on call_type
|
|
164
|
-
if call_type == 'GET':
|
|
165
|
-
response = requests.get(url, headers=headers, params=params)
|
|
166
|
-
elif call_type == 'POST':
|
|
167
|
-
headers['Content-Type'] = 'application/json'
|
|
168
|
-
response = requests.post(url, headers=headers, json=data)
|
|
169
|
-
elif call_type == 'DELETE':
|
|
170
|
-
response = requests.delete(url, headers=headers)
|
|
171
|
-
else:
|
|
172
|
-
raise ValueError("Unsupported call type: {}".format(call_type))
|
|
173
|
-
|
|
174
163
|
masked_headers = headers.copy()
|
|
175
164
|
if 'Authorization' in masked_headers:
|
|
176
165
|
masked_headers['Authorization'] = 'Bearer ***'
|
|
177
166
|
|
|
167
|
+
def make_request():
|
|
168
|
+
if call_type == 'GET':
|
|
169
|
+
return requests.get(url, headers=headers, params=params)
|
|
170
|
+
elif call_type == 'POST':
|
|
171
|
+
headers['Content-Type'] = 'application/json'
|
|
172
|
+
return requests.post(url, headers=headers, json=data)
|
|
173
|
+
elif call_type == 'DELETE':
|
|
174
|
+
return requests.delete(url, headers=headers)
|
|
175
|
+
else:
|
|
176
|
+
raise ValueError("Unsupported call type: {}".format(call_type))
|
|
177
|
+
|
|
178
|
+
# Make initial request
|
|
179
|
+
response = make_request()
|
|
180
|
+
|
|
181
|
+
# If we get a 5xx error, wait and retry once
|
|
182
|
+
if 500 <= response.status_code < 600:
|
|
183
|
+
MediLink_ConfigLoader.log(
|
|
184
|
+
"Received {} error from server for {} request to {}. Waiting 1 second before retry...".format(
|
|
185
|
+
response.status_code, call_type, url
|
|
186
|
+
),
|
|
187
|
+
level="WARNING"
|
|
188
|
+
)
|
|
189
|
+
time.sleep(1)
|
|
190
|
+
response = make_request()
|
|
191
|
+
|
|
178
192
|
# Raise an HTTPError if the response was unsuccessful
|
|
179
193
|
response.raise_for_status()
|
|
180
194
|
|
|
@@ -305,6 +319,17 @@ def fetch_payer_name_from_api(client, payer_id, config, primary_endpoint='AVAILI
|
|
|
305
319
|
endpoints = config['MediLink_Config']['endpoints'] # Re-attempt to access endpoints
|
|
306
320
|
MediLink_ConfigLoader.log("Re-loaded configuration successfully.", level="INFO")
|
|
307
321
|
|
|
322
|
+
# Sanitize and validate payer_id
|
|
323
|
+
if not isinstance(payer_id, str):
|
|
324
|
+
payer_id = str(payer_id)
|
|
325
|
+
|
|
326
|
+
payer_id = ''.join(char for char in payer_id if char.isalnum())
|
|
327
|
+
|
|
328
|
+
if not payer_id:
|
|
329
|
+
error_message = "Invalid payer_id in API v3: {}. Must contain a string of alphanumeric characters.".format(payer_id)
|
|
330
|
+
MediLink_ConfigLoader.log(error_message, level="ERROR")
|
|
331
|
+
print(error_message)
|
|
332
|
+
|
|
308
333
|
# Define endpoint rotation logic
|
|
309
334
|
endpoint_order = ([primary_endpoint] +
|
|
310
335
|
[endpoint for endpoint in endpoints if endpoint != primary_endpoint]
|
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
|
2
2
|
|
|
3
3
|
setup(
|
|
4
4
|
name='medicafe',
|
|
5
|
-
version="0.
|
|
5
|
+
version="0.250401.0",
|
|
6
6
|
description='MediCafe',
|
|
7
7
|
long_description="""
|
|
8
8
|
# Project Overview: MediCafe
|
|
@@ -65,6 +65,7 @@ setup(
|
|
|
65
65
|
'python-docx==0.8.11',
|
|
66
66
|
'PyYAML==5.2',
|
|
67
67
|
'chardet==3.0.4',
|
|
68
|
+
'cffi==1.8.2', # msal needs this and then pip install will fail because 1.15.X won't work on XP.
|
|
68
69
|
'msal==1.26.0'
|
|
69
70
|
],
|
|
70
71
|
zip_safe=False
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|