Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
eddb507
rebased onto main
MikhailArtemyev Mar 21, 2026
aa84a9b
py:
MikhailArtemyev Mar 30, 2026
47d8b1b
py: format fixes
MikhailArtemyev Mar 30, 2026
075c121
py:
MikhailArtemyev Mar 30, 2026
45093cb
py: test_extension_profile test refactoring
MikhailArtemyev Mar 30, 2026
02a8cce
py: minor changes
MikhailArtemyev Apr 4, 2026
9144004
rebased onto main
MikhailArtemyev Apr 6, 2026
4705eed
py:
MikhailArtemyev Apr 13, 2026
a2bf1e9
py: added tests for generated profiles, mirroring tests in ts example
MikhailArtemyev Apr 14, 2026
5675ef4
py: fixes in slices
MikhailArtemyev Apr 14, 2026
fa0cb8c
py: emit validate_excluded for prohibited value[x] variants
MikhailArtemyev Apr 15, 2026
2e69c9a
py: push_extension accepts pydantic Extension models
MikhailArtemyev Apr 15, 2026
08454b3
py:
MikhailArtemyev Apr 15, 2026
e64b99d
py: added missing snapshot
MikhailArtemyev Apr 15, 2026
a437821
py: fixed to_json method generation
MikhailArtemyev Apr 20, 2026
200f0dc
py: updated python test snapshot
MikhailArtemyev Apr 20, 2026
53b9aa5
py: rebased
MikhailArtemyev May 20, 2026
146870a
py: removed resource_families
MikhailArtemyev May 20, 2026
10fde6d
py: small mypy fix
MikhailArtemyev May 20, 2026
1ea40bd
py: added generics to python from py-generics
MikhailArtemyev May 21, 2026
ba745c8
py: Fixed alias lookup in matches_value and added max/isTypeDiscrimin…
MikhailArtemyev May 21, 2026
de345de
py: typed-slice support for type-discriminated profiles complete
MikhailArtemyev May 21, 2026
b7ef795
py: minor refactoring and fixes
MikhailArtemyev May 21, 2026
39bda88
py: refactoring
MikhailArtemyev May 22, 2026
f75036b
py: refactoring
MikhailArtemyev May 22, 2026
e34dd83
py: refactoring: pyTypeFromIdentifier now lives in naming-utils.ts
MikhailArtemyev May 22, 2026
bfd3941
py: refactoring: removed emitImport(w, module, names) from profile.ts
MikhailArtemyev May 22, 2026
ea9260e
py: refactoring: generateClassBody now takes a single ProfileGenConte…
MikhailArtemyev May 22, 2026
f7d3220
py: profiles:
MikhailArtemyev May 22, 2026
85a4c46
py: profile: Switched from re-flattening profiles on every generation…
MikhailArtemyev May 22, 2026
6a3d00a
Makefile: fix: run unit tests sequentially to avoid OOM from parallel…
MikhailArtemyev May 28, 2026
d5fec15
py: profiles: Check ext.profile before falling back to URL lookup in …
MikhailArtemyev May 28, 2026
1ab07d5
py: refactoring: Extract generateExtensionGetter/Setter skeletons to …
MikhailArtemyev May 28, 2026
aa6d7a5
py: refactoring: removed collectChoiceAccessors
MikhailArtemyev May 28, 2026
4e64771
py: refactoring: restructured profile.ts
MikhailArtemyev May 28, 2026
0b6f416
py: refactoring: removed dead params (_ext, _className), dropped redu…
MikhailArtemyev May 28, 2026
36cceb3
py: example: added us-core-demo with load.py and avg.py
MikhailArtemyev May 28, 2026
ac173ec
py: regenerated the default example
MikhailArtemyev May 28, 2026
b974c2f
py: fix: annotate generic base types with type params from type-discr…
MikhailArtemyev Jun 3, 2026
49a7b64
py: fix: use specific return types on slice getters (Quantity | None …
MikhailArtemyev Jun 3, 2026
afa86d6
py: fix: set_value_X clears sibling choice variants before setting to…
MikhailArtemyev Jun 3, 2026
090987d
py: fixes: removed unrelated code
MikhailArtemyev Jun 10, 2026
4e166d2
py: gitignore trivial fixes
MikhailArtemyev Jun 10, 2026
ff207e0
py: type closed code bindings as Literal in profile accessors
MikhailArtemyev Jun 10, 2026
5ef6084
py: renamed examples to match ts
MikhailArtemyev Jun 10, 2026
3c35b25
py: snapshot update
MikhailArtemyev Jun 10, 2026
7805284
Merge origin/main into py-profiles-new
MikhailArtemyev Jun 10, 2026
291d6ef
py: add python-us-core example to generation, test targets and CI
MikhailArtemyev Jun 12, 2026
6afc307
py: snapshot update
MikhailArtemyev Jun 12, 2026
775c845
py: enable mypy for python-us-core example
MikhailArtemyev Jun 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/sdk-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,25 @@ jobs:
exit 1
fi

test-python-us-core-example:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v5

- name: Setup Bun
uses: oven-sh/setup-bun@v2

- uses: actions/setup-python@v6
with:
python-version: "3.13"

- name: Install dependencies
run: bun install --frozen-lockfile

- name: Run tests
run: make test-python-us-core-example

test-local-package-folder-example:
runs-on: ubuntu-latest

Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
.env.local

# caches
.eslintcache
.cache
*.tsbuildinfo

Expand All @@ -35,7 +36,12 @@ report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# project-specific temp directories
.codegen-cache/
test-output
.lsp
.clj-kondo
/types/
/generated
.typeschema-cache
*.cpuprofile
/examples/tmp/
/examples/python-r4/fhir_types/type-schemas/
/examples/python-us-core/fhir_types/type-schemas/
40 changes: 33 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ VERSION = $(shell cat package.json | grep version | sed -E 's/ *"version": "//'
test-on-the-fly-example test-on-the-fly-norge-r4 test-on-the-fly-kbv-r4 \
test-typescript-r4-example test-typescript-us-core-example test-typescript-sql-on-fhir-example \
test-typescript-ccda-example test-local-package-folder-example test-mustache-java-r4-example \
test-csharp-sdk generate-python-sdk generate-python-sdk-fhirpy \
python-test-setup python-fhirpy-test-setup test-python-sdk test-python-fhirpy-sdk
test-csharp-sdk generate-python-sdk generate-python-sdk-fhirpy generate-python-us-core-sdk \
python-test-setup python-fhirpy-test-setup python-us-core-test-setup \
test-python-sdk test-python-fhirpy-sdk test-python-us-core-example

all: test test-multi-package test-typescript-r4-example test-typescript-us-core-example test-typescript-ccda-example test-typescript-sql-on-fhir-example test-local-package-folder-example lint-unsafe test-all-example-generation

Expand All @@ -31,7 +32,8 @@ typecheck:
$(TYPECHECK)

test: typecheck
bun test --path-ignore-patterns="**/test/api/write-generator/multi-package/**"
@find test -name "*.test.ts" -not -path "*/multi-package/*" | sort | \
xargs -P 1 -I{} sh -c 'echo "==> {}" && bun test {} || exit 255'

test-multi-package: typecheck
bun test test/api/write-generator/multi-package/cda.test.ts
Expand All @@ -54,8 +56,9 @@ test-all-example-generation: test-other-example-generation
bun run examples/csharp/generate.ts
bun run examples/local-package-folder/generate.ts
bun run examples/mustache/mustache-java-r4-gen.ts
bun run examples/python/generate.ts
bun run examples/python-r4/generate.ts
Comment thread
MikhailArtemyev marked this conversation as resolved.
bun run examples/python-fhirpy/generate.ts
bun run examples/python-us-core/generate.ts
bun run examples/typescript-ccda/generate.ts
bun run examples/typescript-r4/generate.ts
bun run examples/typescript-sql-on-fhir/generate.ts
Expand Down Expand Up @@ -114,17 +117,22 @@ test-csharp-sdk: typecheck prepare-aidbox-runme
cd examples/csharp && dotnet test

PYTHON=python3.13
PYTHON_EXAMPLE=./examples/python
PYTHON_EXAMPLE=./examples/python-r4
PYTHON_FHIRPY_EXAMPLE=./examples/python-fhirpy
PYTHON_US_CORE_EXAMPLE=./examples/python-us-core

generate-python-sdk:
$(TYPECHECK) --project examples/python/tsconfig.json
bun run examples/python/generate.ts
$(TYPECHECK) --project examples/python-r4/tsconfig.json
Comment thread
MikhailArtemyev marked this conversation as resolved.
bun run examples/python-r4/generate.ts

generate-python-sdk-fhirpy:
$(TYPECHECK) --project examples/python-fhirpy/tsconfig.json
bun run examples/python-fhirpy/generate.ts

generate-python-us-core-sdk:
$(TYPECHECK) --project examples/python-us-core/tsconfig.json
bun run examples/python-us-core/generate.ts

python-test-setup:
@if [ ! -d "$(PYTHON_EXAMPLE)/venv" ]; then \
cd $(PYTHON_EXAMPLE) && \
Expand All @@ -142,6 +150,14 @@ python-fhirpy-test-setup:
pip install fhirpy; \
fi

python-us-core-test-setup:
@if [ ! -d "$(PYTHON_US_CORE_EXAMPLE)/venv" ]; then \
cd $(PYTHON_US_CORE_EXAMPLE) && \
$(PYTHON) -m venv venv && \
. venv/bin/activate && \
pip install -r fhir_types/requirements.txt; \
fi

test-python-sdk: typecheck prepare-aidbox-runme generate-python-sdk python-test-setup
# Run mypy in strict mode
cd $(PYTHON_EXAMPLE) && \
Expand All @@ -165,3 +181,13 @@ test-python-fhirpy-sdk: typecheck prepare-aidbox-runme generate-python-sdk-fhirp
cd $(PYTHON_FHIRPY_EXAMPLE) && \
. venv/bin/activate && \
mypy --strict .

# Profile tests are offline (no Aidbox required).
test-python-us-core-example: typecheck generate-python-us-core-sdk python-us-core-test-setup
cd $(PYTHON_US_CORE_EXAMPLE) && \
. venv/bin/activate && \
mypy --config-file mypy.ini fhir_types/

cd $(PYTHON_US_CORE_EXAMPLE) && \
. venv/bin/activate && \
python -m pytest -v
Loading
Loading