Description: This template is used to add events in any CP based on CP Short Title.
Sample CSV File
This operation is allowed via REST API only. REST API details are as below:
> To Upload File:
URL | http://<host>:<port>/ openspecimen/rest/ng/import-jobs/input-file |
Method | POST |
Request | application/json |
File | CSV File to be uploaded Ex: cpe.csv |
Response |
{ "fileId":"9c08cbe4-d818-4c0c-8808-1d122a67802a" } |
|
> To Start Import:
URL | http://<host>:<port>/ openspecimen/rest/ng/import-jobs/ |
Method | POST |
Request | application/json |
Json |
{ "csvType":"SINGLE_ROW_PER_OBJ", "importType":"CREATE", "inputFileId":"9c08cbe4-d818-4c0c-8808-1d122a67802a", "objectParams":{}, "objectType":"cpe" } |
|
Response |
{ "createdBy":{ "admin":true, "cpCount":0, "creationDate":null, "domain":"openspecimen", "emailAddress":"admin@admin.com", "firstName":"admin", "id":2, "instituteName":null, "lastName":"admin", "loginName":"admin@admin.com" }, "creationTime":1462190850004, "endTime":null, "failedRecords":null, "id":48, "name":"cpe", "params":{}, "status":"IN_PROGRESS", "totalRecords":null, "type":"CREATE" } |
|
Note: Coding needs to be enabled for this, if Specimen Requirements also needs to be imported using BO.
openspecimen/rest/ng/collection-protocol-events
...
URL | http://<host>:<port>/ openspecimen/rest/ng/collection-protocol-events |
Method | POST |
Request | application/json |
json |
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
| {
"activityStatus": "Active",
"clinicalDiagnosis": "8551/3 Acinar cell cystadenocarcinoma",
"clinicalStatus": "Operative",
"code": null,
"collectionProtocol": "BocaBiosciences CP",
"defaultSite": "Bocabio Collection Site",
"eventLabel": "Base visit",
"eventPoint": 0
} |
|
Response |
Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
linenumbers | true |
---|
| {
"id": 10,
"activityStatus": "Active",
"clinicalDiagnosis": "8551/3 Acinar cell cystadenocarcinoma",
"clinicalStatus": "Operative",
"code": null,
"collectionProtocol": "BocaBiosciences CP",
"defaultSite": "Bocabio Collection Site",
"eventLabel": "Base visit",
"eventPoint": 0
} |
|
...
Error Cases :
| | |
---|
200 | All resources | Collection Protocol Event has been created successfully |
400 | All requests | Invalid parameters, e.g duplicate event label, blank event label etc |
401 | All requests | Authorization failed, user doesn’t have authority |
500 | All requests | Internal server error, encountered server error while performing operations |
...