medicafe 0.250814.4__py3-none-any.whl → 0.250818.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.
@@ -18,6 +18,32 @@ except ImportError:
18
18
  # Fallback to local flag if centralized config is not available
19
19
  PERFORMANCE_LOGGING = False
20
20
 
21
+ def get_default_config():
22
+ """Provide a default configuration when config files are missing."""
23
+ return {
24
+ 'MediLink_Config': {
25
+ 'local_storage_path': '.',
26
+ 'receiptsRoot': './receipts',
27
+ 'api_endpoints': {
28
+ 'base_url': 'https://api.example.com',
29
+ 'timeout': 30
30
+ },
31
+ 'logging': {
32
+ 'level': 'INFO',
33
+ 'console_output': True
34
+ }
35
+ }
36
+ }
37
+
38
+ def get_default_crosswalk():
39
+ """Provide a default crosswalk when crosswalk files are missing."""
40
+ return {
41
+ 'insurance_types': {},
42
+ 'diagnosis_codes': {},
43
+ 'procedure_codes': {},
44
+ 'payer_mappings': {}
45
+ }
46
+
21
47
  """
22
48
  This function should be generalizable to have a initialization script over all the Medi* functions
23
49
  """
@@ -62,6 +88,10 @@ def load_configuration(config_path=os.path.join(os.path.dirname(__file__), '..',
62
88
  if PERFORMANCE_LOGGING:
63
89
  print("Path resolution completed in {:.2f} seconds".format(path_check_end - path_check_start))
64
90
 
91
+ # Load configuration with graceful fallback
92
+ config = None
93
+ crosswalk = None
94
+
65
95
  try:
66
96
  config_load_start = time.time()
67
97
  with open(config_path, 'r') as config_file:
@@ -88,30 +118,47 @@ def load_configuration(config_path=os.path.join(os.path.dirname(__file__), '..',
88
118
  if PERFORMANCE_LOGGING:
89
119
  print("Crosswalk file loading completed in {:.2f} seconds".format(crosswalk_load_end - crosswalk_load_start))
90
120
 
91
- config_end = time.time()
92
- if PERFORMANCE_LOGGING:
93
- print("Total configuration loading completed in {:.2f} seconds".format(config_end - config_start))
121
+ except FileNotFoundError:
122
+ # Graceful fallback to default configurations
123
+ print("Configuration files not found. Using default configurations.")
124
+ print("Config path: {}, Crosswalk path: {}".format(config_path, crosswalk_path))
125
+ print("To use custom configurations, create the 'json' directory and add config.json and crosswalk.json files.")
94
126
 
95
- # Cache the loaded configuration
96
- _CONFIG_CACHE = config
97
- _CROSSWALK_CACHE = crosswalk
127
+ config = get_default_config()
128
+ crosswalk = get_default_crosswalk()
98
129
 
99
- return config, crosswalk
130
+ # Log the fallback for debugging
131
+ if PERFORMANCE_LOGGING:
132
+ print("Using default configurations due to missing files")
133
+
100
134
  except ValueError as e:
101
135
  if isinstance(e, UnicodeDecodeError):
102
136
  print("Error decoding file: {}".format(e))
103
137
  else:
104
138
  print("Error parsing file: {}".format(e))
105
- sys.exit(1) # Exit the script due to a critical error in configuration loading
106
- except FileNotFoundError:
107
- print("One or both configuration files not found. Config: {}, Crosswalk: {}".format(config_path, crosswalk_path))
108
- raise
139
+ print("Falling back to default configurations...")
140
+ config = get_default_config()
141
+ crosswalk = get_default_crosswalk()
109
142
  except KeyError as e:
110
143
  print("Critical configuration is missing: {}".format(e))
111
- raise
144
+ print("Falling back to default configurations...")
145
+ config = get_default_config()
146
+ crosswalk = get_default_crosswalk()
112
147
  except Exception as e:
113
148
  print("An unexpected error occurred while loading the configuration: {}".format(e))
114
- raise
149
+ print("Falling back to default configurations...")
150
+ config = get_default_config()
151
+ crosswalk = get_default_crosswalk()
152
+
153
+ config_end = time.time()
154
+ if PERFORMANCE_LOGGING:
155
+ print("Total configuration loading completed in {:.2f} seconds".format(config_end - config_start))
156
+
157
+ # Cache the loaded configuration
158
+ _CONFIG_CACHE = config
159
+ _CROSSWALK_CACHE = crosswalk
160
+
161
+ return config, crosswalk
115
162
 
116
163
  def clear_config_cache():
117
164
  """Clear the configuration cache to force reloading on next call."""
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.250814.4"
30
+ __version__ = "0.250818.0"
31
31
  __author__ = "Daniel Vidaud"
32
32
  __email__ = "daniel@personalizedtransformation.com"
33
33
 
@@ -83,8 +83,11 @@ try:
83
83
  from . import logging_config
84
84
  from . import core_utils
85
85
  __legacy_imports_available__ = True
86
- except Exception:
86
+ except Exception as e:
87
87
  __legacy_imports_available__ = False
88
+ # Don't fail the entire package import if legacy imports fail
89
+ print("Warning: Some legacy imports failed: {}".format(e))
90
+ print("This is expected when configuration files are missing. The package will continue to function.")
88
91
 
89
92
  # Package information
90
93
  __all__ = [
MediCafe/smart_import.py CHANGED
@@ -162,6 +162,18 @@ class ComponentRegistry:
162
162
  module_path = component_mappings[name]
163
163
  try:
164
164
  module = importlib.import_module(module_path)
165
+
166
+ # Special handling for components that may fail due to missing config files
167
+ if name in ['api_core', 'logging_config', 'core_utils']:
168
+ try:
169
+ # Test if the module can initialize properly
170
+ if hasattr(module, 'load_configuration'):
171
+ # This will use our new graceful fallback
172
+ module.load_configuration()
173
+ except Exception as config_error:
174
+ # Log the config error but don't fail the import
175
+ warnings.warn("Component '{}' loaded but configuration failed: {}".format(name, config_error))
176
+
165
177
  return module
166
178
  except ImportError as e:
167
179
  raise ImportError("Failed to load component '{}' from '{}': {}".format(name, module_path, e))
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.250814.4"
25
+ __version__ = "0.250818.0"
26
26
  __author__ = "Daniel Vidaud"
27
27
  __email__ = "daniel@personalizedtransformation.com"
28
28
 
@@ -98,6 +98,7 @@ except Exception as e:
98
98
  # Handle any other import errors
99
99
  import sys
100
100
  print("Warning: Unexpected error importing MediLink_insurance_utils: {}".format(e))
101
+ print("This may be due to missing configuration files. MediLink will continue to function.")
101
102
  MediLink_insurance_utils = None
102
103
 
103
104
  # Optional: Show guide on import (can be disabled)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: medicafe
3
- Version: 0.250814.4
3
+ Version: 0.250818.0
4
4
  Summary: MediCafe
5
5
  Home-page: https://github.com/katanada2/MediCafe
6
6
  Author: Daniel Vidaud
@@ -1,21 +1,21 @@
1
1
  MediBot/MediBot.bat,sha256=67wcth3JTvS1v0ycagk6HjY4MpJ8BoFOIUfC6ZPhczI,26687
2
- MediBot/MediBot.py,sha256=mVARpFgGrI-6Kqdqxh1F45F6NZ8-s3HfChxI7C5ODZY,43434
2
+ MediBot/MediBot.py,sha256=YELaGUDxW8bYMy3s8IHjdoFQJpPZz-2znyDVw1495t4,44196
3
3
  MediBot/MediBot_Charges.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  MediBot/MediBot_Crosswalk_Library.py,sha256=jIaYdoxfT9YgQ5dWZC4jmTYxRX1Y14X-AJ6YEjR58Gc,25158
5
5
  MediBot/MediBot_Crosswalk_Utils.py,sha256=KVq2budurwdHB7dglOuPZEQGup-hjD1SeSPyySLpy9M,39015
6
6
  MediBot/MediBot_Post.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  MediBot/MediBot_Preprocessor.py,sha256=zAcfyuE8wl9JRzLGsUnnXiHxAr-hbCCIB2M-Jb3LUqI,16203
8
- MediBot/MediBot_Preprocessor_lib.py,sha256=UsKLRk3MbJJDsJ-kvqdSngk3m0_04JbVkkgmfeTvPj8,80358
9
- MediBot/MediBot_UI.py,sha256=9QAwlYMp00huLTr5qhwbuxkxq6SRyyQlWuH1Id_GvP8,19471
8
+ MediBot/MediBot_Preprocessor_lib.py,sha256=EsRFsHdrJGOYGnO435vkG8R8f7_xOQdduVGSDCJQp1I,83852
9
+ MediBot/MediBot_UI.py,sha256=iG8UK71aHYBmB0lkjwl-C6L9DbsOyLaq-wt9kChV0jo,23781
10
10
  MediBot/MediBot_dataformat_library.py,sha256=D46fdPtxcgfWTzaLBtSvjtozzZBNqNiODgu4vKMZrBg,10746
11
11
  MediBot/MediBot_docx_decoder.py,sha256=gn7I7Ng5khVIzU0HTTOqi31YSSn1yW8Pyk-i_P9r1oA,32472
12
12
  MediBot/MediBot_smart_import.py,sha256=Emvz7NwemHGCHvG5kZcUyXMcCheidbGKaPfOTg-YCEs,6684
13
- MediBot/__init__.py,sha256=jAm--tLM_OuJvlrik08Kyej8NJI4gKpCbZojPki95po,3192
13
+ MediBot/__init__.py,sha256=b8E2q1mQ-jPOAAROhWnFK_SIu7ZZcKP_luC0nzzO4AM,3192
14
14
  MediBot/get_medicafe_version.py,sha256=uyL_UIE42MyFuJ3SRYxJp8sZx8xjTqlYZ3FdQuxLduY,728
15
15
  MediBot/update_json.py,sha256=vvUF4mKCuaVly8MmoadDO59M231fCIInc0KI1EtDtPA,3704
16
- MediBot/update_medicafe.py,sha256=dmxBtAUOvmT9TIBk0Gy1N8WHhnaPw1o0V3323HIqwxU,34981
17
- MediCafe/MediLink_ConfigLoader.py,sha256=Ia79dZQBvgbc6CtOaNZVlFHaN-fvUmJRpmmVHz_MFv8,8205
18
- MediCafe/__init__.py,sha256=4WkR1QPnMLS9yasZdyPxIeC24_4KgRmpcIUeeIADp74,5477
16
+ MediBot/update_medicafe.py,sha256=09asEEgnGEOq4HH4dmnF18hZdzggqn8zDutQqymdVws,8550
17
+ MediCafe/MediLink_ConfigLoader.py,sha256=zqN0p3il4E5hPiGvd0a5xWo8gAGu4dEAQEKEVknpB0s,9803
18
+ MediCafe/__init__.py,sha256=vfO1j5x9r1dYilKJXeKjaZqOAh8558lrlpv4Hnd5YxQ,5721
19
19
  MediCafe/__main__.py,sha256=mRNyk3D9Ilnu2XhgVI_rut7r5Ro7UIKtwV871giAHI8,12992
20
20
  MediCafe/api_core.py,sha256=IZaBXnP4E7eHzxVbCk2HtxywiVBuhaUyHeaqss8llgY,66378
21
21
  MediCafe/api_core_backup.py,sha256=Oy_Fqt0SEvGkQN1Oqw5iUPVFxPEokyju5CuPEb9k0OY,18686
@@ -26,7 +26,7 @@ MediCafe/graphql_utils.py,sha256=P8zkY7eqTcFVIw_0P7A0tiFct200STOZeHeYVER2UJk,394
26
26
  MediCafe/logging_config.py,sha256=auT65LN5oDEXVhkMeLke63kJHTWxYf2o8YihAfQFgzU,5493
27
27
  MediCafe/logging_demo.py,sha256=TwUhzafna5pMdN3zSKGrpUWRqX96F1JGGsSUtr3dygs,1975
28
28
  MediCafe/migration_helpers.py,sha256=48GnP4xcgvDNNlzoWsKASCpF4H0KnyveHPbz6kjQy50,17737
29
- MediCafe/smart_import.py,sha256=23pttO7QTZyvOP9HR9czDIv7lUsE1sHaE2CWC94Xxxo,19800
29
+ MediCafe/smart_import.py,sha256=KJtjmEvaiZ2ChQMjSb09_TFtz1DChU5KQCvTiK2gOKw,20495
30
30
  MediCafe/submission_index.py,sha256=35gz8Anx1dIqG1I14GvuLY0nTO4dSBr2YsZwof9aIQg,11175
31
31
  MediLink/InsuranceTypeService.py,sha256=FKWC1nRfKV_OtCDUtZustauXNhmCYDFiY9jsAGHPPUM,2178
32
32
  MediLink/MediLink_837p_cob_library.py,sha256=glc7SJBDx0taCGmwmCs81GFJJcvA_D7nycIkTfmIuwE,30650
@@ -54,7 +54,7 @@ MediLink/MediLink_insurance_utils.py,sha256=g741Fj2K26cMy0JX5d_XavMw9LgkK6hjaUJY
54
54
  MediLink/MediLink_main.py,sha256=Y26Bl_7KNIbz18lbgK-18dkqANfWK6QO4sQLFFRQGGw,23337
55
55
  MediLink/MediLink_smart_import.py,sha256=B5SfBn_4bYEWJJDolXbjnwKx_-MaqGZ76LyXQwWDV80,9838
56
56
  MediLink/Soumit_api.py,sha256=5JfOecK98ZC6NpZklZW2AkOzkjvrbYxpJpZNH3rFxDw,497
57
- MediLink/__init__.py,sha256=ynBkS9IJNg_Fs8D3N6g1xUHKjCH0_itl2-p-TvjFxik,3790
57
+ MediLink/__init__.py,sha256=Dx0JY_InpuSRO-3WM0oC0mqnON54FPZfy6_k0dgemHI,3888
58
58
  MediLink/gmail_http_utils.py,sha256=gtqCCrzJC7e8JFQzMNrf7EbK8na2h4sfTu-NMaZ_UHc,4006
59
59
  MediLink/gmail_oauth_utils.py,sha256=MLuzO6awBanV7Ee2gOUrkWrxz8-Htwz2BEIFjLw9Izs,3734
60
60
  MediLink/insurance_type_integration_test.py,sha256=pz2OCXitAznqDciYn6OL9M326m9CYU7YiK-ynssdQ5g,15172
@@ -64,9 +64,9 @@ MediLink/test_cob_library.py,sha256=wUMv0-Y6fNsKcAs8Z9LwfmEBRO7oBzBAfWmmzwoNd1g,
64
64
  MediLink/test_timing.py,sha256=yH2b8QPLDlp1Zy5AhgtjzjnDHNGhAD16ZtXtZzzESZw,2042
65
65
  MediLink/test_validation.py,sha256=FJrfdUFK--xRScIzrHCg1JeGdm0uJEoRnq6CgkP2lwM,4154
66
66
  MediLink/webapp.html,sha256=JPKT559aFVBi1r42Hz7C77Jj0teZZRumPhBev8eSOLk,19806
67
- medicafe-0.250814.4.dist-info/LICENSE,sha256=65lb-vVujdQK7uMH3RRJSMwUW-WMrMEsc5sOaUn2xUk,1096
68
- medicafe-0.250814.4.dist-info/METADATA,sha256=0FSwQ-JAGdWIFJyzsDc1r0qCvCK6wXnh4QKu5KbDNn4,3384
69
- medicafe-0.250814.4.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
70
- medicafe-0.250814.4.dist-info/entry_points.txt,sha256=m3RBUBjr-xRwEkKJ5W4a7NlqHZP_1rllGtjZnrRqKe8,52
71
- medicafe-0.250814.4.dist-info/top_level.txt,sha256=U6-WBJ9RCEjyIs0BlzbQq_PwedCp_IV9n1616NNV5zA,26
72
- medicafe-0.250814.4.dist-info/RECORD,,
67
+ medicafe-0.250818.0.dist-info/LICENSE,sha256=65lb-vVujdQK7uMH3RRJSMwUW-WMrMEsc5sOaUn2xUk,1096
68
+ medicafe-0.250818.0.dist-info/METADATA,sha256=T0bZU7X-TAvqQS22wt4o43zm365lmLzv-zLAuXSdYfg,3384
69
+ medicafe-0.250818.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
70
+ medicafe-0.250818.0.dist-info/entry_points.txt,sha256=m3RBUBjr-xRwEkKJ5W4a7NlqHZP_1rllGtjZnrRqKe8,52
71
+ medicafe-0.250818.0.dist-info/top_level.txt,sha256=U6-WBJ9RCEjyIs0BlzbQq_PwedCp_IV9n1616NNV5zA,26
72
+ medicafe-0.250818.0.dist-info/RECORD,,