medicafe 0.250725.9__py3-none-any.whl → 0.250725.10__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/MediBot.py CHANGED
@@ -1,5 +1,5 @@
1
1
  #MediBot.py
2
- import subprocess, os, tempfile, traceback, re, sys, time, msvcrt, ctypes
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
 
MediBot/MediBot_UI.py CHANGED
@@ -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
- Robust input function that handles Windows XP console timing issues.
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
- print("DEBUG_ROBUST: Retry attempt {} for input".format(attempt + 1))
73
- flush_console_input_buffer()
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
- print("DEBUG_ROBUST: Attempt {} got: '{}' (length: {})".format(attempt + 1, response, len(response)))
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
- def discard_leading_blank():
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
- print("DEBUG_MAIN: robust_input() returned, response = '{}'".format(response))
383
- # Debug: Print what we actually got
384
- print("DEBUG_MAIN: Final response: '{}' (length: {})".format(response, len(response)))
385
- print("DEBUG_MAIN: Response type: {}, repr: {}".format(type(response), repr(response)))
386
- print("DEBUG_MAIN: About to check response validity...")
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("DEBUG_MAIN: Empty response, asking again")
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
- except Exception as e:
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']:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: medicafe
3
- Version: 0.250725.9
3
+ Version: 0.250725.10
4
4
  Summary: MediCafe
5
5
  Home-page: https://github.com/katanada2
6
6
  Author: Daniel Vidaud
@@ -1,11 +1,11 @@
1
1
  MediBot/MediBot.bat,sha256=anz5i-Td1k3HhRUvkCqHsw9lBLVmO6q9bt5kLTfr1Iw,13282
2
- MediBot/MediBot.py,sha256=689_3QojGVLWmiDt7OcmOyW-KdL757jCi2b8EfaRgnU,26163
2
+ MediBot/MediBot.py,sha256=9ilE0Ok9BRcSt_RgXJJheJpc8mTclGSqfuBmq8MamwM,24845
3
3
  MediBot/MediBot_Charges.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  MediBot/MediBot_Crosswalk_Library.py,sha256=Ix4QlAcg3O9Y6n6ZeSUtbmtV-_n-t0-jnefXDBFlhhI,51441
5
5
  MediBot/MediBot_Post.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  MediBot/MediBot_Preprocessor.py,sha256=Lc9uQnE5SAa0dQTOREdPV1QUB2cywXTHJ1h2w-fyeeQ,13331
7
7
  MediBot/MediBot_Preprocessor_lib.py,sha256=LXzV85uq7YoAWbZi88HzAs_GObl7vP8mhFbWZQbd0M8,45687
8
- MediBot/MediBot_UI.py,sha256=mMl3KHOLijxph8n1-xpULROIVy7wQQYEmadr5CYLV2o,18374
8
+ MediBot/MediBot_UI.py,sha256=q6_WUB6olw54xl1Rv6AWgthdMne9bfuRfHNdTv15Lq8,13733
9
9
  MediBot/MediBot_dataformat_library.py,sha256=XNyeiOC6uJUp15UXP_rhtB3rMTPus9ZXDnz5zHNoRYM,8586
10
10
  MediBot/MediBot_docx_decoder.py,sha256=GbhX58pMAsWNhBF7B8AtWiNpUOB4bU0zAM81moXYkkE,27370
11
11
  MediBot/MediPost.py,sha256=C1hZJFr65rN6F_dckjdBxFC0vL2CoqY9W3YFqU5HXtE,336
@@ -49,8 +49,8 @@ MediLink/test.py,sha256=kSvvJRL_3fWuNS3_x4hToOnUljGLoeEw6SUTHQWQRJk,3108
49
49
  MediLink/test_cob_library.py,sha256=wUMv0-Y6fNsKcAs8Z9LwfmEBRO7oBzBAfWmmzwoNd1g,13841
50
50
  MediLink/test_validation.py,sha256=FJrfdUFK--xRScIzrHCg1JeGdm0uJEoRnq6CgkP2lwM,4154
51
51
  MediLink/webapp.html,sha256=JPKT559aFVBi1r42Hz7C77Jj0teZZRumPhBev8eSOLk,19806
52
- medicafe-0.250725.9.dist-info/LICENSE,sha256=65lb-vVujdQK7uMH3RRJSMwUW-WMrMEsc5sOaUn2xUk,1096
53
- medicafe-0.250725.9.dist-info/METADATA,sha256=mEw7yaBi3lzf-Ez_nC-3yqrYY7HSO-tch3HhVvMjthI,5501
54
- medicafe-0.250725.9.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
55
- medicafe-0.250725.9.dist-info/top_level.txt,sha256=3uOwR4q_SP8Gufk2uCHoKngAgbtdOwQC6Qjl7ViBa_c,17
56
- medicafe-0.250725.9.dist-info/RECORD,,
52
+ medicafe-0.250725.10.dist-info/LICENSE,sha256=65lb-vVujdQK7uMH3RRJSMwUW-WMrMEsc5sOaUn2xUk,1096
53
+ medicafe-0.250725.10.dist-info/METADATA,sha256=6cuBOxg-O1EJzDLIy5g-uKRH6U3RfhEtlKRIAE7MK-c,5502
54
+ medicafe-0.250725.10.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
55
+ medicafe-0.250725.10.dist-info/top_level.txt,sha256=3uOwR4q_SP8Gufk2uCHoKngAgbtdOwQC6Qjl7ViBa_c,17
56
+ medicafe-0.250725.10.dist-info/RECORD,,