medicafe 0.250728.9__py3-none-any.whl → 0.250805.2__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.

Files changed (57) hide show
  1. MediBot/MediBot.bat +233 -19
  2. MediBot/MediBot.py +138 -46
  3. MediBot/MediBot_Crosswalk_Library.py +127 -623
  4. MediBot/MediBot_Crosswalk_Utils.py +618 -0
  5. MediBot/MediBot_Preprocessor.py +72 -17
  6. MediBot/MediBot_Preprocessor_lib.py +470 -76
  7. MediBot/MediBot_UI.py +32 -17
  8. MediBot/MediBot_dataformat_library.py +68 -20
  9. MediBot/MediBot_docx_decoder.py +120 -19
  10. MediBot/MediBot_smart_import.py +180 -0
  11. MediBot/__init__.py +89 -0
  12. MediBot/get_medicafe_version.py +25 -0
  13. MediBot/update_json.py +35 -6
  14. MediBot/update_medicafe.py +19 -1
  15. MediCafe/MediLink_ConfigLoader.py +160 -0
  16. MediCafe/__init__.py +171 -0
  17. MediCafe/__main__.py +314 -0
  18. MediCafe/api_core.py +1098 -0
  19. MediCafe/api_core_backup.py +427 -0
  20. MediCafe/api_factory.py +306 -0
  21. MediCafe/api_utils.py +356 -0
  22. MediCafe/core_utils.py +450 -0
  23. MediCafe/graphql_utils.py +445 -0
  24. MediCafe/logging_config.py +123 -0
  25. MediCafe/logging_demo.py +61 -0
  26. MediCafe/migration_helpers.py +463 -0
  27. MediCafe/smart_import.py +436 -0
  28. MediLink/MediLink_837p_cob_library.py +28 -28
  29. MediLink/MediLink_837p_encoder.py +33 -34
  30. MediLink/MediLink_837p_encoder_library.py +226 -150
  31. MediLink/MediLink_837p_utilities.py +129 -5
  32. MediLink/MediLink_API_Generator.py +83 -60
  33. MediLink/MediLink_API_v3.py +1 -1
  34. MediLink/MediLink_ClaimStatus.py +177 -31
  35. MediLink/MediLink_DataMgmt.py +378 -63
  36. MediLink/MediLink_Decoder.py +20 -1
  37. MediLink/MediLink_Deductible.py +155 -28
  38. MediLink/MediLink_Display_Utils.py +72 -0
  39. MediLink/MediLink_Down.py +127 -5
  40. MediLink/MediLink_Gmail.py +720 -653
  41. MediLink/MediLink_PatientProcessor.py +257 -0
  42. MediLink/MediLink_UI.py +85 -71
  43. MediLink/MediLink_Up.py +28 -4
  44. MediLink/MediLink_insurance_utils.py +227 -230
  45. MediLink/MediLink_main.py +248 -0
  46. MediLink/MediLink_smart_import.py +264 -0
  47. MediLink/__init__.py +93 -1
  48. MediLink/insurance_type_integration_test.py +13 -3
  49. MediLink/test.py +1 -1
  50. MediLink/test_timing.py +59 -0
  51. {medicafe-0.250728.9.dist-info → medicafe-0.250805.2.dist-info}/METADATA +1 -1
  52. medicafe-0.250805.2.dist-info/RECORD +81 -0
  53. medicafe-0.250805.2.dist-info/entry_points.txt +2 -0
  54. {medicafe-0.250728.9.dist-info → medicafe-0.250805.2.dist-info}/top_level.txt +1 -0
  55. medicafe-0.250728.9.dist-info/RECORD +0 -59
  56. {medicafe-0.250728.9.dist-info → medicafe-0.250805.2.dist-info}/LICENSE +0 -0
  57. {medicafe-0.250728.9.dist-info → medicafe-0.250805.2.dist-info}/WHEEL +0 -0
