Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -53,7 +53,7 @@ def extrair_texto_pdf(pdf_file):
|
|
53 |
texto_ocr = re.sub(r'\s+', ' ', texto_ocr)
|
54 |
return texto_fitz, texto_ocr
|
55 |
|
56 |
-
# Padr玫es regex
|
57 |
exames = {
|
58 |
"LEUCO": r"leuc[贸o]citos.*?([\d.,]+)\s?(?:10\^3)?/u?l",
|
59 |
"B": r"bas[贸o]filos.*?([\d.,]+)\s?%",
|
@@ -80,7 +80,7 @@ exames = {
|
|
80 |
"GLI": r"glicose.*?([\d.,]+)\s?mg/dl",
|
81 |
"LIP": r"lipase.*?([\d.,]+)\s?u/l",
|
82 |
"MG++": r"magn[e茅]sio.*?([\d.,]+)\s?mg/dl",
|
83 |
-
"PCR": r"pcr
|
84 |
"K+": r"pot[谩a]ssio.*?([\d.,]+)\s?mmol/l",
|
85 |
"NA+": r"s[贸o]dio.*?([\d.,]+)\s?mmol/l",
|
86 |
"PTN": r"prote[铆i]na total.*?([\d.,]+)\s?g/dl",
|
@@ -89,7 +89,7 @@ exames = {
|
|
89 |
"RELA脟脙O": r"rela[c莽][茫a]o\s+a\/g.*?([\d.,]+)",
|
90 |
"TGO": r"tgo.*?([\d.,]+)\s?u/l",
|
91 |
"TGP": r"tgp.*?([\d.,]+)\s?u/l",
|
92 |
-
"TAP": r"
|
93 |
"INR": r"inr.*?([\d.,]+)",
|
94 |
"TTP": r"ttpa.*?([\d.,]+)\s?seg",
|
95 |
"LAC": r"lactato.*?([\d.,]+)\s?mmol/l",
|
|
|
53 |
texto_ocr = re.sub(r'\s+', ' ', texto_ocr)
|
54 |
return texto_fitz, texto_ocr
|
55 |
|
56 |
+
# Padr玫es regex otimizados
|
57 |
exames = {
|
58 |
"LEUCO": r"leuc[贸o]citos.*?([\d.,]+)\s?(?:10\^3)?/u?l",
|
59 |
"B": r"bas[贸o]filos.*?([\d.,]+)\s?%",
|
|
|
80 |
"GLI": r"glicose.*?([\d.,]+)\s?mg/dl",
|
81 |
"LIP": r"lipase.*?([\d.,]+)\s?u/l",
|
82 |
"MG++": r"magn[e茅]sio.*?([\d.,]+)\s?mg/dl",
|
83 |
+
"PCR": r"pcr.*?\bresultado\b\s*([\d]+,[\d]+)",
|
84 |
"K+": r"pot[谩a]ssio.*?([\d.,]+)\s?mmol/l",
|
85 |
"NA+": r"s[贸o]dio.*?([\d.,]+)\s?mmol/l",
|
86 |
"PTN": r"prote[铆i]na total.*?([\d.,]+)\s?g/dl",
|
|
|
89 |
"RELA脟脙O": r"rela[c莽][茫a]o\s+a\/g.*?([\d.,]+)",
|
90 |
"TGO": r"tgo.*?([\d.,]+)\s?u/l",
|
91 |
"TGP": r"tgp.*?([\d.,]+)\s?u/l",
|
92 |
+
"TAP": r"tempo de protrombina.*?\bresultado\b\s*([\d]+,[\d]+)",
|
93 |
"INR": r"inr.*?([\d.,]+)",
|
94 |
"TTP": r"ttpa.*?([\d.,]+)\s?seg",
|
95 |
"LAC": r"lactato.*?([\d.,]+)\s?mmol/l",
|