Import contexts

<< Click to Display Table of Contents >>

Navigation:  Technical documentation > Importing data >

Import contexts

Previous pageReturn to chapter overviewNext page

An import context is used to write data to the FastTrak database.  The import context allows the database to keep track of what data was imported from where, and by whom.  It also allows you to remove data added as a result of an import operation, effectively rolling back the changes.

 

Overview of the process

When you want to import data, you will normally take this course:

 

1.Open an import context (with a call to procedure OpenImportContext)

2.Add a list of persons to the database if needed, using mapping procedures MapPersonBy... or the procedure AddPerson.

3.Add the data with AddLab, AddDiagnose or AddClinProblem, using a BatchId variable supplied from OpenImportContext.

4.Save information about errors that occured with UpdateBatchErrors

5.Close the import context (with a call to procedure CloseImportContext)

 

Adding groups

In some scenarios, you will also want to add some study groups, and add persons to these groups.  An example is the Treat to Target project/study, where a group is added for every physician at a clinic, and their patients are grouped based on who their primary physician is.  This is done with two procedures, AddStudyGroup and AddStudCase.  After adding a Person to a Study, he becomes a StudyCase, and can be put in a group with UpdateCaseGroup.