medicafe 0.250820.5__tar.gz → 0.250820.6__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.
Files changed (86) hide show
  1. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediBot/MediBot.py +13 -1
  2. medicafe-0.250820.6/MediBot/MediBot_Notepad_Utils.py +196 -0
  3. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediBot/__init__.py +1 -1
  4. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediCafe/__init__.py +1 -1
  5. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/__init__.py +1 -1
  6. {medicafe-0.250820.5/medicafe.egg-info → medicafe-0.250820.6}/PKG-INFO +1 -1
  7. {medicafe-0.250820.5 → medicafe-0.250820.6/medicafe.egg-info}/PKG-INFO +1 -1
  8. {medicafe-0.250820.5 → medicafe-0.250820.6}/medicafe.egg-info/SOURCES.txt +1 -0
  9. {medicafe-0.250820.5 → medicafe-0.250820.6}/setup.py +1 -1
  10. {medicafe-0.250820.5 → medicafe-0.250820.6}/LICENSE +0 -0
  11. {medicafe-0.250820.5 → medicafe-0.250820.6}/MANIFEST.in +0 -0
  12. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediBot/MediBot.bat +0 -0
  13. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediBot/MediBot_Charges.py +0 -0
  14. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediBot/MediBot_Crosswalk_Library.py +0 -0
  15. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediBot/MediBot_Crosswalk_Utils.py +0 -0
  16. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediBot/MediBot_Post.py +0 -0
  17. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediBot/MediBot_Preprocessor.py +0 -0
  18. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediBot/MediBot_Preprocessor_lib.py +0 -0
  19. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediBot/MediBot_UI.py +0 -0
  20. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediBot/MediBot_dataformat_library.py +0 -0
  21. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediBot/MediBot_debug.bat +0 -0
  22. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediBot/MediBot_docx_decoder.py +0 -0
  23. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediBot/MediBot_smart_import.py +0 -0
  24. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediBot/clear_cache.bat +0 -0
  25. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediBot/crash_diagnostic.bat +0 -0
  26. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediBot/f_drive_diagnostic.bat +0 -0
  27. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediBot/full_debug_suite.bat +0 -0
  28. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediBot/get_medicafe_version.py +0 -0
  29. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediBot/process_csvs.bat +0 -0
  30. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediBot/update_json.py +0 -0
  31. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediBot/update_medicafe.py +0 -0
  32. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediCafe/MediLink_ConfigLoader.py +0 -0
  33. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediCafe/__main__.py +0 -0
  34. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediCafe/api_core.py +0 -0
  35. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediCafe/api_core_backup.py +0 -0
  36. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediCafe/api_factory.py +0 -0
  37. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediCafe/api_utils.py +0 -0
  38. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediCafe/core_utils.py +0 -0
  39. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediCafe/graphql_utils.py +0 -0
  40. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediCafe/logging_config.py +0 -0
  41. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediCafe/logging_demo.py +0 -0
  42. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediCafe/migration_helpers.py +0 -0
  43. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediCafe/smart_import.py +0 -0
  44. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediCafe/submission_index.py +0 -0
  45. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/InsuranceTypeService.py +0 -0
  46. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/MediLink_837p_cob_library.py +0 -0
  47. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/MediLink_837p_encoder.py +0 -0
  48. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/MediLink_837p_encoder_library.py +0 -0
  49. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/MediLink_837p_utilities.py +0 -0
  50. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/MediLink_API_Generator.py +0 -0
  51. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/MediLink_Azure.py +0 -0
  52. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/MediLink_ClaimStatus.py +0 -0
  53. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/MediLink_DataMgmt.py +0 -0
  54. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/MediLink_Decoder.py +0 -0
  55. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/MediLink_Deductible.py +0 -0
  56. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/MediLink_Deductible_Validator.py +0 -0
  57. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/MediLink_Display_Utils.py +0 -0
  58. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/MediLink_Down.py +0 -0
  59. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/MediLink_Gmail.py +0 -0
  60. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/MediLink_Mailer.py +0 -0
  61. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/MediLink_Parser.py +0 -0
  62. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/MediLink_PatientProcessor.py +0 -0
  63. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/MediLink_Scan.py +0 -0
  64. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/MediLink_Scheduler.py +0 -0
  65. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/MediLink_UI.py +0 -0
  66. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/MediLink_Up.py +0 -0
  67. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/MediLink_insurance_utils.py +0 -0
  68. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/MediLink_main.py +0 -0
  69. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/MediLink_smart_import.py +0 -0
  70. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/Soumit_api.py +0 -0
  71. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/gmail_http_utils.py +0 -0
  72. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/gmail_oauth_utils.py +0 -0
  73. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/insurance_type_integration_test.py +0 -0
  74. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/openssl.cnf +0 -0
  75. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/test.py +0 -0
  76. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/test_cob_library.py +0 -0
  77. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/test_timing.py +0 -0
  78. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/test_validation.py +0 -0
  79. {medicafe-0.250820.5 → medicafe-0.250820.6}/MediLink/webapp.html +0 -0
  80. {medicafe-0.250820.5 → medicafe-0.250820.6}/README.md +0 -0
  81. {medicafe-0.250820.5 → medicafe-0.250820.6}/medicafe.egg-info/dependency_links.txt +0 -0
  82. {medicafe-0.250820.5 → medicafe-0.250820.6}/medicafe.egg-info/entry_points.txt +0 -0
  83. {medicafe-0.250820.5 → medicafe-0.250820.6}/medicafe.egg-info/not-zip-safe +0 -0
  84. {medicafe-0.250820.5 → medicafe-0.250820.6}/medicafe.egg-info/requires.txt +0 -0
  85. {medicafe-0.250820.5 → medicafe-0.250820.6}/medicafe.egg-info/top_level.txt +0 -0
  86. {medicafe-0.250820.5 → medicafe-0.250820.6}/setup.cfg +0 -0
