medicafe 0.251014.0__tar.gz → 0.251015.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 (84) hide show
  1. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediBot/__init__.py +1 -1
  2. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediCafe/__init__.py +1 -1
  3. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediCafe/deductible_utils.py +49 -4
  4. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediLink/MediLink_Display_Utils.py +33 -2
  5. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediLink/__init__.py +1 -1
  6. {medicafe-0.251014.0/medicafe.egg-info → medicafe-0.251015.0}/PKG-INFO +1 -1
  7. {medicafe-0.251014.0 → medicafe-0.251015.0/medicafe.egg-info}/PKG-INFO +1 -1
  8. {medicafe-0.251014.0 → medicafe-0.251015.0}/setup.py +1 -1
  9. {medicafe-0.251014.0 → medicafe-0.251015.0}/LICENSE +0 -0
  10. {medicafe-0.251014.0 → medicafe-0.251015.0}/MANIFEST.in +0 -0
  11. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediBot/MediBot.bat +0 -0
  12. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediBot/MediBot.py +0 -0
  13. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediBot/MediBot_Charges.py +0 -0
  14. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediBot/MediBot_Crosswalk_Library.py +0 -0
  15. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediBot/MediBot_Crosswalk_Utils.py +0 -0
  16. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediBot/MediBot_Notepad_Utils.py +0 -0
  17. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediBot/MediBot_Post.py +0 -0
  18. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediBot/MediBot_Preprocessor.py +0 -0
  19. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediBot/MediBot_Preprocessor_lib.py +0 -0
  20. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediBot/MediBot_UI.py +0 -0
  21. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediBot/MediBot_dataformat_library.py +0 -0
  22. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediBot/MediBot_debug.bat +0 -0
  23. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediBot/MediBot_docx_decoder.py +0 -0
  24. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediBot/MediBot_smart_import.py +0 -0
  25. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediBot/clear_cache.bat +0 -0
  26. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediBot/crash_diagnostic.bat +0 -0
  27. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediBot/f_drive_diagnostic.bat +0 -0
  28. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediBot/full_debug_suite.bat +0 -0
  29. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediBot/get_medicafe_version.py +0 -0
  30. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediBot/process_csvs.bat +0 -0
  31. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediBot/update_json.py +0 -0
  32. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediBot/update_medicafe.py +0 -0
  33. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediCafe/MediLink_ConfigLoader.py +0 -0
  34. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediCafe/__main__.py +0 -0
  35. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediCafe/api_core.py +0 -0
  36. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediCafe/api_factory.py +0 -0
  37. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediCafe/api_utils.py +0 -0
  38. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediCafe/core_utils.py +0 -0
  39. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediCafe/error_reporter.py +0 -0
  40. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediCafe/graphql_utils.py +0 -0
  41. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediCafe/logging_config.py +0 -0
  42. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediCafe/logging_demo.py +0 -0
  43. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediCafe/migration_helpers.py +0 -0
  44. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediCafe/smart_import.py +0 -0
  45. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediCafe/submission_index.py +0 -0
  46. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediLink/InsuranceTypeService.py +0 -0
  47. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediLink/MediLink_837p_cob_library.py +0 -0
  48. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediLink/MediLink_837p_encoder.py +0 -0
  49. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediLink/MediLink_837p_encoder_library.py +0 -0
  50. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediLink/MediLink_837p_utilities.py +0 -0
  51. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediLink/MediLink_API_Generator.py +0 -0
  52. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediLink/MediLink_Azure.py +0 -0
  53. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediLink/MediLink_Charges.py +0 -0
  54. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediLink/MediLink_ClaimStatus.py +0 -0
  55. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediLink/MediLink_DataMgmt.py +0 -0
  56. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediLink/MediLink_Decoder.py +0 -0
  57. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediLink/MediLink_Deductible.py +0 -0
  58. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediLink/MediLink_Deductible_Validator.py +0 -0
  59. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediLink/MediLink_Down.py +0 -0
  60. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediLink/MediLink_Gmail.py +0 -0
  61. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediLink/MediLink_Mailer.py +0 -0
  62. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediLink/MediLink_Parser.py +0 -0
  63. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediLink/MediLink_PatientProcessor.py +0 -0
  64. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediLink/MediLink_Scan.py +0 -0
  65. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediLink/MediLink_Scheduler.py +0 -0
  66. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediLink/MediLink_UI.py +0 -0
  67. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediLink/MediLink_Up.py +0 -0
  68. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediLink/MediLink_insurance_utils.py +0 -0
  69. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediLink/MediLink_main.py +0 -0
  70. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediLink/MediLink_smart_import.py +0 -0
  71. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediLink/Soumit_api.py +0 -0
  72. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediLink/gmail_http_utils.py +0 -0
  73. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediLink/gmail_oauth_utils.py +0 -0
  74. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediLink/openssl.cnf +0 -0
  75. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediLink/test.py +0 -0
  76. {medicafe-0.251014.0 → medicafe-0.251015.0}/MediLink/webapp.html +0 -0
  77. {medicafe-0.251014.0 → medicafe-0.251015.0}/README.md +0 -0
  78. {medicafe-0.251014.0 → medicafe-0.251015.0}/medicafe.egg-info/SOURCES.txt +0 -0
  79. {medicafe-0.251014.0 → medicafe-0.251015.0}/medicafe.egg-info/dependency_links.txt +0 -0
  80. {medicafe-0.251014.0 → medicafe-0.251015.0}/medicafe.egg-info/entry_points.txt +0 -0
  81. {medicafe-0.251014.0 → medicafe-0.251015.0}/medicafe.egg-info/not-zip-safe +0 -0
  82. {medicafe-0.251014.0 → medicafe-0.251015.0}/medicafe.egg-info/requires.txt +0 -0
  83. {medicafe-0.251014.0 → medicafe-0.251015.0}/medicafe.egg-info/top_level.txt +0 -0
  84. {medicafe-0.251014.0 → medicafe-0.251015.0}/setup.cfg +0 -0
