From 945a7249a6cd4f881e162338d2bede7b18518f57 Mon Sep 17 00:00:00 2001 From: "eugene.koon" Date: Fri, 13 Sep 2024 09:05:10 -0400 Subject: [PATCH] test with updated order --- .github/workflows/test.yml | 16 +++++++------- docker-compose.yml | 2 -- scripts/curlRequests/example_patient.json | 26 ++++++----------------- 3 files changed, 14 insertions(+), 30 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bba32cb3..c7e3e077 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,7 @@ jobs: options: --privileged env: - FHIR_CONTAINER_NAME: "node-fhir-server-mongo-fhir-1" + FHIR_CONTAINER_NAME: 'node-fhir-server-mongo-fhir-1' steps: - uses: actions/checkout@v4.1.7 @@ -46,7 +46,7 @@ jobs: - name: Test metadata curl request run: | - # Perform the GET request and store the HTTP status code + # Perform the GET request for basic metadata response=$(curl -s -o /dev/null -w "%{http_code}" -X GET -H "Content-Type: application/json" "http://${CONTAINER_IP}:3000/4_0_0/metadata") # Check if the HTTP status code is 200 @@ -57,12 +57,9 @@ jobs: exit 1 fi - - name: Test curl request - run: sh ./scripts/curlRequests/patient_get_test.sh $CONTAINER_IP - - name: Test new patient curl request run: | - # Perform the GET request and store the HTTP status code + # Perform the PUT request to add a new patient response=$(curl -s -o /dev/null -w "%{http_code}" -X PUT -H "Content-Type: application/json" -T scripts/curlRequests/example_patient.json "http://${CONTAINER_IP}:3000/4_0_0/Patient/example") # Check if the HTTP status code is 200 @@ -73,9 +70,12 @@ jobs: exit 1 fi + - name: Test get patient curl request + run: sh ./scripts/curlRequests/patient_get_test.sh "${CONTAINER_IP}" + - name: Test get patient curl request run: | - # Perform the GET request and store the HTTP status code + # Perform the GET request to get the patient response=$(curl -s -o /dev/null -w "%{http_code}" -X GET -H "Content-Type: application/json" "http://${CONTAINER_IP}:3000/4_0_0/Patient/example") # Check if the HTTP status code is 200 @@ -88,7 +88,7 @@ jobs: - name: Test get non-existing patient curl request run: | - # Perform the GET request and store the HTTP status code + # Perform the GET request to get a non existing patient response=$(curl -s -o /dev/null -w "%{http_code}" -X GET -H "Content-Type: application/json" "http://${CONTAINER_IP}:3000/4_0_0/Patient/ghost") # Check if the HTTP status code is NOT 200 diff --git a/docker-compose.yml b/docker-compose.yml index 97a4ba87..a863a5d9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,7 +21,5 @@ services: image: mongo:7.0.14 ports: - '27017' -# volumes: -# - mongo_data:/data/db volumes: mongo_data: diff --git a/scripts/curlRequests/example_patient.json b/scripts/curlRequests/example_patient.json index 1a369757..eb5a7865 100644 --- a/scripts/curlRequests/example_patient.json +++ b/scripts/curlRequests/example_patient.json @@ -31,24 +31,16 @@ { "use": "official", "family": "Chalmers", - "given": [ - "Peter", - "James" - ] + "given": ["Peter", "James"] }, { "use": "usual", - "given": [ - "Jim" - ] + "given": ["Jim"] }, { "use": "maiden", "family": "Windsor", - "given": [ - "Peter", - "James" - ], + "given": ["Peter", "James"], "period": { "end": "2002" } @@ -95,9 +87,7 @@ "use": "home", "type": "both", "text": "534 Erewhon St PeasantVille, Rainbow, Vic 3999", - "line": [ - "534 Erewhon St" - ], + "line": ["534 Erewhon St"], "city": "PleasantVille", "district": "Rainbow", "state": "Vic", @@ -129,9 +119,7 @@ } ] }, - "given": [ - "Bénédicte" - ] + "given": ["Bénédicte"] }, "telecom": [ { @@ -142,9 +130,7 @@ "address": { "use": "home", "type": "both", - "line": [ - "534 Erewhon St" - ], + "line": ["534 Erewhon St"], "city": "PleasantVille", "district": "Rainbow", "state": "Vic",