medicafe 0.250822.2__py3-none-any.whl → 0.250909.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.
- MediBot/MediBot.py +11 -4
- MediBot/MediBot_Crosswalk_Library.py +16 -3
- MediBot/MediBot_Crosswalk_Utils.py +12 -2
- MediBot/MediBot_Preprocessor_lib.py +1821 -1728
- MediBot/MediBot_docx_decoder.py +14 -3
- MediBot/__init__.py +1 -1
- MediCafe/MediLink_ConfigLoader.py +12 -1
- MediCafe/__init__.py +1 -1
- MediCafe/api_core.py +116 -14
- MediCafe/core_utils.py +9 -4
- MediCafe/deductible_utils.py +1233 -0
- MediLink/MediLink_837p_encoder_library.py +123 -39
- MediLink/MediLink_Deductible.py +569 -555
- MediLink/MediLink_Deductible_Validator.py +9 -3
- MediLink/MediLink_Display_Utils.py +364 -2
- MediLink/MediLink_UI.py +20 -2
- MediLink/__init__.py +1 -1
- {medicafe-0.250822.2.dist-info → medicafe-0.250909.0.dist-info}/METADATA +1 -1
- {medicafe-0.250822.2.dist-info → medicafe-0.250909.0.dist-info}/RECORD +23 -27
- MediCafe/api_core_backup.py +0 -428
- MediLink/insurance_type_integration_test.py +0 -361
- MediLink/test_cob_library.py +0 -436
- MediLink/test_timing.py +0 -59
- MediLink/test_validation.py +0 -127
- {medicafe-0.250822.2.dist-info → medicafe-0.250909.0.dist-info}/LICENSE +0 -0
- {medicafe-0.250822.2.dist-info → medicafe-0.250909.0.dist-info}/WHEEL +0 -0
- {medicafe-0.250822.2.dist-info → medicafe-0.250909.0.dist-info}/entry_points.txt +0 -0
- {medicafe-0.250822.2.dist-info → medicafe-0.250909.0.dist-info}/top_level.txt +0 -0
MediLink/test_cob_library.py
DELETED
@@ -1,436 +0,0 @@
|
|
1
|
-
# test_cob_library.py
|
2
|
-
"""
|
3
|
-
Test file for MediLink_837p_cob_library.py
|
4
|
-
|
5
|
-
This file demonstrates the COB library functionality and provides test cases
|
6
|
-
for various COB scenarios including Medicare secondary claims and 835 integration.
|
7
|
-
"""
|
8
|
-
|
9
|
-
import sys
|
10
|
-
import os
|
11
|
-
from datetime import datetime
|
12
|
-
|
13
|
-
# Add parent directory to path
|
14
|
-
project_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
|
15
|
-
if project_dir not in sys.path:
|
16
|
-
sys.path.append(project_dir)
|
17
|
-
|
18
|
-
# Safe import to avoid circular dependencies
|
19
|
-
try:
|
20
|
-
from MediLink import MediLink_837p_cob_library
|
21
|
-
from MediLink import MediLink_ConfigLoader
|
22
|
-
except ImportError as e:
|
23
|
-
print("Warning: Could not import COB library: {}".format(e))
|
24
|
-
print("This may be due to circular import issues. Testing with mock data.")
|
25
|
-
# Create mock functions for testing
|
26
|
-
class MockCOBLibrary:
|
27
|
-
def process_cob_claim(self, *args, **kwargs):
|
28
|
-
return ["SBR*S*18*******MB~", "AMT*D*150.00~"]
|
29
|
-
|
30
|
-
def extract_835_adjudication_data(self, *args, **kwargs):
|
31
|
-
return {'total_paid': '150.00', 'cas_adjustments': []}
|
32
|
-
|
33
|
-
def validate_cob_configuration(self, *args, **kwargs):
|
34
|
-
return (True, [])
|
35
|
-
|
36
|
-
def validate_cob_claim_integrity(self, *args, **kwargs):
|
37
|
-
return (True, [])
|
38
|
-
|
39
|
-
def determine_medicare_payer_type(self, *args, **kwargs):
|
40
|
-
return "MB"
|
41
|
-
|
42
|
-
MediLink_837p_cob_library = MockCOBLibrary()
|
43
|
-
MediLink_ConfigLoader = type('MockConfigLoader', (), {
|
44
|
-
'log': lambda msg, config=None, level="INFO": print("LOG [{}]: {}".format(level, msg))
|
45
|
-
})()
|
46
|
-
|
47
|
-
def test_medicare_secondary_claim():
|
48
|
-
"""Test Medicare secondary claim processing"""
|
49
|
-
print("Testing Medicare secondary claim processing...")
|
50
|
-
|
51
|
-
# Sample patient data for Medicare secondary claim
|
52
|
-
patient_data = {
|
53
|
-
'claim_type': 'secondary',
|
54
|
-
'payer_id': '00850',
|
55
|
-
'medicare_advantage': False,
|
56
|
-
'primary_paid_amount': '150.00',
|
57
|
-
'cas_adjustments': [
|
58
|
-
{'group': 'CO', 'reason': '45', 'amount': '25.00'},
|
59
|
-
{'group': 'PR', 'reason': '1', 'amount': '10.00'}
|
60
|
-
],
|
61
|
-
'prior_payer_name': 'MEDICARE',
|
62
|
-
'prior_payer_id': '00850',
|
63
|
-
'patient_is_subscriber': True,
|
64
|
-
'requires_attachment': False,
|
65
|
-
'CHART': 'TEST123',
|
66
|
-
'AMOUNT': '200.00',
|
67
|
-
'TOS': '1',
|
68
|
-
'claim_frequency': '1'
|
69
|
-
}
|
70
|
-
|
71
|
-
# Mock configuration
|
72
|
-
config = {
|
73
|
-
'MediLink_Config': {
|
74
|
-
'cob_settings': {
|
75
|
-
'medicare_payer_ids': ['00850'],
|
76
|
-
'cob_mode': 'single_payer_only',
|
77
|
-
'validation_level': 3
|
78
|
-
},
|
79
|
-
'insurance_options': {
|
80
|
-
'MB': 'Medicare Part B',
|
81
|
-
'MA': 'Medicare Advantage'
|
82
|
-
}
|
83
|
-
}
|
84
|
-
}
|
85
|
-
|
86
|
-
crosswalk = {}
|
87
|
-
client = None
|
88
|
-
|
89
|
-
try:
|
90
|
-
# Test COB claim processing
|
91
|
-
cob_segments = MediLink_837p_cob_library.process_cob_claim(
|
92
|
-
patient_data, config, crosswalk, client
|
93
|
-
)
|
94
|
-
|
95
|
-
print("✓ COB segments generated successfully")
|
96
|
-
print("Generated {} segments".format(len(cob_segments)))
|
97
|
-
|
98
|
-
# Validate segments
|
99
|
-
for segment in cob_segments:
|
100
|
-
print(" - {}".format(segment))
|
101
|
-
|
102
|
-
return True
|
103
|
-
|
104
|
-
except Exception as e:
|
105
|
-
print("✗ Error processing COB claim: {}".format(e))
|
106
|
-
return False
|
107
|
-
|
108
|
-
def test_medicare_advantage_claim():
|
109
|
-
"""Test Medicare Advantage claim processing"""
|
110
|
-
print("\nTesting Medicare Advantage claim processing...")
|
111
|
-
|
112
|
-
patient_data = {
|
113
|
-
'claim_type': 'secondary',
|
114
|
-
'payer_id': '00850',
|
115
|
-
'medicare_advantage': True,
|
116
|
-
'primary_paid_amount': '200.00',
|
117
|
-
'cas_adjustments': [
|
118
|
-
{'group': 'CO', 'reason': '45', 'amount': '30.00'}
|
119
|
-
],
|
120
|
-
'prior_payer_name': 'MEDICARE ADVANTAGE',
|
121
|
-
'prior_payer_id': '00850',
|
122
|
-
'patient_is_subscriber': True,
|
123
|
-
'requires_attachment': False,
|
124
|
-
'CHART': 'TEST456',
|
125
|
-
'AMOUNT': '250.00',
|
126
|
-
'TOS': '1',
|
127
|
-
'claim_frequency': '1'
|
128
|
-
}
|
129
|
-
|
130
|
-
config = {
|
131
|
-
'MediLink_Config': {
|
132
|
-
'cob_settings': {
|
133
|
-
'medicare_payer_ids': ['00850'],
|
134
|
-
'cob_mode': 'single_payer_only',
|
135
|
-
'validation_level': 3
|
136
|
-
}
|
137
|
-
}
|
138
|
-
}
|
139
|
-
|
140
|
-
crosswalk = {}
|
141
|
-
client = None
|
142
|
-
|
143
|
-
try:
|
144
|
-
cob_segments = MediLink_837p_cob_library.process_cob_claim(
|
145
|
-
patient_data, config, crosswalk, client
|
146
|
-
)
|
147
|
-
|
148
|
-
print("✓ Medicare Advantage COB segments generated successfully")
|
149
|
-
print("Generated {} segments".format(len(cob_segments)))
|
150
|
-
|
151
|
-
return True
|
152
|
-
|
153
|
-
except Exception as e:
|
154
|
-
print("✗ Error processing Medicare Advantage claim: {}".format(e))
|
155
|
-
return False
|
156
|
-
|
157
|
-
def test_service_level_adjudication():
|
158
|
-
"""Test service-level adjudication with 835 data"""
|
159
|
-
print("\nTesting service-level adjudication...")
|
160
|
-
|
161
|
-
patient_data = {
|
162
|
-
'claim_type': 'secondary',
|
163
|
-
'payer_id': '00850',
|
164
|
-
'medicare_advantage': False,
|
165
|
-
'primary_paid_amount': '300.00',
|
166
|
-
'service_adjudications': [
|
167
|
-
{
|
168
|
-
'payer_id': '00850',
|
169
|
-
'paid_amount': '150.00',
|
170
|
-
'revenue_code': '0001',
|
171
|
-
'units': '1',
|
172
|
-
'adjudication_date': '01-15-2024',
|
173
|
-
'adjustments': [
|
174
|
-
{'group': 'CO', 'reason': '45', 'amount': '25.00'}
|
175
|
-
]
|
176
|
-
},
|
177
|
-
{
|
178
|
-
'payer_id': '00850',
|
179
|
-
'paid_amount': '150.00',
|
180
|
-
'revenue_code': '0002',
|
181
|
-
'units': '1',
|
182
|
-
'adjudication_date': '01-15-2024',
|
183
|
-
'adjustments': []
|
184
|
-
}
|
185
|
-
],
|
186
|
-
'prior_payer_name': 'MEDICARE',
|
187
|
-
'prior_payer_id': '00850',
|
188
|
-
'patient_is_subscriber': True,
|
189
|
-
'requires_attachment': False,
|
190
|
-
'CHART': 'TEST789',
|
191
|
-
'AMOUNT': '400.00',
|
192
|
-
'TOS': '1',
|
193
|
-
'claim_frequency': '1'
|
194
|
-
}
|
195
|
-
|
196
|
-
config = {
|
197
|
-
'MediLink_Config': {
|
198
|
-
'cob_settings': {
|
199
|
-
'medicare_payer_ids': ['00850'],
|
200
|
-
'cob_mode': 'single_payer_only',
|
201
|
-
'validation_level': 3
|
202
|
-
}
|
203
|
-
}
|
204
|
-
}
|
205
|
-
|
206
|
-
crosswalk = {}
|
207
|
-
client = None
|
208
|
-
|
209
|
-
try:
|
210
|
-
cob_segments = MediLink_837p_cob_library.process_cob_claim(
|
211
|
-
patient_data, config, crosswalk, client
|
212
|
-
)
|
213
|
-
|
214
|
-
print("✓ Service-level adjudication segments generated successfully")
|
215
|
-
print("Generated {} segments".format(len(cob_segments)))
|
216
|
-
|
217
|
-
return True
|
218
|
-
|
219
|
-
except Exception as e:
|
220
|
-
print("✗ Error processing service-level adjudication: {}".format(e))
|
221
|
-
return False
|
222
|
-
|
223
|
-
def test_835_integration():
|
224
|
-
"""Test 835 data integration"""
|
225
|
-
print("\nTesting 835 data integration...")
|
226
|
-
|
227
|
-
patient_data = {
|
228
|
-
'claim_type': 'secondary',
|
229
|
-
'payer_id': '00850',
|
230
|
-
'medicare_advantage': False,
|
231
|
-
'clp02_amount': '250.00',
|
232
|
-
'cas_segments': [
|
233
|
-
{'group': 'CO', 'reason': '45', 'amount': '25.00'},
|
234
|
-
{'group': 'PR', 'reason': '1', 'amount': '15.00'}
|
235
|
-
],
|
236
|
-
'svc_segments': [
|
237
|
-
{
|
238
|
-
'payer_id': '00850',
|
239
|
-
'paid_amount': '125.00',
|
240
|
-
'revenue_code': '0001',
|
241
|
-
'units': '1',
|
242
|
-
'adjudication_date': '01-15-2024',
|
243
|
-
'adjustments': []
|
244
|
-
},
|
245
|
-
{
|
246
|
-
'payer_id': '00850',
|
247
|
-
'paid_amount': '125.00',
|
248
|
-
'revenue_code': '0002',
|
249
|
-
'units': '1',
|
250
|
-
'adjudication_date': '01-15-2024',
|
251
|
-
'adjustments': []
|
252
|
-
}
|
253
|
-
],
|
254
|
-
'prior_payer_name': 'MEDICARE',
|
255
|
-
'prior_payer_id': '00850',
|
256
|
-
'patient_is_subscriber': True,
|
257
|
-
'requires_attachment': False,
|
258
|
-
'CHART': 'TEST835',
|
259
|
-
'AMOUNT': '300.00',
|
260
|
-
'TOS': '1',
|
261
|
-
'claim_frequency': '1'
|
262
|
-
}
|
263
|
-
|
264
|
-
config = {
|
265
|
-
'MediLink_Config': {
|
266
|
-
'cob_settings': {
|
267
|
-
'medicare_payer_ids': ['00850'],
|
268
|
-
'cob_mode': 'single_payer_only',
|
269
|
-
'validation_level': 3
|
270
|
-
}
|
271
|
-
}
|
272
|
-
}
|
273
|
-
|
274
|
-
crosswalk = {}
|
275
|
-
client = None
|
276
|
-
|
277
|
-
try:
|
278
|
-
# Test 835 data extraction
|
279
|
-
adjudication_data = MediLink_837p_cob_library.extract_835_adjudication_data(
|
280
|
-
patient_data, config
|
281
|
-
)
|
282
|
-
|
283
|
-
if adjudication_data:
|
284
|
-
print("✓ 835 data extraction successful")
|
285
|
-
print("Total paid: {}".format(adjudication_data.get('total_paid')))
|
286
|
-
print("CAS adjustments: {}".format(len(adjudication_data.get('cas_adjustments', []))))
|
287
|
-
print("Service adjudications: {}".format(len(adjudication_data.get('service_paid_amounts', []))))
|
288
|
-
else:
|
289
|
-
print("✗ 835 data extraction failed")
|
290
|
-
return False
|
291
|
-
|
292
|
-
# Test COB processing with 835 data
|
293
|
-
cob_segments = MediLink_837p_cob_library.process_cob_claim(
|
294
|
-
patient_data, config, crosswalk, client
|
295
|
-
)
|
296
|
-
|
297
|
-
print("✓ 835-integrated COB segments generated successfully")
|
298
|
-
print("Generated {} segments".format(len(cob_segments)))
|
299
|
-
|
300
|
-
return True
|
301
|
-
|
302
|
-
except Exception as e:
|
303
|
-
print("✗ Error processing 835 integration: {}".format(e))
|
304
|
-
return False
|
305
|
-
|
306
|
-
def test_validation():
|
307
|
-
"""Test COB validation functionality"""
|
308
|
-
print("\nTesting COB validation...")
|
309
|
-
|
310
|
-
# Test configuration validation
|
311
|
-
config = {
|
312
|
-
'MediLink_Config': {
|
313
|
-
'cob_settings': {
|
314
|
-
'medicare_payer_ids': ['00850'],
|
315
|
-
'cob_mode': 'single_payer_only',
|
316
|
-
'validation_level': 3
|
317
|
-
}
|
318
|
-
}
|
319
|
-
}
|
320
|
-
|
321
|
-
is_valid, errors = MediLink_837p_cob_library.validate_cob_configuration(config)
|
322
|
-
|
323
|
-
if is_valid:
|
324
|
-
print("✓ COB configuration validation passed")
|
325
|
-
else:
|
326
|
-
print("✗ COB configuration validation failed: {}".format(errors))
|
327
|
-
return False
|
328
|
-
|
329
|
-
# Test claim integrity validation
|
330
|
-
patient_data = {
|
331
|
-
'claim_type': 'secondary',
|
332
|
-
'payer_id': '00850',
|
333
|
-
'medicare_advantage': False,
|
334
|
-
'primary_paid_amount': '200.00',
|
335
|
-
'service_adjudications': [
|
336
|
-
{'paid_amount': '100.00'},
|
337
|
-
{'paid_amount': '100.00'}
|
338
|
-
],
|
339
|
-
'prior_payer_name': 'MEDICARE',
|
340
|
-
'prior_payer_id': '00850',
|
341
|
-
'claim_frequency': '1'
|
342
|
-
}
|
343
|
-
|
344
|
-
is_valid, errors = MediLink_837p_cob_library.validate_cob_claim_integrity(
|
345
|
-
patient_data, config
|
346
|
-
)
|
347
|
-
|
348
|
-
if is_valid:
|
349
|
-
print("✓ COB claim integrity validation passed")
|
350
|
-
else:
|
351
|
-
print("✗ COB claim integrity validation failed: {}".format(errors))
|
352
|
-
return False
|
353
|
-
|
354
|
-
return True
|
355
|
-
|
356
|
-
def test_medicare_payer_type_determination():
|
357
|
-
"""Test Medicare payer type determination"""
|
358
|
-
print("\nTesting Medicare payer type determination...")
|
359
|
-
|
360
|
-
config = {
|
361
|
-
'MediLink_Config': {
|
362
|
-
'cob_settings': {
|
363
|
-
'medicare_payer_ids': ['00850']
|
364
|
-
}
|
365
|
-
}
|
366
|
-
}
|
367
|
-
|
368
|
-
# Test Medicare Part B
|
369
|
-
patient_data = {
|
370
|
-
'payer_id': '00850',
|
371
|
-
'medicare_advantage': False
|
372
|
-
}
|
373
|
-
|
374
|
-
payer_type = MediLink_837p_cob_library.determine_medicare_payer_type(patient_data, config)
|
375
|
-
if payer_type == 'MB':
|
376
|
-
print("✓ Medicare Part B determination correct")
|
377
|
-
else:
|
378
|
-
print("✗ Medicare Part B determination failed: got {}".format(payer_type))
|
379
|
-
return False
|
380
|
-
|
381
|
-
# Test Medicare Advantage
|
382
|
-
patient_data['medicare_advantage'] = True
|
383
|
-
payer_type = MediLink_837p_cob_library.determine_medicare_payer_type(patient_data, config)
|
384
|
-
if payer_type == 'MA':
|
385
|
-
print("✓ Medicare Advantage determination correct")
|
386
|
-
else:
|
387
|
-
print("✗ Medicare Advantage determination failed: got {}".format(payer_type))
|
388
|
-
return False
|
389
|
-
|
390
|
-
# Test non-Medicare
|
391
|
-
patient_data['payer_id'] = '12345'
|
392
|
-
payer_type = MediLink_837p_cob_library.determine_medicare_payer_type(patient_data, config)
|
393
|
-
if payer_type is None:
|
394
|
-
print("✓ Non-Medicare determination correct")
|
395
|
-
else:
|
396
|
-
print("✗ Non-Medicare determination failed: got {}".format(payer_type))
|
397
|
-
return False
|
398
|
-
|
399
|
-
return True
|
400
|
-
|
401
|
-
def main():
|
402
|
-
"""Run all COB library tests"""
|
403
|
-
print("MediLink COB Library Test Suite")
|
404
|
-
print("=" * 40)
|
405
|
-
|
406
|
-
tests = [
|
407
|
-
test_medicare_secondary_claim,
|
408
|
-
test_medicare_advantage_claim,
|
409
|
-
test_service_level_adjudication,
|
410
|
-
test_835_integration,
|
411
|
-
test_validation,
|
412
|
-
test_medicare_payer_type_determination
|
413
|
-
]
|
414
|
-
|
415
|
-
passed = 0
|
416
|
-
total = len(tests)
|
417
|
-
|
418
|
-
for test in tests:
|
419
|
-
try:
|
420
|
-
if test():
|
421
|
-
passed += 1
|
422
|
-
except Exception as e:
|
423
|
-
print("✗ Test {} failed with exception: {}".format(test.__name__, e))
|
424
|
-
|
425
|
-
print("\n" + "=" * 40)
|
426
|
-
print("Test Results: {}/{} tests passed".format(passed, total))
|
427
|
-
|
428
|
-
if passed == total:
|
429
|
-
print("✓ All tests passed!")
|
430
|
-
return True
|
431
|
-
else:
|
432
|
-
print("✗ Some tests failed")
|
433
|
-
return False
|
434
|
-
|
435
|
-
if __name__ == "__main__":
|
436
|
-
main()
|
MediLink/test_timing.py
DELETED
@@ -1,59 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python
|
2
|
-
# test_timing.py - Test script to run MediLink with timing traces
|
3
|
-
|
4
|
-
import sys
|
5
|
-
import os
|
6
|
-
import time
|
7
|
-
|
8
|
-
# Add the parent directory to the path so we can import MediLink modules
|
9
|
-
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
10
|
-
|
11
|
-
def test_medilink_timing():
|
12
|
-
"""
|
13
|
-
Test function to run MediLink with timing traces and identify bottlenecks.
|
14
|
-
"""
|
15
|
-
print("=" * 60)
|
16
|
-
print("MEDILINK TIMING ANALYSIS")
|
17
|
-
print("=" * 60)
|
18
|
-
print("This test will run MediLink with comprehensive timing traces")
|
19
|
-
print("to identify what's causing the slow startup.")
|
20
|
-
print("=" * 60)
|
21
|
-
|
22
|
-
try:
|
23
|
-
# Import and run the main menu
|
24
|
-
from MediLink.MediLink_main import main_menu
|
25
|
-
|
26
|
-
print("\nStarting MediLink timing test...")
|
27
|
-
start_time = time.time()
|
28
|
-
|
29
|
-
# Load configuration to test the caching
|
30
|
-
from MediCafe.MediLink_ConfigLoader import load_configuration
|
31
|
-
config, crosswalk = load_configuration()
|
32
|
-
print("Initial configuration load completed")
|
33
|
-
|
34
|
-
# Test the caching by loading again
|
35
|
-
config2, crosswalk2 = load_configuration()
|
36
|
-
print("Cached configuration load completed")
|
37
|
-
|
38
|
-
# Test file detection with cached config
|
39
|
-
from MediLink.MediLink_DataMgmt import detect_new_files
|
40
|
-
directory_path = config['MediLink_Config']['inputFilePath']
|
41
|
-
files, flagged = detect_new_files(directory_path)
|
42
|
-
print("File detection with cached config completed")
|
43
|
-
|
44
|
-
end_time = time.time()
|
45
|
-
print("\n" + "=" * 60)
|
46
|
-
print("TIMING TEST COMPLETED")
|
47
|
-
print("=" * 60)
|
48
|
-
print("Total execution time: {:.2f} seconds".format(end_time - start_time))
|
49
|
-
print("Configuration caching is working!")
|
50
|
-
|
51
|
-
except KeyboardInterrupt:
|
52
|
-
print("\nTest interrupted by user.")
|
53
|
-
except Exception as e:
|
54
|
-
print("\nError during timing test: {}".format(e))
|
55
|
-
import traceback
|
56
|
-
traceback.print_exc()
|
57
|
-
|
58
|
-
if __name__ == "__main__":
|
59
|
-
test_medilink_timing()
|
MediLink/test_validation.py
DELETED
@@ -1,127 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
Test script to demonstrate the validation system
|
3
|
-
"""
|
4
|
-
|
5
|
-
import os
|
6
|
-
import sys
|
7
|
-
import json
|
8
|
-
|
9
|
-
# Add the current directory to the path
|
10
|
-
sys.path.append(os.path.dirname(__file__))
|
11
|
-
|
12
|
-
try:
|
13
|
-
from MediLink_Deductible_Validator import run_validation_comparison
|
14
|
-
except ImportError:
|
15
|
-
print("Could not import MediLink_Deductible_Validator")
|
16
|
-
sys.exit(1)
|
17
|
-
|
18
|
-
def create_sample_responses():
|
19
|
-
"""Create sample legacy and Super Connector responses for testing"""
|
20
|
-
|
21
|
-
# Sample legacy API response
|
22
|
-
legacy_response = {
|
23
|
-
"memberPolicies": [
|
24
|
-
{
|
25
|
-
"policyInfo": {
|
26
|
-
"coverageType": "Medical",
|
27
|
-
"policyStatus": "Active"
|
28
|
-
},
|
29
|
-
"patientInfo": [
|
30
|
-
{
|
31
|
-
"lastName": "Smith",
|
32
|
-
"firstName": "John",
|
33
|
-
"middleName": "A"
|
34
|
-
}
|
35
|
-
],
|
36
|
-
"insuranceInfo": {
|
37
|
-
"insuranceType": "PPO",
|
38
|
-
"insuranceTypeCode": "PPO",
|
39
|
-
"memberId": "123456789",
|
40
|
-
"payerId": "87726"
|
41
|
-
},
|
42
|
-
"deductibleInfo": {
|
43
|
-
"individual": {
|
44
|
-
"inNetwork": {
|
45
|
-
"remainingAmount": "500.00"
|
46
|
-
}
|
47
|
-
}
|
48
|
-
}
|
49
|
-
}
|
50
|
-
]
|
51
|
-
}
|
52
|
-
|
53
|
-
# Sample Super Connector API response (with some values in different locations)
|
54
|
-
super_connector_response = {
|
55
|
-
"lastName": "Smith",
|
56
|
-
"firstName": "John",
|
57
|
-
"middleName": "A",
|
58
|
-
"policyStatus": "Active",
|
59
|
-
"planTypeDescription": "PPO",
|
60
|
-
"productServiceCode": "PPO",
|
61
|
-
"subscriberId": "123456789",
|
62
|
-
"payerId": "87726",
|
63
|
-
"metYearToDateAmount": "500.00",
|
64
|
-
"rawGraphQLResponse": {
|
65
|
-
"data": {
|
66
|
-
"checkEligibility": {
|
67
|
-
"eligibility": [
|
68
|
-
{
|
69
|
-
"serviceLevels": [
|
70
|
-
{
|
71
|
-
"individual": [
|
72
|
-
{
|
73
|
-
"services": [
|
74
|
-
{
|
75
|
-
"service": "deductible",
|
76
|
-
"remainingAmount": "500.00"
|
77
|
-
}
|
78
|
-
]
|
79
|
-
}
|
80
|
-
]
|
81
|
-
}
|
82
|
-
]
|
83
|
-
}
|
84
|
-
]
|
85
|
-
}
|
86
|
-
}
|
87
|
-
}
|
88
|
-
}
|
89
|
-
|
90
|
-
return legacy_response, super_connector_response
|
91
|
-
|
92
|
-
def main():
|
93
|
-
"""Test the validation system"""
|
94
|
-
print("Testing MediLink Deductible Validation System")
|
95
|
-
print("=" * 50)
|
96
|
-
|
97
|
-
# Create sample responses
|
98
|
-
legacy_response, super_connector_response = create_sample_responses()
|
99
|
-
|
100
|
-
# Create output file path
|
101
|
-
output_file_path = os.path.join(os.getenv('TEMP', '.'), 'test_validation_report.txt')
|
102
|
-
|
103
|
-
# Run validation
|
104
|
-
print("Running validation comparison...")
|
105
|
-
validation_report = run_validation_comparison(
|
106
|
-
legacy_response,
|
107
|
-
super_connector_response,
|
108
|
-
output_file_path
|
109
|
-
)
|
110
|
-
|
111
|
-
print("Validation completed!")
|
112
|
-
print("Report saved to: {}".format(output_file_path))
|
113
|
-
|
114
|
-
# Print summary
|
115
|
-
print("\nSummary:")
|
116
|
-
print("Total legacy values: {}".format(len(validation_report['legacy_values'])))
|
117
|
-
print("Found in Super Connector: {}".format(len(validation_report['found_values'])))
|
118
|
-
print("Missing from Super Connector: {}".format(len(validation_report['missing_values'])))
|
119
|
-
|
120
|
-
# Open the report
|
121
|
-
try:
|
122
|
-
os.system('notepad.exe "{}"'.format(output_file_path))
|
123
|
-
except:
|
124
|
-
print("Could not open report in Notepad")
|
125
|
-
|
126
|
-
if __name__ == "__main__":
|
127
|
-
main()
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|