@@ -12,6 +12,7 @@ except ImportError:
12
12
  msvcrt = None # Not available on non-Windows systems
13
13
  from collections import OrderedDict
14
14
  from datetime import datetime # Added for primary surgery date logic
15
+ import MediBot_Notepad_Utils # For generating notepad files
15
16
 
16
17
  # ============================================================================
17
18
  # MINIMAL PROTECTION: Import State Validation
@@ -802,11 +803,22 @@ if __name__ == "__main__":
802
803
 
803
804
  # Display existing patients table using the enhanced display function
804
805
  patient_type = "MEDICARE" if is_medicare else "PRIVATE"
806
+ table_title = "{} PATIENTS - EXISTING: The following patient(s) already EXIST in the system but may have new dates of service.\n Their diagnosis codes may need to be updated manually by the user to the following list:".format(patient_type)
805
807
  MediBot_UI.display_enhanced_patient_table(
806
808
  patient_info,
807
- "{} PATIENTS - EXISTING: The following patient(s) already EXIST in the system but may have new dates of service.\n Their diagnosis codes may need to be updated manually by the user to the following list:".format(patient_type),
809
+ table_title,
808
810
  show_line_numbers=False
809
811
  )
812
+
813
+ # Generate and open notepad file with existing patients table
814
+ try:
815
+ notepad_file_path = MediBot_Notepad_Utils.generate_existing_patients_notepad(patient_info, table_title)
816
+ if notepad_file_path:
817
+ print("Existing patients table saved and opened in notepad: {}".format(notepad_file_path))
818
+ else:
819
+ print("Warning: Could not create notepad file for existing patients table")
820
+ except Exception as e:
821
+ print("Warning: Error creating notepad file: {}".format(e))
810
822
 
811
823
  # Update csv_data to exclude existing patients
812
824
  # TODO: Update this logic to handle patients that exist but need new charges added.
