Patient Cloud AppConnect Android API References
Public Member Functions | List of all members
com.mdsol.babbage.model.NumericField

Inherits com.mdsol.babbage.model.Field.

Public Member Functions

native int getMaximumResponseDecimalCount ()
 
native int getMaximumResponseIntegerCount ()
 
native long[] getSubjectResponse ()
 
native boolean isPartialOrFullResponse (String string, char decimalSeparator)
 
native boolean isResponseDecimalCountRequired ()
 
native boolean isResponseIntegerCountRequired ()
 
native String responseToString (long[] response, char decimalSeparator)
 
native void setSubjectResponse (long[] response)
 
native long[] stringToResponse (String string, char decimalSeparator)
 
- Public Member Functions inherited from com.mdsol.babbage.model.Field
native boolean equals (Object other)
 
native String getFieldNumber ()
 
native String getFieldOID ()
 
native int getFieldOrdinal ()
 
native Type getFieldType ()
 
native String getHeader ()
 
native long getID ()
 
native String getLabel ()
 
native Problem getResponseProblem ()
 
native boolean isVisible ()
 
- Public Member Functions inherited from com.mdsol.babbage.model.DatastoreRelation
Datastore getDatastore ()
 

Additional Inherited Members

- Protected Member Functions inherited from com.mdsol.babbage.model.Field
void finalize ()
 
- Protected Attributes inherited from com.mdsol.babbage.model.DatastoreRelation
long mNativeObject
 

Detailed Description

The number response is modeled as a vector of int values. The first int represents the integers. The second int is optional and represents the decimals.

NumericField expects a numerical response from the user. The response is made up of integers (before the decimal point) and decimals (after the decimal point). Decimals are optional.

The number response is modeled as a vector of int values. The first int represents the integers. The second int is optional and represents the decimals. So as not to lose zeros after the decimal point, remember that the second int is also padded against the maximum decimal count that the data format specifies. See examples below.

The number response must respect the field’s data format. The data format here is a string of the form x.y, where:

Format examples:

Examples of format and how numeric responses are modeled against it:

Interrogate the expected response format easily with the following numeric field properties:

Member Function Documentation

native int com.mdsol.babbage.model.NumericField.getMaximumResponseDecimalCount ( )

Gets the maximum number of decimals (digits after the decimal point) that the response can have. This information is extracted from the data format of the field.

Returns
the maximum number of decimals
native int com.mdsol.babbage.model.NumericField.getMaximumResponseIntegerCount ( )

Gets the maximum number of integers (digits before the decimal point) that the response can have. Information extracted from the field's data format. If the response is negative, the response does not include the minus sign.

Returns
Maximum number of integers.
native long [] com.mdsol.babbage.model.NumericField.getSubjectResponse ( )

Returns subject responses entered for questions for given fields.

Returns
Subject responses.
native boolean com.mdsol.babbage.model.NumericField.isPartialOrFullResponse ( String  string,
char  decimalSeparator 
)

Identify if string is a possible part of a valid response or a valid response itself.

Parameters
stringString response.
decimalSeparatorDecimal separator in use.
Returns
Whether the string is a possible response path.
native boolean com.mdsol.babbage.model.NumericField.isResponseDecimalCountRequired ( )

Gets whether the number of decimals is required instead of a maximum. Information extracted from the field's data format. When this method returns

true

, the response must have exactly the number of digits returned by getMaximumResponseDecimalCount().

native boolean com.mdsol.babbage.model.NumericField.isResponseIntegerCountRequired ( )

Identifies whether the number of integers is required instead of just being a maximum. This information is extracted from the data format of the field. When this method returns

true

, the response must have exactly the number of integers returned by getMaximumResponseIntegerCount().

native String com.mdsol.babbage.model.NumericField.responseToString ( long[]  response,
char  decimalSeparator 
)

Converts an array of longs response to a string. The array must have one or two values. The first value represents the integers. The second value represents the decimals against the maximum decimal count. If the response cannot be converted while respecting the maximum integer and decimal counts, this method returns

null

.

Parameters
responseArray of longs representing the response.
decimalSeparatorDecimal separator in use.
Returns
String response or null.
native void com.mdsol.babbage.model.NumericField.setSubjectResponse ( long[]  response)

Allows you to set the response from the screen.

Parameters
Screenresponse.
native long [] com.mdsol.babbage.model.NumericField.stringToResponse ( String  string,
char  decimalSeparator 
)

Converts a string to an array of long responses. The array will have one or two values. The first value represents the integers. The second value represents the decimals against the maximum decimal count. If the string cannot be converted while respecting the maximum integer and decimal counts, this method returns

null

.

Parameters
stringString response.
decimalSeparatorDecimal separator in use.
Returns
Array of long values representing the response or null.