Match Visits in Labkey

Matching non-matching visits in Labkey

Introduction

Motivation

In Labkey, variables can only be displayed in a datasets when their visitID match. Since that is hard to achieve in retrospective studies, a more flexible manner of visit matching is required. This infrastructure provides means to match variables from non-matching visits using a lookup table that instructs which visits to match.

Strategy

The matching is performed via an sql script that fills a pre-created datasets that already contains the relevant variable columns. Data are matched on patientID key and use a study based visit matches.

Execution

Execution is based on the tutorial. We assume that you have loaded both the ADPD and MMSE datasets. You should upload the neuroModule, unzip it and move the resulting neuroModule directory to the externalModules directory of the server.

Perform the following tasks:

  • Create a dataset for results named matchedVisits. It should containt columns adpd and mmse.

  • Create a list for the visitID lookup. This is done through (⚙→Manage Lists) and Create new List. Use VisitSelect as the list Name, and VariableName as the PrimaryKey, with Primary Key Type as Text(String). Keep default settings and add field SequenceNum as Integer. Save.

  • Add entries to the list by clicking on the plus (+) simbol. Two entries should be added, one with VariableName MMSE and another with VariableName ADPD. For both, set SequenceNum to 1.

  • Go to the Overview tab and scroll down to the Data Transforms. Find the matchedVisits entry and click on Run Now button in the same row. The matchedVisits dataset will be populated using the lookup VisitSelect we just created.

  • Open the matchedVisits dataset. The displayed Visit column referrs to the MMSE visit and should be set to 1 for all patients. Both MMSE and ADPD values should be set.

  • Change lookup values in the VisitSelect list by (⚙→Manage Lists) and change SequenceNum for MMSE to 2.

  • Re-run the matchedVisits script and observe change in the matchedVisits dataset.

links

social