medicafe 0.250806.10__tar.gz → 0.250806.12__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 (74) hide show
  1. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediBot/MediBot.py +1 -1
  2. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediBot/MediBot_Preprocessor_lib.py +84 -13
  3. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediLink/MediLink_837p_encoder_library.py +12 -0
  4. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediLink/MediLink_PatientProcessor.py +16 -1
  5. {medicafe-0.250806.10 → medicafe-0.250806.12}/PKG-INFO +1 -1
  6. {medicafe-0.250806.10 → medicafe-0.250806.12}/medicafe.egg-info/PKG-INFO +1 -1
  7. {medicafe-0.250806.10 → medicafe-0.250806.12}/setup.py +1 -1
  8. {medicafe-0.250806.10 → medicafe-0.250806.12}/LICENSE +0 -0
  9. {medicafe-0.250806.10 → medicafe-0.250806.12}/MANIFEST.in +0 -0
  10. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediBot/MediBot.bat +0 -0
  11. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediBot/MediBot_Charges.py +0 -0
  12. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediBot/MediBot_Crosswalk_Library.py +0 -0
  13. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediBot/MediBot_Crosswalk_Utils.py +0 -0
  14. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediBot/MediBot_Post.py +0 -0
  15. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediBot/MediBot_Preprocessor.py +0 -0
  16. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediBot/MediBot_UI.py +0 -0
  17. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediBot/MediBot_dataformat_library.py +0 -0
  18. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediBot/MediBot_docx_decoder.py +0 -0
  19. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediBot/MediBot_smart_import.py +0 -0
  20. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediBot/__init__.py +0 -0
  21. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediBot/get_medicafe_version.py +0 -0
  22. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediBot/update_json.py +0 -0
  23. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediBot/update_medicafe.py +0 -0
  24. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediCafe/MediLink_ConfigLoader.py +0 -0
  25. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediCafe/__init__.py +0 -0
  26. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediCafe/__main__.py +0 -0
  27. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediCafe/api_core.py +0 -0
  28. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediCafe/api_core_backup.py +0 -0
  29. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediCafe/api_factory.py +0 -0
  30. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediCafe/api_utils.py +0 -0
  31. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediCafe/core_utils.py +0 -0
  32. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediCafe/graphql_utils.py +0 -0
  33. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediCafe/logging_config.py +0 -0
  34. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediCafe/logging_demo.py +0 -0
  35. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediCafe/migration_helpers.py +0 -0
  36. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediCafe/smart_import.py +0 -0
  37. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediLink/MediLink_837p_cob_library.py +0 -0
  38. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediLink/MediLink_837p_encoder.py +0 -0
  39. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediLink/MediLink_837p_utilities.py +0 -0
  40. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediLink/MediLink_API_Generator.py +0 -0
  41. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediLink/MediLink_Azure.py +0 -0
  42. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediLink/MediLink_ClaimStatus.py +0 -0
  43. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediLink/MediLink_DataMgmt.py +0 -0
  44. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediLink/MediLink_Decoder.py +0 -0
  45. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediLink/MediLink_Deductible.py +0 -0
  46. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediLink/MediLink_Deductible_Validator.py +0 -0
  47. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediLink/MediLink_Display_Utils.py +0 -0
  48. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediLink/MediLink_Down.py +0 -0
  49. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediLink/MediLink_Gmail.py +0 -0
  50. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediLink/MediLink_Mailer.py +0 -0
  51. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediLink/MediLink_Parser.py +0 -0
  52. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediLink/MediLink_Scan.py +0 -0
  53. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediLink/MediLink_Scheduler.py +0 -0
  54. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediLink/MediLink_UI.py +0 -0
  55. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediLink/MediLink_Up.py +0 -0
  56. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediLink/MediLink_insurance_utils.py +0 -0
  57. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediLink/MediLink_main.py +0 -0
  58. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediLink/MediLink_smart_import.py +0 -0
  59. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediLink/Soumit_api.py +0 -0
  60. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediLink/__init__.py +0 -0
  61. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediLink/insurance_type_integration_test.py +0 -0
  62. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediLink/openssl.cnf +0 -0
  63. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediLink/test.py +0 -0
  64. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediLink/test_cob_library.py +0 -0
  65. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediLink/test_timing.py +0 -0
  66. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediLink/test_validation.py +0 -0
  67. {medicafe-0.250806.10 → medicafe-0.250806.12}/MediLink/webapp.html +0 -0
  68. {medicafe-0.250806.10 → medicafe-0.250806.12}/medicafe.egg-info/SOURCES.txt +0 -0
  69. {medicafe-0.250806.10 → medicafe-0.250806.12}/medicafe.egg-info/dependency_links.txt +0 -0
  70. {medicafe-0.250806.10 → medicafe-0.250806.12}/medicafe.egg-info/entry_points.txt +0 -0
  71. {medicafe-0.250806.10 → medicafe-0.250806.12}/medicafe.egg-info/not-zip-safe +0 -0
  72. {medicafe-0.250806.10 → medicafe-0.250806.12}/medicafe.egg-info/requires.txt +0 -0
  73. {medicafe-0.250806.10 → medicafe-0.250806.12}/medicafe.egg-info/top_level.txt +0 -0
  74. {medicafe-0.250806.10 → medicafe-0.250806.12}/setup.cfg +0 -0
