Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions eng/bruno/Fhir/History/folder.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
meta {
name: History
seq: 1
}
20 changes: 20 additions & 0 deletions eng/bruno/Fhir/History/instance-history.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
meta {
name: Instance history
type: http
seq: 1
}

get {
url: {{fhirBase}}/Patient/{{patientId}}/_history
body: none
auth: inherit
}

assert {
res.status: eq 200
res.body.resourceType: eq Bundle
}

docs {
Every version of one patient, as a `history` `Bundle`. Needs `patientId`.
}
24 changes: 24 additions & 0 deletions eng/bruno/Fhir/History/system-history.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
meta {
name: System history
type: http
seq: 3
}

get {
url: {{fhirBase}}/_history?_count=5
body: none
auth: inherit
}

params:query {
_count: 5
}

assert {
res.status: eq 200
res.body.resourceType: eq Bundle
}

docs {
Version history across every resource type on the server.
}
24 changes: 24 additions & 0 deletions eng/bruno/Fhir/History/type-history.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
meta {
name: Type history
type: http
seq: 2
}

get {
url: {{fhirBase}}/Patient/_history?_count=5
body: none
auth: inherit
}

params:query {
_count: 5
}

assert {
res.status: eq 200
res.body.resourceType: eq Bundle
}

docs {
Version history across all patients.
}
21 changes: 21 additions & 0 deletions eng/bruno/Fhir/History/version-read.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
meta {
name: Read version
type: http
seq: 4
}

get {
url: {{fhirBase}}/Patient/{{patientId}}/_history/{{patientVersionId}}
body: none
auth: inherit
}

assert {
res.status: eq 200
res.body.resourceType: eq Patient
}

docs {
Reads one specific version. Needs `patientId` and `patientVersionId`, both saved by
**Create Patient (valid)**.
}
15 changes: 15 additions & 0 deletions eng/bruno/Fhir/Operations/everything-instance.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
meta {
name: Everything (instance)
type: http
seq: 1
}

get {
url: {{fhirBase}}/Patient/{{patientId}}/$everything
body: none
auth: inherit
}

docs {
All resources related to the patient instance, as a `Bundle`. Needs `patientId`.
}
4 changes: 4 additions & 0 deletions eng/bruno/Fhir/Operations/folder.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
meta {
name: Operations
seq: 3
}
25 changes: 25 additions & 0 deletions eng/bruno/Fhir/Operations/meta-read.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
meta {
name: Meta (read)
type: http
seq: 2
}

post {
url: {{fhirBase}}/Patient/{{patientId}}/$meta
body: json
auth: inherit
}

headers {
Content-Type: application/fhir+json
}

body:json {
{
"resourceType": "Parameters"
}
}

docs {
The resource's `meta` (tags, profiles, security labels) as `Parameters`. Needs `patientId`.
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
meta {
name: Create Encounter (invalid status code)
type: http
seq: 2
}

post {
url: {{fhirBase}}/Encounter
body: json
auth: inherit
}

headers {
Content-Type: application/fhir+json
}

body:json {
{
"resourceType": "Encounter",
"status": "closed",
"class": {
"system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
"code": "AMB"
}
}
}

assert {
res.status: eq 400
res.body.resourceType: eq OperationOutcome
}

docs {
`status` must be an `EncounterStatus` code. Expect `400` at `Encounter.status`.
}
43 changes: 43 additions & 0 deletions eng/bruno/Fhir/Resources/Encounter/create-encounter-valid.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
meta {
name: Create Encounter (valid)
type: http
seq: 1
}

post {
url: {{fhirBase}}/Encounter
body: json
auth: inherit
}

headers {
Content-Type: application/fhir+json
}

body:json {
{
"resourceType": "Encounter",
"status": "finished",
"class": {
"system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
"code": "AMB",
"display": "ambulatory"
},
"subject": {
"reference": "Patient/{{patientId}}"
}
}
}

vars:pre-request {
patientId: 123
}

assert {
res.status: eq 201
res.body.resourceType: eq Encounter
}

docs {
An ambulatory encounter for the patient. Expect `201`.
}
7 changes: 7 additions & 0 deletions eng/bruno/Fhir/Resources/Encounter/folder.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
meta {
name: Encounter
}

docs {
Create examples for `Encounter`. Needs `patientId`.
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
meta {
name: Create Observation (invalid quantity value)
type: http
seq: 3
}

post {
url: {{fhirBase}}/Observation
body: json
auth: inherit
}

headers {
Content-Type: application/fhir+json
}

body:json {
{
"resourceType": "Observation",
"status": "final",
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "8867-4"
}
]
},
"valueQuantity": {
"value": "not-a-number",
"unit": "beats/minute"
}
}
}

assert {
res.status: eq 400
res.body.resourceType: eq OperationOutcome
}

docs {
`valueQuantity.value` must be a number, not a string. Expect `400`.
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
meta {
name: Create Observation (invalid status code)
type: http
seq: 2
}

post {
url: {{fhirBase}}/Observation
body: json
auth: inherit
}

headers {
Content-Type: application/fhir+json
}

body:json {
{
"resourceType": "Observation",
"status": "done",
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "8867-4"
}
]
}
}
}

assert {
res.status: eq 400
res.body.resourceType: eq OperationOutcome
}

docs {
`status` must be an `ObservationStatus` code. Expect `400` at `Observation.status`.
}
49 changes: 49 additions & 0 deletions eng/bruno/Fhir/Resources/Observation/create-observation-valid.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
meta {
name: Create Observation (valid)
type: http
seq: 1
}

post {
url: {{fhirBase}}/Observation
body: json
auth: inherit
}

headers {
Content-Type: application/fhir+json
}

body:json {
{
"resourceType": "Observation",
"status": "final",
"code": {
"coding": [
{
"system": "http://loinc.org",
"code": "8867-4",
"display": "Heart rate"
}
]
},
"subject": {
"reference": "Patient/{{patientId}}"
},
"valueQuantity": {
"value": 72,
"unit": "beats/minute",
"system": "http://unitsofmeasure.org",
"code": "/min"
}
}
}

assert {
res.status: eq 201
res.body.resourceType: eq Observation
}

docs {
A heart-rate observation for the patient. Expect `201`.
}
7 changes: 7 additions & 0 deletions eng/bruno/Fhir/Resources/Observation/folder.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
meta {
name: Observation
}

docs {
Create and search examples for `Observation`. Needs `patientId`.
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
meta {
name: Search Observations for patient
type: http
seq: 4
}

get {
url: {{fhirBase}}/Observation?subject=Patient/{{patientId}}
body: none
auth: inherit
}

assert {
res.status: eq 200
res.body.resourceType: eq Bundle
}

docs {
Expect `200` with a `searchset` `Bundle`.
}
Loading