SYNOPSIS
int MGOaddaffiliation (Validation *val, int opts)
DESCRIPTION
The MGOaddaffilation() function adds/updates the affiliation record for
each validation source that matches the given validation id. Information is
passed through val. The required and optional fields are (the values in
brackets indicate which validation tables the field is defined for):
- val.uwnetid (r)
- val.validid (r)
- val.ein (r) [1]
- val.ssn (r)
- val.studentid (r) [1, 2, 7]
- val.account (r) [4]
- val.system_key (r) [2]
- val.clinicianid (r) [3]
- val.advanceid (r) [7]
- val.regid (r)
- val.lname (o)
- val.pac (o)
- val.birthdate (o)
- val.source_code (o)
- val.status_code (o)
val.uwnetid is the uwnetid name.
val.validid is the validation id.
val.ein is the employee number. val.ssn is the social security
number. val.studentid is the student number. val.account is
the AVF account name. val.system_key is the student system key value.
val.clinicianid is the clinician id. val.advanceid is the advance id.
val.regid is the registry id.
You must specify the uwnetid field, plus one (or more) of: validid, ein, ssn,
studentid, account, system_key, clinicianid, advanceid, regid.
val.lname is the last name.
val.pac is the private access code. If specified and the pac is marked
as one-time, the pac will expire automatically in two hours.
val.birthdate is the birthdate in YYYY-MM-DD form.
val.source_code is the validation source reference code.
val.status_code is the affiliation status reference code.
opts can be one or more of:
- 0 - Default behavior
- 1 - Force completion (overrides MGO_E_VAU and MGO_E_UIU errors)
RETURN VALUE
Returns the number of records added upon success or -1 if an error occurred
(in which case MGOerrno and MGOerrmsg are set appropriately).
ERRORS
- MGO_E_MAR - One or more of the required arguments were missing
- MGO_E_PMD - Permission denied. See access control
- MGO_E_VNV - The given validation information is not valid
- MGO_E_VAU - The validation id is already affiliated with another uwnetid
- MGO_E_UIU - Uwnetid is already in use
- MGO_E_MAT - No match found (no such uwnetid)
- MGO_E_SQL - An SQL error occurred. See MGOerrmsg for details
AUTHENTICATION LEVEL
wmango
SEE ALSO
MGOgetaffiliations(),
MGOselraffstatus(),
MGOselrvalsource(),
MGOzero()