In [4]:
import numpy as np
import pandas as pd
from collections import deque
import string
import re

In [8]:
#path = "/home/oier/Desktop/pr0n/informe_9370208.txt"
path = "/docs/Dropbox (Neurita)/Cancer/cun/informe_9370208.txt"

In [9]:
dict = {}
appearances = {}
names = deque()
with open(path) as f:
    txt = f.readlines()

In [10]:
#Get split-array from text
blood = []
sblood = []
append = False
for line in txt:
    if append:
        blood.append(line)
    if ( "EXPLORACIONES COMPLEMENTARIAS" in line ):
        append=True
    if append and (prev == " \n" and line == " \n"):
        append=False
    prev = line

for b in blood:
    for s in b.split(";"):
        sblood.append(s)

In [11]:
#process text:

def to_array(string, sep=" "):
    arest = []
    for r in string:
        for a in r.split(sep):
            arest.append(a)
    return(arest)

def get_number(array):
    try:
        value = float(array.replace(",",".",1))
        return value
    except:
        pass
    return -1

def get_unit(array):
    for a in array:
        try:
            unit = a.replace(".","")
            if "/" in unit:
                return unit.strip()
        except:
            pass
    return -1

def is_name(string):
    return(":" in string)

def is_number(string):
    try:
        value = float(string.replace(",",".",1))
        return True
    except:
        pass
    return False

def is_unit(string):
    try:
        unit = string.replace(".","")
        return("/" in unit)
    except:
            pass
    return False

dblood = {}
value = ""
temp = ""
for line in sblood:
    rest = line.split(" ")
    for s in rest:
        if is_name(s):
            print("string: {} is a name: {} temp: {}".format(s,s.replace(":",""), temp))
            temp = ""
        elif is_number(s):
            print("string: {} is a number: {} temp: {}".format(s,get_number(s), temp))
            temp = ""
        elif is_unit(s):
            print("string: {} is a unit: {} temp: {}".format(s,s.replace(".","").strip(), temp))
            temp = ""
        else:
            if temp:
                temp += " "
            temp += s
        
            
    #    s = rest.split(" ",1)[0]
    #    if is_name(s):
    #        s = line.split(":",1)
    #        print()
    #        name = s[0]
    #        rest = s[1:]
    #    elif is_number(s):
    #        value = get_number(s)
    #    elif is_unit(s):
    #        unit = get_unit(s)
    #        temp = {"value":value, "unit":unit}
    #        dblood[name] = temp
    #        value = ""
    #    else:
    #        value += s
        
        
    

    #temp = {}

print(dblood)


string: 27/07/15 is a unit: 27/07/15 temp: 

string: s-Glucosa: is a name: s-Glucosa temp: 
  

string: 94 is a number: 94.0 temp: 
string: mg/dL is a unit: mg/dL temp: 
string: s-Calcio: is a name: s-Calcio temp: 
string: 9,2 is a number: 9.2 temp: 
string: mg/dL. is a unit: mg/dL temp: 
string: s-Magnesio: is a name: s-Magnesio temp: 
string: 2 is a number: 2.0 temp: 
string: mg/dL is a unit: mg/dL temp: 
string: inorgánico: is a name: inorgánico temp: s-Fosfato
string: 3,5 is a number: 3.5 temp: 

string: mg/dL is a unit: mg/dL temp: 
string: s-Bilirrubina:Total: is a name: s-BilirrubinaTotal temp: 
  

string: 0,49 is a number: 0.49 temp: 
string: mg/dL is a unit: mg/dL temp: 
string: Directa: is a name: Directa temp: 
string: 0,23 is a number: 0.23 temp: 
string: mg/dL is a unit: mg/dL temp: 
string: Indirecta: is a name: Indirecta temp: 
string: 0,26 is a number: 0.26 temp: 
string: mg/dL. is a unit: mg/dL temp: 
string: (GOT): is a name: (GOT) temp: 
 s-AST
string: 27 is a number: 27.0 temp: 
string: UI/L is a unit: UI/L temp: 
string: (GPT): is a name: (GPT) temp: s-ALT
string: 26 is a number: 26.0 temp: 
string: UI/L is a unit: UI/L temp: 
string: alcalina: is a name: alcalina temp: 
 s-Fosfatasa
string: 86 is a number: 86.0 temp: 
string: UI/L is a unit: UI/L temp: 
string: (LDH): is a name: (LDH) temp: s-Lactato deshidrogenasa
string: 262 is a number: 262.0 temp: 
string: UI/L is a unit: UI/L temp: 
string: s-Amilasa: is a name: s-Amilasa temp: 

