Patient Cloud AppConnect Android API References
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
com.mdsol.babbage.model.Datastoreabstract

Inherited by com.mdsol.babbage.model.DiskDatastore.

Public Member Functions

void dispose ()
 
List< FormgetAvailableAnytimeFormsForSubject (long subjectID)
 
List< FormgetAvailableFormsForSubject (long subjectID)
 
List< FormgetAvailableScheduledFormsForSubject (long subjectID)
 
native List< SubjectDataEnvelopegetCollectedData ()
 
native List< FormgetCompletedForms ()
 
native List< FormgetCompletedFormsForSubject (long subjectID)
 
SubjectDataEnvelope getEnvelope (long envelopeID)
 
native Field getField (long id)
 
Form getForm (long id)
 
native List< FormgetForms (long subjectID)
 
List< FormgetForms ()
 
native List< FormgetIncompleteForms ()
 
native List< StudygetStudies ()
 
Study getStudy (String uuid)
 
Study getStudy (long id)
 
Subject getSubject (String uuid, String studyUUID, String userUUID)
 
Subject getSubject (long id)
 
native List< SubjectgetSubjects ()
 
native List< SubjectgetSubjectsForUser (long userID)
 
native int getTotalFormCountForSubject (long subjectID)
 
User getUser (String username)
 
User getUser (long id)
 
native void nuke ()
 
native void purgeExpiredIncompleteFormResponses ()
 
native void removeFormsForSubject (long subjectID)
 
native void reread ()
 

Static Public Member Functions

static native boolean isMigrationRequired ()
 
static boolean migrateIfNeeded (Babbage.Listener listener)
 
static native void setSharedKey (byte[] key)
 

Protected Member Functions

abstract void delete ()
 
void finalize () throws Throwable
 

Protected Attributes

long mNativeObject
 

Detailed Description

Use the Datastore to load and persist clinical objects - study, user, form, and so on - to and from the local database.

Member Function Documentation

abstract void com.mdsol.babbage.model.Datastore.delete ( )
abstractprotected

For dbo::Transaction used in c++ code.

void com.mdsol.babbage.model.Datastore.dispose ( )
void com.mdsol.babbage.model.Datastore.finalize ( ) throws Throwable
protected

Clean up the native object when freed by the GC

List<Form> com.mdsol.babbage.model.Datastore.getAvailableAnytimeFormsForSubject ( long  subjectID)

A public method that returns all forms for the current system date. Invokes a private method.

Parameters
subjectID
Returns
List of forms.
List<Form> com.mdsol.babbage.model.Datastore.getAvailableFormsForSubject ( long  subjectID)

A public method that returns all forms for the current system date. Invokes a private method.

Parameters
subjectID
Returns
List of forms.
List<Form> com.mdsol.babbage.model.Datastore.getAvailableScheduledFormsForSubject ( long  subjectID)

A public method that returns all forms for the current system date. Invokes a private method.

Parameters
subjectID
Returns
List of forms.
native List<SubjectDataEnvelope> com.mdsol.babbage.model.Datastore.getCollectedData ( )

Gets all SubjectDataEnvelopes that have been collected but not submitted.

Returns
The list of collected SubjectDataEnvelopes.
native List<Form> com.mdsol.babbage.model.Datastore.getCompletedForms ( )

Gets all completed and submissible forms.

Returns
The list of submissible forms.
native List<Form> com.mdsol.babbage.model.Datastore.getCompletedFormsForSubject ( long  subjectID)

Gets the forms of a given subject that have been completed and are ready for submission.

Parameters
subjectIDThe identifier of the subject.
Returns
List of submissible forms.
SubjectDataEnvelope com.mdsol.babbage.model.Datastore.getEnvelope ( long  envelopeID)

Gets the SubjectDataEnvelope that matches a given database identifier.

Parameters
idThe database identifier of the SubjectDataEnvelope requested.
Returns
The SubjectDataEnvelope. Null if the target SubjectDataEnvelope does not exist.
native Field com.mdsol.babbage.model.Datastore.getField ( long  id)
Form com.mdsol.babbage.model.Datastore.getForm ( long  id)

