Skip to content

Commit eb3b75e

Browse files
committed
feat!: add new nlp subcommand, require it for any NLP tasks
Right now, there isn't much difference between the "etl" and "nlp" subcommands, except that: - all FHIR resource type tasks must use "etl" - all NLP tasks must use "nlp" - completion tracking isn't used for "nlp" In the future, we'll add more NLP-specific options to the "nlp" subcommand, like document selection args and eventually, some sort of dynamic NLP config options. But for right now, this is just a refactor and splitting out those two subcommands.
1 parent fd75889 commit eb3b75e

File tree

19 files changed

+419
-325
lines changed

19 files changed

+419
-325
lines changed

cumulus_etl/cli.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import rich.logging
1111

1212
from cumulus_etl import common, etl, export, inliner, upload_notes
13-
from cumulus_etl.etl import convert, init
13+
from cumulus_etl.etl import convert, init, nlp
1414

1515

1616
class Command(enum.Enum):
@@ -21,6 +21,7 @@ class Command(enum.Enum):
2121
EXPORT = "export"
2222
INIT = "init"
2323
INLINE = "inline"
24+
NLP = "nlp"
2425
UPLOAD_NOTES = "upload-notes"
2526

2627
# Why isn't this part of Enum directly...?
@@ -72,13 +73,15 @@ async def main(argv: list[str]) -> None:
7273
run_method = init.run_init
7374
elif subcommand == Command.INLINE.value:
7475
run_method = inliner.run_inline
76+
elif subcommand == Command.NLP.value:
77+
run_method = nlp.run_nlp
7578
else:
7679
parser.description = "Extract, transform, and load FHIR data."
7780
if not subcommand:
7881
# Add a note about other subcommands we offer, and tell argparse not to wrap our formatting
7982
parser.formatter_class = argparse.RawDescriptionHelpFormatter
8083
parser.description += "\n\nother commands available:\n"
81-
parser.description += " convert\n export\n init\n inline\n upload-notes"
84+
parser.description += " convert\n export\n init\n inline\n nlp\n upload-notes"
8285
run_method = etl.run_etl
8386

8487
with tempfile.TemporaryDirectory() as tempdir:

cumulus_etl/cli_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def add_task_selection(parser: argparse.ArgumentParser):
117117
task.add_argument(
118118
"--task-filter",
119119
action="append",
120-
choices=["covid_symptom", "cpu", "gpu"],
120+
choices=["covid_symptom", "irae", "cpu", "gpu"],
121121
help="restrict tasks to only the given sets (comma separated)",
122122
)
123123

cumulus_etl/errors.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
INLINE_TASK_FAILED = 39
4040
INLINE_WITHOUT_FOLDER = 40
4141
WRONG_PHI_FOLDER = 41
42+
TASK_NOT_PROVIDED = 42
43+
TASK_MISMATCH = 43
4244

4345

4446
class FatalError(Exception):

0 commit comments

Comments
 (0)