uclh-criu / miade

A set of tools for extracting formattable data from clinical notes stored in electronic health record systems.
https://uclh-criu.github.io/miade/
Other
2 stars 0 forks source link

Dosage frequency float division by zero error #77

Closed jenniferjiangkells closed 1 year ago

jenniferjiangkells commented 1 year ago
...
  File "/usr/local/lib/python3.8/site-packages/miade/core.py", line 161, in add_dosages_to_concepts
    concept.dosage = self.dosage_extractor(dosage_string)
  File "/usr/local/lib/python3.8/site-packages/miade/dosageextractor.py", line 68, in __call__
    return self.extract(text, calculate)
  File "/usr/local/lib/python3.8/site-packages/miade/dosageextractor.py", line 57, in extract
    dosage = Dosage.from_doc(doc=doc, calculate=calculate)
  File "/usr/local/lib/python3.8/site-packages/miade/dosage.py", line 317, in from_doc
    frequency = parse_frequency(text=doc.text, results=doc._.results)
  File "/usr/local/lib/python3.8/site-packages/miade/dosage.py", line 166, in parse_frequency
    frequency_dosage.value = results["time"] / results["freq"]
ZeroDivisionError: float division by zero
: 0
...