Command Line module

 

Managing subject groups with the Command Line module

Create new subject group

Edit the description for an existing subject group

Edit the Arezzo condition that defines a subject group

Specify whether a subject group is dynamic or static

Activate or deactivate a subject group

Assign user access to a subject group

Remove user access from a subject group

Evaluate the dynamic subject groups for a given subject

Evaluate a subject for a given group

Retrieve a list of subject groups

Retrieve a list of subject groups for a given study

Retrieve a list of subject groups for a given subject

Retrieve a list of subject groups for a given user role

Retrieve a list of subjects in a given subject group

Add a subject to a static subject group

Remove a subject from a static subject group

 

These calls cover a range of subject group administrative tasks.

 

From each SubjectGroupAdmin call, a Command Line error may be returned if the command line is not in the correct format, e.g. missing or empty parameters. Otherwise a comma-separated message is output with the appropriate result code. Ensure you follow the required conventions when specifying user credentials.

 

 

Create subject group

Create a new subject group. New groups are automatically activated when they are created.

 

You need the 'Create subject group' permission

Parameters

Parameter

Description

Functionality identifier

"SubjectGroupAdmin"

User credentials

User name/Password/Database/Userrole

Operation Identifier

"CreateSubjectGroup"

subjectGroupCode

The code for the new subject group

studyName

The name of the study for the new subject group

subjectGroupDescription

The description for the new subject group

subjectGroupArezzoCondition

The Arezzo condition used to define the subject group

subjectGroupIsDynamic

Indicates if the subject group is dynamic (1) or static (0)

Command Line and result format

/SubjectGroupAdmin/Username/Password/Database/Role/CreateSubjectGroup/subjectGroupCode/studyName/subjectGroupDescription/subjectGroupArezzoCondition/subjectGroupIsDynamic

Result,CreateSubjectGroup,subjectGroupCode

Example

InferMed.M40.MACRO_CL.exe /SubjectGroupAdmin/Username/Password/Database/Role/CreateSubjectGroup/sg1/Demostudy40/Description of study group/screening:cover:sex = 2/1

Success,CreateSubjectGroup,sg1

Return to top

 

Edit subject group description

Edit the description for an existing subject group.

 

You need the 'Edit subject group' permission

Parameters

Parameter

Description

Functionality identifier

"SubjectGroupAdmin"

User credentials

User name/Password/Database/Userrole

Operation Identifier

"EditSubjectGroupDescription"

subjectGroupCode

The code for the subject group

newDescription

The new description for the subject group

Command Line and result format

/SubjectGroupAdmin/Username/Password/Database/Role/EditSubjectGroupDescription/subjectGroupCode/newDescription

Result,EditSubjectGroupDescription,subjectGroupCode

Example

InferMed.M40.MACRO_CL.exe /SubjectGroupAdmin/Username/Password/Database/Role/EditSubjectGroupDescription/sg1/New Description

Success,EditSubjectGroupDescription,sg1

Return to top

 

Edit Arezzo condition

Edit the Arezzo condition for a subject group.

 

You need the 'Edit subject group' permission

Parameters

Parameter

Description

Functionality identifier

"SubjectGroupAdmin"

User credentials

User name/Password/Database/Userrole

Operation Identifier

"EditSubjectGroupCondition"

subjectGroupCode

The code for the subject group

newArezoCondition

The new Arezzo condition used to define the subject group

Command Line and result format

/SubjectGroupAdmin/Username/Password/Database/Role/EditSubjectGroupCondition/subjectGroupCode/newArezzoCondition

Result,EditSubjectGroupCondition,subjectGroupCode

Example

InferMed.M40.MACRO_CL.exe /SubjectGroupAdmin/Username/Password/Database/Role/EditSubjectGroupCondition/sg1/screening:cover:sex = 1

Success,EditSubjectGroupCondition,sg1  

Return to top

 

Set to dynamic or static

Specify whether a subject group is dynamic or static.

 

You need the 'Edit subject group' permission

Parameters

Parameter

Description

Functionality identifier

"SubjectGroupAdmin"

User credentials

User name/Password/Database/Userrole

Operation Identifier

"EditSubjectGroupIsDynamic"

subjectGroupCode

The code for the subject group

newIsDynamic

Indicates if the subject group is dynamic (1) or static (0)

Command Line and result format

/SubjectGroupAdmin/Username/Password/Database/Role/EditSubjectGroupIsDynamic/subjectGroupCode/newIsDynamic[0 or 1]

