-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bruno scripts for validating delete and $expunge
- Loading branch information
1 parent
6397064
commit 8221ee6
Showing
20 changed files
with
424 additions
and
0 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,11 @@ | ||
meta { | ||
name: Capability Statement | ||
type: http | ||
seq: 1 | ||
} | ||
|
||
get { | ||
url: {{base_url}}/metadata | ||
body: none | ||
auth: none | ||
} |
24 changes: 24 additions & 0 deletions
24
...o/SupplementalDataStore/Create Resources (auth patient)/Create Encounter (my.patient).bru
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,24 @@ | ||
meta { | ||
name: Create Encounter (my.patient) | ||
type: http | ||
seq: 1 | ||
} | ||
|
||
put { | ||
url: {{base_url}}/Encounter/enc.0001 | ||
body: json | ||
auth: inherit | ||
} | ||
|
||
headers { | ||
Accept: application/json | ||
X-Partition-Name: {{url_auth}} | ||
} | ||
|
||
body:json { | ||
{ | ||
"id": "enc.0001", | ||
"resourceType": "Encounter", | ||
"subject": { "reference": "{{pat_id_auth}}" } | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
.../SupplementalDataStore/Create Resources (auth patient)/Search Encounters (my.patient).bru
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,20 @@ | ||
meta { | ||
name: Search Encounters (my.patient) | ||
type: http | ||
seq: 2 | ||
} | ||
|
||
get { | ||
url: {{base_url}}/Encounter?subject={{pat_id_auth}} | ||
body: none | ||
auth: inherit | ||
} | ||
|
||
params:query { | ||
subject: {{pat_id_auth}} | ||
} | ||
|
||
headers { | ||
Accept: application/json | ||
X-Partition-Name: {{url_auth}} | ||
} |
19 changes: 19 additions & 0 deletions
19
bruno/SupplementalDataStore/Create Resources (local)/Create New Local Patient.bru
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,19 @@ | ||
meta { | ||
name: Create New Local Patient | ||
type: http | ||
seq: 1 | ||
} | ||
|
||
post { | ||
url: {{base_url}}/Patient | ||
body: json | ||
auth: inherit | ||
} | ||
|
||
headers { | ||
Accept: application/json | ||
} | ||
|
||
body:json { | ||
{ "resourceType": "Patient" } | ||
} |
24 changes: 24 additions & 0 deletions
24
.../SupplementalDataStore/Create Resources (other patient)/Create Encounter (my.patient).bru
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,24 @@ | ||
meta { | ||
name: Create Encounter (my.patient) | ||
type: http | ||
seq: 1 | ||
} | ||
|
||
put { | ||
url: {{base_url}}/Encounter/enc.9001 | ||
body: json | ||
auth: inherit | ||
} | ||
|
||
headers { | ||
Accept: application/json | ||
X-Partition-Name: {{url_other}} | ||
} | ||
|
||
body:json { | ||
{ | ||
"id": "enc.9001", | ||
"resourceType": "Encounter", | ||
"subject": { "reference": "{{pat_id_other}}" } | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...SupplementalDataStore/Create Resources (other patient)/Search Encounters (my.patient).bru
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,20 @@ | ||
meta { | ||
name: Search Encounters (my.patient) | ||
type: http | ||
seq: 2 | ||
} | ||
|
||
get { | ||
url: {{base_url}}/Encounter?subject={{pat_id_other}} | ||
body: none | ||
auth: inherit | ||
} | ||
|
||
params:query { | ||
subject: {{pat_id_other}} | ||
} | ||
|
||
headers { | ||
Accept: application/json | ||
X-Partition-Name: {{url_other}} | ||
} |
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,27 @@ | ||
meta { | ||
name: Expunge (local) | ||
type: http | ||
seq: 3 | ||
} | ||
|
||
post { | ||
url: {{base_url}}/{{pat_id_local}}/$expunge | ||
body: json | ||
auth: inherit | ||
} | ||
|
||
body:json { | ||
{ | ||
"resourceType": "Parameters", | ||
"parameter": [ | ||
{ | ||
"name": "expungeDeletedResources", | ||
"valueBoolean": true | ||
}, | ||
{ | ||
"name": "_cascade", | ||
"valueString": "delete" | ||
} | ||
] | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
bruno/SupplementalDataStore/Expunge/Expunge (my.patient).bru
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,31 @@ | ||
meta { | ||
name: Expunge (my.patient) | ||
type: http | ||
seq: 1 | ||
} | ||
|
||
post { | ||
url: {{base_url}}/{{pat_id_auth}}/$expunge | ||
body: json | ||
auth: inherit | ||
} | ||
|
||
headers { | ||
X-Partition-Name: {{url_auth}} | ||
} | ||
|
||
body:json { | ||
{ | ||
"resourceType": "Parameters", | ||
"parameter": [ | ||
{ | ||
"name": "expungeDeletedResources", | ||
"valueBoolean": true | ||
}, | ||
{ | ||
"name": "_cascade", | ||
"valueString": "delete" | ||
} | ||
] | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
bruno/SupplementalDataStore/Expunge/Expunge (other.patient).bru
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,27 @@ | ||
meta { | ||
name: Expunge (other.patient) | ||
type: http | ||
seq: 2 | ||
} | ||
|
||
post { | ||
url: {{base_url}}/{{pat_id_auth}}/$expunge | ||
body: json | ||
auth: inherit | ||
} | ||
|
||
body:json { | ||
{ | ||
"resourceType": "Parameters", | ||
"parameter": [ | ||
{ | ||
"name": "expungeDeletedResources", | ||
"valueBoolean": true | ||
}, | ||
{ | ||
"name": "_cascade", | ||
"valueString": "delete" | ||
} | ||
] | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
bruno/SupplementalDataStore/Linkage/Search All Linkages.bru
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,16 @@ | ||
meta { | ||
name: Search All Linkages | ||
type: http | ||
seq: 1 | ||
} | ||
|
||
get { | ||
url: {{base_url}}/Linkage | ||
body: none | ||
auth: inherit | ||
} | ||
|
||
headers { | ||
Accept: application/json | ||
Origin: http://localhost:9999 | ||
} |
51 changes: 51 additions & 0 deletions
51
bruno/SupplementalDataStore/Linkage/Search My Linkages.bru
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,51 @@ | ||
meta { | ||
name: Search My Linkages | ||
type: http | ||
seq: 2 | ||
} | ||
|
||
get { | ||
url: {{base_url}}/Linkage?item={{pat_id_auth}} | ||
body: none | ||
auth: inherit | ||
} | ||
|
||
params:query { | ||
item: {{pat_id_auth}} | ||
} | ||
|
||
headers { | ||
Accept: application/json | ||
} | ||
|
||
script:post-response { | ||
function unexpectedData( msg ) { | ||
console.error( msg ); | ||
return null ; | ||
} | ||
|
||
function extractSourcePatId( body ) { | ||
if ( body.resourceType !== 'Bundle' ) | ||
return unexpectedData( `resource is not a Bundle` ) ; | ||
if ( !body.entry ) | ||
return unexpectedData( `bundle has no entries` ) ; | ||
for ( const entry of body.entry ) { | ||
if ( !entry.resource ) | ||
continue ; | ||
const resource = entry.resource ; | ||
if ( resource.resourceType !== 'Linkage' ) | ||
return unexpectedData( `resource is not a Linkage` ) ; | ||
for ( const item of resource.item ) { | ||
if ( item.type == 'source' ) | ||
return item.resource.reference ; | ||
} | ||
} | ||
return unexpectedData(`missing entry with source item`); | ||
} | ||
|
||
const pat_id_local = extractSourcePatId(res.body) ; | ||
if ( pat_id_local ) | ||
bru.setEnvVar( 'pat_id_local', pat_id_local ) ; | ||
else | ||
bru.setEnvVar( 'pat_id_local', `---not set---` ) ; | ||
} |
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,23 @@ | ||
meta { | ||
name: Read Patient (local) | ||
type: http | ||
seq: 3 | ||
} | ||
|
||
get { | ||
url: {{base_url}}/{{pat_id_local}} | ||
body: none | ||
auth: inherit | ||
} | ||
|
||
headers { | ||
Accept: application/json | ||
} | ||
|
||
body:json { | ||
{ | ||
"id": "enc.0001", | ||
"resourceType": "Encounter", | ||
"subject": { "reference": "{{pat_id_auth}}" } | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
bruno/SupplementalDataStore/Read/Read Patient (my.patient).bru
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,24 @@ | ||
meta { | ||
name: Read Patient (my.patient) | ||
type: http | ||
seq: 1 | ||
} | ||
|
||
get { | ||
url: {{base_url}}/{{pat_id_auth}} | ||
body: none | ||
auth: inherit | ||
} | ||
|
||
headers { | ||
Accept: application/json | ||
X-Partition-Name: {{url_auth}} | ||
} | ||
|
||
body:json { | ||
{ | ||
"id": "enc.0001", | ||
"resourceType": "Encounter", | ||
"subject": { "reference": "{{pat_id_auth}}" } | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
bruno/SupplementalDataStore/Read/Read Patient (other.patient).bru
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,24 @@ | ||
meta { | ||
name: Read Patient (other.patient) | ||
type: http | ||
seq: 2 | ||
} | ||
|
||
get { | ||
url: {{base_url}}/{{pat_id_other}} | ||
body: none | ||
auth: inherit | ||
} | ||
|
||
headers { | ||
Accept: application/json | ||
X-Partition-Name: {{url_other}} | ||
} | ||
|
||
body:json { | ||
{ | ||
"id": "enc.0001", | ||
"resourceType": "Encounter", | ||
"subject": { "reference": "{{pat_id_auth}}" } | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
bruno/SupplementalDataStore/Soft Delete/Soft Delete (local).bru
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,19 @@ | ||
meta { | ||
name: Soft Delete (local) | ||
type: http | ||
seq: 3 | ||
} | ||
|
||
delete { | ||
url: {{base_url}}/{{pat_id_local}}?_cascade=delete | ||
body: none | ||
auth: inherit | ||
} | ||
|
||
params:query { | ||
_cascade: delete | ||
} | ||
|
||
headers { | ||
Accept: application/json | ||
} |
20 changes: 20 additions & 0 deletions
20
bruno/SupplementalDataStore/Soft Delete/Soft Delete (my.patient).bru
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,20 @@ | ||
meta { | ||
name: Soft Delete (my.patient) | ||
type: http | ||
seq: 1 | ||
} | ||
|
||
delete { | ||
url: {{base_url}}/{{pat_id_auth}}?_cascade=delete | ||
body: none | ||
auth: inherit | ||
} | ||
|
||
params:query { | ||
_cascade: delete | ||
} | ||
|
||
headers { | ||
Accept: application/json | ||
X-Partition-Name: {{url_auth}} | ||
} |
Oops, something went wrong.