Table of Contents

Importing answers

As of version 1.6.4 GemsTracker has the ability to import answers to surveys.

During import each set of answers must be linked to an existing token. GemsTracker also checks for existing answers and handles them according to your preferences.

To import answers you need of course sufficient rights to do so. Having those rights you can either select a survey in the track builder and import the answers into that survey or you can select the generic import wizard and select the survey you want to import to there.

After selecting a survey the wizard will show you which fields are available in the survey. Some of the fields depend on the import definition you choose, but the answers in the survey are usually the same for each import definition as the default import definitions only determine the method used to link a set of answers to a specific token.

You can then choose either to upload a file or use a large text field to put the import data in. GemsTracker currently supports three file formats: XML, CSV and tabbed text. The text field supports only the use of tabbed texts (e.g. a straight copy and paste from Excel).

The import will only import those answers that are in the import. Not supplied answers will be left empty or - when the answer exists - not be overwritten by the import.

The XML format

XML Files can use any name for the root element, though if you have the choice we suggest the root tag <gems>.

The root tag should contain one or more answer elements. Again any tag name will do for an answer, but if you have the choice: use <answer> tags.

Within each <answer> element the individual fields are stored in elements using the field name name and format defined by the *import definition* for the survey. Fields are not required unless this is stated in the import definition. Actually you can use a different set of fields for each answer, but usually this does not happen.

The order of the fields is of no importance.

GemsTracker interprets all empty elements as well as fields containing the text null as null values.

The CSV and tabbed text formats

Both these formats expect the text to be encoded using UTF-8 or US ASCII. You should always check the encoding of you import file.

Also in both formats the first line should contains the names of the fields that are about to be imported. This also defines the field order used during the import.

In CSV files fields containing comma's or newline characters must be enclosed in double quotes. Other fields may be enclosed in double quotes. Double quotes within a double quoted field should be escaped by prepending a slash \“.

CSV uses comma's (,) as a field separator and records are separated using newline characters. Both Unix style \n line endings and Windows style \r\n are supported.

Tabbed text files use the tab \t character to separate fields and newline characters to separate records. Again both Unix style \n line endings and Windows style \r\n are supported. Tabbed text fields cannot contain either tabs or newline characters.

GemsTracker interprets both empty fields and fields containing the text null as null values.

Importing the completion date

When the import contains a completion_date field the completion date of the token is set to that date. Otherwise it is set to the import moment, unless the completion date was already set.

This happens regardless of any other use of the completion_date by the chosen import definition.

Linking answers to tokens

There are three methods for linking an answer to a token.

Use this option if the data contains an patient_id and an organization_id. The organization id can either be the GemsTracker internal organization number or the Healtcare provider id, Code name or just the Name specified for the organization in the GemsTracker setup.

This option will use the first uncompleted token the patient has. If no uncompleted tokens exist the most recently completed token will be used instead.

Use this option if the data contains also contains a completion_date field.

GemsTracker will then only select a token when it was valid at the completion date. Again this option will use the first uncompleted token the patient has and that is valid for the completion date and if no uncompleted tokens exist the most recently completed token will be used instead.

If the GemsTracker token is in the import just use this option. It is the only 100% sure method for linking an set of answers to a specific token.

Handling completed tokens

When no token can be found the answer import wizard will generate an error before any answers have been imported.

This is also the default action when answers are linked to a completed token, but you can choose one of two other methods for handling these cases.

Delete old token and create new

First the import wizard checks if the answers supplied by the import clash with the current answers. If the answers are the same or the new answers had not been answered before, then the new answers are merged into the existing answers.

Only when the new answers clash with the old answers, then the current token is deleted and a new token is created. The new answers and any answers not in the import are imported as the new set of answers.

When you look at a patient's track the interface will show the old answers striken through with the new answers below them.

Create new extra set of answers

When you select this option or when the import file contains two sets of answer for the same token and the previous option was not chosen, then GemsTracker will also create a new token. The difference is that the old set of answers will not be overwritten and neither will the previous answers not in the import be copied into the new set of answers.

This import method also checks for the specific answers in the import and their existence in the current token. E.g. if you import an XML file that contains multiple rows for the same token and the answers in the rows do not overlap, then all the answers will merge into a single set of answers. When they do overlap multiple tokens will be created.

When you look at a patient's track the interface will show the all the answers in order of import as separate tokens.