Result,EditSubjectGroupIsDynamic,subjectGroupCode

Example

InferMed.M40.MACRO_CL.exe /SubjectGroupAdmin/Username/Password/Database/Role/EditSubjectGroupIsDynamic/sg1/0

Success,EditSubjectGroupIsDynamic,sg1   

 

Return to top

 

Set to active or inactive

Activate or deactivate a subject group.

 

You need the 'Edit subject group' permission

Parameters

Parameter

Description

Functionality identifier

"SubjectGroupAdmin"

User credentials

User name/Password/Database/Userrole

Operation Identifier

"EditSubjectGroupActive"

subjectGroupCode

The code for the subject group

isActive

Indicates if the subject group is active (1) or inactive (0)

Command Line and result format

/SubjectGroupAdmin/Username/Password/Database/Role/SetSubjectGroupActive/subjectGroupCode/isActive[0 or 1]

Result,SetSubjectGroupActive,subjectGroupCode

Example

InferMed.M40.MACRO_CL.exe /SubjectGroupAdmin/Username/Password/Database/Role/SetSubjectGroupActive/sg1/1

Success,SetSubjectGroupActive,sg1   

Return to top

 

Assign user access to a subject group

Assign a user access to a subject group with a particular role.

 

You need the 'Assign user role to subject group' permission

Parameters

Parameter

Description

Functionality identifier

"SubjectGroupAdmin"

User credentials

User name/Password/Database/Userrole

Operation Identifier

"AssignUserRoleToSubjectGroup"

userId

The user who requires access

roleCode

The user role to assign

subjectGroupCode

The code for the subject group

Command Line and result format

/SubjectGroupAdmin/Username/Password/Database/Role/AssignUserRoleToSubjectGroup/userId/roleCode/subjectGroupCode

Result,AssignUserRoleToSubjectGroup,userId,roleCode,subjectGroupCode

Example

InferMed.M40.MACRO_CL.exe /SubjectGroupAdmin/Username/Password/Database/Role/AssignUserRoleToSubjectGroup/rde/FullUser/sg1

Success,AssignUserRoleToSubjectGroup,rde,FullUser,sg1   

Return to top

 

Remove user access from a subject group

Remove access for a user from a subject group for a particular user role.

 

You need the 'Assign user role to subject group' permission

Parameters

Parameter

Description

Functionality identifier

"SubjectGroupAdmin"

User credentials

User name/Password/Database/Userrole

Operation Identifier

"RemoveUserRoleFromSubjectGroup"

userId

The user whose access is to be removed

roleCode

The user role to remove

subjectGroupCode

The code for the subject group

Command Line and result format

/SubjectGroupAdmin/Username/Password/Database/Role/RemoveUserRoleToSubjectGroup/userId/roleCode/subjectGroupCode

Result,RemoveUserRoleFromSubjectGroup,userId,roleCode,subjectGroupCode

Example

InferMed.M40.MACRO_CL.exe /SubjectGroupAdmin/Username/Password/Database/Role/RemoveUserRoleFromSubjectGroup/rde/FullUser/sg1

Success,RemoveUserRoleFromSubjectGroup,rde,FullUser,sg1  

Return to top

 

Evaluate subject groups

Evaluate the dynamic subject groups for a given subject.

Parameters

Parameter

Description

Functionality identifier

"SubjectGroupAdmin"

User credentials

User name/Password/Database/Userrole

Operation Identifier

"EvaluateSubjectGroupsForSubject"

studyName

The name of the study used to identify the subject

siteName

The name of the site used to identify the subject

subjectId

The ID of the subject

Command Line and result format

/SubjectGroupAdmin/Username/Password/Database/Role/EvaluateSubjectGroupsForSubject/studyName/siteName/subjectId

Result,EvaluateSubjectGroupsForSubject,studyName,site,subjectId

Example

InferMed.M40.MACRO_CL.exe /SubjectGroupAdmin/Username/Password/Database/Role/EvaluateSubjectGroupsForSubject/Demostudy40/london/1

Success,EvaluateSubjectGroupsForSubject,Demostudy40,london,1  

Return to top

 

Evaluate subject for a subject group

Evaluate a subject for a given group.

Parameters

Parameter

Description

Functionality identifier

"SubjectGroupAdmin"

User credentials

User name/Password/Database/Userrole

Operation Identifier

"EvaluateSubjectForSubjectGroup"

