diff --git a/pyproject.toml b/pyproject.toml index f92a7af..2e3eec3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,6 +26,9 @@ test = ["pytest==8.4.1"] minversion = "6.0" testpaths = ["tests"] python_files = ["tests.py"] +pythonpath = [ + "." +] [tool.uv.build-backend] module-name = "sqlonfhir" diff --git a/sqlonfhir/sqlonfhir.py b/sqlonfhir/sqlonfhir.py index d2e53c2..e4377c5 100644 --- a/sqlonfhir/sqlonfhir.py +++ b/sqlonfhir/sqlonfhir.py @@ -5,10 +5,6 @@ from fhirpathpy.models import models -def upper_first(string): - return string[:1].upper() + string[1:] - - # This is here to change identified.ofType(boolean) to identifiedBoolean.ofType(boolean) # This function should be replaced at some point as fhirpathpy and the SQL on FHIR specifications converge def escape_path(path): @@ -204,9 +200,7 @@ def move_functions(view, function, sub_functions): def replace_constants(path, view_definition): - if "constant" not in view_definition: - return path - for constant in view_definition["constant"]: + for constant in view_definition.get("constant") or []: value_key = [vk for vk in constant.keys() if vk.startswith("value")] if "valueBoolean" in constant: path = path.replace(