Skip to content

Commit

Permalink
Update hl7 message handling (#43)
Browse files Browse the repository at this point in the history
* Fixes

* Test updates
  • Loading branch information
pmanko authored Mar 23, 2022
1 parent f15bb16 commit d8e6f32
Show file tree
Hide file tree
Showing 7 changed files with 566 additions and 29 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
run: docker-compose -f ci.docker-compose.yml up -d openhim-config

- name: Sleep for 60 seconds
run: sleep 60s
run: sleep 90s
shell: bash

- name: Display docker logs for openhim config
Expand Down Expand Up @@ -125,29 +125,26 @@ jobs:
- name: Show OpenHIM Log
run: docker-compose -f "ci.docker-compose.yml" logs openhim-core

# Newman Container Approach
# Postman Testing - see https://www.postman.com/itechuw/workspace/shared-health-record/
- name: Run General Tests Collection
env:
POSTMAN_COLLECTION: https://www.getpostman.com/collections/481bb6cc8e1e964fd8bd
POSTMAN_COLLECTION: /.postman/collections/1_general_tests.json
run: docker-compose -f ci.docker-compose.yml up --exit-code-from newman newman

- name: Run Laboratory Workflows Collection
- name: Run Laboratory Workflows Collection (collection/1525496-f28b488f-a40c-4723-8a72-a2b4f64bb5da)
env:
POSTMAN_COLLECTION: https://www.getpostman.com/collections/ff5183adca5b5e720338
POSTMAN_COLLECTION: /.postman/collections/2_laboratory_workflows.json
run: docker-compose -f ci.docker-compose.yml up --exit-code-from newman newman

- name: Run Botswana Laboratory Workflows Collection
env:
POSTMAN_COLLECTION: https://www.getpostman.com/collections/2ee8ebff39c078bac256
run: docker-compose -f ci.docker-compose.yml up --exit-code-from newman newman

- name: Run MLLP Tests
run: docker-compose -f ci.docker-compose.yml up --exit-code-from mllp_tests mllp_tests

- name: Show SHR Log
if: always()
run: docker-compose -f "ci.docker-compose.yml" logs shr

- name: Show kafka Log
if: always()
run: docker-compose -f "ci.docker-compose.yml" logs kafka

- name: Stop containers
Expand Down
172 changes: 172 additions & 0 deletions .postman/collections/1_general_tests.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
{
"info": {
"_postman_id": "77f89792-c73b-4c75-a450-5cb6f79230d4",
"name": "1. General Tests",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "OpenHIM Core should be up",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"pm.test(\"Should return heartbeat\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.master).to.exist;",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "noauth"
},
"method": "GET",
"header": [],
"url": {
"raw": "{{openhim-core-url}}/heartbeat",
"host": [
"{{openhim-core-url}}"
],
"path": [
"heartbeat"
]
}
},
"response": []
},
{
"name": "SHR OpenHIM channel should be up",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"pm.test(\"Returns capability statement\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.resourceType).to.eql(\"CapabilityStatement\");",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{openhim-url}}/SHR/fhir/metadata",
"host": [
"{{openhim-url}}"
],
"path": [
"SHR",
"fhir",
"metadata"
]
}
},
"response": []
},
{
"name": "SHR should have patients",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});",
"",
"pm.test(\"Returns searchset Bundle\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.resourceType).to.eql(\"Bundle\");",
" pm.expect(jsonData.type).to.eql(\"searchset\");",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "basic",
"basic": [
{
"key": "password",
"value": "postman",
"type": "string"
},
{
"key": "username",
"value": "postman",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"url": {
"raw": "{{openhim-url}}/SHR/fhir/Patient",
"host": [
"{{openhim-url}}"
],
"path": [
"SHR",
"fhir",
"Patient"
]
}
},
"response": []
}
],
"auth": {
"type": "basic",
"basic": [
{
"key": "password",
"value": "postman",
"type": "string"
},
{
"key": "username",
"value": "postman",
"type": "string"
}
]
},
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
]
}
Loading

0 comments on commit d8e6f32

Please sign in to comment.