Gets forms that match a given database ID.

Parameters
idThe database identifier of the target form.
Returns
The form. Null if the form does not exist.
native List<Form> com.mdsol.babbage.model.Datastore.getForms ( long  subjectID)

Get all the subject's forms.

Parameters
subjectIDThe identifier of the subject.
Returns
List of forms.
List<Form> com.mdsol.babbage.model.Datastore.getForms ( )

Get all the forms in the database.

Returns
List of forms.
native List<Form> com.mdsol.babbage.model.Datastore.getIncompleteForms ( )

Gets all forms that are not completed.

Returns
The list of submissible forms.
native List<Study> com.mdsol.babbage.model.Datastore.getStudies ( )

Get all studies from the database.

Returns
List that contains all studies.
Study com.mdsol.babbage.model.Datastore.getStudy ( String  uuid)

Gets the study that matches a given universally unique identifier (UUID).

Parameters
uuidThe universally unique identifier (UUID) of the study requested.
Returns
The study. Null if the target study does not exist.
Study com.mdsol.babbage.model.Datastore.getStudy ( long  id)

Gets the study that matches a given database identifier.

Parameters
idThe database identifier of the study requested.
Returns
The study. Null if the target study does not exist.
Subject com.mdsol.babbage.model.Datastore.getSubject ( String  uuid,
String  studyUUID,
String  userUUID 
)

Get the subject that matches the given universally unique identifiers (UUID) belonging to the specified study and user.

Parameters
uuidThe universally unique identifier of the subject.
studyUUIDThe universally unique identifier of the study that the subject belongs to.
userUUIDThe universally unique identifier of the user that the subject belongs to.
Returns
The subject. Null if the requested subject does not exist.
Subject com.mdsol.babbage.model.Datastore.getSubject ( long  id)

Gets subjects that match the given database identifier.

Parameters
idThe subject's database identifier.
Returns
The subject. Null if the requested subject does not exist.
native List<Subject> com.mdsol.babbage.model.Datastore.getSubjects ( )

Get all subjects from the database.

Returns
List of all subjects.
native List<Subject> com.mdsol.babbage.model.Datastore.getSubjectsForUser ( long  userID)

Get the subjects associated with a given user.

Parameters
userIDThe user's database identifier.
Returns
The subjects; otherwise an empty list.
native int com.mdsol.babbage.model.Datastore.getTotalFormCountForSubject ( long  subjectID)

Gets the number of forms that exist for the given subject. The value returned by this method includes all non-completed forms, even those that are not currently available because of their time window.

Parameters
subjectIDThe subject's database identifier.
Returns
The number of forms.
User com.mdsol.babbage.model.Datastore.getUser ( String  username)

Gets the user that matches a given username.

Parameters
usernameThe username of the user.
Returns
The target user if target user exists. Otherwise null.
User com.mdsol.babbage.model.Datastore.getUser ( long  id)

Gets the user that matches a given database identifier.

Parameters
idThe database identifier of the user.
Returns
The user. Null if the target user does not exist.
static native boolean com.mdsol.babbage.model.Datastore.isMigrationRequired ( )
static
static boolean com.mdsol.babbage.model.Datastore.migrateIfNeeded ( Babbage.Listener  listener)
static
native void com.mdsol.babbage.model.Datastore.nuke ( )

Clears the contents of all database tables.

native void com.mdsol.babbage.model.Datastore.purgeExpiredIncompleteFormResponses ( )

Removes user responses from forms that are both expired and partially complete.

native void com.mdsol.babbage.model.Datastore.removeFormsForSubject ( long  subjectID)

Remove all forms that belong to the subject, including completed forms.

Parameters
subjectIDThe identifier of the subject.
native void com.mdsol.babbage.model.Datastore.reread ( )
static native void com.mdsol.babbage.model.Datastore.setSharedKey ( byte[]  key)
static

Member Data Documentation

long com.mdsol.babbage.model.Datastore.mNativeObject
protected

For native object storage.