This repository has been archived by the owner on Apr 3, 2024. It is now read-only.
/
index.rst
147 lines (87 loc) · 4.14 KB
/
index.rst
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
***************
/admin/template
***************
Methods to administrate the Template resource.
PUT /admin/template/:template_id
================================
Replace an existing template with the new provided data.
Request format
--------------
The request should be formatted as follows:
**Headers**
.. csv-table::
:header: "Header-Name", "Required", "Description", "Accepted values"
Accept, , Desired response format after a successful update operation., application/json; application/xml
Content-Type, Yes, Format of the content body, application/json; application/xml
Prefer, , Tell the API if you want the updated template data to be returned or not., return=representation | return=minimal
**Body**
The request body can contain the same data as for the client POST request in the desired format.
Response format
---------------
The response will be formatted as follows:
**Headers**
.. csv-table::
:header: "Header-Name", "Description"
Content-Type, Returned data type. Depends on data type sent with "Accept" header.
**Status Codes**
Depending on several request conditions or errors during the request handling there will be one of the following status codes returned:
.. csv-table::
:header: "Code", "Cause/Meaning"
200 (OK), Template has been replaced successfully and the body contains the new Template data after the update.
204 (NO CONTENT), Template has been replaced successfully and the body contains no data since "Prefer" header was set with "return=minimal"
400 (BAD REQUEST), The body contains invalid data to replace the existing content; e.g. missing mandatory fields or data structures that could not be serialized.
404 (NOT FOUND), The Template with provided id cannot be found.
**Body**
Whether the clients requested "Prefer" header setting the full new Template entry after the updated has been applied will be returned or it will be empty.
DELETE /admin/template/:template_id
===================================
Delete the template identified by "template_id" physically from server. Depending on your implementation the entry has to be removed from file or database storage.
Request format
--------------
The request should be formatted as follows:
**Headers**
There are no headers required.
**Body**
No body required
Response format
---------------
The response will be formatted as follows:
**Headers**
There are no extra headers returned
**Status Codes**
Depending on several request conditions or errors during the request handling there will be on of the following status codes returned:
.. csv-table::
:header: "Code", "Cause/Meaning"
204 (NO CONTENT), Template has been deleted successfully.
404 (NOT FOUND), The Template with provided id cannot be found.
422 (UNPROCESSABLE ENTITY), The Request was correct and template can be found but it is still used by compositions.
**Body**
No body returned
DELETE /admin/template/all
==========================
Delete all templates physically from server. Depending on your implementation the entries has to be removed from file or database storage.
.. note:: The EHRbase environment variable "ADMINAPI_ALLOWDELETEALL" must be set to true. Otherwise the endpoint does not accept requests.
Request format
--------------
The request should be formatted as follows:
**Headers**
There are no headers required.
**Body**
No body required
Response format
---------------
The response will be formatted as follows:
**Headers**
There are no extra headers returned
**Status Codes**
Depending on several request conditions or errors during the request handling there will be one of the following status codes returned:
.. csv-table::
:header: "Code", "Cause/Meaning"
200 (OK), Templates have been deleted successfully.
422 (UNPROCESSABLE ENTITY), The Request was correct but there are templates which are still used by compositions.
**Body**
For 200 (OK): The number of deleted templates is returned in the following schema: ::
{
"deleted": integer
}
For 422 (UNPROCESSABLE ENTITY): Body contains message with list of Compositions that are referencing at least one Template.