@@ -0,0 +1,196 @@
1
+ # -*- coding: ascii -*-
2
+ """
3
+ MediBot Notepad Utilities
4
+ Windows XP + Python 3.4.4 + ASCII-only compatible module for generating notepad files.
5
+
6
+ This module provides utilities to create and open text files containing patient table data
7
+ for manual review and reference.
8
+ """
9
+
10
+ import os
11
+ import subprocess
12
+ import tempfile
13
+ from datetime import datetime
14
+
15
+
16
+ def format_patient_table_for_notepad(patient_info, title):
17
+ """
18
+ Format patient table data for notepad display.
19
+
20
+ Args:
21
+ patient_info: List of tuples (surgery_date, patient_name, patient_id, diagnosis_code, patient_row)
22
+ title: Title for the table section
23
+
24
+ Returns:
25
+ str: Formatted text content suitable for notepad display
26
+ """
27
+ if not patient_info:
28
+ return title + "\n\nNo patients found.\n"
29
+
30
+ lines = []
31
+ lines.append(title)
32
+ lines.append("")
33
+
34
+ # Normalize data to avoid None and unexpected container types in sort key
35
+ normalized_info = []
36
+ for surgery_date, patient_name, patient_id, diagnosis_code, patient_row in patient_info:
37
+ # Normalize date into comparable key and display string
38
+ display_date = None
39
+ current_date_dt = None
40
+ try:
41
+ if hasattr(surgery_date, 'strftime'):
42
+ display_date = surgery_date.strftime('%m-%d')
43
+ current_date_dt = surgery_date
44
+ elif isinstance(surgery_date, str):
45
+ # Date strings may be MM-DD-YYYY or already MM-DD
46
+ parts = surgery_date.split('-') if surgery_date else []
47
+ if len(parts) == 3 and all(parts):
48
+ display_date = "{}-{}".format(parts[0], parts[1])
49
+ try:
50
+ current_date_dt = datetime.strptime(surgery_date, '%m-%d-%Y')
51
+ except Exception:
52
+ current_date_dt = None
53
+ else:
54
+ display_date = surgery_date or 'Unknown Date'
55
+ current_date_dt = None
56
+ else:
57
+ display_date = str(surgery_date) if surgery_date is not None else 'Unknown Date'
58
+ current_date_dt = None
59
+ except Exception:
60
+ display_date = str(surgery_date) if surgery_date is not None else 'Unknown Date'
61
+ current_date_dt = None
62
+
63
+ # Normalize diagnosis display: only show "-Not Found-" when explicitly flagged as N/A
64
+ display_diagnosis = diagnosis_code
65
+ if diagnosis_code == 'N/A':
66
+ display_diagnosis = '-Not Found-'
67
+ elif not diagnosis_code or diagnosis_code.strip() == '':
68
+ display_diagnosis = '-Not Found-'
69
+
70
+ # Extract patient name parts for sorting
71
+ last_name_key = ''
72
+ first_name_key = ''
73
+
74
+ # Try to get last/first from patient_row if available
75
+ if patient_row:
76
+ try:
77
+ last_name_key = str(patient_row.get('Last Name', '')).upper()
78
+ first_name_key = str(patient_row.get('First Name', '')).upper()
79
+ except (AttributeError, TypeError):
80
+ pass
81
+
82
+ # Build primary date for this patient (used for grouping)
83
+ primary_date_dt = current_date_dt
84
+
85
+ # If last/first not available from row, parse from display name "LAST, FIRST ..."
86
+ if not last_name_key and isinstance(patient_name, str):
87
+ try:
88
+ parts = [p.strip() for p in patient_name.split(',')]
89
+ if len(parts) >= 1:
90
+ last_name_key = parts[0].upper()
91
+ if len(parts) >= 2:
92
+ first_name_key = parts[1].split()[0].upper() if parts[1] else ''
93
+ except Exception:
94
+ last_name_key = ''
95
+ first_name_key = ''
96
+
97
+ # Build composite sort key per requirement: by earliest date, then last name within date
98
+ composite_sort_key = (primary_date_dt, last_name_key, first_name_key, str(patient_id or ''))
99
+
100
+ normalized_info.append((composite_sort_key, display_date, str(patient_name or ''), str(patient_id or ''), display_diagnosis))
101
+
102
+ # Sort so that all entries for a patient are grouped under their earliest date
103
+ normalized_info.sort(key=lambda x: x[0])
104
+
105
+ # Calculate column widths for proper alignment
106
+ max_patient_id_len = max(len(pid) for _, _, _, pid, _ in normalized_info)
107
+ max_patient_name_len = max(len(pname) for _, _, pname, _, _ in normalized_info)
108
+ max_diagnosis_len = max(len(dcode) for _, _, _, _, dcode in normalized_info)
109
+
110
+ # Ensure minimum widths for readability
111
+ max_patient_id_len = max(max_patient_id_len, 10) # "Patient ID" header
112
+ max_patient_name_len = max(max_patient_name_len, 12) # "Patient Name" header
113
+ max_diagnosis_len = max(max_diagnosis_len, 9) # "Diagnosis" header
114
+
115
+ # Add table header
116
+ header_format = " {:<6} | {:<" + str(max_patient_id_len) + "} | {:<" + str(max_patient_name_len) + "} | {:<" + str(max_diagnosis_len) + "}"
117
+ lines.append(header_format.format("Date", "Patient ID", "Patient Name", "Diagnosis"))
118
+
119
+ # Add separator line
120
+ separator_format = " {:<6} | {:<" + str(max_patient_id_len) + "} | {:<" + str(max_patient_name_len) + "} | {:<" + str(max_diagnosis_len) + "}"
121
+ lines.append(separator_format.format("-" * 6, "-" * max_patient_id_len, "-" * max_patient_name_len, "-" * max_diagnosis_len))
122
+
123
+ current_patient = None
124
+
125
+ for sort_key, formatted_date, patient_name, patient_id, display_diagnosis in normalized_info:
126
+ if current_patient == patient_id:
127
+ patient_id_dashes = '-' * len(patient_id)
128
+ patient_name_dashes = '-' * len(patient_name)
129
+ secondary_format = " {:<6} | {:<" + str(max_patient_id_len) + "} | {:<" + str(max_patient_name_len) + "} | {:<" + str(max_diagnosis_len) + "}"
130
+ lines.append(secondary_format.format(formatted_date, patient_id_dashes, patient_name_dashes, display_diagnosis))
131
+ else:
132
+ current_patient = patient_id
133
+ primary_format = " {:<6} | {:<" + str(max_patient_id_len) + "} | {:<" + str(max_patient_name_len) + "} | {:<" + str(max_diagnosis_len) + "}"
134
+ lines.append(primary_format.format(formatted_date, patient_id, patient_name, display_diagnosis))
135
+
136
+ lines.append("")
137
+ lines.append("Generated on: {}".format(datetime.now().strftime('%Y-%m-%d %H:%M:%S')))
138
+
139
+ return "\n".join(lines)
140
+
141
+
142
+ def create_and_open_notepad_file(content, filename_prefix="existing_patients"):
143
+ """
144
+ Create a text file with the given content and open it in notepad.
145
+ Compatible with Windows XP and Python 3.4.4.
146
+
147
+ Args:
148
+ content: Text content to write to the file
149
+ filename_prefix: Prefix for the generated filename
150
+
151
+ Returns:
152
+ str: Path to the created file, or None if an error occurred
153
+ """
154
+ try:
155
+ # Generate a unique filename with timestamp
156
+ timestamp = datetime.now().strftime('%Y%m%d_%H%M%S')
157
+ filename = "{}_{}.txt".format(filename_prefix, timestamp)
158
+
159
+ # Use the temp directory for the file
160
+ temp_dir = tempfile.gettempdir()
161
+ file_path = os.path.join(temp_dir, filename)
162
+
163
+ # Write the file with ASCII encoding for XP compatibility
164
+ with open(file_path, 'w') as f:
165
+ # Ensure content is ASCII-compatible
166
+ ascii_content = content.encode('ascii', 'replace').decode('ascii')
167
+ f.write(ascii_content)
168
+
169
+ # Open the file in notepad using Windows XP compatible method
170
+ try:
171
+ # Use subprocess to avoid shell=True security issues
172
+ subprocess.Popen(['notepad.exe', file_path])
173
+ except Exception:
174
+ # Fallback method for older systems
175
+ os.system('notepad.exe "{}"'.format(file_path))
176
+
177
+ return file_path
178
+
179
+ except Exception as e:
180
+ # Return None on error - caller should handle gracefully
181
+ return None
182
+
183
+
184
+ def generate_existing_patients_notepad(patient_info, title):
185
+ """
186
+ Generate a notepad file for existing patients table.
187
+
188
+ Args:
189
+ patient_info: List of tuples (surgery_date, patient_name, patient_id, diagnosis_code, patient_row)
190
+ title: Title for the table section
191
+
192
+ Returns:
193
+ str: Path to the created file, or None if an error occurred
194
+ """
195
+ content = format_patient_table_for_notepad(patient_info, title)
196
+ return create_and_open_notepad_file(content, "existing_patients")
@@ -19,7 +19,7 @@ Smart Import Integration:
19
19
  medibot_main = get_components('medibot_main')
