-
Notifications
You must be signed in to change notification settings - Fork 1
feat(bbmri-miabis): add MIABIS-on-FHIR + BBMRI.de mixed-node E2E test #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
a-tuerk
wants to merge
9
commits into
samply:main
Choose a base branch
from
a-tuerk:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
61a18f4
feat(bbmri-miabis): add mixed-node MIABIS + BBMRI.de E2E test
65512ec
docs(bbmri-miabis): update README for 8-scenario mixed-node setup
8849218
fix(bbmri-miabis): use double base64 encoding for Spot queries
1afec2a
fix(bbmri-miabis): wrap AST in ast::Ast envelope before base64 encoding
95e70f6
fix(bbmri-miabis): address remaining PR #4 review feedback
5191e1a
fix(bbmri-miabis): address final PR #4 review suggestions
e9d199e
docs(bbmri-miabis): add troubleshooting section for Compose v5 and Sp…
41ceac1
docs(bbmri-miabis): expand troubleshooting section with remaining got…
ba8a7d7
fix(bbmri-miabis): switch focus image to develop; adopt docker compos…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| ## MIABIS-on-FHIR + BBMRI.de mixed-node Locator | ||
|
|
||
| Tests a federated search across two nodes: one running MIABIS-on-FHIR data (focus with `CQL_FLAVOUR=miabis`) and one running BBMRI.de data (focus with default flavour). | ||
|
|
||
| ```bash | ||
| # Local mode (manual UI testing at http://localhost:3000/search/) | ||
| docker compose -f bbmri-miabis/compose.local.yaml up --pull always | ||
|
|
||
| # Local mode with automated tests | ||
| docker compose -f bbmri-miabis/compose.local.yaml up -d | ||
| docker compose -f bbmri-miabis/compose.local.yaml wait tester && echo success | ||
| ``` | ||
|
|
||
| ### What this tests | ||
|
|
||
| Eight scenarios across a 2-node federation (MIABIS-on-FHIR node + BBMRI.de node). Counts are totals across both sites. | ||
|
|
||
| **Test data summary:** | ||
| - MIABIS node (`proxy2`, `CQL_FLAVOUR=miabis`): p1 (female, C34) — Plasma/LN + TissueFixed/RT; p2 (male, C18) — WholeBlood/LN | ||
| - BBMRI.de node (`proxy3`, default CQL flavour): bbmri-p1 (female, C50) — blood-plasma/LN; bbmri-p2 (male, C61) — whole-blood/RT | ||
|
|
||
| **Mixed-node scenarios (validate totals across both sites):** | ||
|
|
||
| | Criterion | MIABIS | BBMRI.de | Total | | ||
| |---|---|---|---| | ||
| | *(empty AST)* | 2 | 2 | 4 | | ||
| | `storage_temperature = temperatureRoom` | 1 (p1, RT specimen) | 1 (bbmri-p2, Room) | 2 | | ||
| | `storage_temperature = temperatureLN` | 2 (p1 + p2, LN specimens) | 1 (bbmri-p1, LN) | 3 | | ||
| | `sample_kind = blood-plasma` | 1 (p1, Plasma) | 1 (bbmri-p1) | 2 | | ||
| | `sample_kind = whole-blood` | 1 (p2, WholeBlood) | 1 (bbmri-p2) | 2 | | ||
|
|
||
| **Diagnosis scenarios (validate BBMRI.de node is unaffected by MIABIS workarounds):** | ||
|
|
||
| | Criterion | MIABIS | BBMRI.de | Total | | ||
| |---|---|---|---| | ||
| | `diagnosis = C34` | 1 (p1) | 0 | 1 | | ||
| | `diagnosis = C50` | 0 | 1 (bbmri-p1) | 1 | | ||
| | `diagnosis = C61` | 0 | 1 (bbmri-p2) | 1 | | ||
|
|
||
| ### Key design points | ||
|
|
||
| **`CQL_FLAVOUR=miabis` (per-site focus config):** Selects the MIABIS-on-FHIR CQL template in focus. Spot continues to send `PROJECT=bbmri` unchanged — only the per-site focus environment variable differs. The BBMRI.de focus instance runs without `CQL_FLAVOUR` and uses the default BBMRI template. | ||
|
|
||
| **`CODE_WORKAROUNDS` translation:** Without it, Lens codes (`temperatureRoom`, `blood-plasma`, etc.) do not exist in MIABIS FHIR data and all filter queries silently return 0. The mixed-node temperature and sample_kind scenarios validate that translation works correctly on the MIABIS node while leaving the BBMRI.de node unaffected. | ||
|
|
||
| ### Test data | ||
|
|
||
| `test-bundle.json` — MIABIS-on-FHIR FHIR transaction bundle: | ||
| - Patient p1 (female, dx C34): Specimen Plasma/LN, Specimen TissueFixed/RT | ||
| - Patient p2 (male, dx C18): Specimen WholeBlood/LN | ||
|
|
||
| `test-bundle-bbmri.json` — BBMRI.de FHIR transaction bundle: | ||
| - Patient bbmri-p1 (female, dx C50): Specimen blood-plasma/LN | ||
| - Patient bbmri-p2 (male, dx C61): Specimen whole-blood/RT | ||
|
|
||
| ### Troubleshooting | ||
|
|
||
| **`--exit-code-from tester` kills the stack immediately (Docker Compose v5):** `--exit-code-from` implies `--abort-on-container-exit`, so `pki-setup` exiting normally after PKI initialisation terminates the entire stack before Blaze becomes healthy. Use `up -d` and run `test.sh` directly instead (see commands above). | ||
|
|
||
| **All scenarios return `got=` on second run:** Spot does not re-stream results for a task ID it has already processed. Run `docker compose -f bbmri-miabis/compose.local.yaml down -v` before re-running tests to get a clean stack with fresh task IDs. | ||
|
|
||
| **Spot rejects non-UUID query IDs:** IDs must be in `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx` hex format. Shorthand forms like `test-0001-0000-...` are silently rejected. | ||
|
|
||
| **BBMRI.de filter queries silently return 0:** BBMRI.de focus CQL uses `fhir.bbmri.de` URLs for the StorageTemperature extension and SampleMaterialType CodeSystem. If `test-bundle-bbmri.json` is modified and the wrong namespace (`fhir.bbmri-eric.eu`) is used instead, all filter queries on the BBMRI.de node return 0 with no error. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,123 @@ | ||||||||||||||
| services: | ||||||||||||||
| bbmri-sample-locator: | ||||||||||||||
| image: samply/bbmri-sample-locator:latest | ||||||||||||||
| ports: | ||||||||||||||
| - 3000:3000 | ||||||||||||||
|
TKussel marked this conversation as resolved.
|
||||||||||||||
| environment: | ||||||||||||||
| PUBLIC_SPOT_URL: http://localhost:8055 | ||||||||||||||
|
TKussel marked this conversation as resolved.
|
||||||||||||||
|
|
||||||||||||||
| spot: | ||||||||||||||
| image: samply/rustyspot:latest | ||||||||||||||
| depends_on: | ||||||||||||||
| - proxy1 | ||||||||||||||
| ports: | ||||||||||||||
| - 8055:8055 | ||||||||||||||
| extra_hosts: | ||||||||||||||
| - host.docker.internal:host-gateway | ||||||||||||||
| environment: | ||||||||||||||
| BEAM_PROXY_URL: http://host.docker.internal:4001 | ||||||||||||||
| BEAM_APP_ID: spot.proxy1.broker | ||||||||||||||
| BEAM_SECRET: pass123 | ||||||||||||||
| CORS_ORIGIN: http://localhost:3000 | ||||||||||||||
| PRISM_URL: http://host.docker.internal:8056 | ||||||||||||||
| TRANSFORM: LENS | ||||||||||||||
| PROJECT: bbmri | ||||||||||||||
| SITES: &sites "proxy2,proxy3" | ||||||||||||||
|
|
||||||||||||||
| prism: | ||||||||||||||
| image: samply/prism:main | ||||||||||||||
| depends_on: | ||||||||||||||
| test-data-loader-miabis: | ||||||||||||||
| condition: service_completed_successfully | ||||||||||||||
|
Comment on lines
+30
to
+31
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
| test-data-loader-bbmri: | ||||||||||||||
| condition: service_completed_successfully | ||||||||||||||
| ports: | ||||||||||||||
| - 8056:8056 | ||||||||||||||
| extra_hosts: | ||||||||||||||
| - host.docker.internal:host-gateway | ||||||||||||||
| environment: | ||||||||||||||
| BIND_ADDR: 0.0.0.0:8056 | ||||||||||||||
| BEAM_PROXY_URL: http://host.docker.internal:4001 | ||||||||||||||
| BEAM_APP_ID_LONG: prism.proxy1.broker | ||||||||||||||
| API_KEY: pass123 | ||||||||||||||
| CORS_ORIGIN: any | ||||||||||||||
| PROJECT: bbmri | ||||||||||||||
| SITES: *sites | ||||||||||||||
|
|
||||||||||||||
| focus-miabis: | ||||||||||||||
| image: samply/focus:develop | ||||||||||||||
| depends_on: | ||||||||||||||
| - proxy2 | ||||||||||||||
| extra_hosts: | ||||||||||||||
| - host.docker.internal:host-gateway | ||||||||||||||
| environment: | ||||||||||||||
| BEAM_PROXY_URL: http://host.docker.internal:4002 | ||||||||||||||
| BEAM_APP_ID_LONG: focus.proxy2.broker | ||||||||||||||
| API_KEY: pass123 | ||||||||||||||
| ENDPOINT_TYPE: blaze | ||||||||||||||
| BLAZE_URL: http://host.docker.internal:8080/fhir/ | ||||||||||||||
| OBFUSCATE: no | ||||||||||||||
| CQL_FLAVOUR: miabis | ||||||||||||||
|
|
||||||||||||||
| blaze-miabis: | ||||||||||||||
| image: samply/blaze:0.32 | ||||||||||||||
| ports: | ||||||||||||||
| - 8080:8080 | ||||||||||||||
| healthcheck: | ||||||||||||||
| test: curl -f http://localhost:8080/fhir/metadata | ||||||||||||||
| start_period: 1m | ||||||||||||||
|
|
||||||||||||||
| test-data-loader-miabis: | ||||||||||||||
| image: curlimages/curl:latest | ||||||||||||||
| depends_on: | ||||||||||||||
| blaze-miabis: | ||||||||||||||
| condition: service_healthy | ||||||||||||||
| volumes: | ||||||||||||||
| - ./test-bundle.json:/test-bundle.json:ro | ||||||||||||||
| entrypoint: ["curl", "-sf", "-X", "POST", "http://blaze-miabis:8080/fhir", "-H", "Content-Type: application/fhir+json", "-d", "@/test-bundle.json"] | ||||||||||||||
|
|
||||||||||||||
| focus-bbmri: | ||||||||||||||
| image: samply/focus:develop | ||||||||||||||
| depends_on: | ||||||||||||||
| - proxy3 | ||||||||||||||
| extra_hosts: | ||||||||||||||
| - host.docker.internal:host-gateway | ||||||||||||||
| environment: | ||||||||||||||
| BEAM_PROXY_URL: http://host.docker.internal:4003 | ||||||||||||||
| BEAM_APP_ID_LONG: focus.proxy3.broker | ||||||||||||||
| API_KEY: pass123 | ||||||||||||||
| ENDPOINT_TYPE: blaze | ||||||||||||||
| BLAZE_URL: http://host.docker.internal:8081/fhir/ | ||||||||||||||
|
TKussel marked this conversation as resolved.
|
||||||||||||||
| OBFUSCATE: no | ||||||||||||||
|
|
||||||||||||||
| blaze-bbmri: | ||||||||||||||
| image: samply/blaze:0.32 | ||||||||||||||
| ports: | ||||||||||||||
| - 8081:8080 | ||||||||||||||
| healthcheck: | ||||||||||||||
| test: curl -f http://localhost:8080/fhir/metadata | ||||||||||||||
| start_period: 1m | ||||||||||||||
|
|
||||||||||||||
| test-data-loader-bbmri: | ||||||||||||||
| image: curlimages/curl:latest | ||||||||||||||
| depends_on: | ||||||||||||||
| blaze-bbmri: | ||||||||||||||
| condition: service_healthy | ||||||||||||||
| volumes: | ||||||||||||||
| - ./test-bundle-bbmri.json:/test-bundle-bbmri.json:ro | ||||||||||||||
| entrypoint: ["curl", "-sf", "-X", "POST", "http://blaze-bbmri:8080/fhir", "-H", "Content-Type: application/fhir+json", "-d", "@/test-bundle-bbmri.json"] | ||||||||||||||
|
|
||||||||||||||
| tester: | ||||||||||||||
| image: alpine:latest | ||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
| network_mode: host | ||||||||||||||
| depends_on: | ||||||||||||||
| test-data-loader-miabis: | ||||||||||||||
| condition: service_completed_successfully | ||||||||||||||
| test-data-loader-bbmri: | ||||||||||||||
| condition: service_completed_successfully | ||||||||||||||
| volumes: | ||||||||||||||
| - ./test.sh:/test.sh:ro | ||||||||||||||
| command: sh -c 'apk add -q curl jq bash && bash /test.sh' | ||||||||||||||
|
|
||||||||||||||
| include: | ||||||||||||||
| - ../compose.localbeam.yaml | ||||||||||||||
|
TKussel marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| { | ||
| "resourceType": "Bundle", | ||
| "type": "transaction", | ||
| "entry": [ | ||
| { | ||
| "fullUrl": "urn:uuid:bbmri-patient-1", | ||
| "resource": { | ||
| "resourceType": "Patient", | ||
| "id": "bbmri-patient-1", | ||
| "gender": "female", | ||
| "birthDate": "1972-05-10" | ||
| }, | ||
| "request": { "method": "PUT", "url": "Patient/bbmri-patient-1" } | ||
| }, | ||
| { | ||
| "fullUrl": "urn:uuid:bbmri-patient-2", | ||
| "resource": { | ||
| "resourceType": "Patient", | ||
| "id": "bbmri-patient-2", | ||
| "gender": "male", | ||
| "birthDate": "1968-11-03" | ||
| }, | ||
| "request": { "method": "PUT", "url": "Patient/bbmri-patient-2" } | ||
| }, | ||
| { | ||
| "fullUrl": "urn:uuid:bbmri-condition-1", | ||
| "resource": { | ||
| "resourceType": "Condition", | ||
| "id": "bbmri-condition-1", | ||
| "subject": { "reference": "Patient/bbmri-patient-1" }, | ||
| "code": { | ||
| "coding": [ | ||
| { "system": "http://hl7.org/fhir/sid/icd-10", "code": "C50" } | ||
| ] | ||
| } | ||
| }, | ||
| "request": { "method": "PUT", "url": "Condition/bbmri-condition-1" } | ||
| }, | ||
| { | ||
| "fullUrl": "urn:uuid:bbmri-condition-2", | ||
| "resource": { | ||
| "resourceType": "Condition", | ||
| "id": "bbmri-condition-2", | ||
| "subject": { "reference": "Patient/bbmri-patient-2" }, | ||
| "code": { | ||
| "coding": [ | ||
| { "system": "http://hl7.org/fhir/sid/icd-10", "code": "C61" } | ||
| ] | ||
| } | ||
| }, | ||
| "request": { "method": "PUT", "url": "Condition/bbmri-condition-2" } | ||
| }, | ||
| { | ||
| "fullUrl": "urn:uuid:bbmri-specimen-1", | ||
| "resource": { | ||
| "resourceType": "Specimen", | ||
| "id": "bbmri-specimen-1", | ||
| "subject": { "reference": "Patient/bbmri-patient-1" }, | ||
| "type": { | ||
| "coding": [ | ||
| { | ||
| "system": "https://fhir.bbmri.de/CodeSystem/SampleMaterialType", | ||
| "code": "blood-plasma" | ||
| } | ||
| ] | ||
| }, | ||
| "extension": [ | ||
| { | ||
| "url": "https://fhir.bbmri.de/StructureDefinition/StorageTemperature", | ||
| "valueCodeableConcept": { | ||
| "coding": [ | ||
| { | ||
| "system": "https://fhir.bbmri.de/CodeSystem/StorageTemperature", | ||
| "code": "temperatureLN" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| }, | ||
| "request": { "method": "PUT", "url": "Specimen/bbmri-specimen-1" } | ||
| }, | ||
| { | ||
| "fullUrl": "urn:uuid:bbmri-specimen-2", | ||
| "resource": { | ||
| "resourceType": "Specimen", | ||
| "id": "bbmri-specimen-2", | ||
| "subject": { "reference": "Patient/bbmri-patient-2" }, | ||
| "type": { | ||
| "coding": [ | ||
| { | ||
| "system": "https://fhir.bbmri.de/CodeSystem/SampleMaterialType", | ||
| "code": "whole-blood" | ||
| } | ||
| ] | ||
| }, | ||
| "extension": [ | ||
| { | ||
| "url": "https://fhir.bbmri.de/StructureDefinition/StorageTemperature", | ||
| "valueCodeableConcept": { | ||
| "coding": [ | ||
| { | ||
| "system": "https://fhir.bbmri.de/CodeSystem/StorageTemperature", | ||
| "code": "temperatureRoom" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| }, | ||
| "request": { "method": "PUT", "url": "Specimen/bbmri-specimen-2" } | ||
| } | ||
| ] | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.