Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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:


URLhttp://<host>:<port>/openspecimen/rest/ng/import-jobs/input-file
MethodPOST
Requestapplication/json
File

CSV File to be uploaded Ex: cpe.csv

Response


  
  "fileId":"9c08cbe4-d818-4c0c-8808-1d122a67802a"
}




> To Start Import:


URLhttp://<host>:<port>/openspecimen/rest/ng/import-jobs/
MethodPOST
Requestapplication/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

...

URLhttp://<host>:<port>/openspecimen/rest/ng/collection-protocol-events
MethodPOST
Requestapplication/json
json


Code Block
languagejs
themeEclipse
linenumberstrue
{
    "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
languagejs
themeEclipse
linenumberstrue
{
    "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 :

code
Applies to
Status Message
200All resourcesCollection Protocol Event has been created successfully
400All requestsInvalid parameters, e.g  duplicate event label, blank event label etc
401All requestsAuthorization failed, user doesn’t have authority
500All requestsInternal server error, encountered server error while performing operations

 

...