From 08fe690ea4012d91c154fb6227727b7ef6852c70 Mon Sep 17 00:00:00 2001 From: Giulia Baldini Date: Thu, 23 Nov 2023 18:05:01 +0100 Subject: [PATCH] Readd fhirpath as optional import --- fhir_pyrate/pirate.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fhir_pyrate/pirate.py b/fhir_pyrate/pirate.py index 9ecf5d1..246d29d 100644 --- a/fhir_pyrate/pirate.py +++ b/fhir_pyrate/pirate.py @@ -11,7 +11,6 @@ from types import TracebackType from typing import Any, Callable, Dict, Generator, List, Optional, Tuple, Type, Union -import fhirpathpy import pandas as pd import requests from dateutil.parser import parse @@ -23,6 +22,10 @@ from fhir_pyrate import Ahoy from fhir_pyrate.util import FHIRObj, string_from_column from fhir_pyrate.util.bundle_processing_templates import flatten_data, parse_fhir_path +from fhir_pyrate.util.imports import optional_import + +# Note to people from the future. This actually should be an optional import to avoid that, if people want to use another version of antlr, this creates crazy errors that the version does not match. In such cases, it is not possible to use fhirpathpy, but the processing functions can still be used. +fhirpathpy, _ = optional_import(module="fhirpathpy") logger = logging.getLogger(__name__)