medicafe 0.240419.2__py3-none-any.whl → 0.240613.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of medicafe might be problematic. Click here for more details.

Files changed (38) hide show
  1. MediBot/MediBot.bat +174 -38
  2. MediBot/MediBot.py +80 -77
  3. MediBot/MediBot_Charges.py +0 -28
  4. MediBot/MediBot_Crosswalk_Library.py +281 -0
  5. MediBot/MediBot_Post.py +0 -0
  6. MediBot/MediBot_Preprocessor.py +138 -211
  7. MediBot/MediBot_Preprocessor_lib.py +496 -0
  8. MediBot/MediBot_UI.py +80 -35
  9. MediBot/MediBot_dataformat_library.py +79 -35
  10. MediBot/MediBot_docx_decoder.py +295 -0
  11. MediBot/update_medicafe.py +46 -8
  12. MediLink/MediLink.py +207 -108
  13. MediLink/MediLink_837p_encoder.py +299 -214
  14. MediLink/MediLink_837p_encoder_library.py +445 -245
  15. MediLink/MediLink_API_v2.py +174 -0
  16. MediLink/MediLink_APIs.py +139 -0
  17. MediLink/MediLink_ConfigLoader.py +44 -32
  18. MediLink/MediLink_DataMgmt.py +297 -89
  19. MediLink/MediLink_Decoder.py +63 -0
  20. MediLink/MediLink_Down.py +73 -102
  21. MediLink/MediLink_ERA_decoder.py +4 -4
  22. MediLink/MediLink_Gmail.py +479 -4
  23. MediLink/MediLink_Mailer.py +0 -0
  24. MediLink/MediLink_Parser.py +111 -0
  25. MediLink/MediLink_Scan.py +0 -0
  26. MediLink/MediLink_Scheduler.py +2 -131
  27. MediLink/MediLink_StatusCheck.py +0 -4
  28. MediLink/MediLink_UI.py +87 -27
  29. MediLink/MediLink_Up.py +301 -45
  30. MediLink/MediLink_batch.bat +1 -1
  31. MediLink/test.py +74 -0
  32. medicafe-0.240613.0.dist-info/METADATA +55 -0
  33. medicafe-0.240613.0.dist-info/RECORD +43 -0
  34. {medicafe-0.240419.2.dist-info → medicafe-0.240613.0.dist-info}/WHEEL +5 -5
  35. medicafe-0.240419.2.dist-info/METADATA +0 -19
  36. medicafe-0.240419.2.dist-info/RECORD +0 -32
  37. {medicafe-0.240419.2.dist-info → medicafe-0.240613.0.dist-info}/LICENSE +0 -0
  38. {medicafe-0.240419.2.dist-info → medicafe-0.240613.0.dist-info}/top_level.txt +0 -0
