medicafe 0.250725.9__tar.gz → 0.250725.10__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.
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediBot/MediBot.py +1 -35
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediBot/MediBot_UI.py +14 -107
- {medicafe-0.250725.9 → medicafe-0.250725.10}/PKG-INFO +1 -1
- {medicafe-0.250725.9 → medicafe-0.250725.10}/medicafe.egg-info/PKG-INFO +1 -1
- {medicafe-0.250725.9 → medicafe-0.250725.10}/setup.py +1 -1
- {medicafe-0.250725.9 → medicafe-0.250725.10}/LICENSE +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MANIFEST.in +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediBot/MediBot.bat +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediBot/MediBot_Charges.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediBot/MediBot_Crosswalk_Library.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediBot/MediBot_Post.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediBot/MediBot_Preprocessor.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediBot/MediBot_Preprocessor_lib.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediBot/MediBot_dataformat_library.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediBot/MediBot_docx_decoder.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediBot/PDF_to_CSV_Cleaner.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediBot/__init__.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediBot/update_json.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediBot/update_medicafe.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediLink/MediLink.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediLink/MediLink_837p_cob_library.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediLink/MediLink_837p_encoder.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediLink/MediLink_837p_encoder_library.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediLink/MediLink_837p_utilities.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediLink/MediLink_API_Generator.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediLink/MediLink_API_v2.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediLink/MediLink_API_v3.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediLink/MediLink_APIs.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediLink/MediLink_Azure.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediLink/MediLink_ClaimStatus.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediLink/MediLink_ConfigLoader.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediLink/MediLink_DataMgmt.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediLink/MediLink_Decoder.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediLink/MediLink_Deductible.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediLink/MediLink_Deductible_Validator.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediLink/MediLink_Down.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediLink/MediLink_Gmail.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediLink/MediLink_GraphQL.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediLink/MediLink_Mailer.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediLink/MediLink_Parser.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediLink/MediLink_Scan.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediLink/MediLink_Scheduler.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediLink/MediLink_UI.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediLink/MediLink_Up.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediLink/MediLink_batch.bat +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediLink/Soumit_api.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediLink/__init__.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediLink/openssl.cnf +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediLink/test.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediLink/test_cob_library.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediLink/test_validation.py +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/MediLink/webapp.html +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/README.md +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/medicafe.egg-info/SOURCES.txt +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/medicafe.egg-info/dependency_links.txt +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/medicafe.egg-info/not-zip-safe +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/medicafe.egg-info/requires.txt +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/medicafe.egg-info/top_level.txt +0 -0
- {medicafe-0.250725.9 → medicafe-0.250725.10}/setup.cfg +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#MediBot.py
|
|
2
|
-
import subprocess, os, tempfile, traceback, re, sys, time
|
|
2
|
+
import subprocess, os, tempfile, traceback, re, sys, time
|
|
3
3
|
from collections import OrderedDict
|
|
4
4
|
import MediBot_dataformat_library
|
|
5
5
|
import MediBot_Preprocessor
|
|
@@ -12,35 +12,7 @@ sys.path.append(project_dir)
|
|
|
12
12
|
|
|
13
13
|
from MediLink import MediLink_ConfigLoader
|
|
14
14
|
|
|
15
|
-
def flush_console_input_buffer():
|
|
16
|
-
"""
|
|
17
|
-
Remove any keystrokes already sitting in the console input buffer.
|
|
18
|
-
Necessary on Windows XP where a stray CR/LF can remain after the
|
|
19
|
-
script is launched.
|
|
20
|
-
"""
|
|
21
|
-
if sys.platform != "win32":
|
|
22
|
-
return # no-op on non-Windows
|
|
23
15
|
|
|
24
|
-
try:
|
|
25
|
-
kernel32 = ctypes.WinDLL('kernel32', use_last_error=True)
|
|
26
|
-
STD_INPUT_HANDLE = -10
|
|
27
|
-
h_stdin = kernel32.GetStdHandle(STD_INPUT_HANDLE)
|
|
28
|
-
kernel32.FlushConsoleInputBuffer(h_stdin)
|
|
29
|
-
except Exception:
|
|
30
|
-
# Fallback: drain any leading newlines manually
|
|
31
|
-
while msvcrt.kbhit():
|
|
32
|
-
msvcrt.getch()
|
|
33
|
-
|
|
34
|
-
def discard_leading_blank():
|
|
35
|
-
"""
|
|
36
|
-
Alternative fallback that uses non-blocking msvcrt to drain any available input.
|
|
37
|
-
"""
|
|
38
|
-
if sys.platform != "win32":
|
|
39
|
-
return # no-op on non-Windows
|
|
40
|
-
|
|
41
|
-
# Use non-blocking msvcrt approach to drain any available input
|
|
42
|
-
while msvcrt.kbhit():
|
|
43
|
-
msvcrt.getch()
|
|
44
16
|
|
|
45
17
|
try:
|
|
46
18
|
from MediBot_Crosswalk_Library import crosswalk_update
|
|
@@ -430,9 +402,6 @@ if __name__ == "__main__":
|
|
|
430
402
|
sys.stdout.flush()
|
|
431
403
|
time.sleep(0.2) # Increased delay for Windows XP
|
|
432
404
|
|
|
433
|
-
# Flush console input buffer to remove any stray CR/LF
|
|
434
|
-
flush_console_input_buffer()
|
|
435
|
-
|
|
436
405
|
# Use input() for more reliable input on Windows XP
|
|
437
406
|
proceed = input().lower().strip() in ['yes', 'y']
|
|
438
407
|
else:
|
|
@@ -441,9 +410,6 @@ if __name__ == "__main__":
|
|
|
441
410
|
sys.stdout.flush()
|
|
442
411
|
time.sleep(0.2) # Increased delay for Windows XP
|
|
443
412
|
|
|
444
|
-
# Flush console input buffer to remove any stray CR/LF
|
|
445
|
-
flush_console_input_buffer()
|
|
446
|
-
|
|
447
413
|
# Use input() for more reliable input on Windows XP
|
|
448
414
|
proceed = input().lower().strip() in ['yes', 'y']
|
|
449
415
|
|
|
@@ -18,88 +18,26 @@ config, crosswalk = MediLink_ConfigLoader.load_configuration()
|
|
|
18
18
|
VK_END = int(config.get('VK_END', ""), 16) # Try F12 (7B). Virtual key code for 'End' (23)
|
|
19
19
|
VK_PAUSE = int(config.get('VK_PAUSE', ""), 16) # Try F11 (7A). Virtual-key code for 'Home' (24)
|
|
20
20
|
|
|
21
|
-
def flush_console_input_buffer():
|
|
22
|
-
"""
|
|
23
|
-
Remove any keystrokes already sitting in the console input buffer.
|
|
24
|
-
Necessary on Windows XP where a stray CR/LF can remain after the
|
|
25
|
-
script is launched.
|
|
26
|
-
"""
|
|
27
|
-
if sys.platform != "win32":
|
|
28
|
-
return # no-op on non-Windows
|
|
29
21
|
|
|
30
|
-
print("DEBUG_FLUSH: Starting flush_console_input_buffer()")
|
|
31
|
-
|
|
32
|
-
# Check what's in the buffer before flushing
|
|
33
|
-
chars_in_buffer = []
|
|
34
|
-
while msvcrt.kbhit():
|
|
35
|
-
ch = msvcrt.getch()
|
|
36
|
-
chars_in_buffer.append(ch)
|
|
37
|
-
|
|
38
|
-
if chars_in_buffer:
|
|
39
|
-
print("DEBUG_FLUSH: Found {} chars in buffer before flush: {}".format(len(chars_in_buffer), chars_in_buffer))
|
|
40
|
-
else:
|
|
41
|
-
print("DEBUG_FLUSH: No chars found in buffer before flush")
|
|
42
|
-
|
|
43
|
-
try:
|
|
44
|
-
kernel32 = ctypes.WinDLL('kernel32', use_last_error=True)
|
|
45
|
-
STD_INPUT_HANDLE = -10
|
|
46
|
-
h_stdin = kernel32.GetStdHandle(STD_INPUT_HANDLE)
|
|
47
|
-
result = kernel32.FlushConsoleInputBuffer(h_stdin)
|
|
48
|
-
print("DEBUG_FLUSH: FlushConsoleInputBuffer API call result: {}".format(result))
|
|
49
|
-
except Exception as e:
|
|
50
|
-
print("DEBUG_FLUSH: FlushConsoleInputBuffer API failed: {}".format(e))
|
|
51
|
-
# Fallback: drain any leading newlines manually
|
|
52
|
-
fallback_chars = []
|
|
53
|
-
while msvcrt.kbhit():
|
|
54
|
-
ch = msvcrt.getch()
|
|
55
|
-
fallback_chars.append(ch)
|
|
56
|
-
if fallback_chars:
|
|
57
|
-
print("DEBUG_FLUSH: Fallback removed {} chars: {}".format(len(fallback_chars), fallback_chars))
|
|
58
|
-
else:
|
|
59
|
-
print("DEBUG_FLUSH: Fallback found no chars to remove")
|
|
60
|
-
|
|
61
|
-
print("DEBUG_FLUSH: flush_console_input_buffer() completed")
|
|
62
22
|
|
|
63
23
|
def robust_input(prompt="", max_retries=3):
|
|
64
24
|
"""
|
|
65
|
-
|
|
66
|
-
Automatically retries if the first input returns empty.
|
|
25
|
+
Simple input function with retry logic for Windows XP console issues.
|
|
67
26
|
"""
|
|
68
|
-
print("DEBUG_ROBUST: Starting robust_input with prompt: '{}'".format(prompt))
|
|
69
|
-
|
|
70
27
|
for attempt in range(max_retries):
|
|
71
28
|
if attempt > 0:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
# Print prompt only on first attempt, or if it's a retry
|
|
76
|
-
if attempt == 0:
|
|
77
|
-
print("DEBUG_ROBUST: First attempt - calling input(prompt)")
|
|
78
|
-
response = input(prompt).strip()
|
|
79
|
-
else:
|
|
80
|
-
print("DEBUG_ROBUST: Retry attempt - calling input() without prompt")
|
|
81
|
-
response = input().strip()
|
|
29
|
+
# Clear any leftover input on retry
|
|
30
|
+
while msvcrt.kbhit():
|
|
31
|
+
msvcrt.getch()
|
|
82
32
|
|
|
83
|
-
|
|
33
|
+
response = input(prompt if attempt == 0 else "").strip()
|
|
84
34
|
|
|
85
35
|
if response:
|
|
86
|
-
print("DEBUG_ROBUST: Success! Returning: '{}'".format(response))
|
|
87
36
|
return response
|
|
88
37
|
|
|
89
|
-
# If all attempts failed, return empty string
|
|
90
|
-
print("DEBUG_ROBUST: All {} attempts failed, returning empty string".format(max_retries))
|
|
91
38
|
return ""
|
|
92
39
|
|
|
93
|
-
|
|
94
|
-
"""
|
|
95
|
-
Alternative fallback that uses non-blocking msvcrt to drain any available input.
|
|
96
|
-
"""
|
|
97
|
-
if sys.platform != "win32":
|
|
98
|
-
return # no-op on non-Windows
|
|
99
|
-
|
|
100
|
-
# Use non-blocking msvcrt approach to drain any available input
|
|
101
|
-
while msvcrt.kbhit():
|
|
102
|
-
msvcrt.getch()
|
|
40
|
+
|
|
103
41
|
|
|
104
42
|
class AppControl:
|
|
105
43
|
def __init__(self):
|
|
@@ -235,9 +173,6 @@ def display_patient_selection_menu(csv_data, reverse_mapping, proceed_as_medicar
|
|
|
235
173
|
sys.stdout.flush()
|
|
236
174
|
time.sleep(0.2) # Increased delay for Windows XP
|
|
237
175
|
|
|
238
|
-
# Flush console input buffer to remove any stray CR/LF
|
|
239
|
-
flush_console_input_buffer()
|
|
240
|
-
|
|
241
176
|
# Use input() for more reliable input on Windows XP
|
|
242
177
|
proceed = input().lower().strip() in ['yes', 'y']
|
|
243
178
|
|
|
@@ -253,9 +188,6 @@ def display_patient_selection_menu(csv_data, reverse_mapping, proceed_as_medicar
|
|
|
253
188
|
sys.stdout.flush()
|
|
254
189
|
time.sleep(0.2) # Increased delay for Windows XP
|
|
255
190
|
|
|
256
|
-
# Flush console input buffer to remove any stray CR/LF
|
|
257
|
-
flush_console_input_buffer()
|
|
258
|
-
|
|
259
191
|
# Use input() for more reliable input on Windows XP
|
|
260
192
|
selection = input().strip()
|
|
261
193
|
if not selection:
|
|
@@ -336,9 +268,6 @@ def handle_user_interaction(interaction_mode, error_message):
|
|
|
336
268
|
sys.stdout.flush()
|
|
337
269
|
time.sleep(0.2) # Increased delay for Windows XP
|
|
338
270
|
|
|
339
|
-
# Flush console input buffer to remove any stray CR/LF
|
|
340
|
-
flush_console_input_buffer()
|
|
341
|
-
|
|
342
271
|
# Use input() for more reliable input on Windows XP
|
|
343
272
|
choice = input().strip()
|
|
344
273
|
|
|
@@ -369,45 +298,23 @@ def user_interaction(csv_data, interaction_mode, error_message, reverse_mapping)
|
|
|
369
298
|
|
|
370
299
|
# Force flush for Windows XP compatibility
|
|
371
300
|
sys.stdout.flush()
|
|
372
|
-
|
|
373
|
-
# Flush console input buffer to remove any stray CR/LF from script launch
|
|
374
|
-
flush_console_input_buffer()
|
|
375
301
|
|
|
376
302
|
while True:
|
|
377
303
|
try:
|
|
378
|
-
print("DEBUG_MAIN: About to call robust_input() - waiting for user...")
|
|
379
|
-
# Use robust_input() for more reliable input on Windows XP
|
|
380
304
|
response = robust_input("\nAm I processing Medicare patients? (yes/no): ").lower()
|
|
381
305
|
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
if response:
|
|
389
|
-
print("DEBUG_MAIN: Response is not empty, checking if valid...")
|
|
390
|
-
if response in ['yes', 'y']:
|
|
391
|
-
print("DEBUG_MAIN: Valid response '{}', loading Medicare config".format(response))
|
|
392
|
-
app_control.load_paths_from_config(medicare=True)
|
|
393
|
-
break
|
|
394
|
-
elif response in ['no', 'n']:
|
|
395
|
-
print("DEBUG_MAIN: Valid response '{}', loading Private config".format(response))
|
|
396
|
-
app_control.load_paths_from_config(medicare=False)
|
|
397
|
-
break
|
|
398
|
-
else:
|
|
399
|
-
print("DEBUG_MAIN: Invalid response '{}', asking again".format(response))
|
|
400
|
-
print("Invalid entry. Please enter 'yes' or 'no'.")
|
|
306
|
+
if response in ['yes', 'y']:
|
|
307
|
+
app_control.load_paths_from_config(medicare=True)
|
|
308
|
+
break
|
|
309
|
+
elif response in ['no', 'n']:
|
|
310
|
+
app_control.load_paths_from_config(medicare=False)
|
|
311
|
+
break
|
|
401
312
|
else:
|
|
402
|
-
print("
|
|
403
|
-
print("A response is required. Please try again.")
|
|
313
|
+
print("Invalid entry. Please enter 'yes' or 'no'.")
|
|
404
314
|
except KeyboardInterrupt:
|
|
405
315
|
print("\nOperation cancelled by user. Exiting script.")
|
|
406
316
|
exit()
|
|
407
|
-
|
|
408
|
-
print("DEBUG_MAIN: Exception occurred: {}".format(e))
|
|
409
|
-
import traceback
|
|
410
|
-
traceback.print_exc()
|
|
317
|
+
|
|
411
318
|
|
|
412
319
|
fixed_values = config.get('fixed_values', {}) # Get fixed values from config json
|
|
413
320
|
if response in ['yes', 'y']:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|