Skip to content

Commit

Permalink
Update RS's setup instructions (#503)
Browse files Browse the repository at this point in the history
* Updated RS's branch

* - Added step to instructions to set up db before running multiple-settings command
- Added additional step to edit 0149-etor.yml file
- Updated RS API endpoint
- Updated REPORT_STREAM_URL_PREFIX to remove trailing slash
  • Loading branch information
basiliskus authored Aug 28, 2023
1 parent 561388f commit 0377ef3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
"filename": "README.md",
"hashed_secret": "e07f44b0222f3680e0a3491edcf61030143e2ae7",
"is_verified": false,
"line_number": 186,
"line_number": 202,
"is_secret": false
}
],
Expand Down Expand Up @@ -222,5 +222,5 @@
}
]
},
"generated_at": "2023-08-17T18:48:14Z"
"generated_at": "2023-08-28T21:10:46Z"
}
29 changes: 23 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,22 +169,39 @@ CDC including this GitHub page may be subject to applicable federal law, includi
#### CDC-TI Setup

1. Checkout `rs-form-data` branch for `CDCgov/trusted-intermediary`
2. Run TI with `REPORT_STREAM_URL_PREFIX=http://localhost:7071/ ./gradlew clean app:run`
2. Run TI with `REPORT_STREAM_URL_PREFIX=http://localhost:7071 ./gradlew clean app:run`

#### ReportStream Setup

1. Checkout `flexion/test/ti-rs-setup` branch for `CDCgov/prime-reportstream`
2. Follow [the steps in the ReportStream docs](https://github.com/CDCgov/prime-reportstream/blob/master/prime-router/docs/docs-deprecated/getting-started/getting-started.md#first-build) to build the baseline
3. CD to `prime-reportstream/prime-router`
4. Run RS with `docker compose up --build -d`
5. Run `./prime multiple-settings set -i ./settings/staging/0149-etor.yml`
6. Run `./prime organization addkey --public-key /path/to/trusted-intermediary/mock_credentials/organization-trusted-intermediary-public-key-local.pem --scope "flexion.*.report" --orgName flexion --kid flexion.etor-service-sender --doit`
7. Setup local vault secret
5. Run `./gradlew resetDB && ./gradlew reloadTable && ./gradlew reloadSettings`
6. Edit `prime-router/settings/staging/0149-etor.yml`
1. Comment the following two lines under `receivers.transport`:

```
reportUrl: "https://cdcti-staging-api.azurewebsites.net/v1/etor/orders"
authTokenUrl: "https://cdcti-staging-api.azurewebsites.net/v1/auth/token"
```

2. Uncomment the following lines to call the local instance of the API instead:

```
reportUrl: "http://host.docker.internal:8080/v1/etor/orders"
authTokenUrl: "http://host.docker.internal:8080/v1/auth/token"
```

7. Run `./prime multiple-settings set -i ./settings/staging/0149-etor.yml`
8. Run `./prime organization addkey --public-key /path/to/trusted-intermediary/mock_credentials/organization-trusted-intermediary-public-key-local.pem --scope "flexion.*.report" --orgName flexion --kid flexion.etor-service-sender --doit`
9. Setup local vault secret
1. Go to: `http://localhost:8200/`
2. Use token in `prime-router/.vault/env/.env.local` to authenticate
3. Go to `Secrets engines` > `secret/` > `Create secret`
1. Path for this secret: `FLEXION--ETOR-SERVICE-RECEIVER`
2. JSON data:

```
{
"@type": "UserApiKey",
Expand All @@ -195,11 +212,11 @@ CDC including this GitHub page may be subject to applicable federal law, includi

#### Submit request to ReportStream

`curl --header 'Content-Type: application/hl7-v2' --header 'Client: flexion.simulated-hospital' --header 'Authorization: Bearer none' --data-binary '@/path/to/ORM_O01.hl7' 'http://localhost:7071/api/reports'`
`curl --header 'Content-Type: application/hl7-v2' --header 'Client: flexion.simulated-hospital' --header 'Authorization: Bearer none' --data-binary '@/path/to/ORM_O01.hl7' 'http://localhost:7071/api/waters'`

or

`curl --header 'Content-Type: application/fhir+ndjson' --header 'Client: flexion.etor-service-sender' --header 'Authorization: Bearer none' --data-binary '@/path/to/lab_order.json' 'http://localhost:7071/api/reports'`
`curl --header 'Content-Type: application/fhir+ndjson' --header 'Client: flexion.etor-service-sender' --header 'Authorization: Bearer none' --data-binary '@/path/to/lab_order.json' 'http://localhost:7071/api/waters'`

After one or two minutes, check that hl7 files have been dropped to `prime-reportstream/prime-router/build/sftp` folder

Expand Down

0 comments on commit 0377ef3

Please sign in to comment.