medicafe 0.240517.0__py3-none-any.whl → 0.240716.2__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.bat +46 -6
- MediBot/MediBot.py +9 -36
- MediBot/MediBot_Charges.py +0 -28
- MediBot/MediBot_Crosswalk_Library.py +16 -8
- MediBot/MediBot_Post.py +0 -0
- MediBot/MediBot_Preprocessor.py +26 -63
- MediBot/MediBot_Preprocessor_lib.py +182 -43
- MediBot/MediBot_UI.py +2 -7
- MediBot/MediBot_dataformat_library.py +0 -9
- MediBot/MediBot_docx_decoder.py +283 -60
- MediLink/MediLink.py +80 -120
- MediLink/MediLink_837p_encoder.py +3 -28
- MediLink/MediLink_837p_encoder_library.py +19 -53
- MediLink/MediLink_API_Generator.py +246 -0
- MediLink/MediLink_API_v2.py +2 -0
- MediLink/MediLink_API_v3.py +325 -0
- MediLink/MediLink_APIs.py +2 -0
- MediLink/MediLink_ClaimStatus.py +144 -0
- MediLink/MediLink_ConfigLoader.py +13 -7
- MediLink/MediLink_DataMgmt.py +224 -68
- MediLink/MediLink_Decoder.py +165 -0
- MediLink/MediLink_Deductible.py +203 -0
- MediLink/MediLink_Down.py +122 -96
- MediLink/MediLink_Gmail.py +453 -74
- MediLink/MediLink_Mailer.py +0 -7
- MediLink/MediLink_Parser.py +193 -0
- MediLink/MediLink_Scan.py +0 -0
- MediLink/MediLink_Scheduler.py +2 -172
- MediLink/MediLink_StatusCheck.py +0 -4
- MediLink/MediLink_UI.py +54 -18
- MediLink/MediLink_Up.py +6 -15
- {medicafe-0.240517.0.dist-info → medicafe-0.240716.2.dist-info}/METADATA +4 -1
- medicafe-0.240716.2.dist-info/RECORD +47 -0
- {medicafe-0.240517.0.dist-info → medicafe-0.240716.2.dist-info}/WHEEL +1 -1
- medicafe-0.240517.0.dist-info/RECORD +0 -39
- {medicafe-0.240517.0.dist-info → medicafe-0.240716.2.dist-info}/LICENSE +0 -0
- {medicafe-0.240517.0.dist-info → medicafe-0.240716.2.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
# MediLink_Parser.py
|
|
2
|
+
|
|
3
|
+
def parse_era_content(content):
|
|
4
|
+
extracted_data = []
|
|
5
|
+
normalized_content = content.replace('~\n', '~')
|
|
6
|
+
lines = normalized_content.split('~')
|
|
7
|
+
|
|
8
|
+
record = {}
|
|
9
|
+
check_eft, payer_address = None, None
|
|
10
|
+
allowed_amount, write_off, patient_responsibility, adjustment_amount = 0, 0, 0, 0
|
|
11
|
+
is_payer_section = False
|
|
12
|
+
|
|
13
|
+
for line in lines:
|
|
14
|
+
segments = line.split('*')
|
|
15
|
+
|
|
16
|
+
if segments[0] == 'TRN' and len(segments) > 2:
|
|
17
|
+
check_eft = segments[2]
|
|
18
|
+
|
|
19
|
+
if segments[0] == 'N1':
|
|
20
|
+
if segments[1] == 'PR':
|
|
21
|
+
is_payer_section = True
|
|
22
|
+
elif segments[1] == 'PE':
|
|
23
|
+
is_payer_section = False
|
|
24
|
+
|
|
25
|
+
if is_payer_section and segments[0] == 'N3' and len(segments) > 1:
|
|
26
|
+
payer_address = segments[1]
|
|
27
|
+
|
|
28
|
+
if segments[0] == 'CLP' and len(segments) >= 5:
|
|
29
|
+
if record:
|
|
30
|
+
if adjustment_amount == 0 and (write_off > 0 or patient_responsibility > 0):
|
|
31
|
+
adjustment_amount = write_off + patient_responsibility
|
|
32
|
+
|
|
33
|
+
record.update({
|
|
34
|
+
'Payer Address': payer_address,
|
|
35
|
+
'Allowed Amount': allowed_amount,
|
|
36
|
+
'Write Off': write_off,
|
|
37
|
+
'Patient Responsibility': patient_responsibility,
|
|
38
|
+
'Adjustment Amount': adjustment_amount,
|
|
39
|
+
})
|
|
40
|
+
extracted_data.append(record)
|
|
41
|
+
|
|
42
|
+
allowed_amount, write_off, patient_responsibility, adjustment_amount = 0, 0, 0, 0
|
|
43
|
+
|
|
44
|
+
record = {
|
|
45
|
+
'Check EFT': check_eft,
|
|
46
|
+
'Chart Number': segments[1],
|
|
47
|
+
'Payer Address': payer_address,
|
|
48
|
+
'Amount Paid': segments[4],
|
|
49
|
+
'Charge': segments[3],
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
elif segments[0] == 'CAS':
|
|
53
|
+
if segments[1] == 'CO':
|
|
54
|
+
write_off += float(segments[3])
|
|
55
|
+
elif segments[1] == 'PR':
|
|
56
|
+
patient_responsibility += float(segments[3])
|
|
57
|
+
elif segments[1] == 'OA':
|
|
58
|
+
adjustment_amount += float(segments[3])
|
|
59
|
+
|
|
60
|
+
elif segments[0] == 'AMT' and segments[1] == 'B6':
|
|
61
|
+
allowed_amount += float(segments[2])
|
|
62
|
+
|
|
63
|
+
elif segments[0] == 'DTM' and (segments[1] == '232' or segments[1] == '472'):
|
|
64
|
+
record['Date of Service'] = segments[2]
|
|
65
|
+
|
|
66
|
+
if record:
|
|
67
|
+
if adjustment_amount == 0 and (write_off > 0 or patient_responsibility > 0):
|
|
68
|
+
adjustment_amount = write_off + patient_responsibility
|
|
69
|
+
record.update({
|
|
70
|
+
'Allowed Amount': allowed_amount,
|
|
71
|
+
'Write Off': write_off,
|
|
72
|
+
'Patient Responsibility': patient_responsibility,
|
|
73
|
+
'Adjustment Amount': adjustment_amount,
|
|
74
|
+
})
|
|
75
|
+
extracted_data.append(record)
|
|
76
|
+
|
|
77
|
+
print("Parsed ERA Content:")
|
|
78
|
+
for data in extracted_data:
|
|
79
|
+
print(data)
|
|
80
|
+
|
|
81
|
+
return extracted_data
|
|
82
|
+
|
|
83
|
+
def parse_277_content(content):
|
|
84
|
+
segments = content.split('~')
|
|
85
|
+
records = []
|
|
86
|
+
current_record = {}
|
|
87
|
+
for segment in segments:
|
|
88
|
+
parts = segment.split('*')
|
|
89
|
+
if parts[0] == 'HL':
|
|
90
|
+
if current_record:
|
|
91
|
+
records.append(current_record)
|
|
92
|
+
current_record = {}
|
|
93
|
+
elif parts[0] == 'NM1':
|
|
94
|
+
if parts[1] == 'QC':
|
|
95
|
+
current_record['Patient'] = parts[3] + ' ' + parts[4]
|
|
96
|
+
elif parts[1] == '41':
|
|
97
|
+
current_record['Clearing House'] = parts[3]
|
|
98
|
+
elif parts[1] == 'PR':
|
|
99
|
+
current_record['Payer'] = parts[3]
|
|
100
|
+
elif parts[0] == 'TRN':
|
|
101
|
+
current_record['Claim #'] = parts[2]
|
|
102
|
+
elif parts[0] == 'STC':
|
|
103
|
+
current_record['Status'] = parts[1]
|
|
104
|
+
if len(parts) > 4:
|
|
105
|
+
current_record['Paid'] = parts[4]
|
|
106
|
+
elif parts[0] == 'DTP':
|
|
107
|
+
if parts[1] == '472':
|
|
108
|
+
current_record['Serv.'] = parts[3]
|
|
109
|
+
elif parts[1] == '050':
|
|
110
|
+
current_record['Proc.'] = parts[3]
|
|
111
|
+
elif parts[0] == 'AMT':
|
|
112
|
+
if parts[1] == 'YU':
|
|
113
|
+
current_record['Charged'] = parts[2]
|
|
114
|
+
|
|
115
|
+
if current_record:
|
|
116
|
+
records.append(current_record)
|
|
117
|
+
|
|
118
|
+
print("Parsed 277 Content:")
|
|
119
|
+
for record in records:
|
|
120
|
+
print(record)
|
|
121
|
+
|
|
122
|
+
return records
|
|
123
|
+
|
|
124
|
+
def parse_277IBR_content(content):
|
|
125
|
+
return parse_277_content(content)
|
|
126
|
+
|
|
127
|
+
def parse_277EBR_content(content):
|
|
128
|
+
return parse_277_content(content)
|
|
129
|
+
|
|
130
|
+
def parse_dpt_content(content):
|
|
131
|
+
extracted_data = []
|
|
132
|
+
lines = content.splitlines()
|
|
133
|
+
record = {}
|
|
134
|
+
for line in lines:
|
|
135
|
+
if 'Patient Account Number:' in line:
|
|
136
|
+
if record:
|
|
137
|
+
extracted_data.append(record)
|
|
138
|
+
record = {}
|
|
139
|
+
parts = line.split(':')
|
|
140
|
+
if len(parts) == 2:
|
|
141
|
+
key, value = parts[0].strip(), parts[1].strip()
|
|
142
|
+
record[key] = value
|
|
143
|
+
if record:
|
|
144
|
+
extracted_data.append(record)
|
|
145
|
+
|
|
146
|
+
print("Parsed DPT Content:")
|
|
147
|
+
for data in extracted_data:
|
|
148
|
+
print(data)
|
|
149
|
+
|
|
150
|
+
return extracted_data
|
|
151
|
+
|
|
152
|
+
def parse_ebt_content(content):
|
|
153
|
+
extracted_data = []
|
|
154
|
+
lines = content.splitlines()
|
|
155
|
+
record = {}
|
|
156
|
+
for line in lines:
|
|
157
|
+
if 'Patient Name:' in line and record:
|
|
158
|
+
extracted_data.append(record)
|
|
159
|
+
record = {}
|
|
160
|
+
parts = line.split(':')
|
|
161
|
+
if len(parts) == 2:
|
|
162
|
+
key, value = parts[0].strip(), parts[1].strip()
|
|
163
|
+
record[key] = value
|
|
164
|
+
if record:
|
|
165
|
+
extracted_data.append(record)
|
|
166
|
+
|
|
167
|
+
print("Parsed EBT Content:")
|
|
168
|
+
for data in extracted_data:
|
|
169
|
+
print(data)
|
|
170
|
+
|
|
171
|
+
return extracted_data
|
|
172
|
+
|
|
173
|
+
def parse_ibt_content(content):
|
|
174
|
+
extracted_data = []
|
|
175
|
+
lines = content.splitlines()
|
|
176
|
+
record = {}
|
|
177
|
+
for line in lines:
|
|
178
|
+
if 'Submitter Batch ID:' in line:
|
|
179
|
+
if record:
|
|
180
|
+
extracted_data.append(record)
|
|
181
|
+
record = {}
|
|
182
|
+
parts = line.split(':')
|
|
183
|
+
if len(parts) == 2:
|
|
184
|
+
key, value = parts[0].strip(), parts[1].strip()
|
|
185
|
+
record[key] = value
|
|
186
|
+
if record:
|
|
187
|
+
extracted_data.append(record)
|
|
188
|
+
|
|
189
|
+
print("Parsed IBT Content:")
|
|
190
|
+
for data in extracted_data:
|
|
191
|
+
print(data)
|
|
192
|
+
|
|
193
|
+
return extracted_data
|
|
File without changes
|
MediLink/MediLink_Scheduler.py
CHANGED
|
@@ -1,173 +1,3 @@
|
|
|
1
1
|
"""
|
|
2
|
-
|
|
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
|
-
Crosswalk Example:
|
|
67
|
-
"payer_id": {
|
|
68
|
-
"87726": {
|
|
69
|
-
"medisoft_medicare_id": [],
|
|
70
|
-
"medisoft_id": [
|
|
71
|
-
"320"
|
|
72
|
-
],
|
|
73
|
-
"endpoint": "OPTUMEDI"
|
|
74
|
-
},
|
|
75
|
-
"60054": {
|
|
76
|
-
"medisoft_medicare_id": [],
|
|
77
|
-
"medisoft_id": [
|
|
78
|
-
"369"
|
|
79
|
-
],
|
|
80
|
-
"endpoint": "OPTUMEDI"
|
|
81
|
-
},
|
|
82
|
-
"00590": {
|
|
83
|
-
"medisoft_medicare_id": [],
|
|
84
|
-
"medisoft_id": [
|
|
85
|
-
"317"
|
|
86
|
-
],
|
|
87
|
-
"endpoint": "OPTUMEDI"
|
|
88
|
-
},
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
Crosswalk add:
|
|
92
|
-
- submit_buffer_maria per payer_id
|
|
93
|
-
- submit_limit_days per payer_id
|
|
94
|
-
- deductible_max = $2500.
|
|
95
|
-
- submit limit buffer = 15 days before final.
|
|
96
|
-
|
|
97
|
-
MediLink_Scheduler logic to produce dates of submission:
|
|
98
|
-
deductible slows it until a max limit ($2500), then send anyway.
|
|
99
|
-
after maria buffer, before submit (-15?) limit day.
|
|
100
|
-
Maria collects pre-payment, this is a factor, needs to be somehow accounted for in the process where a quantity gets pre-assigned to a patient so we know when to submit the claim.
|
|
101
|
-
|
|
102
|
-
Date last reviewed, Insurance Type, In network, Annual Deductable Remaining, Recieved pre-payment amount, Check# or 'Cash'.
|
|
103
|
-
|
|
104
|
-
In the future those pre-payments should be either eCheck, Zelle or by CC + 5% surcharge.
|
|
105
|
-
|
|
106
|
-
"""
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
# JSON DB structure draft.
|
|
110
|
-
{
|
|
111
|
-
"patients": {
|
|
112
|
-
"patient_id": {
|
|
113
|
-
"first_name": "John",
|
|
114
|
-
"last_name": "Doe",
|
|
115
|
-
"date_of_birth": "1985-07-12",
|
|
116
|
-
"insurance_details": {
|
|
117
|
-
"provider_id": "XYZ123",
|
|
118
|
-
"policy_number": "P123456789",
|
|
119
|
-
"coverage_start_date": "2020-01-01"
|
|
120
|
-
},
|
|
121
|
-
"contact_info": {
|
|
122
|
-
"email": "john.doe@example.com",
|
|
123
|
-
"phone": "555-1234"
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
"claims": {
|
|
128
|
-
"claim_id": {
|
|
129
|
-
"patient_id": "patient_id",
|
|
130
|
-
"date_of_service": "2023-04-01",
|
|
131
|
-
"status": "pending",
|
|
132
|
-
"scheduled_submission_date": "2023-04-15",
|
|
133
|
-
"actual_submission_date": null,
|
|
134
|
-
"billing_amount": 500.00,
|
|
135
|
-
"deductible_applied": 100.00,
|
|
136
|
-
"covered_amount": 400.00
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
|
-
"insurance_providers": {
|
|
140
|
-
"provider_id": {
|
|
141
|
-
"name": "InsuranceCorp",
|
|
142
|
-
"contact_details": {
|
|
143
|
-
"phone": "555-6789",
|
|
144
|
-
"email": "support@insurancecorp.com"
|
|
145
|
-
},
|
|
146
|
-
"endpoint": "https://api.insurancecorp.com"
|
|
147
|
-
}
|
|
148
|
-
},
|
|
149
|
-
"system_configuration": {
|
|
150
|
-
"last_update": "2023-04-18",
|
|
151
|
-
"backup_frequency": "daily",
|
|
152
|
-
"data_encryption_key": "encrypted_key_value"
|
|
153
|
-
},
|
|
154
|
-
"logs": {
|
|
155
|
-
"log_id": {
|
|
156
|
-
"timestamp": "2023-04-18T12:34:56",
|
|
157
|
-
"event_type": "error",
|
|
158
|
-
"description": "Failed to connect to insurance API",
|
|
159
|
-
"related_claim_id": "claim_id"
|
|
160
|
-
}
|
|
161
|
-
},
|
|
162
|
-
"billing_queue": {
|
|
163
|
-
"patient_id": "claim_id"
|
|
164
|
-
},
|
|
165
|
-
"submitted_837p_batches": {
|
|
166
|
-
"batch_id": {
|
|
167
|
-
"timestamp": "2023-04-20T09:00:00",
|
|
168
|
-
"patients": ["patient_id1", "patient_id2", ...],
|
|
169
|
-
"endpoint": "clearinghouse_endpoint",
|
|
170
|
-
"status": "submitted"
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
2
|
+
Implement MediLink_Scheduler
|
|
3
|
+
"""
|
MediLink/MediLink_StatusCheck.py
CHANGED
MediLink/MediLink_UI.py
CHANGED
|
@@ -1,22 +1,11 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Development Tasks for User Interface (UI) Enhancement in MediSoft Claims Submittal (MediLink) Script:
|
|
5
|
-
|
|
6
|
-
- [ ] Streamline user interaction for endpoint selection and patient adjustments with automated endpoint validation.
|
|
7
|
-
- [ ] Strengthen error handling in file conversion, transmission, and user inputs with actionable user feedback.
|
|
8
|
-
- [ ] Expand logging levels and develop a user notification system for process milestones and errors.
|
|
9
|
-
- [ ] Focus workflow on patient details for endpoint adjustments, facilitating patient-centric file submissions.
|
|
10
|
-
- [ ] Implement internet connectivity checks with retry options for submissions and offer pause/resume capabilities.
|
|
11
|
-
- [ ] Include final review and confirmation steps before submission, allowing for endpoint adjustments per patient.
|
|
12
|
-
- [ ] TODO Need to resolve suggested endpoint issues/refresh/quasi-persist (this is partially implemented, careful)
|
|
13
|
-
- [ ] TODO Augment the menu for displaying the insurance type information before submittal.
|
|
14
|
-
"""
|
|
2
|
+
import os
|
|
3
|
+
import MediLink_ConfigLoader
|
|
15
4
|
|
|
16
5
|
def display_welcome():
|
|
17
6
|
print("\n" + "-" * 60)
|
|
18
7
|
print(" *~^~*: Welcome to MediLink! :*~^~*")
|
|
19
|
-
print("-" * 60
|
|
8
|
+
print("-" * 60)
|
|
20
9
|
|
|
21
10
|
def display_menu(options):
|
|
22
11
|
print("Menu Options:")
|
|
@@ -85,6 +74,18 @@ def get_new_endpoint_choice():
|
|
|
85
74
|
"""
|
|
86
75
|
return input("Select desired endpoint (e.g. 1, 2): ").strip()
|
|
87
76
|
|
|
77
|
+
# Function to display full list of insurance options
|
|
78
|
+
def display_insurance_options(insurance_options=None):
|
|
79
|
+
|
|
80
|
+
# Retrieve insurance options with codes and descriptions
|
|
81
|
+
config, _ = MediLink_ConfigLoader.load_configuration()
|
|
82
|
+
insurance_options = config['MediLink_Config'].get('insurance_options')
|
|
83
|
+
|
|
84
|
+
print("\nInsurance Type Options:")
|
|
85
|
+
for code, description in sorted(insurance_options.items()):
|
|
86
|
+
print("{}: {}".format(code, description))
|
|
87
|
+
print() # Add a blank line for better readability
|
|
88
|
+
|
|
88
89
|
def display_patient_summaries(detailed_patient_data):
|
|
89
90
|
"""
|
|
90
91
|
Displays summaries of all patients and their suggested endpoints.
|
|
@@ -95,24 +96,59 @@ def display_patient_summaries(detailed_patient_data):
|
|
|
95
96
|
display_file_summary(index, summary)
|
|
96
97
|
except KeyError as e:
|
|
97
98
|
print("Summary at index {} is missing key: {}".format(index, e))
|
|
99
|
+
print() # add blank line for improved readability.
|
|
98
100
|
|
|
99
101
|
def ask_for_proceeding_with_endpoints():
|
|
100
102
|
"""
|
|
101
103
|
Asks the user if they want to proceed with all suggested endpoints.
|
|
102
104
|
"""
|
|
103
|
-
proceed = input("
|
|
105
|
+
proceed = input("Do you want to proceed with all suggested endpoints? (Y/N): ").strip().lower()
|
|
104
106
|
return proceed == 'y'
|
|
105
107
|
|
|
106
108
|
def display_file_summary(index, summary):
|
|
107
109
|
# Ensure surgery_date is converted to a datetime object
|
|
108
110
|
surgery_date = datetime.strptime(summary['surgery_date'], "%m-%d-%y")
|
|
111
|
+
|
|
112
|
+
# Add header row if it's the first index
|
|
113
|
+
if index == 1:
|
|
114
|
+
print("{:<3} {:5} {:<10} {:20} {:15} {:2} {:20}".format(
|
|
115
|
+
"No.", "Date", "ID", "Name", "Primary Ins.", "IT", "Suggested Endpoint"
|
|
116
|
+
))
|
|
117
|
+
print("-"*80)
|
|
118
|
+
|
|
119
|
+
# Check if insurance_type is available; if not, set a default placeholder (this should already be '12' at this point)
|
|
120
|
+
insurance_type = summary.get('insurance_type', '--')
|
|
109
121
|
|
|
110
122
|
# Displays the summary of a file.
|
|
111
|
-
print("{:02d}. {:5} (
|
|
123
|
+
print("{:02d}. {:5} ({:<8}) {:20} {:15} {:2} {:20}".format(
|
|
112
124
|
index,
|
|
113
125
|
surgery_date.strftime("%m-%d"),
|
|
114
126
|
summary['patient_id'],
|
|
115
127
|
summary['patient_name'][:20],
|
|
116
128
|
summary['primary_insurance'][:15],
|
|
117
|
-
|
|
118
|
-
|
|
129
|
+
insurance_type[:2],
|
|
130
|
+
summary['suggested_endpoint'][:20])
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
def user_select_files(file_list):
|
|
134
|
+
"""
|
|
135
|
+
Prompt the user to select files from a list of detected files.
|
|
136
|
+
|
|
137
|
+
:param file_list: List of detected files.
|
|
138
|
+
:return: List of files selected by the user.
|
|
139
|
+
"""
|
|
140
|
+
# Sort the files by creation time in descending order
|
|
141
|
+
file_list = sorted(file_list, key=os.path.getctime, reverse=True)
|
|
142
|
+
|
|
143
|
+
print("Select claim files to submit from the following list:")
|
|
144
|
+
for i, file in enumerate(file_list):
|
|
145
|
+
print("{}: {}".format(i+1, os.path.basename(file)))
|
|
146
|
+
|
|
147
|
+
selected_indices = input("\nEnter the numbers of the files to process, separated by commas\n(or press Enter to select all): ")
|
|
148
|
+
if not selected_indices:
|
|
149
|
+
return file_list
|
|
150
|
+
|
|
151
|
+
selected_indices = [int(i.strip()) - 1 for i in selected_indices.split(',')]
|
|
152
|
+
selected_files = [file_list[i] for i in selected_indices]
|
|
153
|
+
|
|
154
|
+
return selected_files
|
MediLink/MediLink_Up.py
CHANGED
|
@@ -7,19 +7,6 @@ import MediLink_837p_encoder
|
|
|
7
7
|
from MediLink_ConfigLoader import log
|
|
8
8
|
from MediLink_DataMgmt import operate_winscp
|
|
9
9
|
|
|
10
|
-
"""
|
|
11
|
-
Handles the transmission of files to endpoints and related tasks for the MediLink script.
|
|
12
|
-
|
|
13
|
-
Functions:
|
|
14
|
-
- check_internet_connection(): Checks for an active internet connection.
|
|
15
|
-
- UPDATE THIS: transmit_files_to_endpoint(converted_files, endpoint_config, local_storage_path): Transmits files to a specified endpoint using WinSCP.
|
|
16
|
-
- handle_transmission_result(transmission_result): Handles the result of the file transmission process.
|
|
17
|
-
- submit_claims(detailed_patient_data_grouped_by_endpoint, config): Submits claims to respective endpoints based on patient data and configuration.
|
|
18
|
-
- confirm_transmission(detailed_patient_data_grouped_by_endpoint): Displays patient data ready for transmission and asks for confirmation.
|
|
19
|
-
|
|
20
|
-
This module provides functionality for transmitting files, confirming transmissions, and ensuring connectivity for the MediLink script.
|
|
21
|
-
"""
|
|
22
|
-
|
|
23
10
|
# Internet Connectivity Check
|
|
24
11
|
def check_internet_connection():
|
|
25
12
|
"""
|
|
@@ -84,7 +71,8 @@ def submit_claims(detailed_patient_data_grouped_by_endpoint, config):
|
|
|
84
71
|
|
|
85
72
|
print("No files were converted for transmission to {0}.".format(endpoint))
|
|
86
73
|
else:
|
|
87
|
-
print("No internet connection detected.")
|
|
74
|
+
print("Error: No internet connection detected.")
|
|
75
|
+
log("Error: No internet connection detected.", level="ERROR")
|
|
88
76
|
try_again = input("Do you want to try again? (Y/N): ").strip().lower()
|
|
89
77
|
if try_again != 'y':
|
|
90
78
|
print("Exiting transmission process. Please try again later.")
|
|
@@ -367,12 +355,15 @@ def confirm_transmission(detailed_patient_data_grouped_by_endpoint):
|
|
|
367
355
|
lists of detailed patient data as values.
|
|
368
356
|
:param config: Configuration settings loaded from a JSON file.
|
|
369
357
|
"""
|
|
358
|
+
# Clear terminal for clarity
|
|
359
|
+
os.system('cls')
|
|
360
|
+
|
|
370
361
|
print("\nReview of patient data ready for transmission:")
|
|
371
362
|
for endpoint, patient_data_list in detailed_patient_data_grouped_by_endpoint.items():
|
|
372
363
|
print("\nEndpoint: {0}".format(endpoint))
|
|
373
364
|
for patient_data in patient_data_list:
|
|
374
365
|
patient_info = "({1}) {0}".format(patient_data['patient_name'], patient_data['patient_id'])
|
|
375
|
-
print("- {:<
|
|
366
|
+
print("- {:<33} | {:<5}, ${:<6}, {}".format(
|
|
376
367
|
patient_info, patient_data['surgery_date'][:5], patient_data['amount'], patient_data['primary_insurance']))
|
|
377
368
|
|
|
378
369
|
confirmation = input("\nProceed with transmission to all endpoints? (Y/N): ").strip().lower()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: medicafe
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.240716.2
|
|
4
4
|
Summary: MediCafe
|
|
5
5
|
Home-page: https://github.com/katanada2
|
|
6
6
|
Author: Daniel Vidaud
|
|
@@ -14,6 +14,9 @@ Requires-Dist: argparse
|
|
|
14
14
|
Requires-Dist: numpy ==1.11.3
|
|
15
15
|
Requires-Dist: pandas ==0.20.0
|
|
16
16
|
Requires-Dist: tqdm ==4.14.0
|
|
17
|
+
Requires-Dist: lxml ==4.2.0
|
|
18
|
+
Requires-Dist: python-docx
|
|
19
|
+
Requires-Dist: PyYAML ==5.2
|
|
17
20
|
|
|
18
21
|
|
|
19
22
|
# Project Overview: MediCafe
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
MediBot/MediBot.bat,sha256=B_iUMQro6kPrTbGOePsTvOq3N9nXn5fE7xnkt4jfSrE,7032
|
|
2
|
+
MediBot/MediBot.py,sha256=X7ZU-xYsnw7xL7nBZTDudhSXdsnEavcHORE4hPM4L58,16704
|
|
3
|
+
MediBot/MediBot_Charges.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
MediBot/MediBot_Crosswalk_Library.py,sha256=RxwihSpPtTlnDbPiQ1VWnPVVdjYA-L69OPWREXMTGiQ,14862
|
|
5
|
+
MediBot/MediBot_Post.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
MediBot/MediBot_Preprocessor.py,sha256=OI9rfDF01OLuLFZoSzIceO3r5fkKEFN7tynXPIceoo4,11941
|
|
7
|
+
MediBot/MediBot_Preprocessor_lib.py,sha256=aU5VWwLqDxka8DGLkrji6C9rYMzoqjxLScZ64Ya-0ok,24170
|
|
8
|
+
MediBot/MediBot_UI.py,sha256=_CS9BV3882mNp-UmMUPKZOsDI3ZGxft5mcr36-Nq1FQ,10318
|
|
9
|
+
MediBot/MediBot_dataformat_library.py,sha256=AVRAl4oDHR6nq2bBiJf2YABrdtnfiQYdYzV0BMvL7U0,8346
|
|
10
|
+
MediBot/MediBot_docx_decoder.py,sha256=nO5N8qPsZoiFzicSJ5mbBfjaqGinxgh_VzjLhEsj95U,13712
|
|
11
|
+
MediBot/MediPost.py,sha256=C1hZJFr65rN6F_dckjdBxFC0vL2CoqY9W3YFqU5HXtE,336
|
|
12
|
+
MediBot/PDF_to_CSV_Cleaner.py,sha256=ZZphmq-5K04DkrZNlcwNAIoZPOD_ROWvS3PMkKFxeiM,8799
|
|
13
|
+
MediBot/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
|
+
MediBot/update_json.py,sha256=eAu3BPYtlGlwVGZdTUmrqq4qLTVcplt-6EnzcGCheG0,1557
|
|
15
|
+
MediBot/update_medicafe.py,sha256=CYxRHNXb-ZwGELWSXJA90foMwac_GBdXhD9hwClUjpA,2249
|
|
16
|
+
MediLink/MediLink.py,sha256=GRMe3OiskBGVpHDGIrTmY4_t2pc5J_pznHt5Z5mU8X8,18054
|
|
17
|
+
MediLink/MediLink_277_decoder.py,sha256=Z3hQK2j-YzdXjov6aDlDRc7M_auFBnl3se4OF5q6_04,4358
|
|
18
|
+
MediLink/MediLink_837p_encoder.py,sha256=onrbzk-6QG97oHRn-AvDtcsYyQ-OpqZJE4KWjgPTwxQ,23550
|
|
19
|
+
MediLink/MediLink_837p_encoder_library.py,sha256=_K162u1spMWZg-7HMebEU2yciGx_1T6lX7FW02Ek3fA,41831
|
|
20
|
+
MediLink/MediLink_API_Generator.py,sha256=AvKJOoQKl2_dJG517chsVAjBKqEEIEz_c12OL03J428,10387
|
|
21
|
+
MediLink/MediLink_API_v2.py,sha256=mcIgLnXPS_NaUBrkKJ8mxCUaQ0AuQUeU1vG6DoplbVY,7733
|
|
22
|
+
MediLink/MediLink_API_v3.py,sha256=8X-5ldKnAJzfE2R0nywa6xYq6C7kqJ3lLDCyqXg9FP4,15911
|
|
23
|
+
MediLink/MediLink_APIs.py,sha256=_EFNjBFwtZsEJM771xa6g-zQCCRrebIHj73ElVVZ8Fs,6229
|
|
24
|
+
MediLink/MediLink_ClaimStatus.py,sha256=s6Ll46yU2-jJueF-3jqVyJ53s1Qll1MONkX2vm1alLY,8655
|
|
25
|
+
MediLink/MediLink_ConfigLoader.py,sha256=p1Fkm-KeRR1vcIS-7K6RUP7g1B7HrgO_KbjmwwNCX4A,4161
|
|
26
|
+
MediLink/MediLink_DataMgmt.py,sha256=y8nNe25mj2ajUmPo7508q_T1vxkYiKzwdRit0oX8V9s,20344
|
|
27
|
+
MediLink/MediLink_Decoder.py,sha256=L4b3OnVERhgP68T4Lvty9MJNXutPAjXRPBjYpzSj2ZM,7139
|
|
28
|
+
MediLink/MediLink_Deductible.py,sha256=3uCUluPx6sHsU7tj9wM62PZK_WY8VOPFlXG3Iccgiy4,8520
|
|
29
|
+
MediLink/MediLink_Down.py,sha256=1SIzPLSI4w4Prb2u0FXsf1Bd6Nksb0tMv0N8w1aWzyE,7110
|
|
30
|
+
MediLink/MediLink_ERA_decoder.py,sha256=MiOtDcXnmevPfHAahIlTLlUc14VcQWAor9Xa7clA2Ts,8710
|
|
31
|
+
MediLink/MediLink_Gmail.py,sha256=FV13-umZIouhetnwkGOBgFQYl5FTyOs__SpjaycUxKk,21195
|
|
32
|
+
MediLink/MediLink_Mailer.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
|
+
MediLink/MediLink_Parser.py,sha256=p2RlCut84hESXjR7tyCZ9O-gUbsUQeYqRp1bXhKbxu4,6322
|
|
34
|
+
MediLink/MediLink_Scan.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
35
|
+
MediLink/MediLink_Scheduler.py,sha256=UJvxhDvHraqra2_TlQVlGeh5jRFrrfK6nCVUHnKOEMY,38
|
|
36
|
+
MediLink/MediLink_StatusCheck.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
37
|
+
MediLink/MediLink_UI.py,sha256=kAtWApyvaE1qMOy5Vzszy3zPBI25wT29jG1XkIWnAAs,6164
|
|
38
|
+
MediLink/MediLink_Up.py,sha256=tKkMaz0FvbIXCJ9eQ2LXp6r4_Ou4yDaqRtekfZE6bF0,18546
|
|
39
|
+
MediLink/MediLink_batch.bat,sha256=nqL5QwCLyRQFSPdv6kgtcV_cpky7FXSOWVl6OxjRXb4,118
|
|
40
|
+
MediLink/Soumit_api.py,sha256=5JfOecK98ZC6NpZklZW2AkOzkjvrbYxpJpZNH3rFxDw,497
|
|
41
|
+
MediLink/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
42
|
+
MediLink/test.py,sha256=kSvvJRL_3fWuNS3_x4hToOnUljGLoeEw6SUTHQWQRJk,3108
|
|
43
|
+
medicafe-0.240716.2.dist-info/LICENSE,sha256=65lb-vVujdQK7uMH3RRJSMwUW-WMrMEsc5sOaUn2xUk,1096
|
|
44
|
+
medicafe-0.240716.2.dist-info/METADATA,sha256=edgBR0DGETtGim21JGQ13iz2K-kqqJwl41hXGAYJxRQ,4625
|
|
45
|
+
medicafe-0.240716.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
46
|
+
medicafe-0.240716.2.dist-info/top_level.txt,sha256=3uOwR4q_SP8Gufk2uCHoKngAgbtdOwQC6Qjl7ViBa_c,17
|
|
47
|
+
medicafe-0.240716.2.dist-info/RECORD,,
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
MediBot/MediBot.bat,sha256=mv_FwGZM75vZVAHqSZLtY3lpuxLFST4xQuEw0OWL6ac,6003
|
|
2
|
-
MediBot/MediBot.py,sha256=q4jbWGdU6mabYL_bIvXqbh5cnGhLHMLrcq9Gas5Sv2Q,17762
|
|
3
|
-
MediBot/MediBot_Charges.py,sha256=N-hjH6d44YlGAGRs3E17VaupIfpLgaNep_pfZqC2K2M,1963
|
|
4
|
-
MediBot/MediBot_Crosswalk_Library.py,sha256=zdADWa_3qvcFbpb-T4Z0fWzru35qleme-kbDPxla6L8,14544
|
|
5
|
-
MediBot/MediBot_Preprocessor.py,sha256=FTEKiC3MWOR6daASTpYLMBvPhO9dNxKJUvlelSw311o,14909
|
|
6
|
-
MediBot/MediBot_Preprocessor_lib.py,sha256=MPVJ8j_0oYz6S8IbW1e8fLKz5ZrxUofUUOnz76ywC4M,17380
|
|
7
|
-
MediBot/MediBot_UI.py,sha256=4B_56VuqOYnyBtdp2NYIOTGAk4ExG6vP3fD54MHr2ng,10660
|
|
8
|
-
MediBot/MediBot_dataformat_library.py,sha256=PrJyy9yB6k6fsishaVo2Me5WIUuiu_L8h304dbTAIyk,8912
|
|
9
|
-
MediBot/MediBot_docx_decoder.py,sha256=TmbEPR3GWObrh4DxNvDuWCwpVG25158RUAIBWR1L7EA,3049
|
|
10
|
-
MediBot/MediPost.py,sha256=C1hZJFr65rN6F_dckjdBxFC0vL2CoqY9W3YFqU5HXtE,336
|
|
11
|
-
MediBot/PDF_to_CSV_Cleaner.py,sha256=ZZphmq-5K04DkrZNlcwNAIoZPOD_ROWvS3PMkKFxeiM,8799
|
|
12
|
-
MediBot/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
-
MediBot/update_json.py,sha256=eAu3BPYtlGlwVGZdTUmrqq4qLTVcplt-6EnzcGCheG0,1557
|
|
14
|
-
MediBot/update_medicafe.py,sha256=CYxRHNXb-ZwGELWSXJA90foMwac_GBdXhD9hwClUjpA,2249
|
|
15
|
-
MediLink/MediLink.py,sha256=ViKHg_2C-0CQHY3zTr0f3llYQNuoqzMX7HrAkDAtudo,20316
|
|
16
|
-
MediLink/MediLink_277_decoder.py,sha256=Z3hQK2j-YzdXjov6aDlDRc7M_auFBnl3se4OF5q6_04,4358
|
|
17
|
-
MediLink/MediLink_837p_encoder.py,sha256=Y87Une7AWtAvuA_oPnQQnF1KoUOixYR2zX1RzNl-4fE,25526
|
|
18
|
-
MediLink/MediLink_837p_encoder_library.py,sha256=cweRB619kabMQ_-jgAYJoRko2kV4rarJ8nzHxLbMxIg,43572
|
|
19
|
-
MediLink/MediLink_API_v2.py,sha256=P--ud2ENGsqnB8JLQQ_eiEJw8KGSlIO2eQKz0DfXeNo,7670
|
|
20
|
-
MediLink/MediLink_APIs.py,sha256=WTWkaixIxIhckA1zoTCekZ8f26dDO1sqjzz-WB88mQg,6166
|
|
21
|
-
MediLink/MediLink_ConfigLoader.py,sha256=rrZmy1_d8-2qx_G7pCph-zhlQq_6c6jorYl47J0DxYo,3914
|
|
22
|
-
MediLink/MediLink_DataMgmt.py,sha256=u1bCviytZkmo1Z40bcIVvlesbz20oCGphc5LFGh17L0,12235
|
|
23
|
-
MediLink/MediLink_Down.py,sha256=wGe5hP_IFS0w0gN7SrG-250AZWExUkYpJkqXVPWTxSs,7248
|
|
24
|
-
MediLink/MediLink_ERA_decoder.py,sha256=MiOtDcXnmevPfHAahIlTLlUc14VcQWAor9Xa7clA2Ts,8710
|
|
25
|
-
MediLink/MediLink_Gmail.py,sha256=3ift2R_OB4SyUo_0iBwqngFT1XBztoI5lcVhiqh9uXA,6370
|
|
26
|
-
MediLink/MediLink_Mailer.py,sha256=44nIZ-MZvBN2ChPQ5mKHt5KQaMum6o8m5XIETIEcOA8,370
|
|
27
|
-
MediLink/MediLink_Scheduler.py,sha256=I_1EGf89ql0viFkQSxfquPq_pl2zpF9D9T55qp0eE6s,7368
|
|
28
|
-
MediLink/MediLink_StatusCheck.py,sha256=NYDlS7eIuUThpoSWsLfp8dZcYwcSP3Rph1UmjyRBruU,222
|
|
29
|
-
MediLink/MediLink_UI.py,sha256=t-llSAqu3Vmz-fr6h_vJnxeOQP0x4lphfjNLARmzuCw,5181
|
|
30
|
-
MediLink/MediLink_Up.py,sha256=4Bn_mOgfZxl1zbwSwmQeWU5QoWY1eMDmaRxcDBcgTqI,19283
|
|
31
|
-
MediLink/MediLink_batch.bat,sha256=nqL5QwCLyRQFSPdv6kgtcV_cpky7FXSOWVl6OxjRXb4,118
|
|
32
|
-
MediLink/Soumit_api.py,sha256=5JfOecK98ZC6NpZklZW2AkOzkjvrbYxpJpZNH3rFxDw,497
|
|
33
|
-
MediLink/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
34
|
-
MediLink/test.py,sha256=kSvvJRL_3fWuNS3_x4hToOnUljGLoeEw6SUTHQWQRJk,3108
|
|
35
|
-
medicafe-0.240517.0.dist-info/LICENSE,sha256=65lb-vVujdQK7uMH3RRJSMwUW-WMrMEsc5sOaUn2xUk,1096
|
|
36
|
-
medicafe-0.240517.0.dist-info/METADATA,sha256=54P027Cucr2Bjqx9FDmXUIAwaA_2xpImy-HgO6wVb_4,4539
|
|
37
|
-
medicafe-0.240517.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
38
|
-
medicafe-0.240517.0.dist-info/top_level.txt,sha256=3uOwR4q_SP8Gufk2uCHoKngAgbtdOwQC6Qjl7ViBa_c,17
|
|
39
|
-
medicafe-0.240517.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|