Skip to content

Commit

Permalink
reformatted
Browse files Browse the repository at this point in the history
  • Loading branch information
bwalsh committed Jan 4, 2025
1 parent 31de8e4 commit 48fb4b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
14 changes: 3 additions & 11 deletions fhir_query/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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}"
Expand Down Expand Up @@ -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

Expand Down
5 changes: 3 additions & 2 deletions fhir_query/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 48fb4b3

Please sign in to comment.