MACRO API

 

Registering a subject with the MACRO API

RegisterSubject

 

This routine enables you to register a subject. If registration is successful, the registration identifier is returned. If not, the return code indicates why.

 

Input

Parameter

Description

user

Currently logged-in user as returned from Login

study

Study name

site

Site code

subject

Subject label (choose to use this or subject ID)

subjectid

Subject ID (choose to use this or subject label)

 

Using subject label:

public static Enums.APIRegResult RegisterSubject(UserProperties user, string study, string site, string subject, ref string regID, ref string message)

 

Using subject ID:

public static Enums.APIRegResult RegisterSubject(UserProperties user, stringstudy, string site, int subjectid, ref string regID, ref string message)

 

Output

·       Return code indicating success or nature of failure

·       regID - if registration succeeds, the registration identifier is returned

·       message - if the subject is not registered an error message describes the reason

Return to top

 

Subject registration return codes

The RegisterSubject routine returns an integer code as type Enums.APIRegResult indicating the result, as listed in the table below. For successful registration (return codes 0 and 1) the returned string contains the registration identifier.

 

Code

Value

Description

0

Success

The subject has been successfully registered, and the new registration identifier is returned

1

AlreadyRegistered

The subject has previously been registered; the existing registration identifier is returned

2

NotReady

Either the subject is not ready for registration (the "trigger" eForm has not yet been saved), or no registration has been set up in the study. No registration identifier is returned

3

NotEligible

The eligibility conditions for registration have not been met for this subject. No registration identifier is returned

4

NotUnique

The uniqueness checks for this subject have failed. No registration identifier is returned

5

MissingData

Some or all of the data required to evaluate the eligibility conditions or uniqueness checks is missing. No registration identifier is returned

6

NoRegistration

Study doesn't use registration

7

NoPermission

User doesn't have RegisterSubject permission

10

UnknownError

An unexpected error occurred whilst trying to register the subject. No registration identifier is returned

11

SubjectCouldNotBeOpened

Either the subject does not exist, or could not be opened. An error message is returned giving details of the problem

12

SubjectRead-only

The subject is read-only (e.g. locked or frozen) and cannot be registered. No registration identifier is returned

 

Return to top

 

Related Topics