From 48fb4b3934dba17a1aa95b047b71d09090705001 Mon Sep 17 00:00:00 2001 From: Brian Walsh Date: Sat, 4 Jan 2025 13:52:10 -0800 Subject: [PATCH] reformatted --- fhir_query/__init__.py | 14 +++----------- fhir_query/cli.py | 5 +++-- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/fhir_query/__init__.py b/fhir_query/__init__.py index b0d4854..1ac96c9 100644 --- a/fhir_query/__init__.py +++ b/fhir_query/__init__.py @@ -15,15 +15,7 @@ from dotty_dict import dotty from halo import Halo -UNKNOWN_CATEGORY = { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "261665006", - "display": "Unknown" - } - ] - } +UNKNOWN_CATEGORY = {"coding": [{"system": "http://snomed.info/sct", "code": "261665006", "display": "Unknown"}]} def setup_logging(debug: bool, log_file: str) -> None: @@ -342,7 +334,7 @@ async def process_links( chunks = [_current_path] tasks = [] if len(_current_path) > chunk_size: - chunks = [_current_path[i: i + chunk_size] for i in range(0, len(_current_path), chunk_size)] + chunks = [_current_path[i : i + chunk_size] for i in range(0, len(_current_path), chunk_size)] for chunk in chunks: _params = params.replace("{path}", ",".join(chunk)) query_url = f"{self.fhir_base_url}/{target_id}?{_params}" @@ -468,7 +460,7 @@ async def fetch_resource(self, resource_type: str, spinner: Halo = None) -> list code_counts[code_coding["display"]] += 1 next_link = next((link["url"] for link in data.get("link", []) if link["relation"] == "next"), None) if next_link: - assert 'write-fhir' not in next_link, f"Found write-fhir in from {url} next link: {next_link}" + assert "write-fhir" not in next_link, f"Found write-fhir in from {url} next link: {next_link}" url = next_link return counts diff --git a/fhir_query/cli.py b/fhir_query/cli.py index 39ac6f4..a4f92bc 100644 --- a/fhir_query/cli.py +++ b/fhir_query/cli.py @@ -112,8 +112,9 @@ def vocabularies( async def collect_vocabularies(_runner: VocabularyRunner, _spinner: Halo) -> dict: _counts = await _runner.collect( - resource_types=["Observation", "Condition", "Procedure", "Medication", "Specimen", "Encounter", - "DocumentReference"], spinner=_spinner) # + resource_types=["Observation", "Condition", "Procedure", "Medication", "Specimen", "Encounter", "DocumentReference"], + spinner=_spinner, + ) # return _counts try: