medicafe 0.250318.0__py3-none-any.whl → 0.250401.0__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.
Potentially problematic release.
This version of medicafe might be problematic. Click here for more details.
- MediLink/MediLink_API_v3.py +36 -11
- {medicafe-0.250318.0.dist-info → medicafe-0.250401.0.dist-info}/METADATA +1 -1
- {medicafe-0.250318.0.dist-info → medicafe-0.250401.0.dist-info}/RECORD +6 -6
- {medicafe-0.250318.0.dist-info → medicafe-0.250401.0.dist-info}/LICENSE +0 -0
- {medicafe-0.250318.0.dist-info → medicafe-0.250401.0.dist-info}/WHEEL +0 -0
- {medicafe-0.250318.0.dist-info → medicafe-0.250401.0.dist-info}/top_level.txt +0 -0
MediLink/MediLink_API_v3.py
CHANGED
|
@@ -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]
|
|
@@ -19,7 +19,7 @@ MediLink/MediLink_837p_encoder.py,sha256=id2qhKUYq_raKcDr5pAY1xF0V_UR5KBC8SXDAeh
|
|
|
19
19
|
MediLink/MediLink_837p_encoder_library.py,sha256=tn3UPyyBEEn_7vvu2sNft6rzWcQ0B61dWvtpKHhnh00,47792
|
|
20
20
|
MediLink/MediLink_API_Generator.py,sha256=vBZ8moR9tvv7mb200HlZnJrk1y-bQi8E16I2r41vgVM,10345
|
|
21
21
|
MediLink/MediLink_API_v2.py,sha256=mcIgLnXPS_NaUBrkKJ8mxCUaQ0AuQUeU1vG6DoplbVY,7733
|
|
22
|
-
MediLink/MediLink_API_v3.py,sha256=
|
|
22
|
+
MediLink/MediLink_API_v3.py,sha256=b8Qo7tRGzdCyixYrfOqaGFiOtot3sXG4dwsWn4uiDW0,32288
|
|
23
23
|
MediLink/MediLink_APIs.py,sha256=jm3f9T034MJKH8A_CIootULoeuk7H8s7PazpFZRCbKI,6222
|
|
24
24
|
MediLink/MediLink_Azure.py,sha256=Ow70jctiHFIylskBExN7WUoRgrKOvBR6jNTnQMk6lJA,210
|
|
25
25
|
MediLink/MediLink_ClaimStatus.py,sha256=GNZ9mRrjxemBHJ5LiJb2DUWhKgWX2vTNY5jxoUgqv-I,9776
|
|
@@ -41,8 +41,8 @@ MediLink/MediLink_batch.bat,sha256=nqL5QwCLyRQFSPdv6kgtcV_cpky7FXSOWVl6OxjRXb4,1
|
|
|
41
41
|
MediLink/Soumit_api.py,sha256=5JfOecK98ZC6NpZklZW2AkOzkjvrbYxpJpZNH3rFxDw,497
|
|
42
42
|
MediLink/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
43
43
|
MediLink/test.py,sha256=kSvvJRL_3fWuNS3_x4hToOnUljGLoeEw6SUTHQWQRJk,3108
|
|
44
|
-
medicafe-0.
|
|
45
|
-
medicafe-0.
|
|
46
|
-
medicafe-0.
|
|
47
|
-
medicafe-0.
|
|
48
|
-
medicafe-0.
|
|
44
|
+
medicafe-0.250401.0.dist-info/LICENSE,sha256=65lb-vVujdQK7uMH3RRJSMwUW-WMrMEsc5sOaUn2xUk,1096
|
|
45
|
+
medicafe-0.250401.0.dist-info/METADATA,sha256=VomIGuTgq7YoupslYFwyDShSmwlCEjw2nqtT6awVd08,5501
|
|
46
|
+
medicafe-0.250401.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
47
|
+
medicafe-0.250401.0.dist-info/top_level.txt,sha256=3uOwR4q_SP8Gufk2uCHoKngAgbtdOwQC6Qjl7ViBa_c,17
|
|
48
|
+
medicafe-0.250401.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|