MediCafe/__main__.py ADDED
@@ -0,0 +1,314 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ MediCafe Entry Point (__main__.py)
4
+
5
+ This module serves as the main entry point for the MediCafe package.
6
+ It can be called directly from the batch file and routes user choices
7
+ to the appropriate sub-applications without adding interface layers.
8
+
9
+ Usage:
10
+ python -m MediCafe <command> [args...]
11
+
12
+ Commands:
13
+ medibot [config_file] - Run MediBot data entry automation
14
+ medilink - Run MediLink claims processing
15
+ claims_status - Run United Claims Status checker
16
+ deductible - Run United Deductible checker
17
+ download_emails - Run email download functionality
18
+ version - Show MediCafe version information
19
+
20
+ The entry point preserves user choices and navigational flow from the
21
+ batch script without adding unnecessary interface layers.
22
+ """
23
+
24
+ import sys
25
+ import os
26
+ import argparse
27
+ import subprocess
28
+
29
+ # Set up module paths for proper imports
30
+ def setup_entry_point_paths():
31
+ """Set up paths for the MediCafe entry point"""
32
+ # Get the parent directory (workspace root)
33
+ current_dir = os.path.dirname(os.path.abspath(__file__))
34
+ workspace_root = os.path.dirname(current_dir)
35
+
36
+ # Add to Python path if not already present
37
+ workspace_str = workspace_root
38
+ if workspace_str not in sys.path:
39
+ sys.path.insert(0, workspace_str)
40
+
41
+ # Also add MediBot and MediLink directories specifically
42
+ medibot_dir = os.path.join(workspace_root, 'MediBot')
43
+ medilink_dir = os.path.join(workspace_root, 'MediLink')
44
+
45
+ if medibot_dir not in sys.path:
46
+ sys.path.insert(0, medibot_dir)
47
+ if medilink_dir not in sys.path:
48
+ sys.path.insert(0, medilink_dir)
49
+
50
+ def run_medibot(config_file=None):
51
+ """Run MediBot application"""
52
+ try:
53
+ print("Starting MediBot...")
54
+
55
+ # Set up command line arguments
56
+ if config_file:
57
+ sys.argv = ['MediBot.py', config_file]
58
+ else:
59
+ sys.argv = ['MediBot.py']
60
+
61
+ # Import and run MediBot directly
62
+ try:
63
+ from MediBot import MediBot
64
+ # If MediBot has a main function, call it
65
+ if hasattr(MediBot, 'main'):
66
+ return MediBot.main()
67
+ else:
68
+ # Otherwise, just import it (it will run its own code)
69
+ return 0
70
+ except ImportError:
71
+ # Fallback: try to run the file directly
72
+ import subprocess
73
+ medibot_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'MediBot', 'MediBot.py')
74
+ if os.path.exists(medibot_path):
75
+ # Use subprocess.call for Python 3.4.4 compatibility
76
+ result = subprocess.call([sys.executable, medibot_path] + sys.argv[1:],
77
+ cwd=os.path.dirname(medibot_path))
78
+ return result
79
+ else:
80
+ raise ImportError("MediBot.py not found at {}".format(medibot_path))
81
+
82
+ except ImportError as e:
83
+ print("Error: Unable to import MediBot: {}".format(e))
84
+ return 1
85
+ except Exception as e:
86
+ print("Error running MediBot: {}".format(e))
87
+ return 1
88
+
89
+ def run_medilink():
90
+ """Run MediLink application"""
91
+ try:
92
+ print("Starting MediLink...")
93
+ # Use subprocess.call for Python 3.4.4 compatibility
94
+
95
+ # Get the path to MediLink_main.py
96
+ current_dir = os.path.dirname(os.path.abspath(__file__))
97
+ workspace_root = os.path.dirname(current_dir)
98
+ medilink_main_path = os.path.join(workspace_root, 'MediLink', 'MediLink_main.py')
99
+
100
+ if os.path.exists(medilink_main_path):
101
+ # Set up environment for subprocess to find MediCafe
102
+ env = os.environ.copy()
103
+ python_path = workspace_root
104
+ if 'PYTHONPATH' in env:
105
+ env['PYTHONPATH'] = python_path + os.pathsep + env['PYTHONPATH']
106
+ else:
107
+ env['PYTHONPATH'] = python_path
108
+
109
+ # Set working directory to MediLink directory for proper file paths
110
+ medilink_dir = os.path.dirname(medilink_main_path)
111
+
112
+ # Use subprocess.call for Python 3.4.4 compatibility
113
+ result = subprocess.call([sys.executable, medilink_main_path],
114
+ cwd=medilink_dir,
115
+ env=env)
116
+ return result
117
+ else:
118
+ print("Error: MediLink_main.py not found at {}".format(medilink_main_path))
119
+ return 1
120
+
121
+ except ImportError as e:
122
+ print("Error: Unable to import MediLink: {}".format(e))
123
+ return 1
124
+ except Exception as e:
125
+ print("Error running MediLink: {}".format(e))
126
+ return 1
127
+
128
+ def run_claims_status():
129
+ """Run United Claims Status checker"""
130
+ try:
131
+ print("Starting United Claims Status...")
132
+ # Use subprocess.call for Python 3.4.4 compatibility
133
+
134
+ # Get the path to MediLink_ClaimStatus.py
135
+ current_dir = os.path.dirname(os.path.abspath(__file__))
136
+ workspace_root = os.path.dirname(current_dir)
137
+ claims_status_path = os.path.join(workspace_root, 'MediLink', 'MediLink_ClaimStatus.py')
138
+
139
+ if os.path.exists(claims_status_path):
140
+ # Set up environment for subprocess to find MediCafe
141
+ env = os.environ.copy()
142
+ python_path = workspace_root
143
+ if 'PYTHONPATH' in env:
144
+ env['PYTHONPATH'] = python_path + os.pathsep + env['PYTHONPATH']
145
+ else:
146
+ env['PYTHONPATH'] = python_path
147
+
148
+ # Set working directory to MediLink directory for proper file paths
149
+ medilink_dir = os.path.dirname(claims_status_path)
150
+
151
+ # Use subprocess.call for Python 3.4.4 compatibility
152
+ result = subprocess.call([sys.executable, claims_status_path],
153
+ cwd=medilink_dir,
154
+ env=env)
155
+ return result
156
+ else:
157
+ print("Error: MediLink_ClaimStatus.py not found at {}".format(claims_status_path))
158
+ return 1
159
+
160
+ except ImportError as e:
161
+ print("Error: Unable to import MediLink_ClaimStatus: {}".format(e))
162
+ return 1
163
+ except Exception as e:
164
+ print("Error running Claims Status: {}".format(e))
165
+ return 1
166
+
167
+ def run_deductible():
168
+ """Run United Deductible checker"""
169
+ try:
170
+ print("Starting United Deductible...")
171
+ # Use subprocess.call for Python 3.4.4 compatibility
172
+
173
+ # Get the path to MediLink_Deductible.py
174
+ current_dir = os.path.dirname(os.path.abspath(__file__))
175
+ workspace_root = os.path.dirname(current_dir)
176
+ deductible_path = os.path.join(workspace_root, 'MediLink', 'MediLink_Deductible.py')
177
+
178
+ if os.path.exists(deductible_path):
179
+ # Set up environment for subprocess to find MediCafe
180
+ env = os.environ.copy()
181
+ python_path = workspace_root
182
+ if 'PYTHONPATH' in env:
183
+ env['PYTHONPATH'] = python_path + os.pathsep + env['PYTHONPATH']
184
+ else:
185
+ env['PYTHONPATH'] = python_path
186
+
187
+ # Set working directory to MediLink directory for proper file paths
188
+ medilink_dir = os.path.dirname(deductible_path)
189
+
190
+ # Use subprocess.call for Python 3.4.4 compatibility
191
+ result = subprocess.call([sys.executable, deductible_path],
192
+ cwd=medilink_dir,
193
+ env=env)
194
+ return result
195
+ else:
196
+ print("Error: MediLink_Deductible.py not found at {}".format(deductible_path))
197
+ return 1
198
+
199
+ except ImportError as e:
200
+ print("Error: Unable to import MediLink_Deductible: {}".format(e))
201
+ return 1
202
+ except Exception as e:
203
+ print("Error running Deductible checker: {}".format(e))
204
+ return 1
205
+
206
+ def run_download_emails():
207
+ """Run email download functionality"""
208
+ try:
209
+ print("Starting email download...")
210
+ # Use subprocess.call for Python 3.4.4 compatibility
211
+
212
+ # Get the path to MediLink_Gmail.py
213
+ current_dir = os.path.dirname(os.path.abspath(__file__))
214
+ workspace_root = os.path.dirname(current_dir)
215
+ medilink_gmail_path = os.path.join(workspace_root, 'MediLink', 'MediLink_Gmail.py')
216
+
217
+ if os.path.exists(medilink_gmail_path):
218
+ # Set up environment for subprocess to find MediCafe
219
+ env = os.environ.copy()
220
+ python_path = workspace_root
221
+ if 'PYTHONPATH' in env:
222
+ env['PYTHONPATH'] = python_path + os.pathsep + env['PYTHONPATH']
223
+ else:
224
+ env['PYTHONPATH'] = python_path
225
+
226
+ # Set working directory to MediLink directory for proper file paths
227
+ medilink_dir = os.path.dirname(medilink_gmail_path)
228
+
229
+ # Use subprocess.call for Python 3.4.4 compatibility
230
+ result = subprocess.call([sys.executable, medilink_gmail_path],
231
+ cwd=medilink_dir,
232
+ env=env)
233
+ return result
234
+ else:
235
+ print("Error: MediLink_Gmail.py not found at {}".format(medilink_gmail_path))
236
+ return 1
237
+
238
+ except ImportError as e:
239
+ print("Error: Unable to import MediLink_Gmail: {}".format(e))
240
+ return 1
241
+ except Exception as e:
242
+ print("Error running email download: {}".format(e))
243
+ return 1
244
+
245
+ def show_version():
246
+ """Show MediCafe version information"""
247
+ try:
248
+ from MediCafe import __version__, __author__
249
+ print("MediCafe version {}".format(__version__))
250
+ print("Author: {}".format(__author__))
251
+ return 0
252
+ except ImportError:
253
+ print("MediCafe version information not available")
254
+ return 1
255
+
256
+ def main():
257
+ """Main entry point for MediCafe"""
258
+ # Set up paths first
259
+ setup_entry_point_paths()
260
+
261
+ # Create argument parser
262
+ parser = argparse.ArgumentParser(
263
+ description='MediCafe - Medical Practice Management Automation Suite',
264
+ prog='python -m MediCafe'
265
+ )
266
+
267
+ parser.add_argument(
268
+ 'command',
269
+ choices=['medibot', 'medilink', 'claims_status', 'deductible', 'download_emails', 'version'],
270
+ help='Command to execute'
271
+ )
272
+
273
+ parser.add_argument(
274
+ 'config_file',
275
+ nargs='?',
276
+ help='Configuration file path (for medibot command)'
277
+ )
278
+
279
+ # Parse arguments
280
+ if len(sys.argv) < 2:
281
+ parser.print_help()
282
+ return 1
283
+
284
+ args = parser.parse_args()
285
+
286
+ # Route to appropriate function based on command
287
+ try:
288
+ if args.command == 'medibot':
289
+ return run_medibot(args.config_file)
290
+ elif args.command == 'medilink':
291
+ return run_medilink()
292
+ elif args.command == 'claims_status':
293
+ return run_claims_status()
294
+ elif args.command == 'deductible':
295
+ return run_deductible()
296
+ elif args.command == 'download_emails':
297
+ return run_download_emails()
298
+ elif args.command == 'version':
299
+ return show_version()
300
+ else:
301
+ print("Unknown command: {}".format(args.command))
302
+ parser.print_help()
303
+ return 1
304
+
305
+ except KeyboardInterrupt:
306
+ print("\nOperation cancelled by user")
307
+ return 1
308
+ except Exception as e:
309
+ print("Unexpected error: {}".format(e))
310
+ return 1
311
+
312
+ if __name__ == '__main__':
313
+ exit_code = main()
314
+ sys.exit(exit_code)