This repository was archived by the owner on Feb 7, 2025. It is now read-only.
generated from CDCgov/template
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add hurl scripts for Epic/UCSD requests (#1178)
* Added hurl scripts for Epic requests * Renamed hurl script * Updated readme * Fixed links * Added readme file for epic hurl script * Added back context to readme
- Loading branch information
1 parent
5566ce0
commit 25dad76
Showing
4 changed files
with
45 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
client= | ||
audience=https://epicproxy-np.et0502.epichosted.com/FhirProxy/oauth2/token | ||
secret=/path/to/ucsd-epic-private-key.pem | ||
root=$CDCTI_HOME/examples/CA/ | ||
fpath="$1" | ||
shift | ||
|
||
hurl \ | ||
--variable fpath=$fpath \ | ||
--file-root $root \ | ||
--variable jwt=$(jwt encode --exp='+5min' --jti $(uuidgen) --alg RS256 -k $client -i $client -s $client -a $audience --no-iat -S @$secret) \ | ||
results.hurl \ | ||
$@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Epic/UCSD Hurl Script | ||
|
||
## Before running the script | ||
|
||
- Add the `client` id to `.hrl` | ||
- Update the `secret` variable path | ||
|
||
## Usage | ||
|
||
`./hrl <HL7_FILE_NAME>` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# curl -H 'Content-Type: application/x-www-form-urlencoded' --data 'client_assertion=$(jwt encode --exp=+5min --jti $(uuidgen) --alg RS256 -k $client -i $client -s $client -a https://epicproxy-np.et0502.epichosted.com/FhirProxy/oauth2/token --no-iat -S @/path/to/ucsd-epic-private-key.pem)' --data 'client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer' --data 'grant_type=client_credentials' 'https://epicproxy-np.et0502.epichosted.com/FhirProxy/oauth2/token' | ||
POST https://epicproxy-np.et0502.epichosted.com/FhirProxy/oauth2/token | ||
Content-Type: application/x-www-form-urlencoded | ||
[FormParams] | ||
client_assertion: {{jwt}} | ||
client_assertion_type: urn:ietf:params:oauth:client-assertion-type:jwt-bearer | ||
grant_type: client_credentials | ||
|
||
HTTP 200 | ||
|
||
[Captures] | ||
token: jsonpath "$['access_token']" | ||
|
||
# curl -H 'Content-Type: application/hl7-v2' -H 'Authorization: Bearer $token' --data-binary '@/path/to/oru.hl7' 'https://epicproxy-np.et0502.epichosted.com/CDPH_NBGS_TST/api/epic/2015/EDI/HTTP/HL7v2/910377' | ||
POST https://epicproxy-np.et0502.epichosted.com/CDPH_NBGS_TST/api/epic/2015/EDI/HTTP/HL7v2/910377 | ||
Content-Type: application/hl7-v2 | ||
Authorization: Bearer {{token}} | ||
file,{{fpath}}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters