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.

Files changed (51) hide show
  1. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediBot/MediBot_Crosswalk_Library.py +18 -8
  2. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_API_v3.py +36 -11
  3. {medicafe-0.250305.1/medicafe.egg-info → medicafe-0.250401.0}/PKG-INFO +1 -1
  4. {medicafe-0.250305.1 → medicafe-0.250401.0/medicafe.egg-info}/PKG-INFO +1 -1
  5. {medicafe-0.250305.1 → medicafe-0.250401.0}/medicafe.egg-info/requires.txt +1 -0
  6. {medicafe-0.250305.1 → medicafe-0.250401.0}/setup.py +2 -1
  7. {medicafe-0.250305.1 → medicafe-0.250401.0}/LICENSE +0 -0
  8. {medicafe-0.250305.1 → medicafe-0.250401.0}/MANIFEST.in +0 -0
  9. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediBot/MediBot.bat +0 -0
  10. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediBot/MediBot.py +0 -0
  11. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediBot/MediBot_Charges.py +0 -0
  12. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediBot/MediBot_Post.py +0 -0
  13. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediBot/MediBot_Preprocessor.py +0 -0
  14. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediBot/MediBot_Preprocessor_lib.py +0 -0
  15. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediBot/MediBot_UI.py +0 -0
  16. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediBot/MediBot_dataformat_library.py +0 -0
  17. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediBot/MediBot_docx_decoder.py +0 -0
  18. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediBot/PDF_to_CSV_Cleaner.py +0 -0
  19. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediBot/__init__.py +0 -0
  20. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediBot/update_json.py +0 -0
  21. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediBot/update_medicafe.py +0 -0
  22. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink.py +0 -0
  23. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_837p_encoder.py +0 -0
  24. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_837p_encoder_library.py +0 -0
  25. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_API_Generator.py +0 -0
  26. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_API_v2.py +0 -0
  27. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_APIs.py +0 -0
  28. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_Azure.py +0 -0
  29. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_ClaimStatus.py +0 -0
  30. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_ConfigLoader.py +0 -0
  31. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_DataMgmt.py +0 -0
  32. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_Decoder.py +0 -0
  33. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_Deductible.py +0 -0
  34. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_Down.py +0 -0
  35. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_Gmail.py +0 -0
  36. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_Mailer.py +0 -0
  37. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_Parser.py +0 -0
  38. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_Scan.py +0 -0
  39. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_Scheduler.py +0 -0
  40. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_UI.py +0 -0
  41. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_Up.py +0 -0
  42. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/MediLink_batch.bat +0 -0
  43. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/Soumit_api.py +0 -0
  44. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/__init__.py +0 -0
  45. {medicafe-0.250305.1 → medicafe-0.250401.0}/MediLink/test.py +0 -0
  46. {medicafe-0.250305.1 → medicafe-0.250401.0}/README.md +0 -0
  47. {medicafe-0.250305.1 → medicafe-0.250401.0}/medicafe.egg-info/SOURCES.txt +0 -0
  48. {medicafe-0.250305.1 → medicafe-0.250401.0}/medicafe.egg-info/dependency_links.txt +0 -0
  49. {medicafe-0.250305.1 → medicafe-0.250401.0}/medicafe.egg-info/not-zip-safe +0 -0
  50. {medicafe-0.250305.1 → medicafe-0.250401.0}/medicafe.egg-info/top_level.txt +0 -0
  51. {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
- crosswalk['payer_id'][payer_id]['medisoft_id'].add(str(medisoft_id_str)) # Ensure IDs are strings
548
- MediLink_ConfigLoader.log(
549
- "Added new insurance ID {} to payer ID {}.".format(medisoft_id_str, payer_id),
550
- config,
551
- level="INFO"
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]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: medicafe
3
- Version: 0.250305.1
3
+ Version: 0.250401.0
4
4
  Summary: MediCafe
5
5
  Home-page: https://github.com/katanada2
6
6
  Author: Daniel Vidaud
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: medicafe
3
- Version: 0.250305.1
3
+ Version: 0.250401.0
4
4
  Summary: MediCafe
5
5
  Home-page: https://github.com/katanada2
6
6
  Author: Daniel Vidaud
@@ -4,6 +4,7 @@ tqdm==4.14.0
4
4
  python-docx==0.8.11
5
5
  PyYAML==5.2
6
6
  chardet==3.0.4
7
+ cffi==1.8.2
7
8
  msal==1.26.0
8
9
 
9
10
  [:platform_python_implementation != "CPython" or sys_platform != "win32" or python_version > "3.5"]
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='medicafe',
5
- version="0.250305.1",
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