|
Patient Cloud AppConnect Android API References
|
Classes | |
| interface | DataConverterListener |
Public Member Functions | |
| DataConverter (Datastore datastore) | |
| void | dispose () |
| native String | exportFormResponses (Form form, String deviceID) throws JSONException |
| native List< Subject > | importDemoSubjects (String json, User user) throws JSONException |
| native User | importDemoUser (String json) throws JSONException |
| native List< Form > | importForms (String formsJSON, String checksJSON, Subject subject) throws JSONException |
| native Study | importStudy (String json, Subject subject) throws JSONException |
| native void | importStudyData (String json, Study study) throws JSONException |
| native void | importSubjectData (String psv, Subject subject) throws PSVException |
| native List< Subject > | importSubjects (String json, User user) throws JSONException |
| native User | importUser (String json) throws JSONException |
| native void | importUserData (String json, User user) throws JSONException |
| void | removeListener () |
| void | setListener (DataConverterListener l) |
The data donverter is a two-way translator for JSON and model objects. It parses JSON and populates the datastore as needed. It is used by the networking client after receiving requested data, and before sending a request to submit data:
| com.mdsol.babbage.model.internal.DataConverter.DataConverter | ( | Datastore | datastore | ) |
Construct a data converter using a given datastore.
| datastore | the datastore to use |
| void com.mdsol.babbage.model.internal.DataConverter.dispose | ( | ) |
Dispose of the data converter. You must call this method when you're done using the data converter.
| native String com.mdsol.babbage.model.internal.DataConverter.exportFormResponses | ( | Form | form, |
| String | deviceID | ||
| ) | throws JSONException |
Export a form to an ODM by formatting the form and its field responses into JSON.
| form | the form to export |
| deviceID | the ID of the device submitting the form |
| JSONException | if the form or one of its fields aren't completed |
| native List<Subject> com.mdsol.babbage.model.internal.DataConverter.importDemoSubjects | ( | String | json, |
| User | user | ||
| ) | throws JSONException |
Import demo subjects by parsing the given JSON and populating the datastore. If the subjects already exist, they will be updated instead of created.
A demo subject is built into the app instead of being received from the network. It is used for demo purposes.
| json | the JSON describing the subjects to import |
| user | the user whose subjects we are importing |
| JSONException | if any problem occurs during parsing |
| native User com.mdsol.babbage.model.internal.DataConverter.importDemoUser | ( | String | json | ) | throws JSONException |
Import a demo user by parsing the given JSON and populating the datastore. If the user already exists, it will be updated instead of created.
A demo user is built into the app instead of being received from the network. It is used for demo purposes.
| json | the JSON describing the user to import |
| JSONException | if any problem occurs during parsing |
| native List<Form> com.mdsol.babbage.model.internal.DataConverter.importForms | ( | String | formsJSON, |
| String | checksJSON, | ||
| Subject | subject | ||
| ) | throws JSONException |
Import forms, fields and edit checks by parsing the given JSON and populating the datastore. If the forms already exist, they will be updated instead of created.
| formsJSON | the JSON describing the forms and fields to import |
| checksJSON | the JSON describing the edit checks to import |
| subject | the subject whose forms we are importing |
| JSONException | if any problem occurs during parsing |
| native Study com.mdsol.babbage.model.internal.DataConverter.importStudy | ( | String | json, |
| Subject | subject | ||
| ) | throws JSONException |
Import a study by parsing the given JSON and populating the datastore. If the study already exists, it will be updated instead of created.
| json | the JSON describing the study to import |
| subject | the subject whose study we are importing |
| JSONException | if any problem occurs during parsing |
| native void com.mdsol.babbage.model.internal.DataConverter.importStudyData | ( | String | json, |
| Study | study | ||
| ) | throws JSONException |
Import a study's data by parsing the given JSON and populating the datastore.
| json | the JSON describing the study to import |
| study | the study whose data we are importing |
| JSONException | if any problem occurs during parsing |
| native void com.mdsol.babbage.model.internal.DataConverter.importSubjectData | ( | String | psv, |
| Subject | subject | ||
| ) | throws PSVException |
Import a subject's data by parsing the given PSV and populating the datastore.
| psv | the PSV describing the subject to import |
| subject | the subject whose data we are importing |
| PSVException | if any problem occurs during parsing |
| native List<Subject> com.mdsol.babbage.model.internal.DataConverter.importSubjects | ( | String | json, |
| User | user | ||
| ) | throws JSONException |
Import subjects by parsing the given JSON and populating the datastore. If the subjects already exist, they will be updated instead of created.
| json | the JSON describing the subjects to import |
| user | the user whose subjects we are importing |
| JSONException | if any problem occurs during parsing |
| native User com.mdsol.babbage.model.internal.DataConverter.importUser | ( | String | json | ) | throws JSONException |
Import a user by parsing the given JSON and populating the datastore. If the user already exists, it will be updated instead of created.
| json | the JSON describing the user to import |
| JSONException | if any problem occurs during parsing |
| native void com.mdsol.babbage.model.internal.DataConverter.importUserData | ( | String | json, |
| User | user | ||
| ) | throws JSONException |
Import a user's data by parsing the given JSON and populating the datastore.
| json | the JSON describing the user to import |
| user | the user whose data we are importing |
| JSONException | if any problem occurs during parsing |
| void com.mdsol.babbage.model.internal.DataConverter.removeListener | ( | ) |
| void com.mdsol.babbage.model.internal.DataConverter.setListener | ( | DataConverterListener | l | ) |
1.8.11