Skip to main content
Version: 1.2.0

OptionObject2

Legacy Object

A newer version of this object is now available (OptionObject2015) and is recommended for new projects.

The OptionObject2 holds all of the content of and metadata describing the calling myAvatar form. AvatarScriptLink.NET adds several utility methods to assist with handlings these objects.

Properties

PropertyDescription
EntityIDThe unique Id of the selected entity. I.e., Patient, Staff, or User.
EpisodeNumberThe selected Episode Number. Will be null if the form is non-episodic.
ErrorCodeInforms myAvatar of the outcome of the ScriptLink API call.
ErrorMesgMessage to display to user with certain error codes.
FacilityThe Facility Id the user is currently working in.
FormsList of myAvatar form sections including rows and fields. See FormObject.
NamespaceNameThe Namespace the user is currently working in.
OptionIdThe unique Id of the form that sent this request.
OptionStaffIdThe Staff Id assigned to the logged on user. May be null/empty if not associated with a Practitioner.
OptionUserIdThe User Id of the logged on user.
ParentNamespaceThe Parent Namespace of the Namespace the user is currently logged into.
ServerNameThe server the request was submitted from.
SystemCodeThe System Code the user is currently working in.

Methods

The following methods are available on the OptionObject2 to assist with common tasks.

MethodDescription
AddFormObject(FormObject)Adds a FormObject to the OptionObject2.
AddFormObject(string, bool)Creates a FormObject with specified FormId and adds to the OptionObject2015. The second parameter specifies whether the FormObject should be flagged as a Multiple Iteration form.
AddRowObject(string, RowObject)Adds a RowObject to the FormObject with the specified FormId.
Builder()Initializes a builder for constructing a OptionObject2.
Clone90Clones the OptionObject2.
DeleteRowObject(RowObject)Marks a RowObject" for deletion.
DeleteRowObject(string)Marks a RowObject" for deletion by specified RowId.
DisableAllFieldObjects()Sets all FieldObjects as disabled.
DisableAllFieldObjects(List of string)Sets all FieldObjects as disabled except for any listed to be excluded.
Equals(OptionObjectBase)Used to compare two OptionObject2 to determine if they are equal. Returns bool.
Equals(object)Used to compare OptionObject2 to an object to determine if they are equal. Returns bool.
GetCurrentRowId(string)Returns the CurrentRow RowId of the form matching the FormId.
GetFieldValue(string)Returns the first value of the field matching the Field Number.
GetFieldValue(string, string, string)Returns the value of the FieldObject" matching the Field Number on the specified FormObject and RowObject.
GetFieldValues(string)Returns the values of the field matching the Field Number.
GetHashCode()Overrides the GetHashCode method for a OptionObjectBase.
GetMultipleIterationStatus(string)Returns the Multiple Iteration Status of the form matching the FormId.
GetParentRowId(string)Returns the CurrentRow ParentRowId of the form matching the FormId.
Initialize()Initializes an empty OptionObject2.
IsFieldEnabled(string)Returns whether the specified field is enabled.
IsFieldLocked(string)Returns whether the specified field is locked.
IsFieldModified(string)Returns whether the specified field is modified.
IsFieldPresent(string)Returns whether the specified field is present.
IsFieldRequired(string)Returns whether the specified field is required.
IsFormPresent(string)Returns whether the specified form is present.
IsRowMarkedForDeletion(string)Returns whether the specified RowObject is marked for deletion.
IsRowPresent(string)Returns whether the specified row is present
SetDisabledField(string)Sets the specified field as disabled.
SetDisabledFields(List of string)Sets the specified fields as disabled.
SetEnabledField(string)Sets the specified field as enabled.
SetEnabledFields(List of string)Sets the specified fields as enabled.
SetFieldValue(string, string)Sets the FieldValue of a FieldObject in the OptionObject2 on the first form's CurrentRow.
SetFieldValue(string, string, string, string)Sets the FieldValue of a FieldObject in the OptionObject2.
SetLockedField(string)Sets the specified field as locked.
SetLockedFields(List of string)Sets the specified fields as disabled.
SetOptionalField(string)Set the specified field as not required and enables if disabled.
SetOptionalFields(List of string)Set the specified fields as not required and enables if disabled.
SetRequiredField(string)Sets the specified field as required.
SetRequiredFields(List of string)Sets the specified fields as required.
SetUnlockedField(string)Set the specified field as unlocked.
SetUnlockedFields(List of string)Set the specified fields as unlocked.
ToHtmlString()Returns a string with all of the contents of the OptionObject2 formatted in HTML.
ToHtmlString(bool)Returns a string with all of the contents of the OptionObject2 formatted in HTML. Passing true will include HTML header tags.
ToJson()Returns a string with all of the contents of the OptionObject2 formatted as JSON.
ToOptionObject()Transforms the OptionObject2 to an OptionObject.
ToOptionObject2()Creates a clone of the OptionObject2.
ToOptionObject2015()Transforms the OptionObject2 as an OptionObject2015.
ToReturnOptionObject()Creates an OptionObject2 with the minimum information required to return.
ToReturnOptionObject(int, string)Creates an OptionObject2 with the minimum information required to return plus the provided Error Code and Message.
ToXml()Returns a string with all of the contents of the OptionObject2 formatted as XML.

Examples

The following code shows how to use OptionObject2 to construct a web service compatible with myAvatar.

Detailed Class Diagram