MACRO API

 

Managing eForm access with the MACRO API

AddEformAccessRule - Create a new eForm access rule

RemoveEformAccessRule - Delete an existing eForm access rule

GetEformAccessRules - Retrieve a list of eForm access rules for a given eForm/visit/role combination

 

These routines enable you to control access to specific eForms, based on role.

 

To manage eForm access rules, you need the 'Maintain Schedule' permission

 

 

 

AddEformAccessRule

 

Create a new eForm access rule.

 

Input

Parameter

Description

user

Currently logged-in user as returned from Login

clinicalTrialName

Name of study for which the new access rule will operate

visitCode

Code of visit containing the eForm to which you are controlling access (leave blank for all visits)

eFormCode

Code of eForm to which you are controlling access

roleCode

Code of role that you want to associate with the rule

accessIsBeingGranted

Indicates if the rule allows access (1) or denies it (0)

 

public static eEformRoleBasedAccessResult AddEformAccessRule(UserProperties user, string clinicalTrialName, string visitCode, string eFormCode, string roleCode, bool accessIsBeingGranted)

 

Output

·       Return code  indicating success or failure

Return to top

 

 

RemoveEformAccessRule

 

Delete an existing eForm access rule.

 

Input

Parameter

Description

user

Currently logged-in user as returned from Login

clinicalTrialName

Name of study for which the existing access rule operates

visitCode

Code of visit containing the eForm to which you are controlling access (leave blank for all visits)

eFormCode

Code of eForm to which you are controlling access

roleCode

Code of user role that is associated with the rule

accessIsBeingGranted

Indicates if the rule allows access (1) or denies it (0)

 

public static eEformRoleBasedAccessResult RemoveEformAccessRule(UserProperties user, string clinicalTrialName, string visitCode, string eFormCode, string roleCode, bool accessIsBeingGranted)

 

Output

·       Return code  indicating success or failure

Return to top

 

 

GetEformAccessRules

 

Retrieve a list of all access rules for a particular eForm, eForm and visit, or eForm, visit and user role combination, depending on which elements you include in the input.

 

Input

Parameter

Description

user

Currently logged-in user as returned from Login

clinicalTrialName

Name of study for which the existing access rule operates

eFormCode

Code of eForm for which you want a list of rules

visitCode

Code of visit for which you want a list of rules (can be left blank)

roleCode

Code of user role for which you want a list of rules (can be left blank)

 

Retrieve a list of rules for an eForm:

public static eEformRoleBasedAccessResult GetEformAccessRules(UserProperties user, string clinicalTrialName, string eFormCode, ref List<ApiClasses.EFormRoleBasedAccessRule> roleBasedAccessRules)

 

Retrieve a list of rules for an eForm and visit combination:

public static eEformRoleBasedAccessResult GetEformAccessRules(UserProperties user, string clinicalTrialName, string eFormCode, string visitCode, ref List<ApiClasses.EFormRoleBasedAccessRule> roleBasedAccessRules)

 

Retrieve a list of rules for an eForm, visit and user role combination:

public static eEformRoleBasedAccessResult GetEformAccessRules(UserProperties user, string clinicalTrialName, string eFormCode, string visitCode, string roleCode, ref List<ApiClasses.EFormRoleBasedAccessRule> roleBasedAccessRules)

 

Output

·       Return code indicating success or failure

·       List of eForm access rules as a list of ApiClasses.EFormRoleBasedAccessRule objects

Return to top

 

eForm access administration return codes

These return codes are of type eEformRoleBasedAccessResult with the following values:

 

Code

Value

Description

0

Success

The operation was successful

1

PermissionError

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

2

DatabaseError

An unexpected error occurred while accessing the database

3

InvalidRoleError

The specified role is null or empty or does not exist

4

InvalidStudyError

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

5

InvalidVisitError The specified visit is null or empty or does not exist

6

InvalidEformError

The specified eForm is null or empty or does not exist, or does not exist in the specified visit

99

Unknown

An unknown error occurred

 

Return to top

 

Related Topics