string: 57 is a number: 57.0 temp: 
string: UI/L is a unit: UI/L temp: 
string: s-Lipasa: is a name: s-Lipasa temp: 
string: 25 is a number: 25.0 temp: 
string: U/l. is a unit: U/l temp: 
string: p-Ionograma: is a name: p-Ionograma temp: 
  

string: Sodio: is a name: Sodio temp: 
string: 145 is a number: 145.0 temp: 
string: mEq/L is a unit: mEq/L temp: 
string: Potasio: is a name: Potasio temp: 
string: 3,6 is a number: 3.6 temp: 
string: mEq/L is a unit: mEq/L temp: 
string: Cloruro: is a name: Cloruro temp: 
string: 107 is a number: 107.0 temp: 
string: mEq/L. is a unit: mEq/L temp: 
string: p-CO2_total: is a name: p-CO2_total temp: 

string: total: is a name: total temp: CO2
string: 20,0 is a number: 20.0 temp: 
string: mEq/L is a unit: mEq/L temp: 
string: restante: is a name: restante temp: Anion
string: 17,7 is a number: 17.7 temp: 
string: mEq/L. is a unit: mEq/L temp: 
string: p-Urea: is a name: p-Urea temp: 

string: 26 is a number: 26.0 temp: 
string: mg/dL. is a unit: mg/dL temp: 
string: p-Creatinina: is a name: p-Creatinina temp: 

string: 0,9 is a number: 0.9 temp: 
string: mg/dL is a unit: mg/dL temp: 
string: Cockroft: is a name: Cockroft temp: Índice
string: 201 is a number: 201.0 temp: 
string: mL/min is a unit: mL/min temp: 
string: MDRD: is a name: MDRD temp: 
string: 108 is a number: 108.0 temp: 
string: mL/min/1,73 is a unit: mL/min/1,73 temp: 
string: Libre: is a name: Libre temp: mE2. 
  
 s-T3
string: 4,42 is a number: 4.42 temp: 
string: pmol/L is a unit: pmol/L temp: 
string: s-TSH: is a name: s-TSH temp: 
string: 1,32 is a number: 1.32 temp: 
string: µU/ml is a unit: µU/ml temp: 
string: Libre: is a name: Libre temp: s-T4 
string: 16,24 is a number: 16.24 temp: 
string: pmol/L is a unit: pmol/L temp: 
string: s-Albúmina: is a name: s-Albúmina temp: 
  

string: 3860,00 is a number: 3860.0 temp: 
string: mg/dL is a unit: mg/dL temp: 
string: s-Alfa-fetoproteína: is a name: s-Alfa-fetoproteína temp: 
  

string: 1,8 is a number: 1.8 temp: 
string: UI/mL. is a unit: UI/mL temp: 
string: Hematíes: is a name: Hematíes temp: 
  

string: 5,04 is a number: 5.04 temp: 
string: 10E12/L is a unit: 10E12/L temp: 
string: Hb: is a name: Hb temp: 
string: 14,3 is a number: 14.3 temp: 
string: g/dL is a unit: g/dL temp: 
string: Hto: is a name: Hto temp: 
string: 43,8 is a number: 43.8 temp: 
string: VCM: is a name: VCM temp: % 
string: 86,9 is a number: 86.9 temp: 
string: HCM: is a name: HCM temp: fL 
string: 28,4 is a number: 28.4 temp: 
string: CHCM: is a name: CHCM temp: pg  

string: 32,6 is a number: 32.6 temp: 
string: g/dL is a unit: g/dL temp: 
string: Plaquetas: is a name: Plaquetas temp: 
string: 270 is a number: 270.0 temp: 
string: 10E9/L is a unit: 10E9/L temp: 
string: Leucocitos: is a name: Leucocitos temp: 
string: 6,4 is a number: 6.4 temp: 
string: 10E9/L is a unit: 10E9/L temp: 
string: Neutrófilos: is a name: Neutrófilos temp: 
string: 67,1 is a number: 67.1 temp: 
string: Linfocitos: is a name: Linfocitos temp: %  

string: 25,0 is a number: 25.0 temp: 
string: Monocitos: is a name: Monocitos temp: % 
string: 5,7 is a number: 5.7 temp: 
string: Eosinófilos: is a name: Eosinófilos temp: % 
string: 1,7 is a number: 1.7 temp: 
string: Basófilos: is a name: Basófilos temp: % 
string: 0,5 is a number: 0.5 temp: 
string: T.Protrombina: is a name: T.Protrombina temp: %. 
  

