From aeda36ce36001e73828cab9a0b6f754ad53069c3 Mon Sep 17 00:00:00 2001 From: Piotr Mankowski Date: Wed, 31 Aug 2022 14:30:38 -0700 Subject: [PATCH] Debug setup fixes (#58) * Debug setup fixes * Fixed issue with line endings in HL7 templates * Test fix --- config/config_docker.json | 6 +++--- debug.docker-compose.yml | 10 +++++++--- src/workflows/__tests__/labWorkflowsBw.ts | 2 +- src/workflows/labWorkflowsBw.ts | 4 +++- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/config/config_docker.json b/config/config_docker.json index 025ad6f..f85c845 100644 --- a/config/config_docker.json +++ b/config/config_docker.json @@ -36,9 +36,9 @@ "toIpmsOrmTemplate": "ORM_O01_TO_IPMS.hbs", "fromIpmsOruTemplate": "ORU_R01_FROM_IPMS.hbs", "mllp": { - "targetIp": "127.0.0.1", - "targetAdtPort": 1234, - "targetOrmPort": 1234 + "targetIp": "localhost", + "targetAdtPort": 2100, + "targetOrmPort": 2100 } } } \ No newline at end of file diff --git a/debug.docker-compose.yml b/debug.docker-compose.yml index 6bd8dbd..177e8bd 100644 --- a/debug.docker-compose.yml +++ b/debug.docker-compose.yml @@ -16,18 +16,22 @@ services: hostname: shr build: context: ./ - args: + args: - NODE_AUTH_TOKEN + - NODE_ENV=docker ports: - - 3000:3000 + - 4000:3000 - 3001:3001 + - 3002:3002 - '9229:9229' + extra_hosts: + - "host.docker.internal:host-gateway" environment: - NODE_ENV=docker volumes: - ./config/config_docker.json:/app/config/config_docker.json # - ./config/mediator_ci.json:/app/config/mediator_docker.json - entrypoint: node --inspect=0.0.0.0:9229 ./dist/app.js + entrypoint: node --inspect=0.0.0.0:9229 /app/dist/app.js # tty: true # stdin_open: true # entrypoint: bash diff --git a/src/workflows/__tests__/labWorkflowsBw.ts b/src/workflows/__tests__/labWorkflowsBw.ts index 303973c..f967f2f 100644 --- a/src/workflows/__tests__/labWorkflowsBw.ts +++ b/src/workflows/__tests__/labWorkflowsBw.ts @@ -55,7 +55,7 @@ describe('lab Workflows for Botswana should', () => { beforeAll((done: () => void) => { jest.setTimeout(1000000) - server = new MllpServer('127.0.0.1', 1234) + server = new MllpServer('127.0.0.1', 2100) server.listen() hl7 = fs.readFileSync('./src/__data__/sample_ADT.txt').toString().split('\n').join('\r') diff --git a/src/workflows/labWorkflowsBw.ts b/src/workflows/labWorkflowsBw.ts index ee0eff1..3fbe445 100644 --- a/src/workflows/labWorkflowsBw.ts +++ b/src/workflows/labWorkflowsBw.ts @@ -280,7 +280,7 @@ export class LabWorkflowsBw extends LabWorkflows { let crResult = await got.post(`${crUrl}`, options).json() - logger.info(`CR Patient Update Result: ${crResult}`) + logger.info(`CR Patient Update Result: ${JSON.stringify(crResult)}`) return bundle } @@ -308,6 +308,8 @@ export class LabWorkflowsBw extends LabWorkflows { logger.info(`adt:\n${adtMessage}`) + adtMessage = adtMessage.replace(/[\n\r]/g, '\r'); + let adtResult: String = await sender.send(adtMessage) if (adtResult.includes('AA')) {