@@ -19,7 +19,7 @@ Smart Import Integration:
19
19
  medibot_main = get_components('medibot_main')
20
20
  """
21
21
 
22
- __version__ = "0.251014.0"
22
+ __version__ = "0.251015.0"
23
23
  __author__ = "Daniel Vidaud"
24
24
  __email__ = "daniel@personalizedtransformation.com"
25
25
 
@@ -27,7 +27,7 @@ Smart Import System:
27
27
  api_suite = get_api_access()
28
28
  """
29
29
 
30
- __version__ = "0.251014.0"
30
+ __version__ = "0.251015.0"
31
31
  __author__ = "Daniel Vidaud"
32
32
  __email__ = "daniel@personalizedtransformation.com"
33
33
 
@@ -778,7 +778,17 @@ def convert_eligibility_to_enhanced_format(data, dob, member_id, patient_id="",
778
778
  'data_source': 'Legacy',
779
779
  'is_successful': bool(patient_name and remaining_amount != 'Not Found')
780
780
  }
781
-
781
+
782
+ # Provide a diagnostic reason when the patient name couldn't be resolved
783
+ if not patient_name:
784
+ try:
785
+ if not compatibility.get("has_patient_info"):
786
+ result['error_reason'] = 'Legacy API response missing patientInfo'
787
+ else:
788
+ result['error_reason'] = 'Legacy patientInfo present but name fields blank'
789
+ except Exception:
790
+ result['error_reason'] = 'Unable to resolve patient name from Legacy response'
791
+
782
792
  if MediLink_ConfigLoader:
783
793
  MediLink_ConfigLoader.log("Successfully converted Legacy API response: {}".format(result), level="DEBUG")
784
794
  return result
@@ -815,7 +825,17 @@ def convert_eligibility_to_enhanced_format(data, dob, member_id, patient_id="",
815
825
  'data_source': 'OptumAI',
816
826
  'is_successful': bool(patient_name and remaining_amount != 'Not Found')
817
827
  }
818
-
828
+
829
+ # Provide a diagnostic reason when the patient name couldn't be resolved
830
+ if not patient_name:
831
+ try:
832
+ if not compatibility.get("has_patient_info"):
833
+ result['error_reason'] = 'OptumAI response missing member info'
834
+ else:
835
+ result['error_reason'] = 'OptumAI member info present but name fields blank'
836
+ except Exception:
837
+ result['error_reason'] = 'Unable to resolve patient name from OptumAI response'
838
+
819
839
  if MediLink_ConfigLoader:
820
840
  MediLink_ConfigLoader.log("Successfully converted Super Connector API response: {}".format(result), level="DEBUG")
821
841
  return result
@@ -929,7 +949,8 @@ def merge_responses(optumai_data, legacy_data, dob, member_id):
929
949
  'policy_status': 'Not Available',
930
950
  'remaining_amount': 'Not Found',
931
951
  'data_source': 'None',
932
- 'is_successful': False
952
+ 'is_successful': False,
953
+ 'error_reason': 'No eligibility responses returned from OptumAI or Legacy APIs'
933
954
  }
934
955
 
935
956
  # Helper to check if data is valid (not None, has required fields)
@@ -1047,7 +1068,8 @@ def merge_responses(optumai_data, legacy_data, dob, member_id):
1047
1068
  'policy_status': 'Not Available',
1048
1069
  'remaining_amount': 'Not Found',
1049
1070
  'payer_id': '',
1050
- 'data_source': 'None'
1071
+ 'data_source': 'None',
1072
+ 'error_reason': 'Unable to extract patient name from available eligibility responses'
1051
1073
  }
1052
1074
 
1053
1075
  # Intelligently backfill missing fields from Legacy API (secondary)
@@ -1129,6 +1151,22 @@ def merge_responses(optumai_data, legacy_data, dob, member_id):
1129
1151
  if 'data_source' not in merged or not merged['data_source']:
1130
1152
  merged['data_source'] = 'OptumAI' if primary == optumai_data else 'Legacy' if primary else 'None'
1131
1153
 
1154
+ # If patient name still missing or unknown, infer a failure reason when possible
1155
+ try:
1156
+ if (not merged.get('patient_name')) or (merged.get('patient_name') == 'Unknown Patient'):
1157
+ if not merged.get('error_reason'):
1158
+ if is_super_connector_response_format(optumai_data or {}):
1159
+ raw = (optumai_data or {}).get('rawGraphQLResponse', {})
1160
+ elig = raw.get('data', {}).get('checkEligibility', {}).get('eligibility', [])
1161
+ merged['error_reason'] = 'OptumAI response contained no eligibility records' if not elig else 'OptumAI eligibility present but member name missing'
1162
+ elif is_legacy_response_format(legacy_data or {}):
1163
+ policies = (legacy_data or {}).get('memberPolicies', [])
1164
+ merged['error_reason'] = 'Legacy API returned no memberPolicies records' if not policies else 'Legacy policy present but patient name missing'
1165
+ else:
1166
+ merged['error_reason'] = 'Patient name not found in responses or CSV backfill'
1167
+ except Exception:
1168
+ pass
1169
+
1132
1170
  # Set final success status
1133
1171
  merged['is_successful'] = bool(merged.get('patient_name') and
1134
1172
  merged.get('patient_name') != 'Unknown Patient' and
@@ -1214,6 +1252,13 @@ def backfill_enhanced_result(enhanced_result, csv_row=None):
1214
1252
  csv_name = _format_patient_name_from_csv_row(csv_row)
1215
1253
  if csv_name:
1216
1254
  result['patient_name'] = csv_name
1255
+ else:
1256
+ # Attach CSV-specific diagnostic if still missing
1257
+ try:
1258
+ if not result.get('error_reason'):
1259
+ result['error_reason'] = 'CSV patient name fields missing or blank'
1260
+ except Exception:
1261
+ pass
1217
1262
 
1218
1263
  # Backfill patient_id
1219
1264
  if not result.get('patient_id') and csv_row is not None:
@@ -227,7 +227,9 @@ def _normalize_post_api_data(eligibility_result):
227
227
  'insurance_type': str(eligibility_result.get('insurance_type', '')),
228
228
  'policy_status': str(eligibility_result.get('policy_status', '')),
229
229
  'remaining_amount': str(eligibility_result.get('remaining_amount', '')),
230
- 'data_source': str(eligibility_result.get('data_source', ''))
230
+ 'data_source': str(eligibility_result.get('data_source', '')),
231
+ 'error_reason': str(eligibility_result.get('error_reason', '')),
232
+ 'is_successful': bool(eligibility_result.get('is_successful', False))
231
233
  }