studyName

The name of the study used to identify the subject

siteName

The name of the site used to identify the subject

subjectId

The ID of the subject

subjectGroupCode

The code of the subject group

Command Line and result format

/SubjectGroupAdmin/Username/Password/Database/Role/EvaluateSubjectForSubjectGroup/studyName/siteName/subjectId/subjectGroupCode

Result,EvaluateSubjectForSubjectGroup,studyName,site,subjectId,subjectGroupCode

Example

InferMed.M40.MACRO_CL.exe /SubjectGroupAdmin/Username/Password/Database/Role/EvaluateSubjectForSubjectGroup/Demostudy40/london/1/sg1

Success,EvaluateSubjectForSubjectGroup,Demostudy40,london,1,sg1  

Return to top

 

Retrieve list of subject groups

Retrieve a list of subject groups. This returns the number of subject groups, followed by a pipe-separated list of the group codes.

Parameters

Parameter

Description

Functionality identifier

"SubjectGroupAdmin"

User credentials

User name/Password/Database/Userrole

Operation Identifier

"GetSubjectGroups"

Command Line and result format

/SubjectGroupAdmin/Username/Password/Database/Role/GetSubjectGroups

Result,GetSubjectGroups,studyName,numberOfSubjectGroups,pipeSeparatedListOfGroupCodes

Example

InferMed.M40.MACRO_CL.exe /SubjectGroupAdmin/Username/Password/Database/Role/GetSubjectGroups/

Success,GetSubjectGroups,Demostudy40,2,sg1|sg2 

Return to top

 

Retrieve list of subject groups for a study

Retrieve a list of subject groups for a particular study. This returns the number of subject groups, followed by a pipe-separated list of the group codes.

Parameters

Parameter

Description

Functionality identifier

"SubjectGroupAdmin"

User credentials

User name/Password/Database/Userrole

Operation Identifier

"GetSubjectGroupsForStudy"

studyName

The name of the study

Command Line and result format

/SubjectGroupAdmin/Username/Password/Database/Role/GetSubjectGroupsForStudy/studyName

Result,GetSubjectGroupsForStudy,studyName,NoOfSubjectGroups,pipeSeparatedListOfGroupCodes

Example

InferMed.M40.MACRO_CL.exe /SubjectGroupAdmin/Username/Password/Database/Role/GetSubjectGroupsForStudy/demostudy40

Success,GetSubjectGroupsForStudy,Demostudy40,2,sg1|sg2

Return to top

 

Retrieve list of subject groups for a subject

Retrieve a list of subject groups in which a given subject is included. This returns the number of subject groups, followed by a pipe-separated list of the group codes.

Parameters

Parameter

Description

Functionality identifier

"SubjectGroupAdmin"

User credentials

User name/Password/Database/Userrole

Operation Identifier

"GetSubjectGroupsForSubject"

studyName

The name of the study used to identify the subject

siteName

The name of the site used to identify the subject

subjectId

The ID of the subject

Command Line and result format

/SubjectGroupAdmin/Username/Password/Database/Role/GetSubjectGroupsForSubject/studyName/siteName/subjectId

Result,GetSubjectGroupsForSubject,studyName/site/subjectId,numberOfSubjectGroups,pipeSeparatedListOfGroupCodes

Example

InferMed.M40.MACRO_CL.exe /SubjectGroupAdmin/Username/Password/Database/Role/GetSubjectGroupsForSubject/Demostudy40/london/1

Success,GetSubjectGroupsForSubject,Demostudy40/london/1,2,sg1|sg2

Return to top

 

Retrieve list of subject groups for a user role

Retrieve a list of subject groups in which a given user is included with a particular user role. This returns the number of subject groups, followed by a pipe-separated list of the group codes.

Parameters

Parameter

Description

Functionality identifier

"SubjectGroupAdmin"

User credentials

User name/Password/Database/Userrole

Operation Identifier

"GetSubjectGroupsForUserRole"

userId

The user

roleCode

The user role

Command Line and result format

/SubjectGroupAdmin/Username/Password/Database/Role/GetSubjectGroupsForUserRole/userId/roleCode

Result,GetSubjectGroupsForUserRole,userId,roleCode,numberOfSubjectGroups,pipeSeparatedListOfGroupCodes

Example

InferMed.M40.MACRO_CL.exe /SubjectGroupAdmin/Username/Password/Database/Role/GetSubjectGroupsForUserRole/rde/FullUser