@@ -1,132 +1,3 @@
1
1
  """
2
- MediLink Scheduler: A medical claim scheduling and management system that integrates functionalities from MediScheduler and MediLink to optimize medical claim submissions based on patient deductible status, insurance provider deadlines, and a 90-day submission window. It leverages real-time data from insurance APIs for dynamic scheduling to maximize insurance payments by aligning claim submission with deductible fulfillment.
3
-
4
- Features:
5
- - Deductible Optimization: Determines optimal submission times based on deductible fulfillment to maximize reimbursements.
6
- - Dynamic Scheduling: Updates claim submission timelines in response to changes in deductible status and insurance coverage data.
7
- - Secure Data Handling: Ensures the security of sensitive patient data through encryption and HIPAA-compliant practices.
8
- - Integration with MediLink Systems: Seamlessly formats, submits, and tracks claims across MediLink and associated systems.
9
- - Robust Error Handling and Notifications: Implements mechanisms for error detection and user alerts regarding scheduling and submission errors.
10
-
11
- Main Functionalities:
12
- 1. Configuration and System Initialization:
13
- - Configures and establishes secure connections to insurance APIs.
14
- - Loads encrypted system settings and initializes subsystems for logging, data encryption, and notifications.
15
-
16
- 2. Scheduler Integration:
17
- - Enhances MediLink's main menu to include an option for "Optimize and Schedule Submissions".
18
- - This option is visible only when there are new or imminent claims, activating the scheduling function for these claims.
19
-
20
- 3. Scheduling Process:
21
- - Identifies new or urgent claims.
22
- - Fetches real-time deductible information from insurance APIs.
23
- - Computes remaining deductible and determines suitable submission dates.
24
- - Schedules claims with consideration for deductible status and the 90-day deadline, updating a scheduling log with details.
25
-
26
- 4. User Dashboard Update:
27
- - Displays scheduled submissions, including deductible statuses and scheduled dates.
28
- - Allows users to manually adjust or override automated scheduling decisions.
29
-
30
- 5. Pre-Submission Checks:
31
- - Daily verification of claims ready for submission.
32
- - Prepares 837P claim files and finalizes submission details with user confirmation.
33
- - Securely transmits data to insurance providers and logs all submission activities.
34
-
35
- 6. Direct Submission Handling:
36
- - Uses MediLink_Up.submit_claims to manage final claim submissions.
37
- - Ensures that all scheduled claims are submitted with requisite details.
38
-
39
- 7. Data Security:
40
- - Applies encryption to any new data storage or sensitive data involved in the scheduling process.
41
- - Maintains compliance with HIPAA and relevant security standards.
42
-
43
- 8. Error Management and Alerts:
44
- - Extends error handling capabilities to include specific scheduling and submission issues.
45
- - Enhances notifications for reminders and updates on deductible status.
46
-
47
- 9. Integration with MediLink Logging and Error Handling:
48
- - Integrates scheduler operations into MediLink’s existing logging and error management frameworks.
49
-
50
- 10. Maintenance and Data Cleanup:
51
- - Regularly refreshes insurance data mappings and updates deductible information.
52
- - Manages cleanup of processed claims to maintain database integrity and performance.
53
-
54
- 11. User Interface Improvements:
55
- - Updates UI to ensure user-friendliness and provides clear operational feedback.
56
- - Revises help documentation to reflect new functionalities and guides for scheduling tasks.
57
-
58
- Database Management:
59
- - Maintains a JSON-based database for patient billing data, labeled as patient_billing_db, storing information from various sources (Z.dat file, APIs, SFTP).
60
- - Database content includes claim statuses, deductible details, error logs, and identifiers for billing readiness.
61
- - Facilitates efficient tracking and processing of claims, with considerations for integrating individual patient data in batched submissions.
62
- - Stays on the local machine in a defined secure location per config, ensuring HIPAA compliance without the need for data encryption at rest.
63
-
64
- Note: Potential for data corruption or synchronization issues due to system limitations; backup and manual verification measures are advised.
65
- """
66
-
67
-
68
- # JSON DB structure draft.
69
- {
70
- "patients": {
71
- "patient_id": {
72
- "first_name": "John",
73
- "last_name": "Doe",
74
- "date_of_birth": "1985-07-12",
75
- "insurance_details": {
76
- "provider_id": "XYZ123",
77
- "policy_number": "P123456789",
78
- "coverage_start_date": "2020-01-01"
79
- },
80
- "contact_info": {
81
- "email": "john.doe@example.com",
82
- "phone": "555-1234"
83
- }
84
- }
85
- },
86
- "claims": {
87
- "claim_id": {
88
- "patient_id": "patient_id",
89
- "date_of_service": "2023-04-01",
90
- "status": "pending",
91
- "scheduled_submission_date": "2023-04-15",
92
- "actual_submission_date": null,
93
- "billing_amount": 500.00,
94
- "deductible_applied": 100.00,
95
- "covered_amount": 400.00
96
- }
97
- },
98
- "insurance_providers": {
99
- "provider_id": {
100
- "name": "InsuranceCorp",
101
- "contact_details": {
102
- "phone": "555-6789",
103
- "email": "support@insurancecorp.com"
104
- },
105
- "endpoint": "https://api.insurancecorp.com"
106
- }
107
- },
108
- "system_configuration": {
109
- "last_update": "2023-04-18",
110
- "backup_frequency": "daily",
111
- "data_encryption_key": "encrypted_key_value"
112
- },
113
- "logs": {
114
- "log_id": {
115
- "timestamp": "2023-04-18T12:34:56",
116
- "event_type": "error",
117
- "description": "Failed to connect to insurance API",
118
- "related_claim_id": "claim_id"
119
- }
120
- },
121
- "billing_queue": {
122
- "patient_id": "claim_id"
123
- },
124
- "submitted_837p_batches": {
125
- "batch_id": {
126
- "timestamp": "2023-04-20T09:00:00",
127
- "patients": ["patient_id1", "patient_id2", ...],
128
- "endpoint": "clearinghouse_endpoint",
129
- "status": "submitted"
130
- }
131
- }
132
- }
2
+ Implement MediLink_Scheduler
3
+ """
@@ -1,4 +0,0 @@
1
- """
2
- Checks and updates the status of submitted medical claims using API endpoints.
3
- Integrates with MediLink_Down and MediPost to retrieve and process ERAs and other relevant response data from insurance providers.
4
- """
MediLink/MediLink_UI.py CHANGED
@@ -1,21 +1,10 @@
1
- import datetime
2
- import sys
3
-
4
- """
5
- Development Tasks for User Interface (UI) Enhancement in MediSoft Claims Submittal (MediLink) Script:
6
-
7
- Streamline user interaction for endpoint selection and patient adjustments with automated endpoint validation.
8
- Strengthen error handling in file conversion, transmission, and user inputs with actionable user feedback.
9
- Expand logging levels and develop a user notification system for process milestones and errors.
10
- Focus workflow on patient details for endpoint adjustments, facilitating patient-centric file submissions.
11
- Implement internet connectivity checks with retry options for submissions and offer pause/resume capabilities.
12
- Include final review and confirmation steps before submission, allowing for endpoint adjustments per patient.
13
- """
1
+ from datetime import datetime
2
+ import os
14
3
 
15
4
  def display_welcome():
16
5
  print("\n" + "-" * 60)
17
- print("\n *~^~*: Welcome to MediLink! :*~^~*\n")
18
- print("-" * 60 + "\n")
6
+ print(" *~^~*: Welcome to MediLink! :*~^~*")
7
+ print("-" * 60)
19
8
 
20
9
  def display_menu(options):
21
10
  print("Menu Options:")
@@ -35,7 +24,7 @@ def display_patient_options(detailed_patient_data):
35
24
  """
