Skip to content

Migrate to fhir format#141

Merged
alexlipovka merged 19 commits into
masterfrom
migrate-to-fhir-format
May 22, 2026
Merged

Migrate to fhir format#141
alexlipovka merged 19 commits into
masterfrom
migrate-to-fhir-format

Conversation

@alexlipovka

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread app/aidbox/operations.py Outdated
env_questionnaire_response = extract_client.resource("QuestionnaireResponse", **resource)
elif resource["resourceType"] == "Parameters":
env = await parameter_to_env(extract_client, resource, is_fhir)
env = await parameter_to_env(extract_client, resource, True)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since we drop support for aidbox format, we can get rid of is_fhir flag it as well

Comment thread app/aidbox/settings.py
constraint_legacy_behavior = (
os.getenv("CONSTRAINT_LEGACY_BEHAVIOR", "True").lower() == "true"
)
constraint_legacy_behavior = os.getenv("CONSTRAINT_LEGACY_BEHAVIOR", "True").lower() == "true"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's wrong with formatting? there should be ruff/black formatter that unopinatedly formats the code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's black and isort. Moved to autoformatting to separate blame-ignored commits

Comment thread app/aidbox/utils.py Outdated
Comment thread app/sdc/getters.py Outdated
return [ext["valueCanonical"] for ext in exts if ext.get("valueCanonical")]


def get_item_constraints(extensions: list) -> list[dict]:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexlipovka better to avoid using dicts, create typed dict like LaunchContext (see example above)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread app/sdc/utils.py Outdated

async def parameter_to_env(
client: AsyncFHIRClient, resource, is_fhir: bool = True
client: AsyncFHIRClient, resource: Parameters, is_fhir: bool = True

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's remove is_fhir - it's default behaviour now

result = fhirpath({}, expression, env)

if result == [True if legacy_behavior else False]:
# TODO: calculate error location path

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert todo for future

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry

Comment thread tests/sdc/test_assemble.py Outdated


@pytest.mark.asyncio
async def test_assemble_propagates_cqf_library():

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-write using safedb similar to others

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@alexlipovka alexlipovka merged commit e888220 into master May 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants