medicafe 0.251015.0__py3-none-any.whl → 0.251016.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.

MediBot/__init__.py CHANGED
@@ -19,7 +19,7 @@ Smart Import Integration:
19
19
  medibot_main = get_components('medibot_main')
20
20
  """
21
21
 
22
- __version__ = "0.251015.0"
22
+ __version__ = "0.251016.0"
23
23
  __author__ = "Daniel Vidaud"
24
24
  __email__ = "daniel@personalizedtransformation.com"
25
25
 
MediCafe/__init__.py CHANGED
@@ -27,7 +27,7 @@ Smart Import System:
27
27
  api_suite = get_api_access()
28
28
  """
29
29
 
30
- __version__ = "0.251015.0"
30
+ __version__ = "0.251016.0"
31
31
  __author__ = "Daniel Vidaud"
32
32
  __email__ = "daniel@personalizedtransformation.com"
33
33
 
@@ -375,12 +375,16 @@ def manual_deductible_lookup():
375
375
 
376
376
  # Fetch eligibility data
377
377
  found_data = False
378
+ printed_messages = set()
378
379
  for i, payer_id in enumerate(payer_ids, 1):
379
380
  print("Checking Payer ID {} ({}/{}): {}".format(payer_id, i, len(payer_ids), payer_id))
380
381
 
381
382
  # Use the current mode setting for validation
382
383
  run_validation = DEBUG_MODE
383
- eligibility_data = get_eligibility_info(client, payer_id, provider_last_name, formatted_dob, member_id, npi, run_validation=run_validation, is_manual_lookup=True)
384
+ eligibility_data = get_eligibility_info(
385
+ client, payer_id, provider_last_name, formatted_dob, member_id, npi,
386
+ run_validation=run_validation, is_manual_lookup=True, printed_messages=printed_messages
387
+ )
384
388
  if eligibility_data:
385
389
  found_data = True
386
390
 
@@ -484,13 +488,28 @@ def manual_deductible_lookup():
484
488
  enhanced_result['policy_status'][:14],
485
489
  enhanced_result['remaining_amount'][:14])
486
490
  output_file.write(table_row + "\n")
491
+
492
+ # Persist per-row error diagnostics in a user-friendly way
493
+ try:
494
+ row_reason = _compute_error_reason(enhanced_result)
495
+ row_messages = enhanced_result.get('error_messages', []) or []
496
+ if row_reason or row_messages:
497
+ output_file.write(" >> Errors:" + "\n")
498
+ if row_reason:
499
+ output_file.write(" >> - {}\n".format(row_reason))
500
+ for msg in row_messages:
501
+ # Avoid duplicating the reason message if identical
502
+ if not row_reason or msg.strip() != row_reason.strip():
503
+ output_file.write(" >> - {}\n".format(str(msg)))
504
+ except Exception:
505
+ pass
487
506
  else:
488
507
  display_eligibility_info(eligibility_data, formatted_dob, member_id, output_file)
489
508
 
490
509
  # Ask if user wants to open the report
491
510
  open_report = input("\nEligibility data found! Open the report? (Y/N): ").strip().lower()
492
511
  if open_report in ['y', 'yes']:
493
- os.system('notepad.exe "{}"'.format(output_file_path))
512
+ os.startfile(output_file_path)
494
513
  print("Manual eligibility report generated: {}\n".format(output_file_path))
495
514
  break # Assuming one payer ID per manual lookup
496
515
  else:
@@ -523,6 +542,8 @@ def get_eligibility_info(client, payer_id, provider_last_name, date_of_birth, me
523
542
  if run_validation:
524
543
  # Debug mode: Call both APIs and run validation
525
544
  MediLink_ConfigLoader.log("Running in DEBUG MODE - calling both APIs", level="INFO")
545
+ # Always initialize row-level error messages for diagnostics
546
+ error_messages_for_row = []
526
547
 
527
548
  # Get legacy response
528
549
  MediLink_ConfigLoader.log("Getting legacy get_eligibility_v3 API response", level="INFO")
@@ -596,6 +617,11 @@ def get_eligibility_info(client, payer_id, provider_last_name, date_of_birth, me
596
617
  if detail_msg not in printed_messages:
597
618
  print(detail_msg)
598
619
  printed_messages.add(detail_msg)
620
+ # Accumulate per-row messages for persistence in reports
621
+ try:
622
+ error_messages_for_row.append("{} - {}".format(error_code, error_desc))
623
+ except Exception:
624
+ pass
599
625
 
600
626
  # Check for data in error extensions (some APIs return data here)
601
627
  extensions = error.get('extensions', {})
@@ -607,20 +633,25 @@ def get_eligibility_info(client, payer_id, provider_last_name, date_of_birth, me
607
633
  if details:
608
634
  first_detail = details[0]
609
635
  print(" First detail: {}".format(first_detail))
636
+ # Persist a brief extension note without dumping raw objects
637
+ try:
638
+ error_messages_for_row.append("Extensions include {} detail record(s)".format(len(details)))
639
+ except Exception:
640
+ pass
610
641
 
611
642
  # Check status code
612
643
  if super_connector_eligibility:
613
644
  status_code = super_connector_eligibility.get('statuscode')
614
- if status_code and status_code != '200':
645
+ if status_code is not None and str(status_code).strip() != '200':
615
646
  print("Super Connector API status code: {} (non-200 indicates errors)".format(status_code))
647
+ # Record status code for the row diagnostics
648
+ error_messages_for_row.append("Status code {} from Super Connector".format(status_code))
616
649
 
617
650
  # Open validation report in Notepad (only for manual lookups, not batch processing)
618
651
  if validation_file_path and os.path.exists(validation_file_path):
619
652
  # Only open in manual mode - batch processing will handle this separately
620
653
  if is_manual_lookup: # Check if we're in manual lookup mode
621
- ret = os.system('notepad.exe "{}"'.format(validation_file_path))
622
- if ret != 0:
623
- print("Failed to open Notepad (exit code: {}). Please open manually: {}".format(ret, validation_file_path))
654
+ os.startfile(validation_file_path)
624
655
  elif validation_file_path:
625
656
  print("\nValidation report file was not created: {}".format(validation_file_path))
626
657
  except Exception as e:
@@ -628,7 +659,17 @@ def get_eligibility_info(client, payer_id, provider_last_name, date_of_birth, me
628
659
 
629
660
  # After validation, merge responses
630
661
  try:
631
- merged_data = merge_responses(super_connector_eligibility, legacy_eligibility, date_of_birth, member_id)
662
+ if merge_responses is not None:
663
+ merged_data = merge_responses(super_connector_eligibility, legacy_eligibility, date_of_birth, member_id)
664
+ else:
665
+ MediLink_ConfigLoader.log("merge_responses utility not available; returning raw API response", level="WARNING")
666
+ merged_data = super_connector_eligibility or legacy_eligibility or {}
667
+ # Attach accumulated row-level messages for downstream display/persistence
668
+ try:
669
+ if isinstance(merged_data, dict) and error_messages_for_row:
670
+ merged_data['error_messages'] = error_messages_for_row
671
+ except Exception:
672
+ pass
632
673
  return merged_data
633
674
  except Exception as e:
634
675
  MediLink_ConfigLoader.log("Error in merge_responses: {}".format(e), level="ERROR")
@@ -713,8 +754,10 @@ def display_eligibility_info(data, dob, member_id, output_file, patient_id="", s
713
754
  if data is None:
714
755
  return
715
756
 
716
- # Convert to enhanced format
717
- enhanced_data = convert_eligibility_to_enhanced_format(data, dob, member_id, patient_id, service_date)
757
+ # Convert to enhanced format (guard if utility missing)
758
+ enhanced_data = None
759
+ if convert_eligibility_to_enhanced_format is not None:
760
+ enhanced_data = convert_eligibility_to_enhanced_format(data, dob, member_id, patient_id, service_date)
718
761
  if enhanced_data:
719
762
  # Write to output file in legacy format for compatibility
720
763
  table_row = "{:<20} | {:<10} | {:<40} | {:<5} | {:<14} | {:<14}".format(
@@ -727,6 +770,27 @@ def display_eligibility_info(data, dob, member_id, output_file, patient_id="", s
727
770
  output_file.write(table_row + "\n")
728
771
  print(table_row) # Print to console for progressive display
729
772
 
773
+ # Helper to compute a user-friendly error explanation for a result row
774
+ def _compute_error_reason(record):
775
+ try:
776
+ if not isinstance(record, dict):
777
+ return ""
778
+ reason = str(record.get('error_reason', '')).strip()
779
+ name_unknown = (not str(record.get('patient_name', '')).strip()) or (record.get('patient_name') == 'Unknown Patient')
780
+ has_error = (str(record.get('status', '')) == 'Error') or (str(record.get('data_source', '')) in ['None', 'Error'])
781
+ amount_missing = (str(record.get('remaining_amount', '')) == 'Not Found')
782
+
783
+ if not reason:
784
+ if name_unknown:
785
+ reason = 'Patient name could not be determined from API responses or CSV backfill'
786
+ elif amount_missing:
787
+ reason = 'Deductible remaining amount not found in eligibility response'
788
+ elif has_error:
789
+ reason = 'Eligibility lookup encountered an error; see logs for details'
790
+ return reason
791
+ except Exception:
792
+ return ""
793
+
730
794
  # Global mode flags (will be set in main)
731
795
  LEGACY_MODE = False
732
796
  DEBUG_MODE = False
@@ -1042,6 +1106,20 @@ if __name__ == "__main__":
1042
1106
  result['remaining_amount'][:14])
1043
1107
  output_file.write(table_row + "\n")
1044
1108
 
1109
+ # Persist per-row error diagnostics in a user-friendly way
1110
+ try:
1111
+ row_reason = _compute_error_reason(result)
1112
+ row_messages = result.get('error_messages', []) or []
1113
+ if row_reason or row_messages:
1114
+ output_file.write(" >> Errors:" + "\n")
1115
+ if row_reason:
1116
+ output_file.write(" >> - {}\n".format(row_reason))
1117
+ for msg in row_messages:
1118
+ if not row_reason or msg.strip() != row_reason.strip():
1119
+ output_file.write(" >> - {}\n".format(str(msg)))
1120
+ except Exception:
1121
+ pass
1122
+
1045
1123
  # Write enhanced error summary to file
1046
1124
  if errors:
1047
1125
  error_msg = "\nErrors encountered during API calls:\n"
@@ -1053,7 +1131,7 @@ if __name__ == "__main__":
1053
1131
  # Ask if user wants to open the report
1054
1132
  open_report = input("\nBatch processing complete! Open the eligibility report? (Y/N): ").strip().lower()
1055
1133
  if open_report in ['y', 'yes']:
1056
- os.system('notepad.exe "{}"'.format(output_file_path))
1134
+ os.startfile(output_file_path)
1057
1135
 
1058
1136
  # Print summary of validation reports only in debug mode
1059
1137
  if DEBUG_MODE:
@@ -1072,9 +1150,7 @@ if __name__ == "__main__":
1072
1150
  if open_validation in ['y', 'yes']:
1073
1151
  for file_path in validation_files_created:
1074
1152
  print("Opening: {}".format(os.path.basename(file_path)))
1075
- ret = os.system('notepad.exe "{}"'.format(file_path))
1076
- if ret != 0:
1077
- print("Failed to open Notepad for: {}".format(os.path.basename(file_path)))
1153
+ os.startfile(file_path)
1078
1154
  else:
1079
1155
  print("No validation reports were generated.")
1080
1156
  print("This may be because:")
MediLink/__init__.py CHANGED
@@ -22,7 +22,7 @@ Smart Import Integration:
22
22
  datamgmt = get_components('medilink_datamgmt')
23
23
  """
24
24
 
25
- __version__ = "0.251015.0"
25
+ __version__ = "0.251016.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.251015.0
3
+ Version: 0.251016.0
4
4
  Summary: MediCafe
5
5
  Home-page: https://github.com/katanada2/MediCafe
6
6
  Author: Daniel Vidaud
@@ -12,7 +12,7 @@ MediBot/MediBot_dataformat_library.py,sha256=D46fdPtxcgfWTzaLBtSvjtozzZBNqNiODgu
12
12
  MediBot/MediBot_debug.bat,sha256=F5Lfi3nFEEo4Ddx9EbX94u3fNAMgzMp3wsn-ULyASTM,6017
13
13
  MediBot/MediBot_docx_decoder.py,sha256=9BSjV-kB90VHnqfL_5iX4zl5u0HcHvHuL7YNfx3gXpQ,33143
14
14
  MediBot/MediBot_smart_import.py,sha256=Emvz7NwemHGCHvG5kZcUyXMcCheidbGKaPfOTg-YCEs,6684
15
- MediBot/__init__.py,sha256=RZDruyBkYuWNTwJuX6TMpymOyX3V6jq-jUTBwV249rE,3192
15
+ MediBot/__init__.py,sha256=FZWJSZwXT7mV-SuC2nrJ4Bu8ihD-2ovcwi_cB_Q-wxE,3192
16
16
  MediBot/clear_cache.bat,sha256=F6-VhETWw6xDdGWG2wUqvtXjCl3lY4sSUFqF90bM8-8,1860
17
17
  MediBot/crash_diagnostic.bat,sha256=j8kUtyBg6NOWbXpeFuEqIRHOkVzgUrLOqO3FBMfNxTo,9268
18
18
  MediBot/f_drive_diagnostic.bat,sha256=4572hZaiwZ5wVAarPcZJQxkOSTwAdDuT_X914noARak,6878
@@ -22,7 +22,7 @@ MediBot/process_csvs.bat,sha256=3tI7h1z9eRj8rUUL4wJ7dy-Qrak20lRmpAPtGbUMbVQ,3489
22
22
  MediBot/update_json.py,sha256=vvUF4mKCuaVly8MmoadDO59M231fCIInc0KI1EtDtPA,3704
23
23
  MediBot/update_medicafe.py,sha256=G1lyvVOHYuho1d-TJQNN6qaB4HBWaJ2PpXqemBoPlRQ,17937
24
24
  MediCafe/MediLink_ConfigLoader.py,sha256=NoLb2YiJwlkrRYCt2PHvcFJ7yTIRWQCrsvkZIJWreM4,11141
25
- MediCafe/__init__.py,sha256=DGCg0jShqGBlX0QwzU-oOvl21DxN0Yadu1qEYVTFVtU,5721
25
+ MediCafe/__init__.py,sha256=836lZyypRMJOboD7D8PCWhdX1-qeiLYV8jIkOddN6ZU,5721
26
26
  MediCafe/__main__.py,sha256=mRNyk3D9Ilnu2XhgVI_rut7r5Ro7UIKtwV871giAHI8,12992
27
27
  MediCafe/api_core.py,sha256=r9cqa5-HU4A7iz3NLxzRwuxsxOfDiJn9SRgtPjT83qU,90764
28
28
  MediCafe/api_factory.py,sha256=I5AeJoyu6m7oCrjc2OvVvO_4KSBRutTsR1riiWhTZV0,12086
@@ -47,7 +47,7 @@ MediLink/MediLink_Charges.py,sha256=82fnqHGvT7tfdfjucnFHiLdUE0WhHDXrcS0k_Ln3c8U,
47
47
  MediLink/MediLink_ClaimStatus.py,sha256=nKX7QymhCULiaGfISYw_P0Eqy0TP6qKG4C2d3TdGFVo,22720
48
48
  MediLink/MediLink_DataMgmt.py,sha256=9hc5jyWU65nYT66afDybOyYAcW-DvEYuHpWTun96U50,52407
49
49
  MediLink/MediLink_Decoder.py,sha256=1gzdybNg4Vv69s5PNbX8bPNrXT_N_kPpFpt2HpkauWA,16430
50
- MediLink/MediLink_Deductible.py,sha256=jr-TrfOTxQDc4dwvwUy4jSSb_AnsU0pWLq_kyktAgZk,57942
50
+ MediLink/MediLink_Deductible.py,sha256=zXywVRs5JuRVi_2e37vG25OR-0F8M4QPWjZtm7Oh9PE,62232
51
51
  MediLink/MediLink_Deductible_Validator.py,sha256=x6tHJOi88TblUpDPSH6QhIdXXRgr3rXI7kYPVGZYCgU,24998
52
52
  MediLink/MediLink_Display_Utils.py,sha256=wWGbqhGL_6vZrVE4_7-xYg7fdjVbTR1149VJTS3deI0,24513
53
53
  MediLink/MediLink_Down.py,sha256=s4_z-RaqHYanjwbQCl-OSkg4XIpcIQ2Q6jXa8-q_QXw,28111
@@ -63,15 +63,15 @@ MediLink/MediLink_insurance_utils.py,sha256=g741Fj2K26cMy0JX5d_XavMw9LgkK6hjaUJY
63
63
  MediLink/MediLink_main.py,sha256=CAXu0IRzhra3ppIFDcCppFNAZp7kCuN6gPtJSdFqGzs,24857
64
64
  MediLink/MediLink_smart_import.py,sha256=B5SfBn_4bYEWJJDolXbjnwKx_-MaqGZ76LyXQwWDV80,9838
65
65
  MediLink/Soumit_api.py,sha256=5JfOecK98ZC6NpZklZW2AkOzkjvrbYxpJpZNH3rFxDw,497
66
- MediLink/__init__.py,sha256=pUz0lDh96t0FYdCxUQlawfKMvDiib088-00IsHgRwfk,3888
66
+ MediLink/__init__.py,sha256=HSxr33c98IfHHjLqOKA2edeqEaLPKTcjGDOyh4SbnCQ,3888
67
67
  MediLink/gmail_http_utils.py,sha256=gtqCCrzJC7e8JFQzMNrf7EbK8na2h4sfTu-NMaZ_UHc,4006
68
68
  MediLink/gmail_oauth_utils.py,sha256=Ugr-DEqs4_RddRMSCJ_dbgA3TVeaxpbAor-dktcTIgY,3713
69
69
  MediLink/openssl.cnf,sha256=76VdcGCykf0Typyiv8Wd1mMVKixrQ5RraG6HnfKFqTo,887
70
70
  MediLink/test.py,sha256=DM_E8gEbhbVfTAm3wTMiNnK2GCD1e5eH6gwTk89QIc4,3116
71
71
  MediLink/webapp.html,sha256=MI9zZ4y1_h5Ji3nz2fmm6Q29AsPunks-wR-R8Ct73-w,19856
72
- medicafe-0.251015.0.dist-info/LICENSE,sha256=65lb-vVujdQK7uMH3RRJSMwUW-WMrMEsc5sOaUn2xUk,1096
73
- medicafe-0.251015.0.dist-info/METADATA,sha256=AVt3fFn191rtXLPHcmal5udTp73FL8RTu8fu-YpMndU,3414
74
- medicafe-0.251015.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
75
- medicafe-0.251015.0.dist-info/entry_points.txt,sha256=m3RBUBjr-xRwEkKJ5W4a7NlqHZP_1rllGtjZnrRqKe8,52
76
- medicafe-0.251015.0.dist-info/top_level.txt,sha256=U6-WBJ9RCEjyIs0BlzbQq_PwedCp_IV9n1616NNV5zA,26
77
- medicafe-0.251015.0.dist-info/RECORD,,
72
+ medicafe-0.251016.0.dist-info/LICENSE,sha256=65lb-vVujdQK7uMH3RRJSMwUW-WMrMEsc5sOaUn2xUk,1096
73
+ medicafe-0.251016.0.dist-info/METADATA,sha256=azl9SAxSeR4LVnIoZ447V27-FdNaZO4KUddOKO2ofq4,3414
74
+ medicafe-0.251016.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
75
+ medicafe-0.251016.0.dist-info/entry_points.txt,sha256=m3RBUBjr-xRwEkKJ5W4a7NlqHZP_1rllGtjZnrRqKe8,52
76
+ medicafe-0.251016.0.dist-info/top_level.txt,sha256=U6-WBJ9RCEjyIs0BlzbQq_PwedCp_IV9n1616NNV5zA,26
77
+ medicafe-0.251016.0.dist-info/RECORD,,