medicafe 0.250722.0__py3-none-any.whl → 0.250723.1__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.py +82 -2
- MediBot/MediBot_Crosswalk_Library.py +53 -21
- MediBot/MediBot_Preprocessor_lib.py +795 -779
- MediBot/MediBot_UI.py +43 -9
- MediLink/MediLink_API_v3.py +3 -0
- MediLink/MediLink_ClaimStatus.py +231 -118
- MediLink/MediLink_Deductible.py +120 -70
- {medicafe-0.250722.0.dist-info → medicafe-0.250723.1.dist-info}/METADATA +1 -1
- {medicafe-0.250722.0.dist-info → medicafe-0.250723.1.dist-info}/RECORD +12 -12
- {medicafe-0.250722.0.dist-info → medicafe-0.250723.1.dist-info}/LICENSE +0 -0
- {medicafe-0.250722.0.dist-info → medicafe-0.250723.1.dist-info}/WHEEL +0 -0
- {medicafe-0.250722.0.dist-info → medicafe-0.250723.1.dist-info}/top_level.txt +0 -0
MediLink/MediLink_Deductible.py
CHANGED
|
@@ -157,7 +157,9 @@ def manual_deductible_lookup():
|
|
|
157
157
|
for i, payer_id in enumerate(payer_ids, 1):
|
|
158
158
|
print("Checking Payer ID {} ({}/{}): {}".format(payer_id, i, len(payer_ids), payer_id))
|
|
159
159
|
|
|
160
|
-
|
|
160
|
+
# Use the current mode setting for validation
|
|
161
|
+
run_validation = DEBUG_MODE
|
|
162
|
+
eligibility_data = get_eligibility_info(client, payer_id, provider_last_name, formatted_dob, member_id, npi, run_validation=run_validation)
|
|
161
163
|
if eligibility_data:
|
|
162
164
|
found_data = True
|
|
163
165
|
# Generate unique output file for manual request
|
|
@@ -201,66 +203,77 @@ def get_eligibility_info(client, payer_id, provider_last_name, date_of_birth, me
|
|
|
201
203
|
MediLink_ConfigLoader.log("member_id: {}".format(member_id), level="DEBUG")
|
|
202
204
|
MediLink_ConfigLoader.log("npi: {}".format(npi), level="DEBUG")
|
|
203
205
|
|
|
204
|
-
#
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
)
|
|
213
|
-
|
|
214
|
-
# Also get Super Connector response for comparison
|
|
215
|
-
MediLink_ConfigLoader.log("Getting new get_eligibility_super_connector API response", level="INFO")
|
|
216
|
-
super_connector_eligibility = None
|
|
217
|
-
try:
|
|
218
|
-
super_connector_eligibility = MediLink_API_v3.get_eligibility_super_connector(
|
|
206
|
+
# Check if we're in legacy mode (no validation) or debug mode (with validation)
|
|
207
|
+
if run_validation:
|
|
208
|
+
# Debug mode: Call both APIs and run validation
|
|
209
|
+
MediLink_ConfigLoader.log("Running in DEBUG MODE - calling both APIs", level="INFO")
|
|
210
|
+
|
|
211
|
+
# Get legacy response
|
|
212
|
+
MediLink_ConfigLoader.log("Getting legacy get_eligibility_v3 API response", level="INFO")
|
|
213
|
+
legacy_eligibility = MediLink_API_v3.get_eligibility_v3(
|
|
219
214
|
client, payer_id, provider_last_name, 'MemberIDDateOfBirth', date_of_birth, member_id, npi
|
|
220
215
|
)
|
|
221
|
-
except Exception as e:
|
|
222
|
-
MediLink_ConfigLoader.log("Super Connector API failed: {}".format(e), level="ERROR")
|
|
223
|
-
|
|
224
|
-
# Run validation if requested and we have both responses
|
|
225
|
-
if run_validation and legacy_eligibility and super_connector_eligibility:
|
|
226
|
-
validation_file_path = os.path.join(os.getenv('TEMP'), 'validation_report_{}_{}.txt'.format(member_id, date_of_birth))
|
|
227
|
-
validation_report = MediLink_Deductible_Validator.run_validation_comparison(
|
|
228
|
-
legacy_eligibility, super_connector_eligibility, validation_file_path
|
|
229
|
-
)
|
|
230
|
-
print("\nValidation report generated: {}".format(validation_file_path))
|
|
231
216
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
print(" Error {}: {} - {}".format(i+1, error_code, error_desc))
|
|
242
|
-
|
|
243
|
-
# Check for data in error extensions (some APIs return data here)
|
|
244
|
-
extensions = error.get('extensions', {})
|
|
245
|
-
if extensions and 'details' in extensions:
|
|
246
|
-
details = extensions.get('details', [])
|
|
247
|
-
if details:
|
|
248
|
-
print(" Found {} detail records in error extensions".format(len(details)))
|
|
249
|
-
# Log first detail record for debugging
|
|
250
|
-
if details:
|
|
251
|
-
first_detail = details[0]
|
|
252
|
-
print(" First detail: {}".format(first_detail))
|
|
217
|
+
# Get Super Connector response for comparison
|
|
218
|
+
MediLink_ConfigLoader.log("Getting new get_eligibility_super_connector API response", level="INFO")
|
|
219
|
+
super_connector_eligibility = None
|
|
220
|
+
try:
|
|
221
|
+
super_connector_eligibility = MediLink_API_v3.get_eligibility_super_connector(
|
|
222
|
+
client, payer_id, provider_last_name, 'MemberIDDateOfBirth', date_of_birth, member_id, npi
|
|
223
|
+
)
|
|
224
|
+
except Exception as e:
|
|
225
|
+
MediLink_ConfigLoader.log("Super Connector API failed: {}".format(e), level="ERROR")
|
|
253
226
|
|
|
254
|
-
#
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
227
|
+
# Run validation if we have both responses
|
|
228
|
+
if legacy_eligibility and super_connector_eligibility:
|
|
229
|
+
validation_file_path = os.path.join(os.getenv('TEMP'), 'validation_report_{}_{}.txt'.format(member_id, date_of_birth))
|
|
230
|
+
validation_report = MediLink_Deductible_Validator.run_validation_comparison(
|
|
231
|
+
legacy_eligibility, super_connector_eligibility, validation_file_path
|
|
232
|
+
)
|
|
233
|
+
print("\nValidation report generated: {}".format(validation_file_path))
|
|
234
|
+
|
|
235
|
+
# Log any Super Connector API errors
|
|
236
|
+
if "rawGraphQLResponse" in super_connector_eligibility:
|
|
237
|
+
raw_response = super_connector_eligibility.get('rawGraphQLResponse', {})
|
|
238
|
+
errors = raw_response.get('errors', [])
|
|
239
|
+
if errors:
|
|
240
|
+
print("Super Connector API returned {} error(s):".format(len(errors)))
|
|
241
|
+
for i, error in enumerate(errors):
|
|
242
|
+
error_code = error.get('code', 'UNKNOWN')
|
|
243
|
+
error_desc = error.get('description', 'No description')
|
|
244
|
+
print(" Error {}: {} - {}".format(i+1, error_code, error_desc))
|
|
245
|
+
|
|
246
|
+
# Check for data in error extensions (some APIs return data here)
|
|
247
|
+
extensions = error.get('extensions', {})
|
|
248
|
+
if extensions and 'details' in extensions:
|
|
249
|
+
details = extensions.get('details', [])
|
|
250
|
+
if details:
|
|
251
|
+
print(" Found {} detail records in error extensions".format(len(details)))
|
|
252
|
+
# Log first detail record for debugging
|
|
253
|
+
if details:
|
|
254
|
+
first_detail = details[0]
|
|
255
|
+
print(" First detail: {}".format(first_detail))
|
|
256
|
+
|
|
257
|
+
# Check status code
|
|
258
|
+
status_code = super_connector_eligibility.get('statuscode')
|
|
259
|
+
if status_code and status_code != '200':
|
|
260
|
+
print("Super Connector API status code: {} (non-200 indicates errors)".format(status_code))
|
|
261
|
+
|
|
262
|
+
# Open validation report in Notepad
|
|
263
|
+
os.system('notepad.exe "{}"'.format(validation_file_path))
|
|
258
264
|
|
|
259
|
-
#
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
265
|
+
# Return legacy response for consistency
|
|
266
|
+
eligibility = legacy_eligibility
|
|
267
|
+
|
|
268
|
+
else:
|
|
269
|
+
# Legacy mode: Only call legacy API
|
|
270
|
+
MediLink_ConfigLoader.log("Running in LEGACY MODE - calling legacy API only", level="INFO")
|
|
271
|
+
|
|
272
|
+
# Only get legacy response
|
|
273
|
+
MediLink_ConfigLoader.log("Getting legacy get_eligibility_v3 API response", level="INFO")
|
|
274
|
+
eligibility = MediLink_API_v3.get_eligibility_v3(
|
|
275
|
+
client, payer_id, provider_last_name, 'MemberIDDateOfBirth', date_of_birth, member_id, npi
|
|
276
|
+
)
|
|
264
277
|
|
|
265
278
|
# Log the response
|
|
266
279
|
MediLink_ConfigLoader.log("Eligibility response: {}".format(json.dumps(eligibility, indent=4)), level="DEBUG")
|
|
@@ -630,19 +643,54 @@ def display_eligibility_info(data, dob, member_id, output_file):
|
|
|
630
643
|
MediLink_ConfigLoader.log("Unknown response format in display_eligibility_info", level="WARNING")
|
|
631
644
|
MediLink_ConfigLoader.log("Response structure: {}".format(json.dumps(data, indent=2)), level="DEBUG")
|
|
632
645
|
|
|
646
|
+
# Global mode flags (will be set in main)
|
|
647
|
+
LEGACY_MODE = False
|
|
648
|
+
DEBUG_MODE = False
|
|
649
|
+
|
|
633
650
|
# Main Execution Flow
|
|
634
651
|
if __name__ == "__main__":
|
|
635
652
|
print("\n" + "=" * 80)
|
|
636
653
|
print("MEDILINK DEDUCTIBLE LOOKUP TOOL")
|
|
637
654
|
print("=" * 80)
|
|
638
|
-
print("This tool provides manual and batch eligibility lookups
|
|
639
|
-
print("Validation reports compare legacy vs Super Connector API responses.")
|
|
655
|
+
print("This tool provides manual and batch eligibility lookups.")
|
|
640
656
|
print("=" * 80)
|
|
641
657
|
|
|
658
|
+
# User input switch for mode selection
|
|
659
|
+
print("\nSelect operation mode:")
|
|
660
|
+
print("1. Legacy Mode (Default) - Single API calls, consolidated output")
|
|
661
|
+
print("2. Debug Mode - Dual API calls with validation reports")
|
|
662
|
+
print("3. Exit")
|
|
663
|
+
|
|
664
|
+
mode_choice = input("\nEnter your choice (1-3) [Default: 1]: ").strip()
|
|
665
|
+
if not mode_choice:
|
|
666
|
+
mode_choice = "1"
|
|
667
|
+
|
|
668
|
+
if mode_choice == "3":
|
|
669
|
+
print("\nExiting. Thank you for using MediLink Deductible Tool!")
|
|
670
|
+
sys.exit(0)
|
|
671
|
+
elif mode_choice not in ["1", "2"]:
|
|
672
|
+
print("Invalid choice. Using Legacy Mode (Default).")
|
|
673
|
+
mode_choice = "1"
|
|
674
|
+
|
|
675
|
+
# Set mode flags
|
|
676
|
+
LEGACY_MODE = (mode_choice == "1")
|
|
677
|
+
DEBUG_MODE = (mode_choice == "2")
|
|
678
|
+
|
|
679
|
+
if LEGACY_MODE:
|
|
680
|
+
print("\nRunning in LEGACY MODE")
|
|
681
|
+
print("- Single API calls (Legacy API only)")
|
|
682
|
+
print("- Progressive output during processing")
|
|
683
|
+
print("- Consolidated output file at the end")
|
|
684
|
+
else:
|
|
685
|
+
print("\nRunning in DEBUG MODE")
|
|
686
|
+
print("- Dual API calls (Legacy + Super Connector)")
|
|
687
|
+
print("- Validation reports and comparisons")
|
|
688
|
+
print("- Detailed logging and error reporting")
|
|
689
|
+
|
|
642
690
|
while True:
|
|
643
691
|
print("\nChoose an option:")
|
|
644
|
-
print("1. Manual Patient Lookup
|
|
645
|
-
print("2. Batch CSV Processing
|
|
692
|
+
print("1. Manual Patient Lookup")
|
|
693
|
+
print("2. Batch CSV Processing")
|
|
646
694
|
print("3. Exit")
|
|
647
695
|
|
|
648
696
|
choice = input("\nEnter your choice (1-3): ").strip()
|
|
@@ -696,8 +744,9 @@ if __name__ == "__main__":
|
|
|
696
744
|
print("Processing patient {}/{}: Member ID {}, DOB {}".format(
|
|
697
745
|
processed_count, total_patients, member_id, dob))
|
|
698
746
|
|
|
699
|
-
# Run with validation enabled
|
|
700
|
-
|
|
747
|
+
# Run with validation enabled only in debug mode
|
|
748
|
+
run_validation = DEBUG_MODE
|
|
749
|
+
eligibility_data = get_eligibility_info(client, payer_id, provider_last_name, dob, member_id, npi, run_validation=run_validation)
|
|
701
750
|
if eligibility_data is not None:
|
|
702
751
|
display_eligibility_info(eligibility_data, dob, member_id, output_file) # Display as we get the result
|
|
703
752
|
processed_patients.add((dob, member_id)) # Mark this patient as processed
|
|
@@ -719,14 +768,15 @@ if __name__ == "__main__":
|
|
|
719
768
|
if open_report in ['y', 'yes']:
|
|
720
769
|
os.system('notepad.exe "{}"'.format(output_file_path))
|
|
721
770
|
|
|
722
|
-
# Print summary of validation reports
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
771
|
+
# Print summary of validation reports only in debug mode
|
|
772
|
+
if DEBUG_MODE:
|
|
773
|
+
print("\n" + "=" * 80)
|
|
774
|
+
print("VALIDATION SUMMARY")
|
|
775
|
+
print("=" * 80)
|
|
776
|
+
print("Validation reports have been generated for each patient processed.")
|
|
777
|
+
print("Each report compares the legacy API response with the Super Connector API response.")
|
|
778
|
+
print("Check the TEMP directory for validation_report_*.txt files.")
|
|
779
|
+
print("=" * 80)
|
|
730
780
|
|
|
731
781
|
# Ask if user wants to continue
|
|
732
782
|
continue_choice = input("\nDo you want to perform another operation? (Y/N): ").strip().lower()
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
MediBot/MediBot.bat,sha256=anz5i-Td1k3HhRUvkCqHsw9lBLVmO6q9bt5kLTfr1Iw,13282
|
|
2
|
-
MediBot/MediBot.py,sha256
|
|
2
|
+
MediBot/MediBot.py,sha256=-7_Jk1qHruYxorWKcIFXvIopu1CRCF1c3JOj5cIXASk,24059
|
|
3
3
|
MediBot/MediBot_Charges.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
MediBot/MediBot_Crosswalk_Library.py,sha256=
|
|
4
|
+
MediBot/MediBot_Crosswalk_Library.py,sha256=Ix4QlAcg3O9Y6n6ZeSUtbmtV-_n-t0-jnefXDBFlhhI,51441
|
|
5
5
|
MediBot/MediBot_Post.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
MediBot/MediBot_Preprocessor.py,sha256=Lc9uQnE5SAa0dQTOREdPV1QUB2cywXTHJ1h2w-fyeeQ,13331
|
|
7
|
-
MediBot/MediBot_Preprocessor_lib.py,sha256=
|
|
8
|
-
MediBot/MediBot_UI.py,sha256=
|
|
7
|
+
MediBot/MediBot_Preprocessor_lib.py,sha256=irojPF1oQCt78H1GjJ0hfILUpO12d4rfFjfoViVaBEk,41194
|
|
8
|
+
MediBot/MediBot_UI.py,sha256=BSQ6VBk2t6eWJYD9it2kwdtGaE3Bt2bIdwVy5s0bRd0,12697
|
|
9
9
|
MediBot/MediBot_dataformat_library.py,sha256=JXTV-HWahqeYF_lbNn1UYxqUtZ6ZBeFXHOyRGlDq4xM,8406
|
|
10
10
|
MediBot/MediBot_docx_decoder.py,sha256=z-_oVrSocu4-CenDGDHOkDeqPcKqZqm6Ao9mABgqxJU,23561
|
|
11
11
|
MediBot/MediPost.py,sha256=C1hZJFr65rN6F_dckjdBxFC0vL2CoqY9W3YFqU5HXtE,336
|
|
@@ -21,14 +21,14 @@ MediLink/MediLink_837p_encoder_library.py,sha256=y4cTt8G2yQbMm8oEmccJJTb0yOTeUj8
|
|
|
21
21
|
MediLink/MediLink_837p_utilities.py,sha256=Bi91S1aJbsEOpWXp_IOUgCQ76IPiOJNkOfXXtcirzmI,10416
|
|
22
22
|
MediLink/MediLink_API_Generator.py,sha256=vBZ8moR9tvv7mb200HlZnJrk1y-bQi8E16I2r41vgVM,10345
|
|
23
23
|
MediLink/MediLink_API_v2.py,sha256=mcIgLnXPS_NaUBrkKJ8mxCUaQ0AuQUeU1vG6DoplbVY,7733
|
|
24
|
-
MediLink/MediLink_API_v3.py,sha256=
|
|
24
|
+
MediLink/MediLink_API_v3.py,sha256=SH3nS95qrJDWAvptr7RYT8C4lDFWNPpBfnMs2uFn2Og,40923
|
|
25
25
|
MediLink/MediLink_APIs.py,sha256=jm3f9T034MJKH8A_CIootULoeuk7H8s7PazpFZRCbKI,6222
|
|
26
26
|
MediLink/MediLink_Azure.py,sha256=Ow70jctiHFIylskBExN7WUoRgrKOvBR6jNTnQMk6lJA,210
|
|
27
|
-
MediLink/MediLink_ClaimStatus.py,sha256=
|
|
27
|
+
MediLink/MediLink_ClaimStatus.py,sha256=kXIDidxSGuqTwjFNMQIKms42jqIu5Qmnet-7Ohe8zjE,11645
|
|
28
28
|
MediLink/MediLink_ConfigLoader.py,sha256=u9ecB0SIN7zuJAo8KcoQys95BtyAo-8S2n4mRd0S3XU,4356
|
|
29
29
|
MediLink/MediLink_DataMgmt.py,sha256=MjCF1L-4RkQnz_vBULPB-DVsEtv0X1WHT1o9YjCGQ7s,33280
|
|
30
30
|
MediLink/MediLink_Decoder.py,sha256=Suw9CmUHgoe0ZW8sJP_pIO8URBrhO5FmxFF8RcUj9lI,13318
|
|
31
|
-
MediLink/MediLink_Deductible.py,sha256=
|
|
31
|
+
MediLink/MediLink_Deductible.py,sha256=btFzmW48biiSce8zES_giAGQggPs5foutNG2slk-Pcw,38916
|
|
32
32
|
MediLink/MediLink_Deductible_Validator.py,sha256=2g-lZd-Y5fJ1mfP87vM6oABg0t5Om-7EkEkilVvDWYY,22888
|
|
33
33
|
MediLink/MediLink_Down.py,sha256=hrDODhs-zRfOKCdiRGENN5Czu-AvdtwJj4Q7grcRXME,6518
|
|
34
34
|
MediLink/MediLink_ERA_decoder.py,sha256=MiOtDcXnmevPfHAahIlTLlUc14VcQWAor9Xa7clA2Ts,8710
|
|
@@ -49,8 +49,8 @@ MediLink/test.py,sha256=kSvvJRL_3fWuNS3_x4hToOnUljGLoeEw6SUTHQWQRJk,3108
|
|
|
49
49
|
MediLink/test_cob_library.py,sha256=wUMv0-Y6fNsKcAs8Z9LwfmEBRO7oBzBAfWmmzwoNd1g,13841
|
|
50
50
|
MediLink/test_validation.py,sha256=FJrfdUFK--xRScIzrHCg1JeGdm0uJEoRnq6CgkP2lwM,4154
|
|
51
51
|
MediLink/webapp.html,sha256=JPKT559aFVBi1r42Hz7C77Jj0teZZRumPhBev8eSOLk,19806
|
|
52
|
-
medicafe-0.
|
|
53
|
-
medicafe-0.
|
|
54
|
-
medicafe-0.
|
|
55
|
-
medicafe-0.
|
|
56
|
-
medicafe-0.
|
|
52
|
+
medicafe-0.250723.1.dist-info/LICENSE,sha256=65lb-vVujdQK7uMH3RRJSMwUW-WMrMEsc5sOaUn2xUk,1096
|
|
53
|
+
medicafe-0.250723.1.dist-info/METADATA,sha256=8kXLtbfrw465DQriwAcRImPpUczYTqT_98nlHcpC1Lg,5501
|
|
54
|
+
medicafe-0.250723.1.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
55
|
+
medicafe-0.250723.1.dist-info/top_level.txt,sha256=3uOwR4q_SP8Gufk2uCHoKngAgbtdOwQC6Qjl7ViBa_c,17
|
|
56
|
+
medicafe-0.250723.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|