|
16 | 16 |
|
17 | 17 | # Workflow Manager - Payload APIs
|
18 | 18 |
|
19 |
| -**TEMPLATE** |
| 19 | +## GET /payloads |
20 | 20 |
|
21 |
| -## GET/POST/PUT/DELETE /payloads/ |
| 21 | +Returns a paginated list of Payloads with additional computed property of payloadStatus. |
22 | 22 |
|
23 |
| -*description* |
| 23 | +- If any of the workflow Instances status' attached to that payload are “Created” then the payloadStatus would be “In Progress” |
| 24 | + |
| 25 | +- If all workflow Instances status' attached to that payload are not “Created” then the payloadStatus would be “Complete” |
| 26 | + |
| 27 | +- If there are no workflow Instances attached to that payload then the payloadStatus would be “Complete” |
24 | 28 |
|
25 | 29 | ### Parameters
|
26 | 30 |
|
27 |
| -*parameters* |
| 31 | +(Query) pageNumber: int |
| 32 | + |
| 33 | +(Query) pageSize: int |
| 34 | + |
| 35 | +(Query) maxPageSize: int (default of 10) |
| 36 | + |
| 37 | +(Query) patientId: string |
| 38 | + |
| 39 | +(Query) patientName: string |
28 | 40 |
|
29 | 41 | ### Responses
|
30 | 42 |
|
31 | 43 | Response Content Type: JSON
|
32 | 44 |
|
33 |
| -*response type* |
34 |
| - |
35 | 45 | | Code | Description |
|
36 | 46 | | ---- | --------------------------------------------------------------------------------------------------------------------------------------- |
|
37 |
| -| 200 | Service is healthy. | |
38 |
| -| 503 | Service is unhealthy. | |
| 47 | +| 200 | List of payloads. | |
39 | 48 | | 500 | Server error. The response will be a [Problem details](https://datatracker.ietf.org/doc/html/rfc7807) object with server error details. |
|
40 | 49 |
|
41 | 50 | ### Example Request
|
42 | 51 |
|
43 | 52 | ```bash
|
44 |
| -curl --location --request GET 'http://localhost:5000/workflows' |
| 53 | +curl --location --request GET 'http://localhost:5000/payloads' |
45 | 54 | ```
|
46 | 55 |
|
47 | 56 | ### Example Response
|
48 | 57 |
|
49 | 58 | ```json
|
50 |
| -*sample output* |
| 59 | +{ |
| 60 | + "PageNumber": 1, |
| 61 | + "PageSize": 10, |
| 62 | + "FirstPage": "/payload?pageNumber=1&pageSize=10", |
| 63 | + "LastPage": "/payload?pageNumber=1&pageSize=10", |
| 64 | + "TotalPages": 1, |
| 65 | + "TotalRecords": 3, |
| 66 | + "NextPage": null, |
| 67 | + "PreviousPage": null, |
| 68 | + "Data": |
| 69 | + [ |
| 70 | + { |
| 71 | + "Version": "1.0.0", |
| 72 | + "id": "3042cac6-b8b8-4f65-a2b2-8ec340652c9b", |
| 73 | + "payload_id": "c5c3636b-81dd-44a9-8c4b-71adec7d47b2", |
| 74 | + "workflows": ["1e7b49f2-a3a2-4ded-b489-86ad9b2da9c8"], |
| 75 | + "workflow_instance_ids": [], |
| 76 | + "file_count": 50, |
| 77 | + "correlation_id": "68ccea88-1f40-4eb3-ad23-7f444ac12910", |
| 78 | + "bucket": "bucket_1", |
| 79 | + "calling_aetitle": "Basic_AE", |
| 80 | + "called_aetitle": "MIG", |
| 81 | + "timestamp": "2023-05-03T12:47:59.046Z", |
| 82 | + "files": [], |
| 83 | + "patient_details": |
| 84 | + { |
| 85 | + "patient_id": "732ca351-6267-41e9-a6e8-21b3a74abe7c", |
| 86 | + "patient_name": "Steve Jobs", |
| 87 | + "patient_sex": "male", |
| 88 | + "patient_dob": "1996-02-05T00:00:00Z", |
| 89 | + "patient_age": null, |
| 90 | + "patient_hospital_id": null |
| 91 | + }, |
| 92 | + "payload_status": "Completed", |
| 93 | + "payload_deleted": 1 |
| 94 | + }, |
| 95 | + { |
| 96 | + "Version": "1.0.0", |
| 97 | + "id": "2435a8d7-84f4-407d-9d0e-941bb87b0190", |
| 98 | + "payload_id": "86c0f117-4021-412e-b163-0dc621df672a", |
| 99 | + "workflows": ["3d517d26-118c-4241-beb8-6b51d462c746"], |
| 100 | + "workflow_instance_ids": [], |
| 101 | + "file_count": 3, |
| 102 | + "correlation_id": "1ef12067-0fda-45c6-87b4-bcc4b245e8d9", |
| 103 | + "bucket": "bucket_1", |
| 104 | + "calling_aetitle": "Basic_AE", |
| 105 | + "called_aetitle": "MIG", |
| 106 | + "timestamp": "2023-05-03T12:47:59.046Z", |
| 107 | + "files": [], |
| 108 | + "patient_details": |
| 109 | + { |
| 110 | + "patient_id": "dae4a6d1-573d-4a3f-978f-ed056f628de6", |
| 111 | + "patient_name": "Jane Doe", |
| 112 | + "patient_sex": "female", |
| 113 | + "patient_dob": null, |
| 114 | + "patient_age": null, |
| 115 | + "patient_hospital_id": null |
| 116 | + }, |
| 117 | + "payload_status": "Completed", |
| 118 | + "payload_deleted": 1 |
| 119 | + }, |
| 120 | + { |
| 121 | + "Version": "1.0.0", |
| 122 | + "id": "39d599bc-6635-4f94-9b55-b72a5b11c849", |
| 123 | + "payload_id": "30a8e0c6-e6c4-458f-aa4d-b224b493d3c0", |
| 124 | + "workflows": ["db52fafe-1035-436a-b4ff-50ab850f5f68"], |
| 125 | + "workflow_instance_ids": [], |
| 126 | + "file_count": 3, |
| 127 | + "correlation_id": "40544d26-b4bb-4f67-b4ae-68ff3a237cf2", |
| 128 | + "bucket": "bucket_2", |
| 129 | + "calling_aetitle": "Basic_AE", |
| 130 | + "called_aetitle": "MIG", |
| 131 | + "timestamp": "2023-05-03T12:47:59.046Z", |
| 132 | + "files": [], |
| 133 | + "patient_details": |
| 134 | + { |
| 135 | + "patient_id": null, |
| 136 | + "patient_name": null, |
| 137 | + "patient_sex": null, |
| 138 | + "patient_dob": null, |
| 139 | + "patient_age": null, |
| 140 | + "patient_hospital_id": null |
| 141 | + }, |
| 142 | + "payload_status": "Completed", |
| 143 | + "payload_deleted": 1 |
| 144 | + } |
| 145 | + ], |
| 146 | + "Succeeded": true, |
| 147 | + "Errors": null, |
| 148 | + "Message": null |
| 149 | +} |
51 | 150 | ```
|
52 | 151 |
|
| 152 | +--- |
| 153 | + |
| 154 | +## GET /payloads/{id} |
| 155 | + |
| 156 | +Returns specific payload for given id. |
| 157 | + |
| 158 | +### Parameters |
| 159 | +(Route) id: string - UUID |
| 160 | + |
| 161 | +### Responses |
| 162 | + |
| 163 | +Response Content Type: JSON |
| 164 | + |
| 165 | +| Code | Description | |
| 166 | +| ---- | --------------------------------------------------------------------------------------------------------------------------------------- | |
| 167 | +| 200 | List of payloads. | |
| 168 | +| 400 | [Problem details](https://datatracker.ietf.org/doc/html/rfc7807) Failed to validate id. | |
| 169 | +| 404 | [Problem details](https://datatracker.ietf.org/doc/html/rfc7807) Failed to find payload with payload id. | |
| 170 | +| 500 | Server error. The response will be a [Problem details](https://datatracker.ietf.org/doc/html/rfc7807) object with server error details. | |
| 171 | + |
| 172 | + |
| 173 | +### Example Request |
| 174 | + |
| 175 | +```bash |
| 176 | +curl --location --request GET 'http://localhost:5000/payloads/3042cac6-b8b8-4f65-a2b2-8ec340652c9b' |
| 177 | +``` |
| 178 | + |
| 179 | +### Example Response |
| 180 | +```json |
| 181 | +{ |
| 182 | + "Version": "1.0.0", |
| 183 | + "id": "3042cac6-b8b8-4f65-a2b2-8ec340652c9b", |
| 184 | + "payload_id": "c5c3636b-81dd-44a9-8c4b-71adec7d47b2", |
| 185 | + "workflows": ["1e7b49f2-a3a2-4ded-b489-86ad9b2da9c8"], |
| 186 | + "workflow_instance_ids": [], |
| 187 | + "file_count": 50, |
| 188 | + "correlation_id": "68ccea88-1f40-4eb3-ad23-7f444ac12910", |
| 189 | + "bucket": "bucket_1", |
| 190 | + "calling_aetitle": "Basic_AE", |
| 191 | + "called_aetitle": "MIG", |
| 192 | + "timestamp": "2023-05-03T12:47:59.046Z", |
| 193 | + "files": [], |
| 194 | + "patient_details": |
| 195 | + { |
| 196 | + "patient_id": "732ca351-6267-41e9-a6e8-21b3a74abe7c", |
| 197 | + "patient_name": "Steve Jobs", |
| 198 | + "patient_sex": "male", |
| 199 | + "patient_dob": "1996-02-05T00:00:00Z", |
| 200 | + "patient_age": null, |
| 201 | + "patient_hospital_id": null |
| 202 | + }, |
| 203 | +} |
| 204 | +``` |
| 205 | + |
| 206 | +--- |
| 207 | + |
| 208 | +## DELETE /payloads/{id} |
| 209 | + |
| 210 | +TODO |
| 211 | + |
| 212 | +--- |
0 commit comments