On the Indivo side, we will probably want to create a new schema for your survey and then add the schema to Indivo. Note that Indivo 2.0 supports plugin data models, but I am currently in the process of switching from Indivo 1.0 to 2.0, so we aren’t ready to do this right away. This should be complete by tomorrow (Thursday).
With regard to a survey, in particular, it may not make sense to store a survey in a patient’s record, so we should discuss this further.
Note that it is possible to store arbitrary XML documents in Indivo, but if you don’t use Indivo’s support for plugging in the schema you won’t be able to query the documents by type and you won’t be able to get reports with the documents.
On the CollaboRhythm side, supporting a new data type would generally involve the following:
1. Define the schema (example: MedicationFill.xsd)
2. Create some example XML documents (example: MedicationFillExample.xsd and /data/slice1/mbrooks/medication_metformin_hierarchy.xml)
3. Create the ActionScript model classe(s) corresponding to the schema to facilitate automatic marshalling/unmarshalling (example: MedicationFill.as)
4. Create the ActionScript model collection class for storing multiple instances of the model (example: MedicationFillsModel.as)
5. Create a service to read and parse the Indivio documents (example: MedicationFillsHealthRecordService.as)
6. Either (a) change the core of CollaboRhythm to always load all instances of the new data type (see HealthRecordServiceFacade.as) or (b) load just what you need when you need it in your plugin, probably via an AppController when the app is loaded or viewed, such as in CataractMapAppController.as
The process for seeding an Indivo record with example data involves some more work, but I won’t go into that now.
Note that as a short term work-around, you can potentially use some existing data type, such as HealthActionPlan to store the survey.
Also note that you may want to avoid the task of getting data in and out of Indivo initially and just load some data straight from XML files embedded in your plugin.