Skip to content

Commit f8d5969

Browse files
committed
OpenConceptLab/ocl_issues#1912 | Updated Bulk Import GET API documentation
1 parent 6ed0fe2 commit f8d5969

File tree

1 file changed

+50
-43
lines changed

1 file changed

+50
-43
lines changed

docs/source/oclapi/apireference/bulkimporting.md

+50-43
Original file line numberDiff line numberDiff line change
@@ -303,49 +303,56 @@ To view the final outcome of a previous bulk import, use a GET request to specif
303303
GET /importers/bulk-import/?task=:taskid[&result=:format]
304304
```
305305
* GET Request Parameters:
306-
* **task** (Required for GET request) - Task ID of a previously submitted bulk import request
307-
* **result** (Optional) - default="summary"; format of the results to be returned. Options are:
308-
* **summary** -- one line of plain text (see `OclImportResults.get_detailed_summary()`)
309-
* **report** -- longer report of plain text (see `OclImportResults.display_report()`)
310-
* **json** -- full results object serialized to JSON (see `OclImportResults.to_json()`)
311-
_”Summary” example_
312-
```
313-
Processed 348 of 348 -- 346 NEW (200:39, 201:307); 1 UPDATE (200:1); 1 DELETE (200:1)
314-
```
315-
316-
317-
_”Report” example_
318-
319-
320-
```
321-
REPORT OF IMPORT RESULTS:
322-
/orgs/DATIM-MOH-BW-FY19/collections/HTS-TST-N-MOH-HllvX50cXC0/:
323-
NEW 200:
324-
[{"message": "Added the latest versions of concept to the collection. Future updates will not be added automatically.",
325-
"added": true, "expression":
326-
...
327-
```
328-
329-
330-
_”JSON” example_
331-
332-
333-
334-
335-
```
336-
{
337-
"count": 348,
338-
"elapsed_seconds": 94.10947012901306,
339-
"total_lines": 348,
340-
"num_skipped": 0,
341-
"results": {
342-
"/orgs/DATIM-MOH-BW-FY19/collections/HTS-TST-N-MOH-HllvX50cXC0/": {
343-
"NEW": {
344-
"200": [
345-
{
346-
"obj_type": "Reference",
347-
"text": "{\"data\": {\"expressions\": [\"/orgs/DATIM-MOH-BW-FY19/sources/DATIM-Alignment-Indicators/mappings/MAP-DATIM-HAS-OPTION-HTS_TST_N_MOH-HllvX50cXC0/\", \"/orgs/PEPFAR/sources/DATIM-MOH-FY19/concepts/HTS_TST_N_MOH/\", \"/orgs/PEPFAR/sources/DATIM-MOH-FY19/concepts/HllvX50cXC0/\", \"/orgs/DATIM-MOH-BW-FY19/sources/
348-
```
306+
* **task=\<str:uuid\>** (Required for GET request) - Task ID of a previously submitted bulk import request
307+
* **result=json** (Optional) - full results object serialized to JSON (see `OclImportResults.to_json()`)
308+
309+
Default GET Response (without `?result=json`) has:
310+
1. "message" (string)
311+
```doctest
312+
Started: 2024-08-08 02:58:04.072628 | Processed: 62/62 | Created: 48 | Updated: 1 | Deleted: 0 | Existing: 1 | Permission Denied: 0 | Unchanged: 11 | Time: 41.45secs
313+
```
314+
2. ”report” (json) -- Summary of the results in counts
315+
```json
316+
{
317+
"total": <int>, # Total number of lines/requests in the import content
318+
"processed": <int>, # Number of lines/requests processed
319+
"created": <int>, # Number of new resources created
320+
"updated": <int>, # Number of new resources updated
321+
"invalid": int, # Number of invalid (bad) resources
322+
"exists": <int>, # Number of resources that already exist
323+
"failed": <int>, # Number of resources that failed to be created/updated
324+
"exception": <int>, # Number of resources that caused an exception
325+
"deleted": <int>, # Number of resources that were deleted
326+
"others": <int>, # Number of resources that OCL had no idea on what to do with
327+
"unknown": <int>, # Number of resources that had "resource_type" unknown to OCL
328+
"permission_denied": <int>, # Number of resources that the user did not have permission to create/update
329+
"unchanged": <int>, # Number of resources that were unchanged due to same standard checksum
330+
"elapsed_seconds": <float:seconds>, # Time taken to process the import
331+
"start_time": <str:datetime-utc>, # Time the import started
332+
"child_resource_time_distribution": {
333+
"concept": <float:seconds>, # Time taken to process concepts
334+
"mapping": <float:seconds> # Time taken to process mappings
335+
}
336+
}
337+
```
338+
339+
340+
GET Response with `?result=json` has:
341+
1. "result" (json):
342+
```json
343+
{
344+
"count": 348,
345+
"elapsed_seconds": 94.10947012901306,
346+
"total_lines": 348,
347+
"num_skipped": 0,
348+
"results": {
349+
"/orgs/DATIM-MOH-BW-FY19/collections/HTS-TST-N-MOH-HllvX50cXC0/": {
350+
"NEW": {
351+
"200": [
352+
{
353+
"obj_type": "Reference",
354+
"text": "{\"data\": {\"expressions\": [\"/orgs/DATIM-MOH-BW-FY19/sources/DATIM-Alignment-Indicators/mappings/MAP-DATIM-HAS-OPTION-HTS_TST_N_MOH-HllvX50cXC0/\", \"/orgs/PEPFAR/sources/DATIM-MOH-FY19/concepts/HTS_TST_N_MOH/\", \"/orgs/PEPFAR/sources/DATIM-MOH-FY19/concepts/HllvX50cXC0/\", \"/orgs/DATIM-MOH-BW-FY19/sources/
355+
```
349356
350357
351358
* Notes:

0 commit comments

Comments
 (0)