From 785029899b1328c3174b702173694ecca7c75366 Mon Sep 17 00:00:00 2001 From: Joe Flack Date: Sun, 10 Nov 2024 21:09:42 -0500 Subject: [PATCH] Fast run updates --- src/comp_loinc/loinc_builder_steps.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/comp_loinc/loinc_builder_steps.py b/src/comp_loinc/loinc_builder_steps.py index 841a116..01cf513 100644 --- a/src/comp_loinc/loinc_builder_steps.py +++ b/src/comp_loinc/loinc_builder_steps.py @@ -161,7 +161,7 @@ def loinc_parts_all( count = 0 for node in self.runtime.graph.get_nodes(LoincNodeType.LoincPart): - count = count + 1 + count += 1 if self.configuration.fast_run and count > 100: break status = node.get_property(LoincPartProps.status) @@ -197,8 +197,12 @@ def entity_labels(self): loinc_tree_loader.load_method_tree() loinc_tree_loader.load_document_tree() + count = 0 loinc_term: LoincTerm for loinc_term in self.runtime.current_module.get_entities_of_type(LoincTerm): + count += 1 + if self.configuration.fast_run and count > 5000: + break node = self.runtime.graph.get_node_by_code( type_=LoincNodeType.LoincTerm, code=loinc_term.id ) @@ -253,8 +257,12 @@ def entity_annotations(self): loinc_tree_loader.load_method_tree() loinc_tree_loader.load_document_tree() + count = 0 loinc_term: LoincTerm for loinc_term in self.runtime.current_module.get_entities_of_type(LoincTerm): + count += 1 + if self.configuration.fast_run and count > 5000: + break node = self.runtime.graph.get_node_by_code( type_=LoincNodeType.LoincTerm, code=loinc_term.id ) @@ -364,7 +372,11 @@ def loinc_part_hierarchy_all(self): loinc_tree_loader.load_method_tree() loinc_tree_loader.load_document_tree() + count = 0 for child_part_node in graph.get_nodes(type_=LoincNodeType.LoincPart): + count += 1 + if self.configuration.fast_run and count > 100: + break child_part_number = child_part_node.get_property( type_=LoincPartProps.part_number ) @@ -510,10 +522,14 @@ def loinc_term_supplementary_def(self): loinc_loader = LoincLoader(graph=graph, configuration=self.configuration) loinc_loader.load_accessory_files__part_file__loinc_part_link_supplementary_csv() + count = 0 loinc_term: LoincTerm for loinc_term in self.runtime.current_module.get_entities_of_type( entity_class=LoincTerm ): + count += 1 + if self.configuration.fast_run and count > 5000: + break loinc_term_id = loinc_term.id loinc_term_node = self.runtime.graph.get_node_by_code( type_=LoincNodeType.LoincTerm, code=loinc_term_id