Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -8,34 +8,37 @@ from datetime import datetime
|
|
8 |
|
9 |
# Example data with placeholder JSON for lab_results and bank_statement
|
10 |
examples = [
|
11 |
-
["bonds_table.png", "Bonds table", "[{\"instrument_name\":\"
|
12 |
-
["lab_results.png", "Lab results", "{\"patient_name\": \"
|
13 |
["bank_statement.png", "Bank statement", "*"]
|
14 |
]
|
15 |
|
16 |
# JSON data for Bonds table
|
17 |
-
bonds_json =
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
|
|
|
|
|
|
39 |
|
40 |
lab_results_json = {
|
41 |
"patient_name": "Yash M. Patel",
|
@@ -156,100 +159,102 @@ lab_results_json = {
|
|
156 |
"reference_value": "150000 - 410000",
|
157 |
"unit": "cumm"
|
158 |
}
|
159 |
-
]
|
|
|
160 |
}
|
161 |
|
162 |
bank_statement_json = {
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
"balance_on_march_1": "$25,032.23",
|
171 |
"total_money_in": "$10,234.23",
|
172 |
"total_money_out": "$10,532.51"
|
173 |
-
},
|
174 |
-
"transactions": [
|
175 |
-
{
|
176 |
-
"date": "02/01",
|
177 |
-
"description": "PGD EasyPay Debit",
|
178 |
-
"withdrawal": "203.24",
|
179 |
-
"deposit": "",
|
180 |
-
"balance": "22,098.23"
|
181 |
-
},
|
182 |
-
{
|
183 |
-
"date": "02/02",
|
184 |
-
"description": "AB&B Online Payment*****",
|
185 |
-
"withdrawal": "71.23",
|
186 |
-
"deposit": "",
|
187 |
-
"balance": "22,027.00"
|
188 |
-
},
|
189 |
-
{
|
190 |
-
"date": "02/04",
|
191 |
-
"description": "Check No. 2345",
|
192 |
-
"withdrawal": "",
|
193 |
-
"deposit": "450.00",
|
194 |
-
"balance": "22,477.00"
|
195 |
-
},
|
196 |
-
{
|
197 |
-
"date": "02/05",
|
198 |
-
"description": "Payroll Direct Dep 23422342 Giants",
|
199 |
-
"withdrawal": "",
|
200 |
-
"deposit": "2,534.65",
|
201 |
-
"balance": "25,011.65"
|
202 |
-
},
|
203 |
-
{
|
204 |
-
"date": "02/06",
|
205 |
-
"description": "Signature POS Debit - TJP",
|
206 |
-
"withdrawal": "84.50",
|
207 |
-
"deposit": "",
|
208 |
-
"balance": "24,927.15"
|
209 |
-
},
|
210 |
-
{
|
211 |
-
"date": "02/07",
|
212 |
-
"description": "Check No. 234",
|
213 |
-
"withdrawal": "1,400.00",
|
214 |
-
"deposit": "",
|
215 |
-
"balance": "23,527.15"
|
216 |
-
},
|
217 |
-
{
|
218 |
-
"date": "02/08",
|
219 |
-
"description": "Check No. 342",
|
220 |
-
"withdrawal": "",
|
221 |
-
"deposit": "25.00",
|
222 |
-
"balance": "23,552.15"
|
223 |
-
},
|
224 |
-
{
|
225 |
-
"date": "02/09",
|
226 |
-
"description": "FPB AutoPay***** Credit Card",
|
227 |
-
"withdrawal": "456.02",
|
228 |
-
"deposit": "",
|
229 |
-
"balance": "23,096.13"
|
230 |
-
},
|
231 |
-
{
|
232 |
-
"date": "02/08",
|
233 |
-
"description": "Check No. 123",
|
234 |
-
"withdrawal": "",
|
235 |
-
"deposit": "25.00",
|
236 |
-
"balance": "23,552.15"
|
237 |
},
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
253 |
}
|
254 |
|
255 |
|
|
|
8 |
|
9 |
# Example data with placeholder JSON for lab_results and bank_statement
|
10 |
examples = [
|
11 |
+
["bonds_table.png", "Bonds table", "[{\"instrument_name\":\"str\", \"valuation\":0}]"],
|
12 |
+
["lab_results.png", "Lab results", "{\"patient_name\": \"str\", \"patient_age\": \"str\", \"patient_pid\": 0, \"lab_results\": [{\"investigation\": \"str\", \"result\": 0.00, \"reference_value\": \"str\", \"unit\": \"str\"}]}"],
|
13 |
["bank_statement.png", "Bank statement", "*"]
|
14 |
]
|
15 |
|
16 |
# JSON data for Bonds table
|
17 |
+
bonds_json = {
|
18 |
+
"data": [
|
19 |
+
{
|
20 |
+
"instrument_name": "UNITS BLACKROCK FIX INC DUB FDS PLC ISHS EUR INV GRD CP BD IDX/INST/E",
|
21 |
+
"valuation": 19049
|
22 |
+
},
|
23 |
+
{
|
24 |
+
"instrument_name": "UNITS ISHARES III PLC CORE EUR GOVT BOND UCITS ETF/EUR",
|
25 |
+
"valuation": 83488
|
26 |
+
},
|
27 |
+
{
|
28 |
+
"instrument_name": "UNITS ISHARES III PLC EUR CORP BOND 1-5YR UCITS ETF/EUR",
|
29 |
+
"valuation": 213030
|
30 |
+
},
|
31 |
+
{
|
32 |
+
"instrument_name": "UNIT ISHARES VI PLC/JP MORGAN USD E BOND EUR HED UCITS ETF DIST/HDGD/",
|
33 |
+
"valuation": 32774
|
34 |
+
},
|
35 |
+
{
|
36 |
+
"instrument_name": "UNITS XTRACKERS II SICAV/EUR HY CORP BOND UCITS ETF/-1D-/DISTR.",
|
37 |
+
"valuation": 23643
|
38 |
+
}
|
39 |
+
],
|
40 |
+
"valid": "true"
|
41 |
+
}
|
42 |
|
43 |
lab_results_json = {
|
44 |
"patient_name": "Yash M. Patel",
|
|
|
159 |
"reference_value": "150000 - 410000",
|
160 |
"unit": "cumm"
|
161 |
}
|
162 |
+
],
|
163 |
+
"valid": "true"
|
164 |
}
|
165 |
|
166 |
bank_statement_json = {
|
167 |
+
"bank": "First Platypus Bank",
|
168 |
+
"address": "1234 Kings St., New York, NY 12123",
|
169 |
+
"account_holder": "Mary G. Orta",
|
170 |
+
"account_number": "1234567890123",
|
171 |
+
"statement_date": "3/1/2022",
|
172 |
+
"period_covered": "2/1/2022 - 3/1/2022",
|
173 |
+
"account_summary": {
|
174 |
"balance_on_march_1": "$25,032.23",
|
175 |
"total_money_in": "$10,234.23",
|
176 |
"total_money_out": "$10,532.51"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
177 |
},
|
178 |
+
"transactions": [
|
179 |
+
{
|
180 |
+
"date": "02/01",
|
181 |
+
"description": "PGD EasyPay Debit",
|
182 |
+
"withdrawal": "203.24",
|
183 |
+
"deposit": "",
|
184 |
+
"balance": "22,098.23"
|
185 |
+
},
|
186 |
+
{
|
187 |
+
"date": "02/02",
|
188 |
+
"description": "AB&B Online Payment*****",
|
189 |
+
"withdrawal": "71.23",
|
190 |
+
"deposit": "",
|
191 |
+
"balance": "22,027.00"
|
192 |
+
},
|
193 |
+
{
|
194 |
+
"date": "02/04",
|
195 |
+
"description": "Check No. 2345",
|
196 |
+
"withdrawal": "",
|
197 |
+
"deposit": "450.00",
|
198 |
+
"balance": "22,477.00"
|
199 |
+
},
|
200 |
+
{
|
201 |
+
"date": "02/05",
|
202 |
+
"description": "Payroll Direct Dep 23422342 Giants",
|
203 |
+
"withdrawal": "",
|
204 |
+
"deposit": "2,534.65",
|
205 |
+
"balance": "25,011.65"
|
206 |
+
},
|
207 |
+
{
|
208 |
+
"date": "02/06",
|
209 |
+
"description": "Signature POS Debit - TJP",
|
210 |
+
"withdrawal": "84.50",
|
211 |
+
"deposit": "",
|
212 |
+
"balance": "24,927.15"
|
213 |
+
},
|
214 |
+
{
|
215 |
+
"date": "02/07",
|
216 |
+
"description": "Check No. 234",
|
217 |
+
"withdrawal": "1,400.00",
|
218 |
+
"deposit": "",
|
219 |
+
"balance": "23,527.15"
|
220 |
+
},
|
221 |
+
{
|
222 |
+
"date": "02/08",
|
223 |
+
"description": "Check No. 342",
|
224 |
+
"withdrawal": "",
|
225 |
+
"deposit": "25.00",
|
226 |
+
"balance": "23,552.15"
|
227 |
+
},
|
228 |
+
{
|
229 |
+
"date": "02/09",
|
230 |
+
"description": "FPB AutoPay***** Credit Card",
|
231 |
+
"withdrawal": "456.02",
|
232 |
+
"deposit": "",
|
233 |
+
"balance": "23,096.13"
|
234 |
+
},
|
235 |
+
{
|
236 |
+
"date": "02/08",
|
237 |
+
"description": "Check No. 123",
|
238 |
+
"withdrawal": "",
|
239 |
+
"deposit": "25.00",
|
240 |
+
"balance": "23,552.15"
|
241 |
+
},
|
242 |
+
{
|
243 |
+
"date": "02/09",
|
244 |
+
"description": "FPB AutoPay***** Credit Card",
|
245 |
+
"withdrawal": "156.02",
|
246 |
+
"deposit": "",
|
247 |
+
"balance": "23,096.13"
|
248 |
+
},
|
249 |
+
{
|
250 |
+
"date": "02/08",
|
251 |
+
"description": "Cash Deposit",
|
252 |
+
"withdrawal": "",
|
253 |
+
"deposit": "25.00",
|
254 |
+
"balance": "23,552.15"
|
255 |
+
}
|
256 |
+
],
|
257 |
+
"valid": "true"
|
258 |
}
|
259 |
|
260 |
|