medicafe 0.250725.18__py3-none-any.whl → 0.250728.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.bat +53 -1
- MediBot/MediBot.py +7 -2
- MediBot/MediBot_Crosswalk_Library.py +30 -10
- MediBot/MediBot_Preprocessor_lib.py +94 -6
- MediBot/MediBot_UI.py +348 -310
- MediBot/update_medicafe.py +30 -1
- MediLink/MediLink.py +161 -22
- MediLink/MediLink_837p_encoder.py +31 -11
- MediLink/MediLink_837p_encoder_library.py +5 -1
- MediLink/MediLink_API_v3.py +76 -18
- MediLink/MediLink_DataMgmt.py +4 -2
- MediLink/MediLink_UI.py +7 -2
- MediLink/MediLink_Up.py +32 -17
- {medicafe-0.250725.18.dist-info → medicafe-0.250728.1.dist-info}/METADATA +1 -1
- {medicafe-0.250725.18.dist-info → medicafe-0.250728.1.dist-info}/RECORD +18 -18
- {medicafe-0.250725.18.dist-info → medicafe-0.250728.1.dist-info}/LICENSE +0 -0
- {medicafe-0.250725.18.dist-info → medicafe-0.250728.1.dist-info}/WHEEL +0 -0
- {medicafe-0.250725.18.dist-info → medicafe-0.250728.1.dist-info}/top_level.txt +0 -0
MediLink/MediLink_Up.py
CHANGED
|
@@ -7,6 +7,14 @@ from MediLink_ConfigLoader import log, load_configuration
|
|
|
7
7
|
from MediLink_DataMgmt import operate_winscp
|
|
8
8
|
import MediLink_API_v3
|
|
9
9
|
|
|
10
|
+
# Pre-compile regex patterns for better performance
|
|
11
|
+
GS_PATTERN = re.compile(r'GS\*HC\*[^*]*\*[^*]*\*([0-9]{8})\*([0-9]{4})')
|
|
12
|
+
SE_PATTERN = re.compile(r'SE\*\d+\*\d{4}~')
|
|
13
|
+
NM1_IL_PATTERN = re.compile(r'NM1\*IL\*1\*([^*]+)\*([^*]+)\*([^*]*)')
|
|
14
|
+
DTP_472_PATTERN = re.compile(r'DTP\*472\D*8\*([0-9]{8})')
|
|
15
|
+
CLM_PATTERN = re.compile(r'CLM\*[^\*]*\*([0-9]+\.?[0-9]*)')
|
|
16
|
+
NM1_PR_PATTERN = re.compile(r'NM1\*PR\*2\*([^*]+)\*')
|
|
17
|
+
|
|
10
18
|
# Internet Connectivity Check
|
|
11
19
|
def check_internet_connection():
|
|
12
20
|
"""
|
|
@@ -88,6 +96,7 @@ def submit_claims(detailed_patient_data_grouped_by_endpoint, config, crosswalk):
|
|
|
88
96
|
api_responses = []
|
|
89
97
|
for file_path in converted_files:
|
|
90
98
|
with open(file_path, 'r') as file:
|
|
99
|
+
# Optimize string operations by doing replacements in one pass
|
|
91
100
|
x12_request_data = file.read().replace('\n', '').replace('\r', '').strip()
|
|
92
101
|
response = MediLink_API_v3.submit_uhc_claim(client, x12_request_data)
|
|
93
102
|
api_responses.append((file_path, response))
|
|
@@ -156,8 +165,10 @@ def handle_transmission_result(transmission_result, config, operation_type, meth
|
|
|
156
165
|
# Process the last few lines of the log file for transfer status
|
|
157
166
|
last_lines = log_contents[-35:]
|
|
158
167
|
for file_path in transmission_result:
|
|
168
|
+
# Pre-format success messages to avoid repeated string formatting
|
|
159
169
|
success_message = "Transfer done: '{}'".format(file_path)
|
|
160
170
|
additional_success_message = "Upload of file '{}' was successful, but error occurred while setting the permissions and/or timestamp.".format(file_path)
|
|
171
|
+
# Use any() with generator expression for better performance
|
|
161
172
|
success = any(success_message in line or additional_success_message in line for line in last_lines)
|
|
162
173
|
message = "Success" if success else "Transfer incomplete or error occurred"
|
|
163
174
|
success_dict[file_path] = (success, message)
|
|
@@ -311,7 +322,7 @@ def parse_837p_file(file_path):
|
|
|
311
322
|
log("Parsing submitted 837p...")
|
|
312
323
|
|
|
313
324
|
# Extract the submission date from the GS segment
|
|
314
|
-
gs_match =
|
|
325
|
+
gs_match = GS_PATTERN.search(content)
|
|
315
326
|
if gs_match:
|
|
316
327
|
date = gs_match.group(1)
|
|
317
328
|
time = gs_match.group(2)
|
|
@@ -321,28 +332,32 @@ def parse_837p_file(file_path):
|
|
|
321
332
|
date_of_submission = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
|
322
333
|
|
|
323
334
|
# Split content using 'SE*{count}*{control_number}~' as delimiter
|
|
324
|
-
patient_records =
|
|
335
|
+
patient_records = SE_PATTERN.split(content)
|
|
325
336
|
|
|
326
337
|
# Remove any empty strings from list that may have been added from split
|
|
327
338
|
patient_records = [record for record in patient_records if record.strip()]
|
|
328
339
|
|
|
329
340
|
for record in patient_records:
|
|
330
341
|
# Extract patient name
|
|
331
|
-
name_match =
|
|
342
|
+
name_match = NM1_IL_PATTERN.search(record)
|
|
332
343
|
# Extract service date
|
|
333
|
-
service_date_match =
|
|
344
|
+
service_date_match = DTP_472_PATTERN.search(record)
|
|
334
345
|
# Extract claim amount
|
|
335
|
-
amount_match =
|
|
346
|
+
amount_match = CLM_PATTERN.search(record)
|
|
336
347
|
# Extract insurance name (payer_name)
|
|
337
|
-
insurance_name_match =
|
|
348
|
+
insurance_name_match = NM1_PR_PATTERN.search(record)
|
|
338
349
|
|
|
339
350
|
if name_match and service_date_match and amount_match:
|
|
340
351
|
# Handle optional middle name
|
|
341
352
|
middle_name = name_match.group(3).strip() if name_match.group(3) else ""
|
|
342
353
|
patient_name = "{} {} {}".format(name_match.group(2), middle_name, name_match.group(1)).strip()
|
|
343
|
-
|
|
354
|
+
|
|
355
|
+
# Optimize date formatting
|
|
356
|
+
service_date_raw = service_date_match.group(1)
|
|
357
|
+
service_date = "{}-{}-{}".format(service_date_raw[:4], service_date_raw[4:6], service_date_raw[6:])
|
|
358
|
+
|
|
344
359
|
amount_billed = float(amount_match.group(1))
|
|
345
|
-
insurance_name = insurance_name_match.group(1)
|
|
360
|
+
insurance_name = insurance_name_match.group(1) if insurance_name_match else ""
|
|
346
361
|
|
|
347
362
|
patient_details.append({
|
|
348
363
|
"name": patient_name,
|
|
@@ -377,17 +392,17 @@ def build_receipt_content(receipt_data):
|
|
|
377
392
|
receipt_lines.append(table_header)
|
|
378
393
|
receipt_lines.append("-" * len(table_header))
|
|
379
394
|
|
|
380
|
-
#
|
|
395
|
+
# Pre-format the status display to avoid repeated conditional checks
|
|
381
396
|
for patient in data["patients"]:
|
|
382
|
-
# Use the message as the status if the submission failed
|
|
383
397
|
status_display = "SUCCESS" if patient['status'] else patient['message']
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
patient['
|
|
387
|
-
patient['
|
|
388
|
-
patient['
|
|
389
|
-
|
|
390
|
-
|
|
398
|
+
# Use join for better performance than multiple format calls
|
|
399
|
+
patient_info = " | ".join([
|
|
400
|
+
"{:<20}".format(patient['name']),
|
|
401
|
+
"{:<15}".format(patient['service_date']),
|
|
402
|
+
"${:<14}".format(patient['amount_billed']),
|
|
403
|
+
"{:<20}".format(patient['insurance_name']),
|
|
404
|
+
"{:<10}".format(status_display)
|
|
405
|
+
])
|
|
391
406
|
receipt_lines.append(patient_info)
|
|
392
407
|
|
|
393
408
|
receipt_lines.append("") # Blank line for separation
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
MediBot/MediBot.bat,sha256=
|
|
2
|
-
MediBot/MediBot.py,sha256=
|
|
1
|
+
MediBot/MediBot.bat,sha256=grTnJY4tfLB6LjIX4kyB4eh3lfZU01KGYT5GmFBOVv4,14979
|
|
2
|
+
MediBot/MediBot.py,sha256=rtNNquSU8tbDXgxHJSppJB2DvXIxzImGe4QpE-KtbQQ,25154
|
|
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=CAC1upqFu37fTWD3hFD5Djiy7yDAcV4SRkcbutdaeeY,53012
|
|
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=pTXtaREJdj0kupzCR_QsHLUlPHYFZ2lUzSLm4IBoHKY,49081
|
|
8
|
+
MediBot/MediBot_UI.py,sha256=js2DVzr5KV4IRckv_O0ZgvV488M3NcFjkLim9Dk0W5M,14992
|
|
9
9
|
MediBot/MediBot_dataformat_library.py,sha256=XNyeiOC6uJUp15UXP_rhtB3rMTPus9ZXDnz5zHNoRYM,8586
|
|
10
10
|
MediBot/MediBot_docx_decoder.py,sha256=GbhX58pMAsWNhBF7B8AtWiNpUOB4bU0zAM81moXYkkE,27370
|
|
11
11
|
MediBot/MediPost.py,sha256=C1hZJFr65rN6F_dckjdBxFC0vL2CoqY9W3YFqU5HXtE,336
|
|
12
12
|
MediBot/PDF_to_CSV_Cleaner.py,sha256=ZZphmq-5K04DkrZNlcwNAIoZPOD_ROWvS3PMkKFxeiM,8799
|
|
13
13
|
MediBot/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
14
|
MediBot/update_json.py,sha256=9FJZb-32EujpKuSoCjyCbdTdthOIuhcMoN4Wchuzn8A,2508
|
|
15
|
-
MediBot/update_medicafe.py,sha256=
|
|
16
|
-
MediLink/MediLink.py,sha256=
|
|
15
|
+
MediBot/update_medicafe.py,sha256=E09jPw_aBjO30YqqUqDOL1zxN1srCyraFDX6vPexGLo,12725
|
|
16
|
+
MediLink/MediLink.py,sha256=tWJG_zHqJJfk2L2YifwHGpqH5bKhfVKuP_XYr8i4DU0,28546
|
|
17
17
|
MediLink/MediLink_277_decoder.py,sha256=Z3hQK2j-YzdXjov6aDlDRc7M_auFBnl3se4OF5q6_04,4358
|
|
18
18
|
MediLink/MediLink_837p_cob_library.py,sha256=pWWd03yXTamNJKDbPCdOCkfglW4OLXQtIN3eiMSdfAA,29934
|
|
19
|
-
MediLink/MediLink_837p_encoder.py,sha256=
|
|
20
|
-
MediLink/MediLink_837p_encoder_library.py,sha256=
|
|
19
|
+
MediLink/MediLink_837p_encoder.py,sha256=2YcbIi3G3AETLDITWJIcMh2kBM62IgwR0W_lCVVLO0w,28816
|
|
20
|
+
MediLink/MediLink_837p_encoder_library.py,sha256=flRGNiQfMY3668ZIwyOMYFD1p96WArcR_WjYjhZmNP4,55812
|
|
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=cOxqXA_NK-O7iVaojnXhmyUg3CC5iS1TanEvA1XEV_o,44808
|
|
25
25
|
MediLink/MediLink_APIs.py,sha256=jm3f9T034MJKH8A_CIootULoeuk7H8s7PazpFZRCbKI,6222
|
|
26
26
|
MediLink/MediLink_Azure.py,sha256=Ow70jctiHFIylskBExN7WUoRgrKOvBR6jNTnQMk6lJA,210
|
|
27
27
|
MediLink/MediLink_ClaimStatus.py,sha256=kXIDidxSGuqTwjFNMQIKms42jqIu5Qmnet-7Ohe8zjE,11645
|
|
28
28
|
MediLink/MediLink_ConfigLoader.py,sha256=u9ecB0SIN7zuJAo8KcoQys95BtyAo-8S2n4mRd0S3XU,4356
|
|
29
|
-
MediLink/MediLink_DataMgmt.py,sha256=
|
|
29
|
+
MediLink/MediLink_DataMgmt.py,sha256=AVkiQ3kMmOZHaZ3Q-I2QyCZdfcU-45mIapSoZ2rdW5M,33374
|
|
30
30
|
MediLink/MediLink_Decoder.py,sha256=lKWiOcRClz8F5P3jrvFTq_hW9XF4OrPfA4LFz2zLSLg,14013
|
|
31
31
|
MediLink/MediLink_Deductible.py,sha256=els8CQMK3pRzlqzs12HDgqx42WLXuHFU-nfXiA4y0Js,39426
|
|
32
32
|
MediLink/MediLink_Deductible_Validator.py,sha256=2g-lZd-Y5fJ1mfP87vM6oABg0t5Om-7EkEkilVvDWYY,22888
|
|
@@ -39,8 +39,8 @@ MediLink/MediLink_Parser.py,sha256=w2ZD4minjwkaMz7nzP_r8v_Ow_uM5KHjpPSY8mIHcdE,9
|
|
|
39
39
|
MediLink/MediLink_Scan.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
40
40
|
MediLink/MediLink_Scheduler.py,sha256=UJvxhDvHraqra2_TlQVlGeh5jRFrrfK6nCVUHnKOEMY,38
|
|
41
41
|
MediLink/MediLink_StatusCheck.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
42
|
-
MediLink/MediLink_UI.py,sha256=
|
|
43
|
-
MediLink/MediLink_Up.py,sha256=
|
|
42
|
+
MediLink/MediLink_UI.py,sha256=I9nIZsHJhIVRUPqj0xHoorgEbZUIWO7fn-l7yg2HU1g,7862
|
|
43
|
+
MediLink/MediLink_Up.py,sha256=mA6Z1PeuydqW7ufUd5BBOstQgBAm1Wh6sf5YvORk0Us,23981
|
|
44
44
|
MediLink/MediLink_batch.bat,sha256=nqL5QwCLyRQFSPdv6kgtcV_cpky7FXSOWVl6OxjRXb4,118
|
|
45
45
|
MediLink/Soumit_api.py,sha256=5JfOecK98ZC6NpZklZW2AkOzkjvrbYxpJpZNH3rFxDw,497
|
|
46
46
|
MediLink/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -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.250728.1.dist-info/LICENSE,sha256=65lb-vVujdQK7uMH3RRJSMwUW-WMrMEsc5sOaUn2xUk,1096
|
|
53
|
+
medicafe-0.250728.1.dist-info/METADATA,sha256=8UHkAZRaYP4W3MUFS7YdlBCMFC_UOECvwRhvKmBkfdc,5501
|
|
54
|
+
medicafe-0.250728.1.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
55
|
+
medicafe-0.250728.1.dist-info/top_level.txt,sha256=3uOwR4q_SP8Gufk2uCHoKngAgbtdOwQC6Qjl7ViBa_c,17
|
|
56
|
+
medicafe-0.250728.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|