-
Notifications
You must be signed in to change notification settings - Fork 0
/
testrest
155 lines (95 loc) · 3.57 KB
/
testrest
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
## Use in VSCode. Required extension : humao.rest-client
## How to use:
## Define the variables e.g. host
## Upload the examples if needed
@host = https://hapi.fhir.org/baseR4
//@host = https://test.fhir.org/r4
//@host = https://server.fire.ly/r4
### See if host is alive
GET {{host}}/metadata HTTP/1.1
### GET all patients
GET {{host}}/Patient
### GET all Observations
GET {{host}}/Observation
### GET all Observations
GET {{host}}/Observation?_sort=date
### GET a specific Patient using the id
GET {{host}}/Patient/1545788
### GET a specific patient by SEARCHING using the ID
GET {{host}}/Patient?_id=1545788
### POST search
POST {{host}}/Patient/_search HTTP/1.1
Content-Type: application/x-www-form-urlencoded
_id=2081525
### Search for Observation for a specific patient - NOK
GET {{host}}/Observation?subject=Patient/2081525
### POST Search for Observation for a specific patient - NOK
POST {{host}}/Observation/_search HTTP/1.1
Content-Type: application/x-www-form-urlencoded
subject=2081525
### Search Patient by name
POST {{host}}/Patient/_search HTTP/1.1
Content-Type: application/x-www-form-urlencoded
name=Trinh
### Search Patient by name 2
GET {{host}}/Patient/?name="Beutlin"
### Search Patient by birth date
GET {{host}}/Patient?birthdate=eq1991-05-07
### Search Patient by marital status
GET {{host}}/Patient?_maritalStatus=M
### Search Patient by marital status 2
GET {{host}}/Patient?_maritalStatus=https://terminology.hl7.org/CodeSystem/v3-MaritalStatus|U
###Search Patient by gender
GET {{host}}/Patient?gender=male
### Search Patient by gender (NOT)
GET {{host}}/Patient?gender:not=male
### Search Medication Request for a certain Patient
GET {{host}}/MedicationRequest?subject=Patient/5
####
### Search observation for a given patient - literal reference (Patient/xxx)
GET {{host}}/Patient/1545788
### Search observation for a given patient - logical reference (patient.identifier=xxxx)
GET {{host}}/Patient?_id=1545788
### Return a JSON response (?format=json)
GET {{host}}/Patient/1545788?_format=json
### Return a XML response (?format=xml)
GET {{host}}/Patient/1545788?_format=xml
### Return only summary (_summary)
GET {{host}}/Patient?_summary=true
### Return only certain elements (_elements)
GET {{host}}/Patient?_elements=identifier,active,link
### Sort search results
GET {{host}}/Patient?_sort=-birthdate,name
### search: Return only 10 results, then next 10 results
GET {{host}}/Patient?_sort=-birthdate,name&_count=10
### Free text search
GET {{host}}/Patient?given:contains=eve
GET {{host}}/Patient?given:exact=Eve
### search chaining, reverse chaining
#chaining
GET {{host}}/DiagnosticReport?subject:Patient.name=Maria
# reverse Chaining
GET {{host}}/Patient?_has:MedicationRequest:subject:intent=order
### search using _include, _revinclude
#### _include
GET {{host}}/MedicationRequest?_include=MedicationRequest:patient
#### _revinclude with id
GET {{host}}/Patient?_id=5&_revinclude=Observation:subject
#### _revinclude without id
GET {{host}}/Patient?_revinclude=Observation:subject
### search using _contained
GET {{host}}/Medication?_contained=true
### search types (tokens, etc)
#### Search Patient by gender
GET {{host}}/Patient?gender=male
#### Search Patient by gender (NOT)
GET {{host}}/Patient?gender:not=male
### search operators: search patients above 65
GET {{host}}/Patient?birthdate=lt1956-11-03
### todo
GET {{host}}/Observation?subject=Patient/23
GET {{host}}/Observation?_text=glucose
### teste
POST {{host}}/Patient/$graphql HTTP/1.1
Content-Type: application/json
{"query":" { \n Patient(id: example) { id, active } \n }","variables":{}}