@@ -462,7 +462,7 @@ if __name__ == "__main__":
462
462
 
463
463
  if existing_patients:
464
464
  print("\nNOTE: The following patient(s) already EXIST in the system and \n will be excluded from processing:")
465
-
465
+ # BUG There a "ERROR: 'str' object has no attribute 'strftime'" that shows up after this somewhere.
466
466
  # Collect surgery dates and patient info for existing patients
467
467
  patient_info = []
468
468
  for patient_id, patient_name in existing_patients:
@@ -66,6 +66,56 @@ try:
66
66
  except ImportError:
67
67
  # Fallback to local flag if centralized config is not available
68
68
  PERFORMANCE_LOGGING = False
69
+
70
+ # XP Compatibility: Add robust fallback for configuration loading
71
+ def get_cached_configuration_xp_safe():
72
+ """
73
+ XP-compatible version of get_cached_configuration with robust fallbacks.
74
+ """
75
+ global _config_cache, _crosswalk_cache
76
+
77
+ # If we already have cached data, return it
78
+ if _config_cache is not None and _crosswalk_cache is not None:
79
+ return _config_cache, _crosswalk_cache
80
+
81
+ # Try to load configuration using the standard method
82
+ try:
83
+ if MediLink_ConfigLoader and hasattr(MediLink_ConfigLoader, 'load_configuration'):
84
+ _config_cache, _crosswalk_cache = MediLink_ConfigLoader.load_configuration()
85
+ return _config_cache, _crosswalk_cache
86
+ except Exception as e:
87
+ print("Warning: Failed to load configuration via MediLink_ConfigLoader: {}".format(e))
88
+
89
+ # Fallback: Try to load configuration files directly
90
+ try:
91
+ import json
92
+ project_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
93
+
94
+ # Try to load config.json
95
+ config_path = os.path.join(project_dir, 'json', 'config.json')
96
+ if os.path.exists(config_path):
97
+ with open(config_path, 'r') as f:
98
+ _config_cache = json.load(f)
99
+ else:
100
+ _config_cache = {}
101
+
102
+ # Try to load crosswalk.json
103
+ crosswalk_path = os.path.join(project_dir, 'json', 'crosswalk.json')
104
+ if os.path.exists(crosswalk_path):
105
+ with open(crosswalk_path, 'r') as f:
106
+ _crosswalk_cache = json.load(f)
107
+ else:
108
+ _crosswalk_cache = {}
109
+
110
+ return _config_cache, _crosswalk_cache
111
+
112
+ except Exception as e:
113
+ print("Warning: Failed to load configuration files directly: {}".format(e))
114
+ # Return empty defaults
115
+ _config_cache = {}
116
+ _crosswalk_cache = {}
117
+ return _config_cache, _crosswalk_cache
118
+
69
119
  class InitializationError(Exception):
70
120
  def __init__(self, message):
71
121
  self.message = message
@@ -91,12 +141,7 @@ def get_cached_configuration():
91
141
  """
92
142
  Returns cached configuration and crosswalk data to avoid repeated I/O operations.
93
143
  """
94
- global _config_cache, _crosswalk_cache
95
-
96
- if _config_cache is None or _crosswalk_cache is None:
97
- _config_cache, _crosswalk_cache = MediLink_ConfigLoader.load_configuration()
98
-
99
- return _config_cache, _crosswalk_cache
144
+ return get_cached_configuration_xp_safe()
100
145
 
101
146
  def open_csv_for_editing(csv_file_path):
102
147
  try:
@@ -1134,7 +1179,17 @@ def load_insurance_data_from_mains(config):
1134
1179
  dict: A dictionary mapping insurance names to insurance IDs.
1135
1180
  """
1136
1181
  # Use cached configuration to avoid repeated loading
1137
- config, crosswalk = get_cached_configuration()
1182
+ try:
1183
+ config, crosswalk = get_cached_configuration()
1184
+ except Exception as e:
1185
+ print("Warning: Failed to load cached configuration: {}".format(e))
1186
+ # Return empty mapping if configuration loading fails
1187
+ return {}
1188
+
1189
+ # XP Compatibility: Check if MediLink_DataMgmt is available
1190
+ if MediLink_DataMgmt is None:
1191
+ print("Warning: MediLink_DataMgmt not available. Cannot load MAINS data.")
1192
+ return {}
1138
1193
 
1139
1194
  # Retrieve MAINS path and slicing information from the configuration
1140
1195
  # TODO (Low) For secondary insurance, this needs to be pulling from the correct MAINS (there are 2)
@@ -1142,8 +1197,12 @@ def load_insurance_data_from_mains(config):
1142
1197
  # Meh, this just has to be part of the new architecture plan where we make Medisoft a downstream
1143
1198
  # recipient from the db.
1144
1199
  # TODO (High) The Medisoft Medicare flag needs to be brought in here.
1145
- mains_path = config['MAINS_MED_PATH']
1146
- mains_slices = crosswalk['mains_mapping']['slices']
1200
+ try:
1201
+ mains_path = config.get('MAINS_MED_PATH', '')
1202
+ mains_slices = crosswalk.get('mains_mapping', {}).get('slices', {})
1203
+ except (KeyError, AttributeError) as e:
1204
+ print("Warning: Failed to get MAINS configuration: {}".format(e))
1205
+ return {}
1147
1206
 
1148
1207
  # Initialize the dictionary to hold the insurance to insurance ID mappings
1149
1208
  insurance_to_id = {}
@@ -1152,7 +1211,8 @@ def load_insurance_data_from_mains(config):
1152
1211
  # Check if MAINS file exists before attempting to read
1153
1212
  if not os.path.exists(mains_path):
1154
1213
  error_msg = "CRITICAL: MAINS file not found at: {}. This file is required for insurance name to Medisoft ID mapping.".format(mains_path)
1155
- MediLink_ConfigLoader.log(error_msg, level="CRITICAL")
1214
+ if hasattr(MediLink_ConfigLoader, 'log'):
1215
+ MediLink_ConfigLoader.log(error_msg, level="CRITICAL")
1156
1216
  print("\n" + "="*80)
1157
1217
  print("CRITICAL ERROR: MAINS FILE MISSING")
1158
1218
  print("="*80)
@@ -1171,17 +1231,26 @@ def load_insurance_data_from_mains(config):
1171
1231
  print("="*80)
1172
1232
  return insurance_to_id
1173
1233
 
1234
+ # XP Compatibility: Check if MediLink_DataMgmt has the required function
1235
+ if not hasattr(MediLink_DataMgmt, 'read_general_fixed_width_data'):
1236
+ print("Warning: MediLink_DataMgmt.read_general_fixed_width_data not available. Cannot load MAINS data.")
1237
+ return insurance_to_id
1238
+
1174
1239
  # Read data from MAINS using a provided function to handle fixed-width data
1175
1240
  for record, line_number in MediLink_DataMgmt.read_general_fixed_width_data(mains_path, mains_slices):
1176
1241
  insurance_name = record['MAINSNAME']
1177
1242
  # Assuming line_number gives the correct insurance ID without needing adjustment
1178
1243
  insurance_to_id[insurance_name] = line_number
1179
1244
 
1180
- MediLink_ConfigLoader.log("Successfully loaded {} insurance records from MAINS".format(len(insurance_to_id)), level="INFO")
1245
+ if hasattr(MediLink_ConfigLoader, 'log'):
1246
+ MediLink_ConfigLoader.log("Successfully loaded {} insurance records from MAINS".format(len(insurance_to_id)), level="INFO")
1247
+ else:
1248
+ print("Successfully loaded {} insurance records from MAINS".format(len(insurance_to_id)))
1181
1249
 
1182
1250
  except FileNotFoundError:
1183
1251
  error_msg = "CRITICAL: MAINS file not found: {}. This file is required for insurance name to Medisoft ID mapping.".format(mains_path)
1184
- MediLink_ConfigLoader.log(error_msg, level="CRITICAL")
1252
+ if hasattr(MediLink_ConfigLoader, 'log'):
1253
+ MediLink_ConfigLoader.log(error_msg, level="CRITICAL")
1185
1254
  print("\n" + "="*80)
1186
1255
  print("CRITICAL ERROR: MAINS FILE MISSING")
1187
1256
  print("="*80)
@@ -1199,7 +1268,9 @@ def load_insurance_data_from_mains(config):
1199
1268
  print("3. The file should contain insurance company data from your Medisoft system")
1200
1269
  print("="*80)
1201
1270
  except Exception as e:
1202
- MediLink_ConfigLoader.log("Error loading MAINS data: {}. Continuing without MAINS data.".format(str(e)), level="ERROR")
1271
+ error_msg = "Error loading MAINS data: {}. Continuing without MAINS data.".format(str(e))
1272
+ if hasattr(MediLink_ConfigLoader, 'log'):
1273
+ MediLink_ConfigLoader.log(error_msg, level="ERROR")
1203
1274
  print("Error loading MAINS data: {}. Continuing without MAINS data.".format(str(e)))
1204
1275
 
1205
1276
  return insurance_to_id
@@ -23,6 +23,18 @@ try:
23
23
  except ImportError:
24
24
  pass
25
25
 
26
+ # XP Compatibility: Add fallback function if import fails
27
+ if load_insurance_data_from_mains is None:
28
+ def load_insurance_data_from_mains_fallback(config):
29
+ """
30
+ Fallback function for load_insurance_data_from_mains when MediBot_Preprocessor_lib is not available.
31
+ Returns empty dictionary to prevent AttributeError.
32
+ """
33
+ print("Warning: load_insurance_data_from_mains not available. Using empty insurance mapping.")
34
+ return {}
35
+
36
+ load_insurance_data_from_mains = load_insurance_data_from_mains_fallback
37
+
26
38
  try:
27
39
  from MediBot import MediBot_Crosswalk_Library
28
40
  except ImportError:
@@ -23,11 +23,26 @@ def _get_load_insurance_function():
23
23
  import MediBot_Preprocessor_lib
24
24
  return MediBot_Preprocessor_lib.load_insurance_data_from_mains
25
25
  except (ImportError, AttributeError) as e:
26
- MediLink_ConfigLoader.log("Failed to import load_insurance_data_from_mains: {}".format(e), level="WARNING")
26
+ if MediLink_ConfigLoader and hasattr(MediLink_ConfigLoader, 'log'):
27
+ MediLink_ConfigLoader.log("Failed to import load_insurance_data_from_mains: {}".format(e), level="WARNING")
28
+ else:
29
+ print("Warning: Failed to import load_insurance_data_from_mains: {}".format(e))
27
30
  return None
28
31
 
29
32
  load_insurance_data_from_mains = _get_load_insurance_function()
30
33
 
34
+ # XP Compatibility: Add fallback function if import fails
35
+ if load_insurance_data_from_mains is None:
36
+ def load_insurance_data_from_mains_fallback(config):
37
+ """
38
+ Fallback function for load_insurance_data_from_mains when MediBot_Preprocessor_lib is not available.
39
+ Returns empty dictionary to prevent AttributeError.
40
+ """
41
+ print("Warning: load_insurance_data_from_mains not available. Using empty insurance mapping.")
42
+ return {}
43
+
44
+ load_insurance_data_from_mains = load_insurance_data_from_mains_fallback
45
+
31
46
 
32
47
  def collect_detailed_patient_data(selected_files, config, crosswalk):
33
48
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: medicafe
3
- Version: 0.250806.10
3
+ Version: 0.250806.12
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.250806.10
3
+ Version: 0.250806.12
4
4
  Summary: MediCafe
5
5
  Home-page: https://github.com/katanada2
6
6
  Author: Daniel Vidaud
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='medicafe',
5
- version="0.250806.10",
5
+ version="0.250806.12",
6
6
  description='MediCafe',
7
7
  long_description="""
8
8
  # Project Overview: MediCafe
File without changes
File without changes