Success,GetSubjectGroupsForUserRole,rde,FullUser,2,sg1|sg2

Return to top

 

Retrieve list of subjects in a subject group

Retrieve a list of subjects in a particular subject group. This returns the number of subject groups, followed by a pipe-separated list of the group codes.

Parameters

Parameter

Description

Functionality identifier

"SubjectGroupAdmin"

User credentials

User name/Password/Database/Userrole

Operation Identifier

"GetSubjectsInSubjectGroup"

subjectGroupCode

The subject group

Command Line and result format

/SubjectGroupAdmin/Username/Password/Database/Role/GetSubjectsInSubjectGroup/subjectGroupCode

Result,GetSubjectsInSubjectGroup,subjectGroupCode,numberOfSubjectsInGroup,pipeSeparatedListOfSubjectReferences

Example

InferMed.M40.MACRO_CL.exe /SubjectGroupAdmin/Username/Password/Database/Role/GetSubjectsInSubjectGroup/sg1

Success,GetSubjectsInSubjectGroup,sg1,2,Demostudy40/london/1|Demostudy40/london/2

Return to top

 

Add subject to subject group

Add a subject to a static subject group.

 

You need the 'Add subject to subject group' permission

Parameters

Parameter

Description

Functionality identifier

"SubjectGroupAdmin"

User credentials

User name/Password/Database/Userrole

Operation Identifier

"AddSubjectToSubjectGroup"

studyName

The name of the study used to identify the subject

siteName

The name of the site used to identify the subject

subjectId

The ID of the subject to be added

subjectGroupCode

The subject group

Command Line and result format

/SubjectGroupAdmin/Username/Password/Database/Role/AddSubjectToSubjectGroup/studyName/siteName/subjectId/subjectGroupCode

Result,AddSubjectToSubjectGroup,studyName/site/subjectId,subjectGroupCode

Example

InferMed.M40.MACRO_CL.exe /SubjectGroupAdmin/Username/Password/Database/Role/AddSubjectToSubjectGroup/Demostudy40/london/1/sg1

Success,AddSubjectToSubjectGroup,Demostudy40/london/1,sg1

Return to top

 

Remove subject from subject group

Remove a subject from a static subject group.

 

You need the 'Add subject to subject group' permission.

Parameters

Parameter

Description

Functionality identifier

"SubjectGroupAdmin"

User credentials

User name/Password/Database/Userrole

Operation Identifier

"RemoveSubjectFromSubjectGroup"

studyName

The name of the study used to identify the subject

siteName

The name of the site used to identify the subject

subjectId

The ID of the subject to be removed

subjectGroupCode

The subject group

Command Line and result format

/SubjectGroupAdmin/Username/Password/Database/Role/RemoveSubjectFromSubjectGroup/studyName/siteName/subjectId/subjectGroupCode

Result,RemoveSubjectFromSubjectGroup,studyName/site/subjectId,subjectGroupCode

Example

InferMed.M40.MACRO_CL.exe /SubjectGroupAdmin/Username/Password/Database/Role/RemoveSubjectFromSubjectGroup/Demostudy40/london/1/sg1

Success,RemoveSubjectFromSubjectGroup,Demostudy40/london/1,sg1

Return to top

 

Subject group administration result codes

Each subject group operation returns an individual result to the console as a comma-separated message with one of the following result codes:

 

Code

Description

Success

The subject group administration operation was successful

PermissionError

The current user does not have the relevant MACRO permissions to perform the action

DatabaseError

An unexpected error occurred while accessing the database

InvalidGroupCode

The specified code is null or empty or does not exist

InvalidSubjectGroupDescription

The specified description is null or empty or does not exist

SubjectGroupExists

An existing subject group has been specified in "CreateSubjectGroup"

InvalidStudyError

The specified study is null or empty, does not exist, or does not have the required status

InvalidSubjectGroupError The specified subject group is null or empty or does not exist

InvalidUserError

The specified user is null or empty or does not exist

InvalidRoleError

The specified user role is null or empty or does not exist

InvalidSiteError

The specified site is null or empty or does not exist

InvalidSubjectError

The specified subject is null or empty or does not exist

SubjectGroupMustBeStatic

The requested action can only be performed on a static subject group

SubjectGroupInactive

The requested action can only be performed on an active subject group

Unknown

An unknown error occurred when processing the study/site administration action

 

Return to top

 

Related Topics

About subject groups

Managing subject groups with the API