From 0b3a80f799996de5a283856415c976b5287adb12 Mon Sep 17 00:00:00 2001 From: <> Date: Thu, 1 Aug 2024 10:11:32 +0000 Subject: [PATCH] Deployed 77dfb39 with MkDocs version: 1.6.0 --- .nojekyll | 0 404.html | 1005 +++ about/overview/index.html | 1111 +++ about/team/index.html | 1048 +++ api-reference/annotator/index.html | 3074 ++++++++ api-reference/concept/index.html | 1628 ++++ api-reference/dosage/index.html | 1602 ++++ api-reference/dosageextractor/index.html | 1409 ++++ .../medsallergiesannotator/index.html | 3038 ++++++++ api-reference/metaannotations/index.html | 1235 +++ api-reference/note/index.html | 2477 ++++++ api-reference/noteprocessor/index.html | 2397 ++++++ api-reference/problemsannotator/index.html | 2287 ++++++ assets/_mkdocstrings.css | 119 + assets/images/favicon.png | Bin 0 -> 1870 bytes assets/javascripts/bundle.fe8b6f2b.min.js | 29 + assets/javascripts/bundle.fe8b6f2b.min.js.map | 7 + assets/javascripts/lunr/min/lunr.ar.min.js | 1 + assets/javascripts/lunr/min/lunr.da.min.js | 18 + assets/javascripts/lunr/min/lunr.de.min.js | 18 + assets/javascripts/lunr/min/lunr.du.min.js | 18 + assets/javascripts/lunr/min/lunr.el.min.js | 1 + assets/javascripts/lunr/min/lunr.es.min.js | 18 + assets/javascripts/lunr/min/lunr.fi.min.js | 18 + assets/javascripts/lunr/min/lunr.fr.min.js | 18 + assets/javascripts/lunr/min/lunr.he.min.js | 1 + assets/javascripts/lunr/min/lunr.hi.min.js | 1 + assets/javascripts/lunr/min/lunr.hu.min.js | 18 + assets/javascripts/lunr/min/lunr.hy.min.js | 1 + assets/javascripts/lunr/min/lunr.it.min.js | 18 + assets/javascripts/lunr/min/lunr.ja.min.js | 1 + assets/javascripts/lunr/min/lunr.jp.min.js | 1 + assets/javascripts/lunr/min/lunr.kn.min.js | 1 + assets/javascripts/lunr/min/lunr.ko.min.js | 1 + assets/javascripts/lunr/min/lunr.multi.min.js | 1 + assets/javascripts/lunr/min/lunr.nl.min.js | 18 + assets/javascripts/lunr/min/lunr.no.min.js | 18 + assets/javascripts/lunr/min/lunr.pt.min.js | 18 + assets/javascripts/lunr/min/lunr.ro.min.js | 18 + assets/javascripts/lunr/min/lunr.ru.min.js | 18 + assets/javascripts/lunr/min/lunr.sa.min.js | 1 + .../lunr/min/lunr.stemmer.support.min.js | 1 + assets/javascripts/lunr/min/lunr.sv.min.js | 18 + assets/javascripts/lunr/min/lunr.ta.min.js | 1 + assets/javascripts/lunr/min/lunr.te.min.js | 1 + assets/javascripts/lunr/min/lunr.th.min.js | 1 + assets/javascripts/lunr/min/lunr.tr.min.js | 18 + assets/javascripts/lunr/min/lunr.vi.min.js | 1 + assets/javascripts/lunr/min/lunr.zh.min.js | 1 + assets/javascripts/lunr/tinyseg.js | 206 + assets/javascripts/lunr/wordcut.js | 6708 +++++++++++++++++ .../workers/search.b8dbb3d2.min.js | 42 + .../workers/search.b8dbb3d2.min.js.map | 7 + assets/miade-logo-small.png | Bin 0 -> 21900 bytes assets/miade-logo.png | Bin 0 -> 33012 bytes assets/stylesheets/main.3cba04c6.min.css | 1 + assets/stylesheets/main.3cba04c6.min.css.map | 1 + assets/stylesheets/palette.06af60db.min.css | 1 + .../stylesheets/palette.06af60db.min.css.map | 1 + contributing/index.html | 1043 +++ index.html | 1105 +++ objects.inv | Bin 0 -> 744 bytes search/search_index.json | 1 + sitemap.xml | 3 + sitemap.xml.gz | Bin 0 -> 127 bytes user-guide/configurations/index.html | 1200 +++ user-guide/cookbook/index.html | 1048 +++ user-guide/quickstart/index.html | 1384 ++++ 68 files changed, 35504 insertions(+) create mode 100644 .nojekyll create mode 100644 404.html create mode 100644 about/overview/index.html create mode 100644 about/team/index.html create mode 100644 api-reference/annotator/index.html create mode 100644 api-reference/concept/index.html create mode 100644 api-reference/dosage/index.html create mode 100644 api-reference/dosageextractor/index.html create mode 100644 api-reference/medsallergiesannotator/index.html create mode 100644 api-reference/metaannotations/index.html create mode 100644 api-reference/note/index.html create mode 100644 api-reference/noteprocessor/index.html create mode 100644 api-reference/problemsannotator/index.html create mode 100644 assets/_mkdocstrings.css create mode 100644 assets/images/favicon.png create mode 100644 assets/javascripts/bundle.fe8b6f2b.min.js create mode 100644 assets/javascripts/bundle.fe8b6f2b.min.js.map create mode 100644 assets/javascripts/lunr/min/lunr.ar.min.js create mode 100644 assets/javascripts/lunr/min/lunr.da.min.js create mode 100644 assets/javascripts/lunr/min/lunr.de.min.js create mode 100644 assets/javascripts/lunr/min/lunr.du.min.js create mode 100644 assets/javascripts/lunr/min/lunr.el.min.js create mode 100644 assets/javascripts/lunr/min/lunr.es.min.js create mode 100644 assets/javascripts/lunr/min/lunr.fi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.fr.min.js create mode 100644 assets/javascripts/lunr/min/lunr.he.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hu.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hy.min.js create mode 100644 assets/javascripts/lunr/min/lunr.it.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ja.min.js create mode 100644 assets/javascripts/lunr/min/lunr.jp.min.js create mode 100644 assets/javascripts/lunr/min/lunr.kn.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ko.min.js create mode 100644 assets/javascripts/lunr/min/lunr.multi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.nl.min.js create mode 100644 assets/javascripts/lunr/min/lunr.no.min.js create mode 100644 assets/javascripts/lunr/min/lunr.pt.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ro.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ru.min.js create mode 100644 assets/javascripts/lunr/min/lunr.sa.min.js create mode 100644 assets/javascripts/lunr/min/lunr.stemmer.support.min.js create mode 100644 assets/javascripts/lunr/min/lunr.sv.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ta.min.js create mode 100644 assets/javascripts/lunr/min/lunr.te.min.js create mode 100644 assets/javascripts/lunr/min/lunr.th.min.js create mode 100644 assets/javascripts/lunr/min/lunr.tr.min.js create mode 100644 assets/javascripts/lunr/min/lunr.vi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.zh.min.js create mode 100644 assets/javascripts/lunr/tinyseg.js create mode 100644 assets/javascripts/lunr/wordcut.js create mode 100644 assets/javascripts/workers/search.b8dbb3d2.min.js create mode 100644 assets/javascripts/workers/search.b8dbb3d2.min.js.map create mode 100644 assets/miade-logo-small.png create mode 100644 assets/miade-logo.png create mode 100644 assets/stylesheets/main.3cba04c6.min.css create mode 100644 assets/stylesheets/main.3cba04c6.min.css.map create mode 100644 assets/stylesheets/palette.06af60db.min.css create mode 100644 assets/stylesheets/palette.06af60db.min.css.map create mode 100644 contributing/index.html create mode 100644 index.html create mode 100644 objects.inv create mode 100644 search/search_index.json create mode 100644 sitemap.xml create mode 100644 sitemap.xml.gz create mode 100644 user-guide/configurations/index.html create mode 100644 user-guide/cookbook/index.html create mode 100644 user-guide/quickstart/index.html diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/404.html b/404.html new file mode 100644 index 0000000..ea91428 --- /dev/null +++ b/404.html @@ -0,0 +1,1005 @@ + + + +
+ + + + + + + + + + + + + + + + +Data about people’s health stored in electronic health records (EHRs) can play an important role in improving the quality of patient care. Much of the information in EHRs is recorded in ordinary language without any restriction on format ('free text'), as this is the natural way in which people communicate. However, if this information were stored in a standardised, structured format, computers will also be able to process the information to help clinicians find and interpret information for better and safer decision making. This would enable EHR systems such as Epic, the system in place at UCLH since April 2019, to support clinical decision making. For instance, the system may be able to ensure that a patient is not prescribed medicine that would give them an allergic reaction.
+Free text may contain words and abbreviations which may be interpreted in more than one way, such as 'HR', which can mean 'Hour' or 'Heart Rate'. Free text may also contain negations; for example, a diagnosis may be mentioned in the text but the rest of the sentence might say that it was ruled out. Although computers can be used to interpret free text, they cannot always get it right, so clinicians will always have to check the results to ensure patient safety. Expressing information in a structured way can avoid this problem, but has a big disadvantage - it can be time-consuming for clinicians to enter the information. This can mean that information is incomplete, or clinicians are so busy on the computer that they do not have time to listen to their patients.
+The aim of MiADE is to develop a system to support automatic conversion of the clinician’s free text into a structured format. The clinician can check the structured data immediately, before making it a formal part of the patient’s record. The system will record a patient’s diagnoses, medications and allergies in a structured way, using NHS-endorsed clinical data standards (e.g. FIHR and SNOMED CT). It will use a technique called Natural Language Processing (NLP). NLP has been used by research teams to extract information from existing EHRs but has rarely been used to improve the way information is entered in the first place. Our NLP system will continuously learn and improve as more text is analysed and checked by clinicians.
+We will first test the system in University College London Hospitals, where a new EHR system called Epic is in place. We will study how effective it is, and how clinicians and patients find it when it is used in consultations. Based on feedback, we will make improvements and install it for testing at a second site (Great Ormond Street Hospital). Our aim is for the system to be eventually rolled out to more hospitals and doctors’ surgeries across the NHS.
+ + + + + + + + + + + + + +The MiADE project is developed by a team of clinicians, developers, AI researchers, and data standard experts at University College London (UCL) and the University College London Hospitals (UCLH), in collaboration with the Cogstack at King's College London (KCL).
+ + + + + + + + + + + + + +
+ Bases: ABC
An abstract base class for annotators.
+Annotators are responsible for processing medical notes and extracting relevant concepts from them.
+ + +Attributes:
+Name | +Type | +Description | +
---|---|---|
cat |
+
+ CAT
+ |
+
+
+
+ The MedCAT instance used for concept extraction. + |
+
config |
+
+ AnnotatorConfig
+ |
+
+
+
+ The configuration for the annotator. + |
+
miade/annotators.py
198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 +413 +414 +415 +416 +417 +418 +419 +420 +421 +422 +423 +424 +425 +426 +427 +428 +429 +430 +431 +432 +433 +434 +435 +436 +437 +438 +439 +440 +441 +442 +443 +444 +445 +446 +447 +448 +449 +450 +451 +452 +453 +454 +455 +456 +457 +458 +459 +460 +461 +462 +463 +464 +465 +466 +467 +468 +469 +470 +471 +472 +473 +474 +475 +476 +477 +478 +479 +480 +481 +482 +483 +484 +485 +486 +487 +488 +489 +490 +491 +492 +493 +494 +495 +496 +497 +498 +499 +500 +501 +502 +503 +504 +505 +506 +507 +508 +509 +510 +511 +512 +513 +514 +515 +516 +517 +518 +519 +520 +521 +522 |
|
concept_types
+
+
+ abstractmethod
+ property
+
+
+¶Abstract property that should return a list of concept types supported by the annotator.
+pipeline
+
+
+ abstractmethod
+ property
+
+
+¶Abstract property that should return a list of pipeline steps for the annotator.
+__call__(note, record_concepts=None, dosage_extractor=None)
+
+¶Runs the annotation pipeline on a given note and returns the extracted concepts.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
note |
+
+ Note
+ |
+
+
+
+ The input note to process. + |
+ + required + | +
record_concepts |
+
+ Optional[List[Concept]]
+ |
+
+
+
+ The list of concepts from existing EHR records. + |
+
+ None
+ |
+
dosage_extractor |
+
+ Optional[DosageExtractor]
+ |
+
+
+
+ The dosage extractor to use for extracting dosage information. + |
+
+ None
+ |
+
Returns:
+Type | +Description | +
---|---|
+ List[Concept]
+ |
+
+
+
+ List[Concept]: The extracted concepts from the note. + |
+
miade/annotators.py
add_dosages_to_concepts(dosage_extractor, concepts, note)
+
+
+ staticmethod
+
+
+¶Gets dosages for medication concepts
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
dosage_extractor |
+
+ DosageExtractor
+ |
+
+
+
+ The dosage extractor object + |
+ + required + | +
concepts |
+
+ List[Concept]
+ |
+
+
+
+ List of concepts extracted + |
+ + required + | +
note |
+
+ Note
+ |
+
+
+
+ The input note + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ List[Concept]
+ |
+
+
+
+ List of concepts with dosages for medication concepts + |
+
miade/annotators.py
add_numbering_to_name(concepts)
+
+
+ staticmethod
+
+
+¶Adds numbering to the names of problem concepts to control output ordering.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
concepts |
+
+ List[Concept]
+ |
+
+
+
+ The list of concepts to add numbering to. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ List[Concept]
+ |
+
+
+
+ The list of concepts with numbering added to their names. + |
+
miade/annotators.py
deduplicate(concepts, record_concepts=None)
+
+
+ staticmethod
+
+
+¶Removes duplicate concepts from the extracted concepts list by strict ID matching.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
concepts |
+
+ List[Concept]
+ |
+
+
+
+ The list of extracted concepts. + |
+ + required + | +
record_concepts |
+
+ Optional[List[Concept]]
+ |
+
+
+
+ The list of concepts from existing EHR records. + |
+
+ None
+ |
+
Returns:
+Type | +Description | +
---|---|
+ List[Concept]
+ |
+
+
+
+ The deduplicated list of concepts. + |
+
miade/annotators.py
filter_concepts_in_numbered_list(concepts, note)
+
+
+ staticmethod
+
+
+¶Filters and returns a list of concepts in a numbered list in a note using a two-pointer algorithm.
+This filters out concepts that may not be relevant given a note that has structured list headings +and numbered lists within that. i.e. only return the first line of a numbered list. e.g. + 1. CCF - + - had echo on 15/6 + - on diuretics +will only return the concept CCF as it is the first item in a numbered list
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
concepts |
+
+ List[Concept]
+ |
+
+
+
+ The list of concepts to filter. + |
+ + required + | +
note |
+
+ Note
+ |
+
+
+
+ The note containing numbered lists. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ List[Concept]
+ |
+
+
+
+ The filtered list of concepts. + |
+
miade/annotators.py
342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 +375 +376 +377 +378 +379 +380 +381 +382 +383 +384 +385 +386 +387 +388 +389 +390 +391 +392 +393 +394 +395 +396 +397 +398 +399 +400 +401 +402 +403 +404 +405 +406 +407 +408 +409 +410 +411 +412 |
|
get_concepts(note)
+
+¶Extracts concepts from a note using the MedCAT instance.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
note |
+
+ Note
+ |
+
+
+
+ The input note to extract concepts from. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ List[Concept]
+ |
+
+
+
+ The extracted concepts from the note. + |
+
miade/annotators.py
postprocess()
+
+
+ abstractmethod
+
+
+¶Abstract method that should implement the logic for post-processing extracted concepts.
+ + +preprocess(note, refine=True)
+
+¶Preprocesses a note by cleaning its text and splitting it into paragraphs.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
note |
+
+ Note
+ |
+
+
+
+ The input note to preprocess. + |
+ + required + | +
refine |
+
+ bool
+ |
+
+
+
+ Whether to refine the paragraph detection algorithm and allow merging of continuous prose + |
+
+ True
+ |
+
Returns:
+Type | +Description | +
---|---|
+ Note
+ |
+
+
+
+ The preprocessed note. + |
+
miade/annotators.py
run_pipeline()
+
+
+ abstractmethod
+
+
+¶Abstract method that runs the annotation pipeline on a given note and returns the extracted concepts.
+ + +
+ Bases: object
Represents a concept in the system.
+ + +Attributes:
+Name | +Type | +Description | +
---|---|---|
id |
+
+ str
+ |
+
+
+
+ The unique identifier of the concept. + |
+
name |
+
+ str
+ |
+
+
+
+ The name of the concept. + |
+
category |
+
+ Optional[Enum]
+ |
+
+
+
+ The category of the concept (optional). + |
+
start |
+
+ Optional[int]
+ |
+
+
+
+ The start position of the concept (optional). + |
+
end |
+
+ Optional[int]
+ |
+
+
+
+ The end position of the concept (optional). + |
+
dosage |
+
+ Optional[Dosage]
+ |
+
+
+
+ The dosage of the concept (optional). + |
+
linked_concepts |
+
+ Optional[List[Concept]]
+ |
+
+
+
+ The linked concepts of the concept (optional). + |
+
negex |
+
+ Optional[bool]
+ |
+
+
+
+ The negex value of the concept (optional). + |
+
meta_anns |
+
+ Optional[List[MetaAnnotations]]
+ |
+
+
+
+ The meta annotations of the concept (optional). + |
+
debug_dict |
+
+ Optional[Dict]
+ |
+
+
+
+ The debug dictionary of the concept (optional). + |
+
miade/concept.py
18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 +100 +101 +102 +103 +104 |
|
from_entity(entity)
+
+
+ classmethod
+
+
+¶Converts an entity dictionary into a Concept object.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
entity |
+
+ Dict
+ |
+
+
+
+ The entity dictionary containing the necessary information. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ Concept
+ |
+
+
+
+ The Concept object created from the entity dictionary. + |
+
miade/concept.py
+ Bases: object
Container for drug dosage information
+ +miade/dosage.py
268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 +369 +370 +371 +372 +373 +374 |
|
from_doc(doc, calculate=True)
+
+
+ classmethod
+
+
+¶Parses dosage from a spacy doc object.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
doc |
+
+ Doc
+ |
+
+
+
+ Spacy doc object with processed dosage text. + |
+ + required + | +
calculate |
+
+ bool
+ |
+
+
+
+ Whether to calculate duration if total and daily dose is given. Defaults to True. + |
+
+ True
+ |
+
Returns:
+Type | +Description | +
---|---|
+ | +
+
+
+ An instance of the class with the parsed dosage information. + |
+
miade/dosage.py
287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 +327 +328 +329 +330 +331 +332 +333 +334 +335 +336 +337 +338 +339 +340 +341 +342 +343 +344 +345 +346 +347 +348 +349 +350 +351 +352 +353 +354 +355 +356 +357 +358 +359 +360 +361 +362 +363 +364 +365 +366 +367 +368 |
|
Parses and extracts drug dosage
+ + +Attributes:
+Name | +Type | +Description | +
---|---|---|
model |
+
+ str
+ |
+
+
+
+ The name of the model to be used for dosage extraction. + |
+
dosage_extractor |
+
+ Language
+ |
+
+
+
+ The Spacy pipeline for dosage extraction. + |
+
miade/dosageextractor.py
extract(text, calculate=True)
+
+¶Processes a string that contains dosage instructions (excluding drug concept as this is handled by core)
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
text |
+
+ str
+ |
+
+
+
+ The string containing dosage instructions. + |
+ + required + | +
calculate |
+
+ bool
+ |
+
+
+
+ Whether to calculate duration from total and daily dose, if given. + |
+
+ True
+ |
+
Returns:
+Type | +Description | +
---|---|
+ Optional[Dosage]
+ |
+
+
+
+ The dosage object with parsed dosages in CDA format. + |
+
miade/dosageextractor.py
+ Bases: Annotator
Annotator class for medication and allergy concepts.
+This class extends the Annotator
base class and provides methods for running a pipeline of
+annotation tasks on a given note, as well as validating and converting concepts related to
+medications and allergies.
Attributes:
+Name | +Type | +Description | +
---|---|---|
valid_meds |
+
+ List[int]
+ |
+
+
+
+ A list of valid medication IDs. + |
+
reactions_subset_lookup |
+
+ Dict[int, str]
+ |
+
+
+
+ A dictionary mapping reaction IDs to their corresponding subset IDs. + |
+
allergens_subset_lookup |
+
+ Dict[int, str]
+ |
+
+
+
+ A dictionary mapping allergen IDs to their corresponding subset IDs. + |
+
allergy_type_lookup |
+
+ Dict[str, List[str]]
+ |
+
+
+
+ A dictionary mapping allergen types to their corresponding codes. + |
+
vtm_to_vmp_lookup |
+
+ Dict[str, str]
+ |
+
+
+
+ A dictionary mapping VTM (Virtual Therapeutic Moiety) IDs to VMP (Virtual Medicinal Product) IDs. + |
+
vtm_to_text_lookup |
+
+ Dict[str, str]
+ |
+
+
+
+ A dictionary mapping VTM IDs to their corresponding text. + |
+
miade/annotators.py
806 + 807 + 808 + 809 + 810 + 811 + 812 + 813 + 814 + 815 + 816 + 817 + 818 + 819 + 820 + 821 + 822 + 823 + 824 + 825 + 826 + 827 + 828 + 829 + 830 + 831 + 832 + 833 + 834 + 835 + 836 + 837 + 838 + 839 + 840 + 841 + 842 + 843 + 844 + 845 + 846 + 847 + 848 + 849 + 850 + 851 + 852 + 853 + 854 + 855 + 856 + 857 + 858 + 859 + 860 + 861 + 862 + 863 + 864 + 865 + 866 + 867 + 868 + 869 + 870 + 871 + 872 + 873 + 874 + 875 + 876 + 877 + 878 + 879 + 880 + 881 + 882 + 883 + 884 + 885 + 886 + 887 + 888 + 889 + 890 + 891 + 892 + 893 + 894 + 895 + 896 + 897 + 898 + 899 + 900 + 901 + 902 + 903 + 904 + 905 + 906 + 907 + 908 + 909 + 910 + 911 + 912 + 913 + 914 + 915 + 916 + 917 + 918 + 919 + 920 + 921 + 922 + 923 + 924 + 925 + 926 + 927 + 928 + 929 + 930 + 931 + 932 + 933 + 934 + 935 + 936 + 937 + 938 + 939 + 940 + 941 + 942 + 943 + 944 + 945 + 946 + 947 + 948 + 949 + 950 + 951 + 952 + 953 + 954 + 955 + 956 + 957 + 958 + 959 + 960 + 961 + 962 + 963 + 964 + 965 + 966 + 967 + 968 + 969 + 970 + 971 + 972 + 973 + 974 + 975 + 976 + 977 + 978 + 979 + 980 + 981 + 982 + 983 + 984 + 985 + 986 + 987 + 988 + 989 + 990 + 991 + 992 + 993 + 994 + 995 + 996 + 997 + 998 + 999 +1000 +1001 +1002 +1003 +1004 +1005 +1006 +1007 +1008 +1009 +1010 +1011 +1012 +1013 +1014 +1015 +1016 +1017 +1018 +1019 +1020 +1021 +1022 +1023 +1024 +1025 +1026 +1027 +1028 +1029 +1030 +1031 +1032 +1033 +1034 +1035 +1036 +1037 +1038 +1039 +1040 +1041 +1042 +1043 +1044 +1045 +1046 +1047 +1048 +1049 +1050 +1051 +1052 +1053 +1054 +1055 +1056 +1057 +1058 +1059 +1060 +1061 +1062 +1063 +1064 +1065 +1066 +1067 +1068 +1069 +1070 +1071 +1072 +1073 +1074 +1075 +1076 +1077 +1078 +1079 +1080 +1081 +1082 +1083 +1084 +1085 +1086 +1087 +1088 +1089 +1090 +1091 +1092 +1093 +1094 +1095 +1096 +1097 +1098 +1099 +1100 +1101 +1102 +1103 +1104 +1105 +1106 +1107 +1108 +1109 +1110 +1111 +1112 +1113 +1114 +1115 +1116 +1117 +1118 +1119 +1120 +1121 +1122 +1123 +1124 +1125 +1126 +1127 +1128 +1129 +1130 +1131 +1132 +1133 +1134 +1135 +1136 +1137 +1138 +1139 +1140 +1141 +1142 +1143 +1144 +1145 +1146 +1147 +1148 +1149 +1150 +1151 +1152 +1153 +1154 +1155 +1156 +1157 +1158 +1159 +1160 +1161 +1162 +1163 +1164 +1165 +1166 +1167 +1168 +1169 +1170 +1171 +1172 +1173 +1174 +1175 +1176 +1177 +1178 +1179 +1180 +1181 +1182 +1183 +1184 +1185 +1186 +1187 +1188 +1189 +1190 +1191 +1192 +1193 +1194 +1195 +1196 +1197 +1198 +1199 +1200 +1201 +1202 +1203 +1204 +1205 +1206 +1207 +1208 +1209 +1210 +1211 +1212 +1213 +1214 +1215 +1216 +1217 +1218 +1219 +1220 +1221 +1222 +1223 +1224 +1225 +1226 +1227 +1228 +1229 +1230 +1231 +1232 +1233 +1234 +1235 +1236 +1237 +1238 +1239 +1240 +1241 +1242 +1243 +1244 +1245 +1246 +1247 +1248 +1249 +1250 +1251 +1252 +1253 +1254 +1255 +1256 +1257 +1258 +1259 +1260 +1261 +1262 +1263 +1264 +1265 +1266 +1267 +1268 +1269 +1270 +1271 +1272 +1273 +1274 +1275 +1276 +1277 +1278 +1279 +1280 +1281 +1282 +1283 +1284 +1285 +1286 +1287 +1288 +1289 +1290 +1291 +1292 +1293 +1294 +1295 +1296 +1297 +1298 +1299 +1300 +1301 +1302 +1303 +1304 +1305 +1306 +1307 +1308 +1309 +1310 +1311 +1312 +1313 +1314 +1315 +1316 +1317 +1318 +1319 +1320 +1321 +1322 +1323 |
|
concept_types: List[Category]
+
+
+ property
+
+
+¶Returns a list of concept types.
+ + +Returns:
+Type | +Description | +
---|---|
+ List[Category]
+ |
+
+
+
+ [Category.MEDICATION, Category.ALLERGY, Category.REACTION] + |
+
pipeline: List[str]
+
+
+ property
+
+
+¶Returns a list of annotators in the pipeline.
+The annotators are executed in the order they appear in the list.
+ + +Returns:
+Type | +Description | +
---|---|
+ List[str]
+ |
+
+
+
+ ["preprocessor", "medcat", "list_cleaner", "paragrapher", "postprocessor", "dosage_extractor", "vtm_converter", "deduplicator"] + |
+
convert_VTM_to_VMP_or_text(concepts)
+
+¶Converts medication concepts from VTM (Virtual Therapeutic Moiety) to VMP (Virtual Medicinal Product) or text.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
concepts |
+
+ List[Concept]
+ |
+
+
+
+ A list of medication concepts. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ List[Concept]
+ |
+
+
+
+ A list of medication concepts with updated IDs, names, and dosages. + |
+
miade/annotators.py
1253 +1254 +1255 +1256 +1257 +1258 +1259 +1260 +1261 +1262 +1263 +1264 +1265 +1266 +1267 +1268 +1269 +1270 +1271 +1272 +1273 +1274 +1275 +1276 +1277 +1278 +1279 +1280 +1281 +1282 +1283 +1284 +1285 +1286 +1287 +1288 +1289 +1290 +1291 +1292 +1293 +1294 +1295 +1296 +1297 +1298 +1299 +1300 +1301 +1302 +1303 +1304 +1305 +1306 +1307 +1308 +1309 +1310 +1311 +1312 +1313 +1314 +1315 +1316 +1317 +1318 +1319 +1320 +1321 +1322 +1323 |
|
postprocess(concepts, note)
+
+¶Postprocesses a list of concepts and links reactions to allergens.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
concepts |
+
+ List[Concept]
+ |
+
+
+
+ The list of concepts to be postprocessed. + |
+ + required + | +
note |
+
+ Note
+ |
+
+
+
+ The note object associated with the concepts. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ List[Concept]
+ |
+
+
+
+ The postprocessed list of concepts. + |
+
miade/annotators.py
process_paragraphs(note, concepts)
+
+¶Process the paragraphs in a note and update the list of concepts.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
note |
+
+ Note
+ |
+
+
+
+ The note object containing the paragraphs. + |
+ + required + | +
concepts |
+
+ List[Concept]
+ |
+
+
+
+ The list of concepts to be updated. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ List[Concept]
+ |
+
+
+
+ The updated list of concepts. + |
+
miade/annotators.py
run_pipeline(note, record_concepts=None, dosage_extractor=None)
+
+¶Runs the annotation pipeline on the given note.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
note |
+
+ Note
+ |
+
+
+
+ The input note to run the pipeline on. + |
+ + required + | +
record_concepts |
+
+ Optional[List[Concept]]
+ |
+
+
+
+ The list of previously recorded concepts. + |
+
+ None
+ |
+
dosage_extractor |
+
+ Optional[DosageExtractor]
+ |
+
+
+
+ The dosage extractor function. + |
+
+ None
+ |
+
Returns:
+Type | +Description | +
---|---|
+ List[Concept]
+ |
+
+
+
+ The list of annotated concepts. + |
+
miade/annotators.py
+ Bases: BaseModel
Represents a meta annotation with a name, value, and optional confidence.
+ + +Attributes:
+Name | +Type | +Description | +
---|---|---|
name |
+
+ str
+ |
+
+
+
+ The name of the meta annotation. + |
+
value |
+
+ Enum
+ |
+
+
+
+ The value of the meta annotation. + |
+
confidence |
+
+ float
+ |
+
+
+
+ The confidence level of the meta annotation. + |
+
miade/metaannotations.py
+ Bases: object
Represents a Note object
+ + +Attributes:
+Name | +Type | +Description | +
---|---|---|
text |
+
+ str
+ |
+
+
+
+ The text content of the note. + |
+
raw_text |
+
+ str
+ |
+
+
+
+ The raw text content of the note. + |
+
paragraphs |
+
+ Optional[List[Paragraph]]
+ |
+
+
+
+ A list of Paragraph objects representing the paragraphs in the note. + |
+
numbered_lists |
+
+ Optional[List[NumberedList]]
+ |
+
+
+
+ A list of NumberedList objects representing the numbered lists in the note. + |
+
miade/note.py
12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + 22 + 23 + 24 + 25 + 26 + 27 + 28 + 29 + 30 + 31 + 32 + 33 + 34 + 35 + 36 + 37 + 38 + 39 + 40 + 41 + 42 + 43 + 44 + 45 + 46 + 47 + 48 + 49 + 50 + 51 + 52 + 53 + 54 + 55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 |
|
clean_text()
+
+¶Cleans the text content of the note.
+This method performs various cleaning operations on the text content of the note, +such as replacing spaces, removing punctuation, and removing empty lines.
+ +miade/note.py
get_numbered_lists()
+
+¶Finds multiple lists of sequentially ordered numbers (with more than one item) that directly follow a newline character +and captures the text following these numbers up to the next newline.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
text |
+
+ str
+ |
+
+
+
+ The input text in which to search for multiple lists of sequentially ordered numbers with more than one item and their subsequent text. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ | +
+
+
+ list of lists: Each sublist contains tuples where each tuple includes the start index of the number, + |
+
+ | +
+
+
+ the end index of the line, and the captured text for each valid sequentially ordered list found. Returns an empty list if no such patterns are found. + |
+
miade/note.py
get_paragraphs(paragraph_regex)
+
+¶Split the text into paragraphs and assign paragraph types based on regex patterns.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
paragraph_regex |
+
+ Dict
+ |
+
+
+
+ A dictionary containing paragraph types as keys and regex patterns as values. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ None
+ |
+
+
+
+ None + |
+
miade/note.py
merge_empty_non_prose_with_next_prose()
+
+¶This method checks if a Paragraph has an empty body and a type that is not prose, +and merges it with the next Paragraph if the next paragraph is type prose.
+ + +Returns:
+Type | +Description | +
---|---|
+ None
+ |
+
+
+
+ None + |
+
miade/note.py
merge_prose_sections()
+
+¶Merges consecutive prose sections in the paragraphs list.
+ + +Returns:
+Type | +Description | +
---|---|
+ None
+ |
+
+
+
+ A list of merged prose sections. + |
+
miade/note.py
process(lookup_dict, refine=True)
+
+¶Process the note by cleaning the text, extracting numbered lists, and getting paragraphs based on a lookup dictionary.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
lookup_dict |
+
+ Dict
+ |
+
+
+
+ A dictionary used to lookup specific paragraphs. + |
+ + required + | +
refine |
+
+ bool
+ |
+
+
+
+ Flag indicating whether to refine the processed note - this will merge any consecutive prose + |
+
+ True
+ |
+
miade/note.py
Main processor of MiADE which extract, postprocesses, and deduplicates concepts given +annotators (MedCAT models), Note, and existing concepts
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
model_directory |
+
+ Path
+ |
+
+
+
+ Path to directory that contains medcat models and a config.yaml file + |
+ + required + | +
model_config_path |
+
+ Path
+ |
+
+
+
+ Path to the model config file. Defaults to None. + |
+
+ None
+ |
+
log_level |
+
+ int
+ |
+
+
+
+ Log level. Defaults to logging.INFO. + |
+
+ INFO
+ |
+
dosage_extractor_log_level |
+
+ int
+ |
+
+
+
+ Log level for dosage extractor. Defaults to logging.INFO. + |
+
+ INFO
+ |
+
device |
+
+ str
+ |
+
+
+
+ Device to run inference on (cpu or gpu). Defaults to "cpu". + |
+
+ 'cpu'
+ |
+
custom_annotators |
+
+ List[Annotator]
+ |
+
+
+
+ List of custom annotators. Defaults to None. + |
+
+ None
+ |
+
miade/core.py
55 + 56 + 57 + 58 + 59 + 60 + 61 + 62 + 63 + 64 + 65 + 66 + 67 + 68 + 69 + 70 + 71 + 72 + 73 + 74 + 75 + 76 + 77 + 78 + 79 + 80 + 81 + 82 + 83 + 84 + 85 + 86 + 87 + 88 + 89 + 90 + 91 + 92 + 93 + 94 + 95 + 96 + 97 + 98 + 99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110 +111 +112 +113 +114 +115 +116 +117 +118 +119 +120 +121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133 +134 +135 +136 +137 +138 +139 +140 +141 +142 +143 +144 +145 +146 +147 +148 +149 +150 +151 +152 +153 +154 +155 +156 +157 +158 +159 +160 +161 +162 +163 +164 +165 +166 +167 +168 +169 +170 +171 +172 +173 +174 +175 +176 +177 +178 +179 +180 +181 +182 +183 +184 +185 +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213 +214 +215 +216 +217 +218 +219 +220 +221 +222 +223 +224 +225 +226 +227 +228 +229 +230 +231 +232 +233 +234 +235 +236 +237 +238 +239 +240 +241 +242 +243 +244 +245 +246 +247 +248 +249 +250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266 +267 +268 +269 +270 +271 +272 +273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289 +290 +291 +292 +293 +294 +295 +296 +297 +298 +299 +300 +301 +302 +303 +304 +305 +306 +307 +308 +309 +310 +311 +312 |
|
add_annotator(name)
+
+¶Adds an annotator to the processor.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
name |
+
+ str
+ |
+
+
+
+ The alias of the annotator to add. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ None
+ |
+
+
+
+ None + |
+
Raises:
+Type | +Description | +
---|---|
+ Exception
+ |
+
+
+
+ If there is an error creating the annotator. + |
+
miade/core.py
get_concept_dicts(note, filter_uncategorized=True, record_concepts=None)
+
+¶Returns concepts in dictionary format.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
note |
+
+ Note
+ |
+
+
+
+ Note containing text to extract concepts from. + |
+ + required + | +
filter_uncategorized |
+
+ bool
+ |
+
+
+
+ If True, does not return concepts where category=None. Default is True. + |
+
+ True
+ |
+
record_concepts |
+
+ Optional[List[Concept]]
+ |
+
+
+
+ List of concepts in existing record. + |
+
+ None
+ |
+
Returns:
+Type | +Description | +
---|---|
+ List[Dict]
+ |
+
+
+
+ Extracted concepts in JSON-compatible dictionary format. + |
+
miade/core.py
print_model_cards()
+
+¶Prints the model cards for each annotator in the annotators
list.
Each model card includes the name of the annotator's class and its category.
+ +miade/core.py
process(note, record_concepts=None)
+
+¶Process the given note and extract concepts using the loaded annotators.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
note |
+
+ Note
+ |
+
+
+
+ The note to be processed. + |
+ + required + | +
record_concepts |
+
+ Optional[List[Concept]]
+ |
+
+
+
+ A list of existing concepts in the EHR record. + |
+
+ None
+ |
+
Returns:
+Type | +Description | +
---|---|
+ List[Concept]
+ |
+
+
+
+ A list of extracted concepts. + |
+
miade/core.py
remove_annotator(name)
+
+¶Removes an annotator from the processor.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
name |
+
+ str
+ |
+
+
+
+ The alias of the annotator to remove. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ None
+ |
+
+
+
+ None + |
+
miade/core.py
+ Bases: Annotator
Annotator class for identifying and processing problems in medical notes.
+This class extends the base Annotator
class and provides specific functionality
+for identifying and processing problems in medical notes. It implements methods
+for loading problem lookup data, processing meta annotations, filtering concepts,
+and post-processing the annotated concepts.
Attributes:
+Name | +Type | +Description | +
---|---|---|
cat |
+
+ CAT
+ |
+
+
+
+ The CAT (Concept Annotation Tool) instance used for annotation. + |
+
config |
+
+ AnnotatorConfig
+ |
+
+
+
+ The configuration object for the annotator. + |
+
concept_types (list): A list of concept types supported by this annotator. +pipeline (list): The list of processing steps in the annotation pipeline.
+miade/annotators.py
525 +526 +527 +528 +529 +530 +531 +532 +533 +534 +535 +536 +537 +538 +539 +540 +541 +542 +543 +544 +545 +546 +547 +548 +549 +550 +551 +552 +553 +554 +555 +556 +557 +558 +559 +560 +561 +562 +563 +564 +565 +566 +567 +568 +569 +570 +571 +572 +573 +574 +575 +576 +577 +578 +579 +580 +581 +582 +583 +584 +585 +586 +587 +588 +589 +590 +591 +592 +593 +594 +595 +596 +597 +598 +599 +600 +601 +602 +603 +604 +605 +606 +607 +608 +609 +610 +611 +612 +613 +614 +615 +616 +617 +618 +619 +620 +621 +622 +623 +624 +625 +626 +627 +628 +629 +630 +631 +632 +633 +634 +635 +636 +637 +638 +639 +640 +641 +642 +643 +644 +645 +646 +647 +648 +649 +650 +651 +652 +653 +654 +655 +656 +657 +658 +659 +660 +661 +662 +663 +664 +665 +666 +667 +668 +669 +670 +671 +672 +673 +674 +675 +676 +677 +678 +679 +680 +681 +682 +683 +684 +685 +686 +687 +688 +689 +690 +691 +692 +693 +694 +695 +696 +697 +698 +699 +700 +701 +702 +703 +704 +705 +706 +707 +708 +709 +710 +711 +712 +713 +714 +715 +716 +717 +718 +719 +720 +721 +722 +723 +724 +725 +726 +727 +728 +729 +730 +731 +732 +733 +734 +735 +736 +737 +738 +739 +740 +741 +742 +743 +744 +745 +746 +747 +748 +749 +750 +751 +752 +753 +754 +755 +756 +757 +758 +759 +760 +761 +762 +763 +764 +765 +766 +767 +768 +769 +770 +771 +772 +773 +774 +775 +776 +777 +778 +779 +780 +781 +782 +783 +784 +785 +786 +787 +788 +789 +790 +791 +792 +793 +794 +795 +796 +797 +798 +799 +800 +801 +802 +803 |
|
concept_types: List[Category]
+
+
+ property
+
+
+¶Get the list of concept types supported by this annotator.
+ + +Returns:
+Type | +Description | +
---|---|
+ List[Category]
+ |
+
+
+
+ [Category.PROBLEM] + |
+
pipeline: List[str]
+
+
+ property
+
+
+¶Get the list of processing steps in the annotation pipeline.
+ + +Returns:
+Type | +Description | +
---|---|
+ List[str]
+ |
+
+
+
+ ["preprocessor", "medcat", "list_cleaner", "paragrapher", "postprocessor", "deduplicator"] + |
+
postprocess(concepts)
+
+¶Post-process the concepts and filter out irrelevant concepts.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
concepts |
+
+ List[Concept]
+ |
+
+
+
+ The list of concepts to post-process. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ List[Concept]
+ |
+
+
+
+ The filtered list of concepts. + |
+
miade/annotators.py
process_paragraphs(note, concepts)
+
+¶Process the paragraphs in a note and filter the concepts.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
note |
+
+ Note
+ |
+
+
+
+ The note to process. + |
+ + required + | +
concepts |
+
+ List[Concept]
+ |
+
+
+
+ The list of concepts to filter. + |
+ + required + | +
Returns:
+Type | +Description | +
---|---|
+ List[Concept]
+ |
+
+
+
+ The filtered list of concepts. + |
+
miade/annotators.py
run_pipeline(note, record_concepts=None)
+
+¶Runs the annotation pipeline on a given note and returns the extracted problems concepts.
+ + +Parameters:
+Name | +Type | +Description | +Default | +
---|---|---|---|
note |
+
+ Note
+ |
+
+
+
+ The input note to process. + |
+ + required + | +
record_concepts |
+
+ Optional[List[Concept]]
+ |
+
+
+
+ The list of concepts from existing EHR records. + |
+
+ None
+ |
+
Returns:
+Type | +Description | +
---|---|
+ List[Concept]
+ |
+
+
+
+ List[Concept]: The extracted concepts from the note. + |
+
miade/annotators.py