36
25
  Displays a list of patients with their current suggested endpoints, prompting for selections to adjust.
37
26
  """
38
- print("\nPlease select the patients you want to adjust by entering their numbers separated by commas (e.g., 1,3,5):")
27
+ print("\nPlease select the patients to adjust by entering their numbers separated by commas\n(e.g., 1,3,5):")
39
28
  # Can disable this extra print for now because the px list would already be on-screen.
40
29
  #for i, data in enumerate(detailed_patient_data, start=1):
41
30
  # patient_info = "{0} ({1}) - {2}".format(data['patient_name'], data['patient_id'], data['surgery_date'])
@@ -62,26 +51,62 @@ def get_endpoint_decision():
62
51
  """
63
52
  return input("Change endpoint? (Y/N): ").strip().lower()
64
53
 
65
- def display_endpoint_options(endpoint_mapping):
54
+ def display_endpoint_options(endpoints_config):
66
55
  """
67
56
  Displays the endpoint options to the user based on the provided mapping.
68
57
 
69
58
  Args:
70
- endpoint_mapping (dict): A dictionary mapping option numbers to endpoint names.
71
- Example: {'1': 'Availity', '2': 'OptumEDI', ...}
59
+ endpoints_config (dict): A dictionary mapping endpoint keys to their properties,
60
+ where each property includes a 'name' key for the user-friendly name.
61
+ Example: {'Availity': {'name': 'Availity'}, 'OptumEDI': {'name': 'OptumEDI'}, ...}
72
62
 
73
63
  Returns:
74
64
  None
75
65
  """
76
66
  print("Select the new endpoint for the patient:")
77
- for option, endpoint_name in endpoint_mapping.items():
78
- print("{0}. {1}".format(option, endpoint_name))
67
+ for index, (key, details) in enumerate(endpoints_config.items(), 1):
68
+ print("{0}. {1}".format(index, details['name']))
79
69
 
80
70
  def get_new_endpoint_choice():
81
71
  """
82
72
  Gets the user's choice for a new endpoint.
83
73
  """
