medicafe 0.250708.1__py3-none-any.whl → 0.250711.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.

@@ -73,6 +73,7 @@ class TokenCache:
73
73
  return token_info['access_token']
74
74
 
75
75
  # Log cache miss
76
+ # BUG In the future, check the token refresh flow here to make sure we're not picking up unnecessary tokens.
76
77
  log_message = "No valid token found for {}".format(endpoint_name)
77
78
  MediLink_ConfigLoader.log(log_message, level="INFO")
78
79
 
@@ -213,6 +213,7 @@ def get_eligibility_info(client, payer_id, provider_last_name, date_of_birth, me
213
213
  return None
214
214
 
215
215
  # Helper functions to extract data from different API response formats
216
+ # BUG the API response is coming through correctly but the parsers below are not correctly extracting the super_connector variables.
216
217
 
217
218
  def extract_legacy_patient_info(policy):
218
219
  """Extract patient information from legacy API response format"""
@@ -225,21 +226,14 @@ def extract_legacy_patient_info(policy):
225
226
 
226
227
  def extract_super_connector_patient_info(eligibility_data):
227
228
  """Extract patient information from Super Connector API response format"""
228
- if not eligibility_data or 'data' not in eligibility_data:
229
+ if not eligibility_data:
229
230
  return {'lastName': '', 'firstName': '', 'middleName': ''}
230
231
 
231
- # Navigate to the first eligibility record
232
- eligibility_list = eligibility_data.get('data', {}).get('checkEligibility', {}).get('eligibility', [])
233
- if not eligibility_list:
234
- return {'lastName': '', 'firstName': '', 'middleName': ''}
235
-
236
- first_eligibility = eligibility_list[0]
237
- member_info = first_eligibility.get('eligibilityInfo', {}).get('member', {})
238
-
232
+ # The response structure is flat at the top level
239
233
  return {
240
- 'lastName': member_info.get("lastName", ""),
241
- 'firstName': member_info.get("firstName", ""),
242
- 'middleName': member_info.get("middleName", "")
234
+ 'lastName': eligibility_data.get("lastName", ""),
235
+ 'firstName': eligibility_data.get("firstName", ""),
236
+ 'middleName': eligibility_data.get("middleName", "")
243
237
  }
244
238
 
245
239
  def extract_legacy_remaining_amount(policy):
@@ -254,11 +248,23 @@ def extract_legacy_remaining_amount(policy):
254
248
 
255
249
  def extract_super_connector_remaining_amount(eligibility_data):
256
250
  """Extract remaining amount from Super Connector API response format"""
257
- if not eligibility_data or 'data' not in eligibility_data:
251
+ if not eligibility_data:
258
252
  return ""
259
253
 
260
- # Navigate to the first eligibility record
261
- eligibility_list = eligibility_data.get('data', {}).get('checkEligibility', {}).get('eligibility', [])
254
+ # First, check top-level metYearToDateAmount which might indicate deductible met
255
+ met_amount = eligibility_data.get('metYearToDateAmount')
256
+ if met_amount is not None:
257
+ return str(met_amount)
258
+
259
+ # Navigate to the rawGraphQLResponse structure
260
+ raw_response = eligibility_data.get('rawGraphQLResponse', {})
261
+ if not raw_response:
262
+ return ""
263
+
264
+ data = raw_response.get('data', {})
265
+ check_eligibility = data.get('checkEligibility', {})
266
+ eligibility_list = check_eligibility.get('eligibility', [])
267
+
262
268
  if not eligibility_list:
263
269
  return ""
264
270
 
@@ -274,6 +280,12 @@ def extract_super_connector_remaining_amount(eligibility_data):
274
280
  # Look for deductible-related information
275
281
  if service.get('service') == 'deductible' or 'deductible' in service.get('text', '').lower():
276
282
  return service.get('remainingAmount', "")
283
+
284
+ # Check the message.deductible.text field for deductible information
285
+ message = service.get('message', {})
286
+ deductible_msg = message.get('deductible', {})
287
+ if deductible_msg and deductible_msg.get('text'):
288
+ return deductible_msg.get('text', "")
277
289
 
278
290
  # If no specific deductible found, try to get from plan levels
279
291
  plan_levels = first_eligibility.get('eligibilityInfo', {}).get('planLevels', [])
@@ -297,28 +309,20 @@ def extract_legacy_insurance_info(policy):
297
309
 
298
310
  def extract_super_connector_insurance_info(eligibility_data):
299
311
  """Extract insurance information from Super Connector API response format"""
300
- if not eligibility_data or 'data' not in eligibility_data:
301
- return {'insuranceType': '', 'insuranceTypeCode': '', 'memberId': '', 'payerId': ''}
302
-
303
- # Navigate to the first eligibility record
304
- eligibility_list = eligibility_data.get('data', {}).get('checkEligibility', {}).get('eligibility', [])
305
- if not eligibility_list:
312
+ if not eligibility_data:
306
313
  return {'insuranceType': '', 'insuranceTypeCode': '', 'memberId': '', 'payerId': ''}
307
314
 
308
- first_eligibility = eligibility_list[0]
309
- insurance_info = first_eligibility.get('eligibilityInfo', {}).get('insuranceInfo', {})
310
-
311
- # Get coverage type from coverageTypes array
312
- coverage_types = insurance_info.get('coverageTypes', [])
315
+ # Get coverage type from coverageTypes array at the top level
316
+ coverage_types = eligibility_data.get('coverageTypes', [])
313
317
  insurance_type = ""
314
318
  if coverage_types:
315
319
  insurance_type = coverage_types[0].get('description', '')
316
320
 
317
321
  return {
318
322
  'insuranceType': insurance_type,
319
- 'insuranceTypeCode': insurance_info.get("productCode", ""),
320
- 'memberId': insurance_info.get("policyNumber", ""),
321
- 'payerId': insurance_info.get("payerId", "")
323
+ 'insuranceTypeCode': eligibility_data.get("productServiceCode", ""),
324
+ 'memberId': eligibility_data.get("subscriberId", ""),
325
+ 'payerId': eligibility_data.get("legalEntityCode", "")
322
326
  }
323
327
 
324
328
  def extract_legacy_policy_status(policy):
@@ -328,26 +332,19 @@ def extract_legacy_policy_status(policy):
328
332
 
329
333
  def extract_super_connector_policy_status(eligibility_data):
330
334
  """Extract policy status from Super Connector API response format"""
331
- if not eligibility_data or 'data' not in eligibility_data:
335
+ if not eligibility_data:
332
336
  return ""
333
337
 
334
- # Navigate to the first eligibility record
335
- eligibility_list = eligibility_data.get('data', {}).get('checkEligibility', {}).get('eligibility', [])
336
- if not eligibility_list:
337
- return ""
338
-
339
- first_eligibility = eligibility_list[0]
340
- insurance_info = first_eligibility.get('eligibilityInfo', {}).get('insuranceInfo', {})
341
-
342
- return insurance_info.get("policyStatus", "")
338
+ # Policy status is at the top level
339
+ return eligibility_data.get("policyStatus", "")
343
340
 
344
341
  def is_legacy_response_format(data):
345
342
  """Determine if the response is in legacy format (has memberPolicies)"""
346
343
  return data is not None and "memberPolicies" in data
347
344
 
348
345
  def is_super_connector_response_format(data):
349
- """Determine if the response is in Super Connector format (has data.checkEligibility)"""
350
- return data is not None and "data" in data and "checkEligibility" in data.get("data", {})
346
+ """Determine if the response is in Super Connector format (has rawGraphQLResponse)"""
347
+ return data is not None and "rawGraphQLResponse" in data
351
348
 
352
349
  # Function to extract required fields and display in a tabular format
353
350
  def display_eligibility_info(data, dob, member_id, output_file):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: medicafe
3
- Version: 0.250708.1
3
+ Version: 0.250711.0
4
4
  Summary: MediCafe
5
5
  Home-page: https://github.com/katanada2
6
6
  Author: Daniel Vidaud
@@ -19,14 +19,14 @@ MediLink/MediLink_837p_encoder.py,sha256=id2qhKUYq_raKcDr5pAY1xF0V_UR5KBC8SXDAeh
19
19
  MediLink/MediLink_837p_encoder_library.py,sha256=rxame7v_LcNJe8Wdt3INQkTC5MdIbZq9ySsR90OL6Lo,49924
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=_M-rspeOVoetEXA1omJfxmYgjZWhNR6KOsJu8yV0otY,39617
22
+ MediLink/MediLink_API_v3.py,sha256=VdVDvFyl4pgURqvxLxw3aJqGQiWV5NLOsM7FkNAWKVo,39735
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
26
26
  MediLink/MediLink_ConfigLoader.py,sha256=u9ecB0SIN7zuJAo8KcoQys95BtyAo-8S2n4mRd0S3XU,4356
27
27
  MediLink/MediLink_DataMgmt.py,sha256=jrTAPSNVzs1wwYl1g0_8Mda3k2B27CbaSw8Pu2qmThw,33058
28
28
  MediLink/MediLink_Decoder.py,sha256=Suw9CmUHgoe0ZW8sJP_pIO8URBrhO5FmxFF8RcUj9lI,13318
29
- MediLink/MediLink_Deductible.py,sha256=X9oQThxq706xL9Nd0G_VtxakwC9ifG66KKY9G8uRHYs,21175
29
+ MediLink/MediLink_Deductible.py,sha256=rkSaS9n20EWs7KhHYOpv-_gehBPvrC-TdI5NYJ7TM54,20864
30
30
  MediLink/MediLink_Down.py,sha256=hrDODhs-zRfOKCdiRGENN5Czu-AvdtwJj4Q7grcRXME,6518
31
31
  MediLink/MediLink_ERA_decoder.py,sha256=MiOtDcXnmevPfHAahIlTLlUc14VcQWAor9Xa7clA2Ts,8710
32
32
  MediLink/MediLink_Gmail.py,sha256=OYsASNgP4YSTaSnj9XZxPPiy0cw41JC-suLIgRyNrlQ,31439
@@ -44,8 +44,8 @@ MediLink/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
44
44
  MediLink/openssl.cnf,sha256=76VdcGCykf0Typyiv8Wd1mMVKixrQ5RraG6HnfKFqTo,887
45
45
  MediLink/test.py,sha256=kSvvJRL_3fWuNS3_x4hToOnUljGLoeEw6SUTHQWQRJk,3108
46
46
  MediLink/webapp.html,sha256=JPKT559aFVBi1r42Hz7C77Jj0teZZRumPhBev8eSOLk,19806
47
- medicafe-0.250708.1.dist-info/LICENSE,sha256=65lb-vVujdQK7uMH3RRJSMwUW-WMrMEsc5sOaUn2xUk,1096
48
- medicafe-0.250708.1.dist-info/METADATA,sha256=jpcoIsxM7jFiXBks6w5AT8rYb5nZaZdTIMd6NrCYlwg,5501
49
- medicafe-0.250708.1.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
50
- medicafe-0.250708.1.dist-info/top_level.txt,sha256=3uOwR4q_SP8Gufk2uCHoKngAgbtdOwQC6Qjl7ViBa_c,17
51
- medicafe-0.250708.1.dist-info/RECORD,,
47
+ medicafe-0.250711.0.dist-info/LICENSE,sha256=65lb-vVujdQK7uMH3RRJSMwUW-WMrMEsc5sOaUn2xUk,1096
48
+ medicafe-0.250711.0.dist-info/METADATA,sha256=Z-zv1ZzWjxnTHDcXiZevjMfpjQqqkn9x2xJFMZwcvNg,5501
49
+ medicafe-0.250711.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
50
+ medicafe-0.250711.0.dist-info/top_level.txt,sha256=3uOwR4q_SP8Gufk2uCHoKngAgbtdOwQC6Qjl7ViBa_c,17
51
+ medicafe-0.250711.0.dist-info/RECORD,,