CreateSubject |
This routine enables you to create new subjects for a particular study and site. You can choose to specify the subject ID or have it automatically generated.
The MACRO subject ID is returned for successfully created subjects.
The routine can only succeed if:
· The current user role has the "Create subject" permission
· The current user role has access permissions to the study and site
· The study status is either Open or In Preparation
Input
Parameter |
Description |
user |
Currently logged-in user as returned from Login |
studyName |
Study name |
studyId |
Study ID as specified in CLINICALTRIAL table. This is provided for backwards compatibility with earlier versions of the API |
site |
Site code |
createSubjectId |
Integer to be used as subject ID (omit this parameter to have the subject ID generated automatically) |
Using the study name and generating an automatic subject ID:
public static int CreateSubject(UserProperties user, string studyName, string site, ref string message) |
Using the study ID and generating an automatic subject ID:
public static int CreateSubject(UserProperties user, int studyId, string site, ref string message) |
Using the study name and specifying the subject ID:
public static int CreateSubject(UserProperties user, string studyName, string site, int createSubjectId, ref string message) |
Using the study ID and specifying the subject ID:
public static int CreateSubject(UserProperties user, int studyId, string site, int createSubjectId, ref string message) |
Output
· Integer subject ID of newly created subject, or -1 if subject not created
· message - if the subject is not created an error message describes the reason