-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from nealwp/error-dialog
Error dialog
- Loading branch information
Showing
10 changed files
with
243 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,5 @@ lib/* | |
*.json | ||
files | ||
*.drawio* | ||
*.docx | ||
.venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[pytest] | ||
pythonpath = . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from tkinter import Toplevel, Label, LEFT, Button | ||
|
||
|
||
class ErrorDialog(Toplevel): | ||
def __init__(self, parent, error): | ||
super().__init__(parent) | ||
self.title("Error") | ||
Label(self, text=error, anchor='w', justify=LEFT).pack(pady=5, padx=5) | ||
|
||
Button(self, text='Close', command=self.destroy).pack(pady=10) | ||
|
||
self.transient(parent) | ||
self.grab_set() | ||
self.geometry("+%d+%d" % (parent.winfo_rootx()+50, parent.winfo_rooty()+50)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Claimant: John Person Doe | ||
SSN: 000-00-0000 | ||
Last Change: 01/01/1970 | ||
Alleged Onset: N/A | ||
|
||
Claim Type: T16 | ||
Application: 01/01/2023 | ||
Last Insured: N/A | ||
|
||
A. Payment Documents/Decisions | ||
Title | ||
1A: Disability Determination Explanation - DDE | ||
2A: Disability Determination Transmittal - 831 | ||
3A: T16 Cease/Continue Disability Determination and Transmittal - 832 | ||
4A: Disability Determination Explanation - DDE | ||
5A: Disability Determination Explanation - DDE | ||
6A: T16 Cease/Continue Disability Determination and Transmittal - 832 | ||
7A: Disability Determination Explanation - DDE | ||
|
||
Decision Date | ||
08/06/2018 | ||
08/06/2018 | ||
08/30/2022 | ||
08/30/2022 | ||
02/23/2023 | ||
05/17/2023 | ||
05/17/2023 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
Claimant: Jane Person Doe | ||
SSN: 000-00-0000 | ||
Last Change: 01/01/1970 | ||
Alleged Onset: 01/01/2009 | ||
|
||
A. Payment Documents/Decisions | ||
Title | ||
1A: Disability Determination Transmittal - 831 | ||
2A: Disability Determination Explanation - DDE | ||
3A: Disability Determination Transmittal - 831 | ||
4A: Disability Determination Explanation - DDE | ||
|
||
Claim Type: T16 | ||
Application: 02/26/2022 | ||
Last Insured: N/A | ||
|
||
B. Jurisdictional Documents/Notices | ||
Title | ||
1B: T16 Notice of Disapproved Claim - L444 | ||
2B: Request for Reconsideration - 561 | ||
3B: T16 Disability Reconsideration Notice - L1130 | ||
4B: SSA-1696 - Claimant’s Appointment of a Representative - 1696 | ||
5B: Fee Agreement for Representation before SSA - FEEAGRMT | ||
6B: SSA-1696 - Claimant’s Appointment of a Representative - 1696 | ||
7B: Fee Agreement for Representation before SSA - FEEAGRMT | ||
8B: Request for Hearing by ALJ - 501 | ||
9B: Hearing Agreement Form - HRNGAGREEFRM | ||
10B: Outgoing ODAR Correspondence - OUTODARC | ||
11B: Outgoing ODAR Correspondence - OUTODARC | ||
12B: Request for Hearing Acknowledgement Letter - HRGACK | ||
13B: Hearing Agreement Form - HRNGAGREEFRM | ||
14B: Hearing Notice - 507 | ||
15B: Acknowledge Notice of Hearing - 504 | ||
|
||
D. Non-Disability Development | ||
Title | ||
1D: Application for Supplemental Security Income Benefits - 8000 | ||
2D: Detailed Earnings Query - DEQY | ||
3D: Summary Earnings Query - SEQY | ||
4D: Certified Earnings Records - CERTERN | ||
5D: New Hire, Quarter Wage, Unemployment Query (NDNH) - NDNH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,71 @@ | ||
from modules.pdfscanner import * | ||
from src.pdf.scanner import parse_title, parse_client_info | ||
|
||
file_path = r'.\\files\\2909274-cecilia_phillips-case_file_exhibited_bookmarked-8-10-2022- w notes.pdf' | ||
|
||
def test_read_medical_record(): | ||
medical_record = MedicalRecord(file_path) | ||
assert(medical_record) | ||
def test_parse_title(): | ||
test_cases = [ | ||
{ | ||
"test": "6F: 6F - 1 of 13 Office Treatment Records - OFFCREC LIFESTREAM BEHAIVORAL CENTER Tmt. Dt.: 12/28/2016-08/30/2021 (23 pages)", | ||
"expected": ( | ||
"6F", | ||
"6F - 1 of 13 Office Treatment Records - OFFCREC LIFESTREAM BEHAIVORAL CENTER", | ||
"12/28/2016", | ||
"08/30/2021", | ||
) | ||
}, | ||
{ | ||
"test": "16F: 16F - 1 of 112 Emergency Department Records - EMERREC UF HEALTH GAINESVILLE Tmt. Dt.: 01/09/2023 (17 pages)", | ||
"expected": ( | ||
"16F", | ||
"16F - 1 of 112 Emergency Department Records - EMERREC UF HEALTH GAINESVILLE", | ||
"01/09/2023", | ||
"01/09/2023", | ||
) | ||
}, | ||
{ | ||
"test": "19F: 19F - 1 of 23 Medical Evidence of Record - MER VOCATIONAL REHABILITATION (12 pages)", | ||
"expected": ( | ||
"19F", | ||
"19F - 1 of 23 Medical Evidence of Record - MER VOCATIONAL REHABILITATION", | ||
"", | ||
"", | ||
) | ||
}, | ||
] | ||
|
||
def test_get_exhibits_from_medical_record(): | ||
medical_record = MedicalRecord(file_path) | ||
exhibits = medical_record.exhibits | ||
for case in test_cases: | ||
result = parse_title(case["test"]) | ||
assert result == case["expected"] | ||
|
||
|
||
def test_parse_client_info(): | ||
expected = [ | ||
{ | ||
"Alleged Onset": "N/A", | ||
"Application": "01/01/2023", | ||
"Claim Type": "T16", | ||
"Claimant": "John Person Doe", | ||
"Last Change": "01/01/1970", | ||
"Last Insured": "N/A", | ||
"SSN": "000-00-0000", | ||
}, | ||
{ | ||
"Alleged Onset": "01/01/2009", | ||
"Application": "02/26/2022", | ||
"Claim Type": "T16", | ||
"Claimant": "Jane Person Doe", | ||
"Last Change": "01/01/1970", | ||
"Last Insured": "N/A", | ||
"SSN": "000-00-0000", | ||
} | ||
] | ||
|
||
inputs = [ | ||
"tests/helpers/example_page_1.txt", | ||
"tests/helpers/example_page_1_alt.txt" | ||
] | ||
|
||
for i, file in enumerate(inputs): | ||
fd = open(file, "r") | ||
page_one = str(fd.read()) | ||
result = parse_client_info(page_one) | ||
assert result == expected[i] |