medicafe 0.250728.8__tar.gz → 0.250728.9__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.

Files changed (62) hide show
  1. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediLink/MediLink.py +66 -26
  2. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediLink/MediLink_837p_encoder_library.py +22 -6
  3. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediLink/MediLink_DataMgmt.py +27 -9
  4. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediLink/MediLink_UI.py +20 -10
  5. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediLink/MediLink_insurance_utils.py +35 -69
  6. medicafe-0.250728.9/MediLink/__init__.py +1 -0
  7. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediLink/insurance_type_integration_test.py +55 -75
  8. {medicafe-0.250728.8 → medicafe-0.250728.9}/PKG-INFO +1 -1
  9. {medicafe-0.250728.8 → medicafe-0.250728.9}/medicafe.egg-info/PKG-INFO +1 -1
  10. {medicafe-0.250728.8 → medicafe-0.250728.9}/medicafe.egg-info/SOURCES.txt +0 -1
  11. {medicafe-0.250728.8 → medicafe-0.250728.9}/setup.py +1 -1
  12. medicafe-0.250728.8/MediLink/__init__.py +0 -0
  13. medicafe-0.250728.8/README.md +0 -58
  14. {medicafe-0.250728.8 → medicafe-0.250728.9}/LICENSE +0 -0
  15. {medicafe-0.250728.8 → medicafe-0.250728.9}/MANIFEST.in +0 -0
  16. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediBot/MediBot.bat +0 -0
  17. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediBot/MediBot.py +0 -0
  18. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediBot/MediBot_Charges.py +0 -0
  19. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediBot/MediBot_Crosswalk_Library.py +0 -0
  20. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediBot/MediBot_Post.py +0 -0
  21. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediBot/MediBot_Preprocessor.py +0 -0
  22. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediBot/MediBot_Preprocessor_lib.py +0 -0
  23. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediBot/MediBot_UI.py +0 -0
  24. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediBot/MediBot_dataformat_library.py +0 -0
  25. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediBot/MediBot_docx_decoder.py +0 -0
  26. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediBot/PDF_to_CSV_Cleaner.py +0 -0
  27. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediBot/__init__.py +0 -0
  28. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediBot/update_json.py +0 -0
  29. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediBot/update_medicafe.py +0 -0
  30. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediLink/MediLink_837p_cob_library.py +0 -0
  31. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediLink/MediLink_837p_encoder.py +0 -0
  32. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediLink/MediLink_837p_utilities.py +0 -0
  33. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediLink/MediLink_API_Generator.py +0 -0
  34. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediLink/MediLink_API_v2.py +0 -0
  35. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediLink/MediLink_API_v3.py +0 -0
  36. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediLink/MediLink_APIs.py +0 -0
  37. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediLink/MediLink_Azure.py +0 -0
  38. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediLink/MediLink_ClaimStatus.py +0 -0
  39. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediLink/MediLink_ConfigLoader.py +0 -0
  40. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediLink/MediLink_Decoder.py +0 -0
  41. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediLink/MediLink_Deductible.py +0 -0
  42. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediLink/MediLink_Deductible_Validator.py +0 -0
  43. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediLink/MediLink_Down.py +0 -0
  44. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediLink/MediLink_Gmail.py +0 -0
  45. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediLink/MediLink_GraphQL.py +0 -0
  46. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediLink/MediLink_Mailer.py +0 -0
  47. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediLink/MediLink_Parser.py +0 -0
  48. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediLink/MediLink_Scan.py +0 -0
  49. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediLink/MediLink_Scheduler.py +0 -0
  50. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediLink/MediLink_Up.py +0 -0
  51. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediLink/MediLink_api_utils.py +0 -0
  52. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediLink/Soumit_api.py +0 -0
  53. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediLink/openssl.cnf +0 -0
  54. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediLink/test.py +0 -0
  55. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediLink/test_cob_library.py +0 -0
  56. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediLink/test_validation.py +0 -0
  57. {medicafe-0.250728.8 → medicafe-0.250728.9}/MediLink/webapp.html +0 -0
  58. {medicafe-0.250728.8 → medicafe-0.250728.9}/medicafe.egg-info/dependency_links.txt +0 -0
  59. {medicafe-0.250728.8 → medicafe-0.250728.9}/medicafe.egg-info/not-zip-safe +0 -0
  60. {medicafe-0.250728.8 → medicafe-0.250728.9}/medicafe.egg-info/requires.txt +0 -0
  61. {medicafe-0.250728.8 → medicafe-0.250728.9}/medicafe.egg-info/top_level.txt +0 -0
  62. {medicafe-0.250728.8 → medicafe-0.250728.9}/setup.cfg +0 -0
@@ -33,17 +33,25 @@ def collect_detailed_patient_data(selected_files, config, crosswalk):
33
33
  """
34
34
  Collects detailed patient data from the selected files.
35
35
 
36
+ DATA FLOW CLARIFICATION:
37
+ This function processes fixed-width files through extract_and_suggest_endpoint(),
38
+ which creates data structures with 'patient_id' field (sourced from 'CHART' field).
39
+ This is DIFFERENT from MediBot's parse_z_dat() flow which uses 'PATID' field.
40
+
36
41
  :param selected_files: List of selected file paths.
37
42
  :param config: Configuration settings loaded from a JSON file.
38
43
  :param crosswalk: Crosswalk data for mapping purposes.
39
- :return: A list of detailed patient data.
44
+ :return: A list of detailed patient data with 'patient_id' field populated.
40
45
  """
41
46
  detailed_patient_data = []
42
47
  for file_path in selected_files:
48
+ # IMPORTANT: extract_and_suggest_endpoint creates data with 'patient_id' field
49
+ # sourced from the 'CHART' field in fixed-width files
43
50
  detailed_data = extract_and_suggest_endpoint(file_path, config, crosswalk)
44
51
  detailed_patient_data.extend(detailed_data) # Accumulate detailed data for processing
45
52
 
46
53
  # Enrich the detailed patient data with insurance type
54
+ # NOTE: This receives data from extract_and_suggest_endpoint with 'patient_id' field
47
55
  detailed_patient_data = enrich_with_insurance_type(detailed_patient_data, insurance_options)
48
56
 
49
57
  # Display summaries and provide an option for bulk edit
@@ -56,8 +64,16 @@ def enrich_with_insurance_type(detailed_patient_data, patient_insurance_type_map
56
64
  Enriches the detailed patient data with insurance type based on patient ID.
57
65
  Enhanced with optional API integration and comprehensive logging.
58
66
 
67
+ DATA FLOW CLARIFICATION:
68
+ This function receives data from collect_detailed_patient_data() -> extract_and_suggest_endpoint().
69
+ The patient ID field is 'patient_id' (NOT 'PATID').
70
+
71
+ IMPORTANT: Do not confuse with MediBot's parse_z_dat() flow which uses 'PATID'.
72
+ MediLink flow: fixed-width files -> extract_and_suggest_endpoint() -> 'patient_id' field (from 'CHART')
73
+ MediBot flow: Z.dat files -> parse_z_dat() -> 'PATID' field
74
+
59
75
  Parameters:
60
- - detailed_patient_data: List of dictionaries containing detailed patient data.
76
+ - detailed_patient_data: List of dictionaries containing detailed patient data with 'patient_id' field.
61
77
  - patient_insurance_mapping: Dictionary mapping patient IDs to their insurance types.
62
78
 
63
79
  Returns:
@@ -70,48 +86,60 @@ def enrich_with_insurance_type(detailed_patient_data, patient_insurance_type_map
70
86
  UHC and which ones are not yet supported so they know which ones they need to edit. It is possible that we may want to isolate the
71
87
  patient data that is already pulled from UHC so that the user can see which ones are already using the enriched data.
72
88
  """
73
- # Import enhancement utilities
89
+ # Enhanced mode check with graceful degradation
90
+ enhanced_mode = False
91
+
74
92
  try:
75
93
  from MediLink_insurance_utils import (
76
94
  get_feature_flag,
77
- enrich_patient_data_with_metadata,
78
- generate_insurance_assignment_summary,
79
95
  validate_insurance_type_from_config
80
96
  )
81
97
  enhanced_mode = get_feature_flag('enhanced_insurance_enrichment', default=False)
82
- except ImportError:
83
- MediLink_ConfigLoader.log("Insurance utils not available, using legacy mode", level="DEBUG")
98
+ MediLink_ConfigLoader.log("Insurance enhancement utilities loaded successfully", level="DEBUG")
99
+ except ImportError as e:
100
+ MediLink_ConfigLoader.log("Insurance utils not available: {}. Using legacy mode.".format(str(e)), level="INFO")
101
+ enhanced_mode = False
102
+ except Exception as e:
103
+ MediLink_ConfigLoader.log("Error initializing insurance enhancements: {}. Using legacy mode.".format(str(e)), level="ERROR")
84
104
  enhanced_mode = False
85
105
 
86
106
  if patient_insurance_type_mapping is None:
87
- MediLink_ConfigLoader.log("No Patient:Insurance-Type mapping available.", level="WARNING")
107
+ MediLink_ConfigLoader.log("No Patient:Insurance-Type mapping available.", level="INFO")
88
108
  patient_insurance_type_mapping = {}
89
109
 
90
- # Enhanced mode with metadata and validation
110
+ # Enhanced mode with validation
91
111
  if enhanced_mode:
92
112
  MediLink_ConfigLoader.log("Using enhanced insurance type enrichment", level="INFO")
93
113
 
94
114
  for data in detailed_patient_data:
95
- patient_id = data.get('PATID') # I think this is the right name?
96
-
97
- # Get insurance type with validation
98
- raw_insurance_type = patient_insurance_type_mapping.get(patient_id, '12') # Default to '12' (PPO)
99
- validated_insurance_type = validate_insurance_type_from_config(raw_insurance_type, patient_id)
100
-
101
- # Add enhanced metadata
102
- data['insurance_type'] = validated_insurance_type
103
- data['insurance_type_source'] = 'MANUAL' if patient_id in patient_insurance_type_mapping else 'DEFAULT'
104
- data['insurance_type_validated'] = True
105
- data['insurance_type_timestamp'] = time.time()
106
-
107
- # Generate summary statistics
108
- generate_insurance_assignment_summary(detailed_patient_data)
115
+ # FIELD NAME CLARIFICATION: Use 'patient_id' field created by extract_and_suggest_endpoint()
116
+ # This field contains the value from the 'CHART' field in the original fixed-width file
117
+ patient_id = data.get('patient_id')
118
+ if patient_id:
119
+ raw_insurance_type = patient_insurance_type_mapping.get(patient_id, '12') # Default to '12' (PPO/SBR09)
120
+ validated_insurance_type = validate_insurance_type_from_config(raw_insurance_type, patient_id)
121
+ data['insurance_type'] = validated_insurance_type
122
+ data['insurance_type_source'] = 'MANUAL' if patient_id in patient_insurance_type_mapping else 'DEFAULT'
123
+ else:
124
+ # Handle case where patient_id is missing or empty
125
+ MediLink_ConfigLoader.log("No patient_id found in data record", level="WARNING")
126
+ data['insurance_type'] = '12' # SBR09 default PPO
127
+ data['insurance_type_source'] = 'DEFAULT_FALLBACK'
109
128
 
110
129
  else:
111
130
  # Legacy mode (preserve existing behavior exactly)
131
+ MediLink_ConfigLoader.log("Using legacy insurance type enrichment", level="INFO")
112
132
  for data in detailed_patient_data:
113
- patient_id = data.get('PATID') # I think this is the right name?
114
- insurance_type = patient_insurance_type_mapping.get(patient_id, '12') # Default to '12' (PPO)
133
+ # FIELD NAME CLARIFICATION: Use 'patient_id' field created by extract_and_suggest_endpoint()
134
+ # This field contains the value from the 'CHART' field in the original fixed-width file
135
+ patient_id = data.get('patient_id')
136
+ if patient_id:
137
+ insurance_type = patient_insurance_type_mapping.get(patient_id, '12') # Default to '12' (PPO/SBR09)
138
+ else:
139
+ # Handle case where patient_id is missing or empty
140
+ MediLink_ConfigLoader.log("No patient_id found in data record", level="WARNING")
141
+ insurance_type = '12' # Default when no patient ID available
142
+
115
143
  data['insurance_type'] = insurance_type
116
144
 
117
145
  return detailed_patient_data
@@ -123,6 +151,16 @@ def extract_and_suggest_endpoint(file_path, config, crosswalk):
123
151
  an endpoint based on insurance provider information found in the crosswalk and prepares
124
152
  detailed patient data for processing.
125
153
 
154
+ DATA FLOW CLARIFICATION:
155
+ This function is the PRIMARY data source for MediLink patient processing.
156
+ It creates the 'patient_id' field by extracting the 'CHART' field from fixed-width files.
157
+
158
+ IMPORTANT: This is DIFFERENT from MediBot's parse_z_dat() which extracts 'PATID'.
159
+
160
+ Field mapping for MediLink flow:
161
+ - Fixed-width file 'CHART' field -> detailed_data['patient_id']
162
+ - This 'patient_id' is then used by enrich_with_insurance_type()
163
+
126
164
  Parameters:
127
165
  - file_path: Path to the fixed-width file.
128
166
  - crosswalk: Crosswalk dictionary loaded from a JSON file.
@@ -177,7 +215,9 @@ def extract_and_suggest_endpoint(file_path, config, crosswalk):
177
215
  detailed_data = parsed_data.copy() # Copy parsed_data to avoid modifying the original dictionary
178
216
  detailed_data.update({
179
217
  'file_path': file_path,
180
- 'patient_id': parsed_data.get('CHART'),
218
+ # CRITICAL FIELD MAPPING: 'CHART' field from fixed-width file becomes 'patient_id'
219
+ # This is the field that enrich_with_insurance_type() will use
220
+ 'patient_id': parsed_data.get('CHART'), # ← This is the key field mapping for MediLink flow
181
221
  'surgery_date': parsed_data.get('DATE'),
182
222
  'patient_name': ' '.join([parsed_data.get(key, '') for key in ['FIRST', 'MIDDLE', 'LAST']]),
183
223
  'amount': parsed_data.get('AMOUNT'),
@@ -607,8 +607,11 @@ def insurance_type_selection(parsed_data):
607
607
  try:
608
608
  from MediLink_insurance_utils import safe_insurance_type_selection
609
609
  return safe_insurance_type_selection(parsed_data, _original_insurance_type_selection_logic)
610
- except ImportError:
611
- MediLink_ConfigLoader.log("Enhanced insurance selection not available, using original logic", level="DEBUG")
610
+ except ImportError as e:
611
+ MediLink_ConfigLoader.log("Enhanced insurance selection not available: {}. Using original logic".format(str(e)), level="INFO")
612
+ return _original_insurance_type_selection_logic(parsed_data)
613
+ except Exception as e:
614
+ MediLink_ConfigLoader.log("Error in enhanced insurance selection: {}. Using original logic".format(str(e)), level="ERROR")
612
615
  return _original_insurance_type_selection_logic(parsed_data)
613
616
 
614
617
  def _original_insurance_type_selection_logic(parsed_data):
@@ -653,11 +656,24 @@ def _original_insurance_type_selection_logic(parsed_data):
653
656
  # User input for insurance type
654
657
  user_input = input("Enter the 2-character code for the insurance type (or press Enter to default to '12' for PPO): ").strip().upper()
655
658
 
656
- # Validate input and set the insurance type code
657
- if user_input in insurance_options:
658
- insurance_type_code = user_input
659
+ # Input validation and assignment
660
+ if user_input:
661
+ # Basic format validation
662
+ if len(user_input) > 3 or not user_input.isalnum():
663
+ print("Invalid format: Insurance codes should be 1-3 alphanumeric characters. Defaulting to PPO.")
664
+ elif user_input in insurance_options:
665
+ insurance_type_code = user_input
666
+ print("Selected: {} - {}".format(user_input, insurance_options[user_input]))
667
+ else:
668
+ # User wants to use a code not in config - confirm with them
669
+ confirm = input("Code '{}' not found in configuration. Use it anyway? (y/n): ".format(user_input)).strip().lower()
670
+ if confirm in ['y', 'yes']:
671
+ insurance_type_code = user_input
672
+ print("Using code: {}".format(user_input))
673
+ else:
674
+ print("Defaulting to PPO (Preferred Provider Organization)")
659
675
  else:
660
- print("Skipped or Input not recognized. Defaulting to Preferred Provider Organization (PPO)\n")
676
+ print("Using default: PPO (Preferred Provider Organization)")
661
677
 
662
678
  return insurance_type_code
663
679
 
@@ -616,25 +616,43 @@ def confirm_all_suggested_endpoints(detailed_patient_data):
616
616
  return detailed_patient_data
617
617
 
618
618
  def bulk_edit_insurance_types(detailed_patient_data, insurance_options):
619
- # Allow user to edit insurance types in a table-like format with validation
620
- print("Edit Insurance Type (Enter the 2-character code). Enter 'LIST' to display available insurance types.")
619
+ """Allow user to edit insurance types in a table-like format with validation"""
620
+ print("\nEdit Insurance Type (Enter the code). Enter 'LIST' to display available insurance types.")
621
621
 
622
622
  for data in detailed_patient_data:
623
- current_insurance_type = data['insurance_type']
623
+ patient_id = data.get('patient_id', 'Unknown')
624
+ patient_name = data.get('patient_name', 'Unknown')
625
+ current_insurance_type = data.get('insurance_type', '12')
624
626
  current_insurance_description = insurance_options.get(current_insurance_type, "Unknown")
627
+
625
628
  print("({}) {:<25} | Current Ins. Type: {} - {}".format(
626
- data['patient_id'], data['patient_name'], current_insurance_type, current_insurance_description))
629
+ patient_id, patient_name, current_insurance_type, current_insurance_description))
627
630
 
628
631
  while True:
629
- new_insurance_type = input("Enter new insurance type (or press Enter to keep current): ").upper()
632
+ new_insurance_type = input("Enter new insurance type (or press Enter to keep current): ").strip().upper()
633
+
630
634
  if new_insurance_type == 'LIST':
631
635
  MediLink_UI.display_insurance_options(insurance_options)
632
- elif not new_insurance_type or new_insurance_type in insurance_options:
633
- if new_insurance_type:
634
- data['insurance_type'] = new_insurance_type
636
+ continue
637
+
638
+ elif not new_insurance_type:
639
+ # Keep current insurance type
640
+ break
641
+
642
+ elif new_insurance_type in insurance_options:
643
+ # Valid insurance type from config
644
+ data['insurance_type'] = new_insurance_type
635
645
  break
646
+
636
647
  else:
637
- print("Invalid insurance type. Please enter a valid 2-character code or type 'LIST' to see options.")
648
+ # User wants to use a code not in config - confirm with them
649
+ confirm = input("Code '{}' not found in configuration. Use it anyway? (y/n): ".format(new_insurance_type)).strip().lower()
650
+ if confirm in ['y', 'yes']:
651
+ data['insurance_type'] = new_insurance_type
652
+ break
653
+ else:
654
+ print("Invalid insurance type. Please enter a valid code or type 'LIST' to see options.")
655
+ continue
638
656
 
639
657
  def review_and_confirm_changes(detailed_patient_data, insurance_options):
640
658
  # Review and confirm changes
@@ -102,14 +102,18 @@ def get_new_endpoint_choice():
102
102
 
103
103
  # Function to display full list of insurance options
104
104
  def display_insurance_options(insurance_options=None):
105
-
106
- # Retrieve insurance options with codes and descriptions
107
- config, _ = MediLink_ConfigLoader.load_configuration()
108
- insurance_options = config['MediLink_Config'].get('insurance_options')
105
+ """Display insurance options, loading from config if not provided"""
106
+
107
+ if insurance_options is None:
108
+ config, _ = MediLink_ConfigLoader.load_configuration()
109
+ insurance_options = config.get('MediLink_Config', {}).get('insurance_options', {})
109
110
 
110
- print("\nInsurance Type Options:")
111
+ print("\nInsurance Type Options (SBR09 Codes):")
112
+ print("-" * 50)
111
113
  for code, description in sorted(insurance_options.items()):
112
- print("{}: {}".format(code, description))
114
+ print("{:>3}: {}".format(code, description))
115
+ print("-" * 50)
116
+ print("Note: '12' (PPO) is the default if no selection is made.")
113
117
  print() # Add a blank line for better readability
114
118
 
115
119
  def display_patient_summaries(detailed_patient_data):
@@ -130,10 +134,10 @@ def display_file_summary(index, summary):
130
134
 
131
135
  # Add header row if it's the first index
132
136
  if index == 1:
133
- print("{:<3} {:5} {:<10} {:20} {:15} {:2} {:20}".format(
137
+ print("{:<3} {:5} {:<10} {:20} {:15} {:3} {:20}".format(
134
138
  "No.", "Date", "ID", "Name", "Primary Ins.", "IT", "Current Endpoint"
135
139
  ))
136
- print("-"*80)
140
+ print("-"*82)
137
141
 
138
142
  # Check if insurance_type is available; if not, set a default placeholder (this should already be '12' at this point)
139
143
  insurance_type = summary.get('insurance_type', '--')
@@ -143,14 +147,20 @@ def display_file_summary(index, summary):
143
147
  summary.get('user_preferred_endpoint') or
144
148
  summary.get('suggested_endpoint', 'AVAILITY'))
145
149
 
150
+ # Format insurance type for display - handle both 2 and 3 character codes
151
+ if insurance_type and len(insurance_type) <= 3:
152
+ insurance_display = insurance_type
153
+ else:
154
+ insurance_display = insurance_type[:3] if insurance_type else '--'
155
+
146
156
  # Displays the summary of a file.
147
- print("{:02d}. {:5} ({:<8}) {:20} {:15} {:2} {:20}".format(
157
+ print("{:02d}. {:5} ({:<8}) {:20} {:15} {:3} {:20}".format(
148
158
  index,
149
159
  surgery_date.strftime("%m-%d"),
150
160
  summary['patient_id'],
151
161
  summary['patient_name'][:20],
152
162
  summary['primary_insurance'][:15],
153
- insurance_type[:2],
163
+ insurance_display,
154
164
  effective_endpoint[:20])
155
165
  )
156
166
 
@@ -13,9 +13,19 @@ except ImportError:
13
13
  import MediLink_ConfigLoader
14
14
  import MediLink_UI
15
15
 
16
+ # Safe tqdm import with fallback
17
+ try:
18
+ from tqdm import tqdm
19
+ except ImportError:
20
+ # Fallback for when tqdm is not available
21
+ def tqdm(iterable, desc="Processing", **kwargs):
22
+ if desc:
23
+ print("{}...".format(desc))
24
+ return iterable
25
+
16
26
  # Feature flag system
17
27
  def get_feature_flag(flag_name, default=False):
18
- """Centralized feature flag management"""
28
+ """Get feature flag from config or return default"""
19
29
  try:
20
30
  config, _ = MediLink_ConfigLoader.load_configuration()
21
31
  feature_flags = config.get("MediLink_Config", {}).get("feature_flags", {})
@@ -27,25 +37,34 @@ def get_feature_flag(flag_name, default=False):
27
37
  # Enhanced insurance type validation
28
38
  def validate_insurance_type_from_config(insurance_type_code, payer_id=""):
29
39
  """
30
- Validate insurance type against configuration with proper logging.
40
+ Validate insurance type against configuration.
31
41
  Returns validated type or safe fallback.
32
42
  """
33
43
  try:
34
44
  config, _ = MediLink_ConfigLoader.load_configuration()
35
- insurance_options = config['MediLink_Config'].get('insurance_options', {})
45
+ insurance_options = config.get('MediLink_Config', {}).get('insurance_options', {})
36
46
 
37
47
  if not insurance_type_code:
38
- MediLink_ConfigLoader.log("Empty insurance type code for payer {}, using default PPO".format(payer_id), level="WARNING")
48
+ MediLink_ConfigLoader.log("Empty insurance type code for payer {}, using default PPO".format(payer_id), level="INFO")
39
49
  return '12' # Default to PPO
40
50
 
41
- # Direct lookup - insurance type already in config
51
+ # Clean and normalize input
52
+ insurance_type_code = str(insurance_type_code).strip().upper()
53
+
54
+ # Basic format validation
55
+ if len(insurance_type_code) > 3 or not insurance_type_code.isalnum():
56
+ MediLink_ConfigLoader.log("Invalid insurance type format '{}' for payer {}, using PPO fallback".format(
57
+ insurance_type_code, payer_id), level="WARNING")
58
+ return '12'
59
+
60
+ # Configuration lookup - insurance type exists in config
42
61
  if insurance_type_code in insurance_options:
43
62
  MediLink_ConfigLoader.log("Validated insurance type '{}' for payer {}".format(
44
63
  insurance_type_code, payer_id), level="DEBUG")
45
64
  return insurance_type_code
46
65
 
47
66
  # Unknown type - log and fallback
48
- MediLink_ConfigLoader.log("UNKNOWN insurance type '{}' for payer {} - using PPO fallback".format(
67
+ MediLink_ConfigLoader.log("Unknown insurance type '{}' for payer {} - using PPO fallback".format(
49
68
  insurance_type_code, payer_id), level="WARNING")
50
69
 
51
70
  return '12' # Safe fallback to PPO
@@ -54,69 +73,22 @@ def validate_insurance_type_from_config(insurance_type_code, payer_id=""):
54
73
  MediLink_ConfigLoader.log("Insurance validation error: {} - using PPO fallback".format(str(e)), level="ERROR")
55
74
  return '12'
56
75
 
57
- # Enhanced patient data enrichment
58
- def enrich_patient_data_with_metadata(detailed_patient_data, insurance_source='MANUAL'):
59
- """
60
- Add metadata to patient data for tracking and monitoring.
61
- Safe enhancement that doesn't break existing functionality.
62
- """
63
- enhanced_data = []
64
-
65
- for data in detailed_patient_data:
66
- # Create enhanced copy
67
- enhanced_record = data.copy()
68
-
69
- # Add metadata fields
70
- enhanced_record['insurance_type_source'] = insurance_source
71
- enhanced_record['insurance_type_validated'] = True
72
- enhanced_record['insurance_type_timestamp'] = time.time()
73
- enhanced_record['insurance_type_metadata'] = {}
74
-
75
- enhanced_data.append(enhanced_record)
76
-
77
- return enhanced_data
78
-
79
- # Insurance type assignment logging
80
- def log_insurance_type_decision(patient_id, insurance_type, source, metadata=None):
81
- """Enhanced logging for insurance type assignments"""
82
- log_data = {
83
- 'patient_id': patient_id,
84
- 'insurance_type': insurance_type,
85
- 'source': source,
86
- 'timestamp': time.time()
87
- }
88
- if metadata:
89
- log_data['metadata'] = metadata
90
-
91
- MediLink_ConfigLoader.log("Insurance assignment: {}".format(json.dumps(log_data)), level="INFO")
92
-
93
76
  # Monitoring and statistics
94
77
  def generate_insurance_assignment_summary(detailed_patient_data):
95
- """
96
- Generate summary statistics for insurance type assignments.
97
- Helps monitor system performance and data quality.
98
- """
78
+ """Generate basic summary statistics for insurance type assignments"""
99
79
  if not detailed_patient_data:
100
80
  return {}
101
81
 
102
- # Collect statistics
103
- source_counts = {}
82
+ # Collect basic statistics
104
83
  insurance_type_counts = {}
105
84
 
106
85
  for data in detailed_patient_data:
107
- source = data.get('insurance_type_source', 'UNKNOWN')
108
86
  insurance_type = data.get('insurance_type', 'UNKNOWN')
109
-
110
- source_counts[source] = source_counts.get(source, 0) + 1
111
87
  insurance_type_counts[insurance_type] = insurance_type_counts.get(insurance_type, 0) + 1
112
88
 
113
- total_patients = len(detailed_patient_data)
114
-
115
89
  summary = {
116
- 'total_patients': total_patients,
117
- 'sources': source_counts,
118
- 'insurance_types': insurance_type_counts,
119
- 'timestamp': time.time()
90
+ 'total_patients': len(detailed_patient_data),
91
+ 'insurance_types': insurance_type_counts
120
92
  }
121
93
 
122
94
  # Log summary
@@ -138,23 +110,22 @@ def safe_insurance_type_selection(parsed_data, fallback_function):
138
110
 
139
111
  if enhanced_mode:
140
112
  # Try enhanced selection (would be implemented here)
141
- MediLink_ConfigLoader.log("Attempting enhanced insurance selection for {}".format(patient_name), level="DEBUG")
113
+ MediLink_ConfigLoader.log("Attempting enhanced insurance selection", level="DEBUG")
142
114
  # For now, just call fallback - actual enhancement would go here
143
115
  result = fallback_function(parsed_data)
144
- log_insurance_type_decision(patient_name, result, 'ENHANCED')
116
+ MediLink_ConfigLoader.log("Insurance decision: type={}, method=ENHANCED".format(result), level="INFO")
145
117
  return result
146
118
  else:
147
119
  # Use standard selection
148
120
  result = fallback_function(parsed_data)
149
- log_insurance_type_decision(patient_name, result, 'MANUAL')
121
+ MediLink_ConfigLoader.log("Insurance decision: type={}, method=MANUAL".format(result), level="INFO")
150
122
  return result
151
123
 
152
124
  except Exception as e:
153
125
  # Error handling with safe fallback
154
- MediLink_ConfigLoader.log("Insurance selection error for {}: {}. Using PPO default.".format(
155
- patient_name, str(e)), level="ERROR")
126
+ MediLink_ConfigLoader.log("Insurance selection error: {}. Using PPO default.".format(str(e)), level="ERROR")
156
127
 
157
- log_insurance_type_decision(patient_name, '12', 'ERROR_FALLBACK', {'error': str(e)})
128
+ MediLink_ConfigLoader.log("Insurance decision: type=12, method=ERROR_FALLBACK, error={}".format(str(e)), level="INFO")
158
129
  return '12' # Safe fallback
159
130
 
160
131
  # Configuration validation
@@ -237,12 +208,7 @@ def process_patients_with_progress(patients, processing_function, description="P
237
208
  processed_results = []
238
209
  errors = []
239
210
 
240
- try:
241
- from tqdm import tqdm
242
- iterator = tqdm(patients, desc=description)
243
- except ImportError:
244
- iterator = patients
245
- MediLink_ConfigLoader.log("Processing {} patients (tqdm not available)".format(len(patients)), level="INFO")
211
+ iterator = tqdm(patients, desc=description)
246
212
 
247
213
  for i, patient in enumerate(iterator):
248
214
  try:
@@ -0,0 +1 @@
1
+ from .MediLink import enrich_with_insurance_type
@@ -4,27 +4,29 @@
4
4
 
5
5
  import time
6
6
  import json
7
+ import sys, os
8
+ sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
7
9
 
8
10
  try:
9
11
  from MediLink import MediLink_ConfigLoader
10
- from MediLink_API_v3_enhanced import (
11
- validate_production_readiness,
12
- validate_insurance_configuration,
13
- get_feature_flag,
14
- EnhancedAPIClient
12
+ from MediLink_API_v3 import (
13
+ APIClient
15
14
  )
16
- from MediLink_enhanced import (
17
- enrich_with_insurance_type,
18
- monitor_insurance_type_assignments
15
+ from MediLink import (
16
+ enrich_with_insurance_type
19
17
  )
20
- from MediLink_837p_encoder_library_enhanced import (
18
+ from MediLink_837p_encoder_library import (
21
19
  insurance_type_selection,
22
- insurance_type_selection_safe,
23
- is_api_insurance_selection_available
20
+ _original_insurance_type_selection_logic
21
+ )
22
+ from MediLink_insurance_utils import (
23
+ validate_insurance_type_from_config,
24
+ get_feature_flag,
25
+ generate_insurance_assignment_summary
24
26
  )
25
27
  except ImportError as e:
26
28
  print("Import error: {}".format(str(e)))
27
- print("This module requires the enhanced insurance type components.")
29
+ print("This module requires the insurance type components.")
28
30
 
29
31
  def run_insurance_type_integration_tests():
30
32
  """
@@ -46,12 +48,13 @@ def run_insurance_type_integration_tests():
46
48
  test_results['total_tests'] += 1
47
49
  try:
48
50
  print("\n1. Testing Production Readiness Validation...")
49
- validate_production_readiness()
50
- print(" ✅ Production readiness validation PASSED")
51
+ from MediLink_insurance_utils import validate_insurance_configuration
52
+ validate_insurance_configuration()
53
+ print(" PASS Production readiness validation PASSED")
51
54
  test_results['passed_tests'] += 1
52
55
  test_results['test_details'].append({'test': 'production_readiness', 'status': 'PASSED'})
53
56
  except Exception as e:
54
- print(" Production readiness validation FAILED: {}".format(str(e)))
57
+ print(" FAIL Production readiness validation FAILED: {}".format(str(e)))
55
58
  test_results['failed_tests'] += 1
56
59
  test_results['test_details'].append({'test': 'production_readiness', 'status': 'FAILED', 'error': str(e)})
57
60
 
@@ -59,12 +62,13 @@ def run_insurance_type_integration_tests():
59
62
  test_results['total_tests'] += 1
60
63
  try:
61
64
  print("\n2. Testing Insurance Configuration Validation...")
65
+ from MediLink_insurance_utils import validate_insurance_configuration
62
66
  validate_insurance_configuration()
63
- print(" Insurance configuration validation PASSED")
67
+ print(" PASS Insurance configuration validation PASSED")
64
68
  test_results['passed_tests'] += 1
65
69
  test_results['test_details'].append({'test': 'insurance_config', 'status': 'PASSED'})
66
70
  except Exception as e:
67
- print(" Insurance configuration validation FAILED: {}".format(str(e)))
71
+ print(" FAIL Insurance configuration validation FAILED: {}".format(str(e)))
68
72
  test_results['failed_tests'] += 1
69
73
  test_results['test_details'].append({'test': 'insurance_config', 'status': 'FAILED', 'error': str(e)})
70
74
 
@@ -76,24 +80,24 @@ def run_insurance_type_integration_tests():
76
80
  enhanced_flag = get_feature_flag('enhanced_insurance_enrichment', default=False)
77
81
  print(" API Insurance Selection Flag: {}".format(api_flag))
78
82
  print(" Enhanced Insurance Enrichment Flag: {}".format(enhanced_flag))
79
- print(" Feature flag system PASSED")
83
+ print(" PASS Feature flag system PASSED")
80
84
  test_results['passed_tests'] += 1
81
85
  test_results['test_details'].append({'test': 'feature_flags', 'status': 'PASSED'})
82
86
  except Exception as e:
83
- print(" Feature flag system FAILED: {}".format(str(e)))
87
+ print(" FAIL Feature flag system FAILED: {}".format(str(e)))
84
88
  test_results['failed_tests'] += 1
85
89
  test_results['test_details'].append({'test': 'feature_flags', 'status': 'FAILED', 'error': str(e)})
86
90
 
87
- # Test 4: Enhanced API Client Initialization
91
+ # Test 4: API Client Initialization
88
92
  test_results['total_tests'] += 1
89
93
  try:
90
- print("\n4. Testing Enhanced API Client Initialization...")
91
- api_client = EnhancedAPIClient()
92
- print(" Enhanced API client initialization PASSED")
94
+ print("\n4. Testing API Client Initialization...")
95
+ api_client = APIClient()
96
+ print(" PASS API client initialization PASSED")
93
97
  test_results['passed_tests'] += 1
94
98
  test_results['test_details'].append({'test': 'api_client_init', 'status': 'PASSED'})
95
99
  except Exception as e:
96
- print(" Enhanced API client initialization FAILED: {}".format(str(e)))
100
+ print(" FAIL API client initialization FAILED: {}".format(str(e)))
97
101
  test_results['failed_tests'] += 1
98
102
  test_results['test_details'].append({'test': 'api_client_init', 'status': 'FAILED', 'error': str(e)})
99
103
 
@@ -109,11 +113,11 @@ def run_insurance_type_integration_tests():
109
113
  }
110
114
  result = insurance_type_selection(test_parsed_data)
111
115
  assert result == '12', "Should return pre-assigned insurance type"
112
- print(" Insurance type selection backward compatibility PASSED")
116
+ print(" PASS Insurance type selection backward compatibility PASSED")
113
117
  test_results['passed_tests'] += 1
114
118
  test_results['test_details'].append({'test': 'backward_compatibility', 'status': 'PASSED'})
115
119
  except Exception as e:
116
- print(" Insurance type selection backward compatibility FAILED: {}".format(str(e)))
120
+ print(" FAIL Insurance type selection backward compatibility FAILED: {}".format(str(e)))
117
121
  test_results['failed_tests'] += 1
118
122
  test_results['test_details'].append({'test': 'backward_compatibility', 'status': 'FAILED', 'error': str(e)})
119
123
 
@@ -131,33 +135,18 @@ def run_insurance_type_integration_tests():
131
135
  enriched_data = enrich_with_insurance_type(test_patient_data)
132
136
  assert len(enriched_data) == 1, "Should return same number of patients"
133
137
  assert 'insurance_type' in enriched_data[0], "Should add insurance_type field"
134
- assert 'insurance_type_source' in enriched_data[0], "Should add source tracking"
135
- print(" ✅ Patient data enrichment PASSED")
138
+ print(" PASS Patient data enrichment PASSED")
136
139
  test_results['passed_tests'] += 1
137
140
  test_results['test_details'].append({'test': 'patient_enrichment', 'status': 'PASSED'})
138
141
  except Exception as e:
139
- print(" Patient data enrichment FAILED: {}".format(str(e)))
142
+ print(" FAIL Patient data enrichment FAILED: {}".format(str(e)))
140
143
  test_results['failed_tests'] += 1
141
144
  test_results['test_details'].append({'test': 'patient_enrichment', 'status': 'FAILED', 'error': str(e)})
142
145
 
143
- # Test 7: API Availability Check
146
+ # Test 7: Monitoring System
144
147
  test_results['total_tests'] += 1
145
148
  try:
146
- print("\n7. Testing API Availability Check...")
147
- api_available = is_api_insurance_selection_available()
148
- print(" API Insurance Selection Available: {}".format(api_available))
149
- print(" ✅ API availability check PASSED")
150
- test_results['passed_tests'] += 1
151
- test_results['test_details'].append({'test': 'api_availability', 'status': 'PASSED'})
152
- except Exception as e:
153
- print(" ❌ API availability check FAILED: {}".format(str(e)))
154
- test_results['failed_tests'] += 1
155
- test_results['test_details'].append({'test': 'api_availability', 'status': 'FAILED', 'error': str(e)})
156
-
157
- # Test 8: Monitoring System
158
- test_results['total_tests'] += 1
159
- try:
160
- print("\n8. Testing Monitoring System...")
149
+ print("\n7. Testing Monitoring System...")
161
150
  test_patient_data = [
162
151
  {
163
152
  'patient_id': 'TEST001',
@@ -170,12 +159,12 @@ def run_insurance_type_integration_tests():
170
159
  'insurance_type_source': 'API'
171
160
  }
172
161
  ]
173
- monitor_insurance_type_assignments(test_patient_data)
174
- print(" Monitoring system PASSED")
162
+ generate_insurance_assignment_summary(test_patient_data)
163
+ print(" PASS Monitoring system PASSED")
175
164
  test_results['passed_tests'] += 1
176
165
  test_results['test_details'].append({'test': 'monitoring', 'status': 'PASSED'})
177
166
  except Exception as e:
178
- print(" Monitoring system FAILED: {}".format(str(e)))
167
+ print(" FAIL Monitoring system FAILED: {}".format(str(e)))
179
168
  test_results['failed_tests'] += 1
180
169
  test_results['test_details'].append({'test': 'monitoring', 'status': 'FAILED', 'error': str(e)})
181
170
 
@@ -184,13 +173,13 @@ def run_insurance_type_integration_tests():
184
173
  print("TEST SUMMARY")
185
174
  print("=" * 60)
186
175
  print("Total Tests: {}".format(test_results['total_tests']))
187
- print("Passed: {}".format(test_results['passed_tests']))
188
- print("Failed: {}".format(test_results['failed_tests']))
176
+ print("Passed: {}".format(test_results['passed_tests']))
177
+ print("Failed: {}".format(test_results['failed_tests']))
189
178
 
190
179
  if test_results['failed_tests'] == 0:
191
- print("\n🎉 ALL TESTS PASSED! System ready for deployment.")
180
+ print("\nPASS ALL TESTS! System ready for deployment.")
192
181
  else:
193
- print("\n⚠️ {} TESTS FAILED. Review before deployment.".format(test_results['failed_tests']))
182
+ print("\nFAIL {} TESTS. Review before deployment.".format(test_results['failed_tests']))
194
183
  for test in test_results['test_details']:
195
184
  if test['status'] == 'FAILED':
196
185
  print(" - {}: {}".format(test['test'], test.get('error', 'Unknown error')))
@@ -203,41 +192,33 @@ def test_insurance_type_validation():
203
192
  print("INSURANCE TYPE VALIDATION TESTS")
204
193
  print("=" * 50)
205
194
 
206
- # Import validation function
207
- from MediLink_API_v3_enhanced import validate_insurance_type_from_super_connector
208
-
209
195
  test_cases = [
210
196
  {
211
197
  'name': 'Valid PPO Type',
212
- 'plan_description': 'Preferred Provider Organization',
213
198
  'insurance_type': '12',
214
199
  'payer_id': '87726',
215
200
  'expected': '12'
216
201
  },
217
202
  {
218
203
  'name': 'Valid HMO Type',
219
- 'plan_description': 'Health Maintenance Organization',
220
204
  'insurance_type': 'HM',
221
205
  'payer_id': '87726',
222
206
  'expected': 'HM'
223
207
  },
224
208
  {
225
- 'name': 'Novel Valid Type',
226
- 'plan_description': 'Exclusive Provider Organization',
209
+ 'name': 'Novel Valid Type (Strict Validation)',
227
210
  'insurance_type': 'EP',
228
211
  'payer_id': '87726',
229
- 'expected': 'EP' # Should accept if format is valid
212
+ 'expected': '12' # Strict validation rejects novel codes
230
213
  },
231
214
  {
232
215
  'name': 'Invalid Type Format',
233
- 'plan_description': 'Some Plan',
234
216
  'insurance_type': 'INVALID123',
235
217
  'payer_id': '87726',
236
218
  'expected': '12' # Should fallback to PPO
237
219
  },
238
220
  {
239
221
  'name': 'Empty Type',
240
- 'plan_description': 'Some Plan',
241
222
  'insurance_type': '',
242
223
  'payer_id': '87726',
243
224
  'expected': '12' # Should fallback to PPO
@@ -249,21 +230,20 @@ def test_insurance_type_validation():
249
230
 
250
231
  for test_case in test_cases:
251
232
  try:
252
- result = validate_insurance_type_from_super_connector(
253
- test_case['plan_description'],
233
+ result = validate_insurance_type_from_config(
254
234
  test_case['insurance_type'],
255
235
  test_case['payer_id']
256
236
  )
257
237
 
258
238
  if result == test_case['expected']:
259
- print(" {}: {} -> {}".format(test_case['name'], test_case['insurance_type'], result))
239
+ print("PASS {}: {} -> {}".format(test_case['name'], test_case['insurance_type'], result))
260
240
  passed += 1
261
241
  else:
262
- print(" {}: Expected {}, got {}".format(test_case['name'], test_case['expected'], result))
242
+ print("FAIL {}: Expected {}, got {}".format(test_case['name'], test_case['expected'], result))
263
243
  failed += 1
264
244
 
265
245
  except Exception as e:
266
- print(" {}: Exception - {}".format(test_case['name'], str(e)))
246
+ print("FAIL {}: Exception - {}".format(test_case['name'], str(e)))
267
247
  failed += 1
268
248
 
269
249
  print("\nValidation Tests Summary: {} passed, {} failed".format(passed, failed))
@@ -301,9 +281,9 @@ def create_test_configuration():
301
281
 
302
282
  print("Test configuration created:")
303
283
  print(json.dumps(test_config, indent=2))
304
- print("\n📝 Copy this configuration to your config.json file")
305
- print("🚨 Ensure TestMode is False for production")
306
- print("🔧 Enable feature flags gradually during rollout")
284
+ print("\nCopy this configuration to your config.json file")
285
+ print("Ensure TestMode is False for production")
286
+ print("Enable feature flags gradually during rollout")
307
287
 
308
288
  return test_config
309
289
 
@@ -332,9 +312,9 @@ def deployment_checklist():
332
312
  for item in checklist:
333
313
  print(item)
334
314
 
335
- print("\n📋 Complete all checklist items before deployment")
336
- print("🚀 Follow gradual rollout plan with feature flags")
337
- print("🔍 Monitor logs and metrics closely during rollout")
315
+ print("\nComplete all checklist items before deployment")
316
+ print("Follow gradual rollout plan with feature flags")
317
+ print("Monitor logs and metrics closely during rollout")
338
318
 
339
319
  if __name__ == "__main__":
340
320
  print("Insurance Type Selection Enhancement - Integration Test Suite")
@@ -363,6 +343,6 @@ if __name__ == "__main__":
363
343
  print("Overall Tests: {} passed, {} failed out of {} total".format(total_passed, total_failed, total_tests))
364
344
 
365
345
  if total_failed == 0:
366
- print("🎉 ALL SYSTEMS GO! Ready for phased deployment.")
346
+ print("PASS ALL SYSTEMS GO! Ready for phased deployment.")
367
347
  else:
368
- print("⚠️ Address {} failed tests before deployment.".format(total_failed))
348
+ print("FAIL Address {} failed tests before deployment.".format(total_failed))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: medicafe
3
- Version: 0.250728.8
3
+ Version: 0.250728.9
4
4
  Summary: MediCafe
5
5
  Home-page: https://github.com/katanada2
6
6
  Author: Daniel Vidaud
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: medicafe
3
- Version: 0.250728.8
3
+ Version: 0.250728.9
4
4
  Summary: MediCafe
5
5
  Home-page: https://github.com/katanada2
6
6
  Author: Daniel Vidaud
@@ -1,6 +1,5 @@
1
1
  LICENSE
2
2
  MANIFEST.in
3
- README.md
4
3
  setup.py
5
4
  MediBot/MediBot.bat
6
5
  MediBot/MediBot.py
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='medicafe',
5
- version="0.250728.8",
5
+ version="0.250728.9",
6
6
  description='MediCafe',
7
7
  long_description="""
8
8
  # Project Overview: MediCafe
File without changes
@@ -1,58 +0,0 @@
1
- # MediCafe
2
-
3
- MediCafe is a specialized Python package designed to automate and enhance administrative tasks in medical practices using Medisoft. It features two primary components: **MediBot** and **MediLink**, which work together to streamline patient data entry and claims submission processes. This package is particularly tailored for environments running Windows XP with Python 3.4.4.
4
-
5
- ## Features
6
-
7
- ### Automated Data Entry
8
- MediCafe utilizes **AutoHotkey scripting** to automate the entry of patient information into Medisoft. This feature significantly reduces the time and effort required for manual data entry, minimizing human error and improving operational efficiency.
9
-
10
- ### Claims Submission Automation
11
- The MediLink component automates the submission of 837p medical claims to various insurance providers via **APIs** and also using **WinSCP** for secure file transfers. It supports dynamic configurations for multiple endpoints, allowing for seamless integration with different payer systems with easy setup and management of custom 837p headers and trailers. This automation ensures timely and accurate claims processing, enhancing revenue cycle management for healthcare providers.
12
-
13
- ### Crosswalk Setup Tooling
14
- MediCafe includes internal tooling to assist in setting up a **crosswalk** with referential data for payer IDs, diagnostic codes, and other essential mappings. This feature simplifies the process of aligning data formats and identifiers across different systems, ensuring consistency and accuracy in data handling.
15
-
16
- ## Installation
17
-
18
- MediCafe can be easily installed via pip:
19
- ```bash
20
- pip install medicafe
21
- ```
22
-
23
- ### Configuration
24
- A custom configuration file is required for each environment and provider. This file must be set up to define paths, mappings, and other necessary parameters specific to the user's setup.
25
-
26
- ## Entry Point
27
- The primary entry point for running MediCafe is through the **MediBot** batch file:
28
- ```bash
29
- MediBot.bat
30
- ```
31
-
32
- ## Known Bugs
33
- - **Endpoint Persistence**: Issues with endpoint update persistence when user adjustments are made.
34
- - **Insurance Mode Glitches**: Certain insurance modes may not adjust data correctly, requiring manual intervention.
35
- - **Manual Entry Requirements**: Some processes may require manual entries to handle off-nominal conditions, as indicated by comments in the codebase.
36
-
37
- ## Future Work
38
- Future enhancements and features can be identified through TODO comments and other annotations in the codebase. These may include:
39
- - Improvements to the crosswalk setup process.
40
- - Additional automation features for data entry and claims processing.
41
- - Enhancements to user interaction and error handling mechanisms.
42
-
43
- ### Developer Info:
44
- - Name: Daniel Vidaud
45
- - GitHub: [\[Your GitHub Profile\]](https://github.com/katanada2)
46
- - Email: daniel@personalizedtransformations.com
47
- - LinkedIn: [\[Your LinkedIn Profile\]](https://www.linkedin.com/in/dvidaud/)
48
-
49
- ### Contribution Guideline:
50
- Contributions are welcome! If you'd like to contribute, please follow the steps below:
51
- 1. Fork the repository.
52
- 2. Create your feature branch (`git checkout -b feature/AmazingFeature`).
53
- 3. Commit your changes (`git commit -m 'Add some AmazingFeature'`).
54
- 4. Push to the branch (`git push origin feature/AmazingFeature`).
55
- 5. Open a pull request.
56
-
57
- ### Disclaimer:
58
- MediCafe is developed as an open-source project. While we strive to provide a reliable and effective system, the developers are not responsible for any discrepancies or issues that may arise from its use. Always ensure data confidentiality and compliance with healthcare regulations.
File without changes
File without changes
File without changes