84
- return input("Select new endpoint (1, 2, or 3): ").strip()
74
+ return input("Select desired endpoint (e.g. 1, 2): ").strip()
75
+
76
+ # Function to display full list of insurance options
77
+ def display_insurance_options(insurance_options=None):
78
+
79
+ # Define insurance options with codes and descriptions
80
+ insurance_options = {
81
+ "11": "Other Non-Federal Programs",
82
+ "12": "Preferred Provider Organization (PPO)",
83
+ "13": "Point of Service (POS)",
84
+ "14": "Exclusive Provider Organization (EPO)",
85
+ "15": "Indemnity Insurance",
86
+ "16": "Health Maintenance Organization (HMO) Medicare Risk",
87
+ "17": "Dental Maintenance Organization",
88
+ "AM": "Automobile Medical",
89
+ "BL": "Blue Cross/Blue Shield",
90
+ "CH": "Champus",
91
+ "CI": "Commercial Insurance Co.",
92
+ "DS": "Disability",
93
+ "FI": "Federal Employees Program",
94
+ "HM": "Health Maintenance Organization",
95
+ "LM": "Liability Medical",
96
+ "MA": "Medicare Part A",
97
+ "MB": "Medicare Part B",
98
+ "MC": "Medicaid",
99
+ "OF": "Other Federal Program",
100
+ "TV": "Title V",
101
+ "VA": "Veterans Affairs Plan",
102
+ "WC": "Workers Compensation Health Claim",
103
+ "ZZ": "Mutually Defined"
104
+ }
105
+
106
+ print("\nInsurance Type Options:")
107
+ for code, description in sorted(insurance_options.items()):
108
+ print("{}: {}".format(code, description))
109
+ print() # Add a blank line for better readability
85
110
 
86
111
  def display_patient_summaries(detailed_patient_data):
87
112
  """
@@ -93,24 +118,59 @@ def display_patient_summaries(detailed_patient_data):
93
118
  display_file_summary(index, summary)
94
119
  except KeyError as e:
95
120
  print("Summary at index {} is missing key: {}".format(index, e))
121
+ print() # add blank line for improved readability.
96
122
 
97
123
  def ask_for_proceeding_with_endpoints():
98
124
  """
99
125
  Asks the user if they want to proceed with all suggested endpoints.
100
126
  """
101
- proceed = input("\nDo you want to proceed with all suggested endpoints? (Y/N): ").strip().lower()
127
+ proceed = input("Do you want to proceed with all suggested endpoints? (Y/N): ").strip().lower()
102
128
  return proceed == 'y'
103
129
 
104
130
  def display_file_summary(index, summary):
105
131
  # Ensure surgery_date is converted to a datetime object
106
- surgery_date = datetime.datetime.strptime(summary['surgery_date'], "%m-%d-%y")
132
+ surgery_date = datetime.strptime(summary['surgery_date'], "%m-%d-%y")
133
+
134
+ # Add header row if it's the first index
135
+ if index == 1:
136
+ print("{:<3} {:5} {:<10} {:20} {:15} {:2} {:20}".format(
137
+ "No.", "Date", "ID", "Name", "Primary Ins.", "IT", "Suggested Endpoint"
138
+ ))
139
+ print("-"*80)
140
+
141
+ # Check if insurance_type is available; if not, set a default placeholder (this should already be '12' at this point)
142
+ insurance_type = summary.get('insurance_type', '--')
107
143
 
108
144
  # Displays the summary of a file.
109
- print("{:02d}. {:5} (ID: {:<8}) {:20} {:15} Suggested Endpoint: {}".format(
145
+ print("{:02d}. {:5} ({:<8}) {:20} {:15} {:2} {:20}".format(
110
146
  index,
111
147
  surgery_date.strftime("%m-%d"),
112
148
  summary['patient_id'],
113
149
  summary['patient_name'][:20],
114
150
  summary['primary_insurance'][:15],
115
- summary['suggested_endpoint'])
116
- )
151
+ insurance_type[:2],
152
+ summary['suggested_endpoint'][:20])
153
+ )
154
+
155
+ def user_select_files(file_list):
156
+ """
157
+ Prompt the user to select files from a list of detected files.
158
+
159
+ :param file_list: List of detected files.
160
+ :return: List of files selected by the user.
161
+ """
162
+ # Sort the files by creation time in descending order
163
+ file_list = sorted(file_list, key=os.path.getctime, reverse=True)
164
+
165
+ print("Select claim files to submit from the following list:")
166
+ for i, file in enumerate(file_list):
167
+ print("{}: {}".format(i+1, os.path.basename(file)))
168
+
169
+ selected_indices = input("\nEnter the numbers of the files to process, separated by commas\n(or press Enter to select all): ")
170
+ if not selected_indices:
171
+ return file_list
172
+
173
+ selected_indices = [int(i.strip()) - 1 for i in selected_indices.split(',')]
174
+ selected_files = [file_list[i] for i in selected_indices]
175
+
176
+ return selected_files