Skip to content

Commit

Permalink
feat: changes for the pipeline run
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonKonar committed Dec 7, 2024
1 parent 8a6e25a commit 3db01b9
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 16 deletions.
1 change: 1 addition & 0 deletions .github/comp_override/compose.override.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ services:
environment:
PARSING_MAP_PATH: "/opt/fhir-module/util/default_csv_map.json"
MATERIAL_TYPE_MAP_PATH: "/opt/fhir-module/util/default_csv_material_type_map.json"
MIABIS_MATERIAL_TYPE_MAP_PATH: "/opt/fhir-module/util/default_csv_miabis_material_type_map.json"
RECORDS_FILE_TYPE: "csv"
COLLECTION_MAPPING_ATTRIBUTE : "diagnosis"
volumes:
Expand Down
16 changes: 13 additions & 3 deletions .github/scripts/check-patient-exists.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
#!/bin/bash -e

NUM_OF_PATIENTS=$(curl -X GET http://localhost:8080/fhir/Patient?_summary=count | jq .total)
NUM_OF_CONDITIONS=$(curl -X GET http://localhost:8080/fhir/Condition?_summary=count | jq .total)
NUM_OF_SPECIMENS=$(curl -X GET http://localhost:8080/fhir/Specimen?_summary=count | jq .total)
# Check if a URL was provided as an argument
if [ -z "$1" ]; then
echo "Usage: $0 <base-url>"
echo "Example: $0 http://localhost:8080/fhir"
exit 1
fi

# Get the base URL from the first argument
BASE_URL="$1"

NUM_OF_PATIENTS=$(curl -X GET ${BASE_URL}/Patient?_summary=count | jq .total)
NUM_OF_CONDITIONS=$(curl -X GET ${BASE_URL}/fhir/Condition?_summary=count | jq .total)
NUM_OF_SPECIMENS=$(curl -X GET ${BASE_URL}/fhir/Specimen?_summary=count | jq .total)
if [ "$NUM_OF_PATIENTS" = 0 ] || [ "$NUM_OF_CONDITIONS" = 0 ] || [ "$NUM_OF_SPECIMENS" = 0 ]; then
echo "The upload of resources failed." && exit 1
fi
16 changes: 13 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,20 @@ jobs:
- name: Wait for Blaze
run: .github/scripts/wait-for-url.sh http://localhost:8080/health

- name: Wait for MIABIS Blaze
run: .github/scripts/wait-for-url.sh http://localhost:5432/health

- name: Docker Logs
run: docker logs blaze

- name: Docker Logs
run: sleep 20 && docker logs fhir-module

- name: Verify upload succeeded
run: .github/scripts/check-patient-exists.sh
- name: Verify upload succeeded for blaze
run: .github/scripts/check-patient-exists.sh http://localhost:8080/fhir

- name: Verify upload succeeded for MIABIS blaze
run: .github/scripts/check-patient-exists.sh http://localhost:5432/fhir

system-test-csv:
name: System test csv files
Expand Down Expand Up @@ -177,15 +182,20 @@ jobs:
- name: Wait for Blaze
run: .github/scripts/wait-for-url.sh http://localhost:8080/health

- name: Wait for MIABIS Blaze
run: .github/scripts/wait-for-url.sh http://localhost:5432/health

- name: Docker Logs
run: docker logs blaze

- name: Docker Logs
run: sleep 20 && docker logs fhir-module

- name: Verify upload succeeded
run: .github/scripts/check-patient-exists.sh
run: .github/scripts/check-patient-exists.sh http://localhost:8080/fhir

- name: Verify upload succeeded for MIABIS blaze
run: .github/scripts/check-patient-exists.sh http://localhost:5432/fhir


build-push-image:
Expand Down
41 changes: 32 additions & 9 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
version: "3.9"

services:
fhir-module:
image: ghcr.io/bbmri-cz/fhir-module:latest
image: local_fhir_module
container_name: fhir-module
profiles:
- dev
Expand All @@ -11,7 +9,8 @@ services:
- fhir-integration
restart: no
environment:
BLAZE_URL: "http://blaze:8080/fhir"
BLAZE_URL: "http://test-blaze:8080/fhir"
MIABIS_BLAZE_URL: "http://miabis-blaze:8080/fhir"
DIR_PATH: "/opt/records"
PYTHONWARNINGS: "ignore:Unverified HTTPS request"
volumes:
Expand All @@ -20,19 +19,43 @@ services:
target: "/opt/records"


blaze:
container_name: blaze
image: "samply/blaze:0.22"

miabis-blaze:
container_name: miabis-blaze
image: "samply/blaze:latest"
networks:
- fhir-integration
profiles:
- dev
- prod
environment:
JAVA_TOOL_OPTIONS: "-Xmx2g"
DB_SEARCH_PARAM_BUNDLE: "/app/searchParamBundle.json"
LOG_LEVEL: "debug"
ports:
- "5432:8080"
volumes:
- type: bind
source: "util/searchParamBundle.json"
target: "/app/searchParamBundle.json"

test-blaze:
container_name: test-blaze
image: "samply/blaze:latest"
networks:
- fhir-integration
profiles:
- dev
environment:
BASE_URL: "http://localhost:8080"
JAVA_TOOL_OPTIONS: "-Xmx2g"
DB_SEARCH_PARAM_BUNDLE: "/app/searchParamBundle.json"
LOG_LEVEL: "debug"
ports:
- "8080:8080"
volumes:
- type: bind
source: "util/searchParamBundle.json"
target: "/app/searchParamBundle.json"

networks:
fhir-integration:
fhir-integration:
2 changes: 1 addition & 1 deletion test/xml_data/MMCI_1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</tissue>
</LTS>
<STS>
<diagnosisMaterial number="136043" sampleId="&amp;:2032:136043" year="2032">
<diagnosisMaterial number="136043" sampleId="BBM:2032:136043" year="2032">
<materialType>S</materialType>
<diagnosis>C509</diagnosis>
<takingDate>2032-10-4T10:02:00</takingDate>
Expand Down

0 comments on commit 3db01b9

Please sign in to comment.