These routines enable you to enter and request subject data.
You can also request subject data with a REST API call.
You must include an authorization token in this request which is generated from the /token call.
https://localhost/webapi/api/subjectData/[ActionName][Parameters]
inputSubjectDataFromXML - to enter subject data as XML (POST)
inputSubjectData - to enter subject data using the parameters listed below (POST)
getSubjectDataFromXML - to retrieve subject data as XML (GET)
getSubjectDataFromUserRole - to retrieve a list of subjects (GET)
Parameter |
Type |
Description |
studyName |
string |
Study name |
site |
string |
Site code |
subjectId |
integer |
Subject ID |
visitCode |
string |
Visit code |
visitCycle |
integer |
Visit cycle |
eFormCode |
string |
eForm code |
eFormCycle |
integer |
eForm cycle |
laboratory |
string |
Laboratory code of lab used for laboratory questions |
questionCode |
string |
Question code |
questionCycle |
integer |
Question cycle |
value |
string |
Response value |
timestamp |
string |
Response timestamp |
timezone(Offset) |
string |
Response timezone |
POST /api/subjectData/inputSubjectDataFromXML Host: localhost/webapi Content-Type: application/x-www-form-urlencoded Authorization: Bearer [Token] dataInputXml=[XML to input subject data] |
The structure of the XML should be:
<?xml version="1.0"?><MACROSubject Study="Demostudy40" Site="london" Id="15"> <Visit Code="screening" Cycle="1"> <Eform Code="cover" Cycle="1"> <Question Code="subject" Cycle="1" Value="123"/> <Question Code="initials" Cycle="1" Value="PAS"/> <Question Code="dobirth" Cycle="1" Value="22/10/1962"/> <Question Code="sex" Cycle="1" Value="Male"/> </Eform> <Eform Code="demography" Cycle="1"> <Question Code="race" Cycle="1" Value="other"/> <Question Code="raceother" Cycle="1" Value="Inuit"/> <Question Code="smoke" Cycle="1" Value="No"/> <Question Code="gender" Cycle="1" Value="male"/> <Question Code="type" Cycle="1" Value="Healthy volunteer"/> </Eform> </Visit> </MACROSubject > |
Successfully entered data is included in the return message.
POST /api/subjectData/inputSubjectData?studyName=demostudy&site=paris&subjectId=762&visitCode=screening&visitCycle=1&eFormCode=inclusion&eFormCycle=1&laboratory=geneva&questionCode=smoker&questionCycle=1&value=No×tamp=20190421&timezoneOffset=1 Host: localhost/localhost Content-Type: application/x-www-form-urlencoded Authorization: Bearer [Token] |
Successfully entered data is included in the return message.
GET /api/subjectData/getSubjectDataFromXML Host: localhost/localhost Content-Type: application/x-www-form-urlencoded Authorization: Bearer [Token] dataInputXml=%3C%3Fxml+version%3D%221.0%22%3F%3E%0A%0A%3CMACROSubject+Study%3D%22Demostudy40%22+Site%3D%22london%22+Id%3D%223%22%3E%0A%0A++++%3CVisit+Code%3D%22screening%22%3E%0A%0A++++++++%3CEform+Code%3D%22cover%22%2F%3E%0A%0A++++%3C%2FVisit%3E%0A%0A++++%3CVisit+Code%3D%22treat |
The structure of the XML will be:
<?xml
version="1.0"?>
<MACROSubject Study="Demostudy40" Site="london" Id="3"> <Visit Code="screening"> <Eform Code="cover"/> </Visit> <Visit Code="treatment"/> <Visit Code="followup"> <Eform Code="ECG1"/> </Visit> </MACROSubject > |
Successfully retrieved data is provided in the return message.
Please note that for this call only, the 'SubjectNotExist' result code will be returned in all following cases:
GET /api/subjectData/getSubjectDataFromUserRole Host: localhost/webapi Content-Type: application/x-www-form-urlencoded Authorization: Bearer [Token] |
Successfully retrieved data is provided in the return message:
{ "resultCode": "Success", "message": "<?xml version=\"1.0\"?><MACROSubjects><MACROSubject><Study>Demostudy40</Study><Site>chennai</Site><Id>1</Id></MACROSubject><MACROSubject><Study>Demostudy40</Study><Site>chennai</Site><Id>2</Id></MACROSubject></MACROSubjects>" } |
If the subject is part of a subject group and the current user does not have permission to access the subject group, then the 'PermissionError' result code will be returned.
If the current user is not associated with the subject group, or no data is retrieved for the subject group, then the return message will be empty:
{ "resultCode": "Success", "message": "" } |
Value |
Description |
Success |
The operation was successful |
FileError |
The given file path was blank, or does not exist, or the current user does not have file access to the given path, or an incorrect file type was selected for import |
PermissionError |
The current user does not have the relevant MACRO permissions to perform the action or access the subject data |
InvalidStudyError |
The given study name was blank, or does not exist in the MACRO database |
InvalidSubjectError |
The given subject does not exist in the MACRO database, or no subjects exist in the MACRO database for the given range of subject IDs |
InvalidSiteError |
The given site name was blank, or does not exist in the MACRO database |
InvalidLaboratoryError | The given laboratory name was blank, or does not exist in the MACRO database |
Unknown |
An unknown error occurred |