20
20
  """
21
21
 
22
- __version__ = "0.250820.5"
22
+ __version__ = "0.250820.6"
23
23
  __author__ = "Daniel Vidaud"
24
24
  __email__ = "daniel@personalizedtransformation.com"
25
25
 
@@ -27,7 +27,7 @@ Smart Import System:
27
27
  api_suite = get_api_access()
28
28
  """
29
29
 
30
- __version__ = "0.250820.5"
30
+ __version__ = "0.250820.6"
31
31
  __author__ = "Daniel Vidaud"
32
32
  __email__ = "daniel@personalizedtransformation.com"
33
33
 
@@ -22,7 +22,7 @@ Smart Import Integration:
22
22
  datamgmt = get_components('medilink_datamgmt')
23
23
  """
24
24
 
25
- __version__ = "0.250820.5"
25
+ __version__ = "0.250820.6"
26
26
  __author__ = "Daniel Vidaud"
27
27
  __email__ = "daniel@personalizedtransformation.com"
28
28
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: medicafe
3
- Version: 0.250820.5
3
+ Version: 0.250820.6
4
4
  Summary: MediCafe
5
5
  Home-page: https://github.com/katanada2/MediCafe
6
6
  Author: Daniel Vidaud
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: medicafe
3
- Version: 0.250820.5
3
+ Version: 0.250820.6
4
4
  Summary: MediCafe
5
5
  Home-page: https://github.com/katanada2/MediCafe
6
6
  Author: Daniel Vidaud
@@ -7,6 +7,7 @@ MediBot/MediBot.py
7
7
  MediBot/MediBot_Charges.py
8
8
  MediBot/MediBot_Crosswalk_Library.py
9
9
  MediBot/MediBot_Crosswalk_Utils.py
10
+ MediBot/MediBot_Notepad_Utils.py
10
11
  MediBot/MediBot_Post.py
11
12
  MediBot/MediBot_Preprocessor.py
12
13
  MediBot/MediBot_Preprocessor_lib.py
@@ -54,7 +54,7 @@ if long_description_text is None:
54
54
 
55
55
  setup(
56
56
  name='medicafe',
57
- version="0.250820.5",
57
+ version="0.250820.6",
58
58
  description='MediCafe',
59
59
  long_description=long_description_text,
60
60
  long_description_content_type='text/markdown',
File without changes
File without changes
File without changes
File without changes