232
234
 
233
235
  # Default unknown patient name when blank
@@ -440,6 +442,9 @@ def _display_primary_line(record, line_number, col_widths, context):
440
442
  str(record.get('data_source', ''))[:col_widths['data_source']], col_widths['data_source']
441
443
  ))
442
444
 
445
+ # After primary line in post-API view, display an explanatory error row when appropriate
446
+ _maybe_display_error_row(record, context)
447
+
443
448
  def _display_secondary_line(record, col_widths, context):
444
449
  """Display secondary line with dashes for grouped data"""
445
450
  patient_id_dashes = '-' * min(len(str(record.get('patient_id', ''))), col_widths['patient_id'])
@@ -491,4 +496,30 @@ def _display_secondary_line(record, col_widths, context):
491
496
  policy_status_dashes, col_widths['policy_status'],
492
497
  str(record.get('remaining_amount', ''))[:col_widths['remaining_amount']], col_widths['remaining_amount'],
493
498
  str(record.get('data_source', ''))[:col_widths['data_source']], col_widths['data_source']
494
- ))
499
+ ))
500
+
501
+ # For grouped secondary lines, we do not repeat error rows
502
+
503
+ def _maybe_display_error_row(record, context):
504
+ """Print an explanatory error row beneath the primary line when name or other lookups failed."""
505
+ try:
506
+ if context != 'post_api':
507
+ return
508
+ name_unknown = (not record.get('patient_name')) or (record.get('patient_name') == 'Unknown Patient')
509
+ has_error = (record.get('status') == 'Error') or (record.get('data_source') in ['None', 'Error'])
510
+ amount_missing = (str(record.get('remaining_amount', '')) == 'Not Found')
511
+ reason = record.get('error_reason', '')
512
+
513
+ if not reason:
514
+ if name_unknown:
515
+ reason = 'Patient name could not be determined from API responses or CSV backfill'
516
+ elif amount_missing:
517
+ reason = 'Deductible remaining amount not found in eligibility response'
518
+ elif has_error:
519
+ reason = 'Eligibility lookup encountered an error; see logs for details'
520
+
521
+ if reason:
522
+ print(" >> Error: {}".format(reason))
523
+ except Exception:
524
+ # Never let diagnostics break table rendering
525
+ pass
@@ -22,7 +22,7 @@ Smart Import Integration:
22
22
  datamgmt = get_components('medilink_datamgmt')
23
23
  """
24
24
 
25
- __version__ = "0.251014.0"
25
+ __version__ = "0.251015.0"
26
26
  __author__ = "Daniel Vidaud"
27
27
  __email__ = "daniel@personalizedtransformation.com"
28
28
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: medicafe
3
- Version: 0.251014.0
3
+ Version: 0.251015.0
4
4
  Summary: MediCafe
5
5
  Home-page: https://github.com/katanada2/MediCafe
6
6
  Author: Daniel Vidaud
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: medicafe
3
- Version: 0.251014.0
3
+ Version: 0.251015.0
4
4
  Summary: MediCafe
5
5
  Home-page: https://github.com/katanada2/MediCafe
6
6
  Author: Daniel Vidaud
@@ -54,7 +54,7 @@ if long_description_text is None:
54
54
 
55
55
  setup(
56
56
  name='medicafe',
57
- version="0.251014.0",
57
+ version="0.251015.0",
58
58
  description='MediCafe',
59
59
  long_description=long_description_text,
60
60
  long_description_content_type='text/markdown',
File without changes
File without changes
File without changes
File without changes