string: 107,0 is a number: 107.0 temp: 
string: INR: is a name: INR temp: % 
string: TTPA: is a name: TTPA temp: 1,0.
string: 34,7 is a number: 34.7 temp: 
string: Razón: is a name: Razón temp: s 
string: Fibrinógeno: is a name: Fibrinógeno temp: 1,0.
string: 340 is a number: 340.0 temp: 
string: mg/dL. is a unit: mg/dL temp: 
string: (Australia): is a name: (Australia) temp: 
  
 Serol. Hepatitis B. Antígeno HBs
string: totales): is a name: totales) temp: Negativo. 
 Serol. Hepatitis B. Anti HBc (Anticuerpos
string: AntiVHC: is a name: AntiVHC temp: Negativo. 
 Serol. Hepatitis C.
string: (Ag+Ac): is a name: (Ag+Ac) temp: Negativo. 
 Serol. de VIH 1-2
string: B: is a name: B temp: Negativo. 
 Carga Viral Virus Hepatitis
string: C: is a name: C temp: No se detecta ADN de VHB. 
 Carga Viral Virus Hepatitis
string: sedimento: is a name: sedimento temp: No se detecta ARN de VHC. 
  
 Anormales y
string: Densidad: is a name: Densidad temp: 

string: 1,019 is a number: 1.019 temp: 
string: pH: is a name: pH temp: 
string: 5,0 is a number: 5.0 temp: 
string: Leucocitos: is a name: Leucocitos temp: 
string: Sedimento: is a name: Sedimento temp: Negativo 
string: (CDC): is a name: (CDC) temp: Sin alteración. 
  
 HLA-AB
string: muestra: is a name: muestra temp: 
 Tipo de
string: HLA-A: is a name: HLA-A temp: Células mononucleadas aisladas de sangre periférica. 
string: 11 is a number: 11.0 temp: 
string: A: is a name: A temp: HLA-

string: 30 is a number: 30.0 temp: 
string: HLA-B: is a name: HLA-B temp: 
string: 35 is a number: 35.0 temp: 
string: HLA-B: is a name: HLA-B temp: 
string: 40 is a number: 40.0 temp: 
{}

In [12]:
sblood


Out[12]:
[' \n',
 '27/07/15  \n',
 ' \n',
 's-Glucosa: 94 mg/dL',
 ' s-Calcio: 9,2 mg/dL. s-Magnesio: 2 mg/dL',
 ' s-Fosfato inorgánico: \n',
 '3,5 mg/dL',
 ' \n',
 ' \n',
 's-Bilirrubina:Total: 0,49 mg/dL',
 ' Directa: 0,23 mg/dL',
 ' Indirecta: 0,26 mg/dL. \n',
 's-AST (GOT): 27 UI/L',
 ' s-ALT (GPT): 26 UI/L',
 '  \n',
 's-Fosfatasa alcalina: 86 UI/L',
 ' s-Lactato deshidrogenasa (LDH): 262 UI/L',
 '  \n',
 's-Amilasa: 57 UI/L',
 ' s-Lipasa: 25 U/l. \n',
 ' \n',
 'p-Ionograma: Sodio: 145 mEq/L',
 ' Potasio: 3,6 mEq/L',
 ' Cloruro: 107 mEq/L. \n',
 'p-CO2_total: CO2 total: 20,0 mEq/L',
 ' Anion restante: 17,7 mEq/L. \n',
 'p-Urea: 26 mg/dL. \n',
 'p-Creatinina: 0,9 mg/dL',
 ' Índice Cockroft: 201 mL/min',
 ' MDRD: 108 mL/min/1,73 mE2. \n',
 ' \n',
 's-T3 Libre: 4,42 pmol/L',
 ' s-TSH: 1,32 µU/ml',
 ' s-T4  Libre: 16,24 pmol/L',
 '  \n',
 ' \n',
 's-Albúmina: 3860,00 mg/dL',
 '  \n',
 ' \n',
 's-Alfa-fetoproteína: 1,8 UI/mL. \n',
 ' \n',
 'Hematíes: 5,04 10E12/L',
 ' Hb: 14,3 g/dL',
 ' Hto: 43,8 %',
 ' VCM: 86,9 fL',
 ' HCM: 28,4 pg',
 ' \n',
 'CHCM: 32,6 g/dL',
 ' Plaquetas: 270 10E9/L',
 ' Leucocitos: 6,4 10E9/L',
 ' Neutrófilos: 67,1 %',
 ' \n',
 'Linfocitos: 25,0 %',
 ' Monocitos: 5,7 %',
 ' Eosinófilos: 1,7 %',
 ' Basófilos: 0,5 %. \n',
 ' \n',
 'T.Protrombina: 107,0 %',
 ' INR: 1,0. TTPA: 34,7 s',
 ' Razón: 1,0. Fibrinógeno: 340 mg/dL. \n',
 ' \n',
 'Serol. Hepatitis B. Antígeno HBs (Australia): Negativo. \n',
 'Serol. Hepatitis B. Anti HBc (Anticuerpos totales): Negativo. \n',
 'Serol. Hepatitis C. AntiVHC: Negativo. \n',
 'Serol. de VIH 1-2 (Ag+Ac): Negativo. \n',
 'Carga Viral Virus Hepatitis B: No se detecta ADN de VHB. \n',
 'Carga Viral Virus Hepatitis C: No se detecta ARN de VHC. \n',
 ' \n',
 'Anormales y sedimento: \n',
 'Densidad: 1,019',
 ' pH: 5,0',
 ' Leucocitos: Negativo',
 ' Sedimento: Sin alteración. \n',
 ' \n',
 'HLA-AB (CDC): \n',
 'Tipo de muestra: Células mononucleadas aisladas de sangre periférica.',
 ' HLA-A: 11',
 ' HLA-\n',
 'A: 30',
 ' HLA-B: 35',
 ' HLA-B: 40 (probable 60). \n',
 ' \n',
 ' \n']

In [13]:
float("")


---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-13-2909c948daee> in <module>()
----> 1 float("")

ValueError: could not convert string to float: 

In [7]:
#algorithm:


#name: value units.
#main name: name: value units; name: value units.

#all the text together: one space separation.
#make sure :,; and . charaters have a space separation after them.

#procesar el texto como se pueda para tener en cuenta lo de arriva.

In [14]:
#CLEAN TEXT: Unify all the content

blood = []
sblood = []
append = False
for line in txt:
    if append:
        blood.append(line)
    if ( "EXPLORACIONES COMPLEMENTARIAS" in line ):
        append=True
    if append and (prev == " \n" and line == " \n"):
        append=False
    prev = line

strblood = ""
tmp = ""
for b in blood:
    for c in b:
        if c == "\n":
            tmp += " "
        else:
            tmp += c
            
for b in tmp.strip():
    if b in [";", ".",":"]:
        strblood += b
        strblood += " "
    else:
        strblood += b

In [15]:
strblood.strip()


Out[15]:
'27/07/15     s-Glucosa:  94 mg/dL;  s-Calcio:  9,2 mg/dL.  s-Magnesio:  2 mg/dL;  s-Fosfato inorgánico:   3,5 mg/dL;     s-Bilirrubina: Total:  0,49 mg/dL;  Directa:  0,23 mg/dL;  Indirecta:  0,26 mg/dL.   s-AST (GOT):  27 UI/L;  s-ALT (GPT):  26 UI/L;    s-Fosfatasa alcalina:  86 UI/L;  s-Lactato deshidrogenasa (LDH):  262 UI/L;    s-Amilasa:  57 UI/L;  s-Lipasa:  25 U/l.     p-Ionograma:  Sodio:  145 mEq/L;  Potasio:  3,6 mEq/L;  Cloruro:  107 mEq/L.   p-CO2_total:  CO2 total:  20,0 mEq/L;  Anion restante:  17,7 mEq/L.   p-Urea:  26 mg/dL.   p-Creatinina:  0,9 mg/dL;  Índice Cockroft:  201 mL/min;  MDRD:  108 mL/min/1,73 mE2.     s-T3 Libre:  4,42 pmol/L;  s-TSH:  1,32 µU/ml;  s-T4  Libre:  16,24 pmol/L;      s-Albúmina:  3860,00 mg/dL;      s-Alfa-fetoproteína:  1,8 UI/mL.     Hematíes:  5,04 10E12/L;  Hb:  14,3 g/dL;  Hto:  43,8 %;  VCM:  86,9 fL;  HCM:  28,4 pg;   CHCM:  32,6 g/dL;  Plaquetas:  270 10E9/L;  Leucocitos:  6,4 10E9/L;  Neutrófilos:  67,1 %;   Linfocitos:  25,0 %;  Monocitos:  5,7 %;  Eosinófilos:  1,7 %;  Basófilos:  0,5 %.     T. Protrombina:  107,0 %;  INR:  1,0.  TTPA:  34,7 s;  Razón:  1,0.  Fibrinógeno:  340 mg/dL.     Serol.  Hepatitis B.  Antígeno HBs (Australia):  Negativo.   Serol.  Hepatitis B.  Anti HBc (Anticuerpos totales):  Negativo.   Serol.  Hepatitis C.  AntiVHC:  Negativo.   Serol.  de VIH 1-2 (Ag+Ac):  Negativo.   Carga Viral Virus Hepatitis B:  No se detecta ADN de VHB.   Carga Viral Virus Hepatitis C:  No se detecta ARN de VHC.     Anormales y sedimento:   Densidad:  1,019;  pH:  5,0;  Leucocitos:  Negativo;  Sedimento:  Sin alteración.     HLA-AB (CDC):   Tipo de muestra:  Células mononucleadas aisladas de sangre periférica. ;  HLA-A:  11;  HLA- A:  30;  HLA-B:  35;  HLA-B:  40 (probable 60).'

In [63]:
dblood = strblood.split(" ")

dictblood = {}
now = {}
insert = False
main = ""
punto = False
was_name = False
master = ""
name = ""
for e in dblood:
    if e:
        if ":" in e:
            if name:
                print(e)
                master = name
                name = e
            name = e
    
        elif "/" in e or "%" in e:
            #now['name'] = master + name
            now["unit"] = e
            insert = True
            
        else:
            if "." in e or ";" in e:
                now["unit"] = "text"
                insert = True
            now["value"] = e
        
        #if ( "name" in now.keys() ) and insert:
        if insert:
            full_name = master + name
            now["name"] = full_name
            
            dictblood[ now["name"] ] = now
            insert = False
            now = {}
            name = ""
            
        if "." in e:
            master = ""


Total:
Sodio:
total:
Densidad:
muestra:

In [64]:
dictblood


Out[64]:
{'': {'unit': 'text', 'value': ';', 'name': ''},
 'Fibrinógeno:': {'unit': 'mg/dL.', 'value': '340', 'name': 'Fibrinógeno:'},
 'totales):': {'unit': 'text', 'value': 'Negativo.', 'name': 'totales):'},
 'CHCM:': {'unit': 'g/dL;', 'value': '32,6', 'name': 'CHCM:'},
 '(Ag+Ac):': {'unit': 'text', 'value': 'Negativo.', 'name': '(Ag+Ac):'},
 's-Bilirrubina:Indirecta:': {'unit': 'mg/dL.',
  'value': '0,26',
  'name': 's-Bilirrubina:Indirecta:'},
 'inorgánico:': {'unit': 'mg/dL;', 'value': '3,5', 'name': 'inorgánico:'},
 'Leucocitos:': {'unit': '10E9/L;', 'value': '6,4', 'name': 'Leucocitos:'},
 '(Australia):': {'unit': 'text',
  'value': 'Negativo.',
  'name': '(Australia):'},
 'Hb:': {'unit': 'g/dL;', 'value': '14,3', 'name': 'Hb:'},
 'Linfocitos:': {'unit': '%;', 'value': '25,0', 'name': 'Linfocitos:'},
 'A:': {'unit': 'text', 'value': '30;', 'name': 'A:'},
 's-Glucosa:': {'unit': 'mg/dL;', 'value': '94', 'name': 's-Glucosa:'},
 'sedimento:Leucocitos:': {'unit': 'text',
  'value': 'Negativo;',
  'name': 'sedimento:Leucocitos:'},
 'HCM:': {'unit': 'text', 'value': 'pg;', 'name': 'HCM:'},
 'Libre:': {'unit': 'pmol/L;', 'value': '16,24', 'name': 'Libre:'},
 'p-Urea:': {'unit': 'mg/dL.', 'value': '26', 'name': 'p-Urea:'},
 's-Bilirrubina:Total:': {'unit': 'mg/dL;',
  'value': '0,49',
  'name': 's-Bilirrubina:Total:'},
 '(LDH):': {'unit': 'UI/L;', 'value': '262', 'name': '(LDH):'},
 'p-Creatinina:': {'unit': 'mg/dL;', 'value': '0,9', 'name': 'p-Creatinina:'},
 '(CDC):muestra:': {'unit': 'text',
  'value': 'periférica.',
  'name': '(CDC):muestra:'},
 'p-Ionograma:Sodio:': {'unit': 'mEq/L;',
  'value': '145',
  'name': 'p-Ionograma:Sodio:'},
 'HLA-B:': {'unit': 'text', 'value': '60).', 'name': 'HLA-B:'},
 'p-Ionograma:Cloruro:': {'unit': 'mEq/L.',
  'value': '107',
  'name': 'p-Ionograma:Cloruro:'},
 'Hto:': {'unit': '%;', 'value': '43,8', 'name': 'Hto:'},
 'AntiVHC:': {'unit': 'text', 'value': 'Negativo.', 'name': 'AntiVHC:'},
 'VCM:': {'unit': 'text', 'value': 'fL;', 'name': 'VCM:'},
 's-TSH:': {'unit': 'µU/ml;', 'value': '1,32', 'name': 's-TSH:'},
 '(GOT):': {'unit': 'UI/L;', 'value': '27', 'name': '(GOT):'},
 's-Calcio:': {'unit': 'mg/dL.', 'value': '9,2', 'name': 's-Calcio:'},
 's-Albúmina:': {'unit': 'mg/dL;', 'value': '3860,00', 'name': 's-Albúmina:'},
 '(GPT):': {'unit': 'UI/L;', 'value': '26', 'name': '(GPT):'},
 'sedimento:Sedimento:': {'unit': 'text',
  'value': 'alteración.',
  'name': 'sedimento:Sedimento:'},
 'p-CO2_total:total:': {'unit': 'mEq/L;',
  'value': '20,0',
  'name': 'p-CO2_total:total:'},
 'C:': {'unit': 'text', 'value': 'VHC.', 'name': 'C:'},
 'Plaquetas:': {'unit': '10E9/L;', 'value': '270', 'name': 'Plaquetas:'},
 'p-CO2_total:restante:': {'unit': 'mEq/L.',
  'value': '17,7',
  'name': 'p-CO2_total:restante:'},
 'TTPA:': {'unit': 'text', 'value': 's;', 'name': 'TTPA:'},
 'HLA-A:': {'unit': 'text', 'value': '11;', 'name': 'HLA-A:'},
 's-Bilirrubina:Directa:': {'unit': 'mg/dL;',
  'value': '0,23',
  'name': 's-Bilirrubina:Directa:'},
 'Basófilos:': {'unit': '%.', 'value': '0,5', 'name': 'Basófilos:'},
 'sedimento:Densidad:': {'unit': 'text',
  'value': '1,019;',
  'name': 'sedimento:Densidad:'},
 'Eosinófilos:': {'unit': '%;', 'value': '1,7', 'name': 'Eosinófilos:'},
 's-Alfa-fetoproteína:': {'unit': 'UI/mL.',
  'value': '1,8',
  'name': 's-Alfa-fetoproteína:'},
 'sedimento:pH:': {'unit': 'text', 'value': '5,0;', 'name': 'sedimento:pH:'},
 'MDRD:': {'unit': 'mL/min/1,73', 'value': '108', 'name': 'MDRD:'},
 'Neutrófilos:': {'unit': '%;', 'value': '67,1', 'name': 'Neutrófilos:'},
 'Cockroft:': {'unit': 'mL/min;', 'value': '201', 'name': 'Cockroft:'},
 's-Amilasa:': {'unit': 'UI/L;', 'value': '57', 'name': 's-Amilasa:'},
 'INR:': {'unit': 'text', 'value': '1,0.', 'name': 'INR:'},
 'B:': {'unit': 'text', 'value': 'VHB.', 'name': 'B:'},
 'Monocitos:': {'unit': '%;', 'value': '5,7', 'name': 'Monocitos:'},
 'Hematíes:': {'unit': '10E12/L;', 'value': '5,04', 'name': 'Hematíes:'},
 'alcalina:': {'unit': 'UI/L;', 'value': '86', 'name': 'alcalina:'},
 'p-Ionograma:Potasio:': {'unit': 'mEq/L;',
  'value': '3,6',
  'name': 'p-Ionograma:Potasio:'},
 's-Lipasa:': {'unit': 'U/l.', 'value': '25', 'name': 's-Lipasa:'},
 'Protrombina:': {'unit': '%;', 'value': '107,0', 'name': 'Protrombina:'},
 'Razón:': {'unit': 'text', 'value': '1,0.', 'name': 'Razón:'},
 's-Magnesio:': {'unit': 'mg/dL;', 'value': '2', 'name': 's-Magnesio:'}}

In [ ]: