Concept: CADHAM Provincial Laboratory (CPL) - Laboratory Information Management System (LIMS) - Overview of Services and Data

Concept Description

Last Updated: 2025-04-22

Introduction

Scope of CPL Services

The Laboratory Information Management System (LIMS) database

Methods

  1. The first step in using the LIMS data is to select observations from the SAMPLE dataset. If you have a cohort you can subset the sample data to only include those individuals using a PHIN format. Note that the patient identifier in LIMS is FILE_PHIN.
    1. Exclude samples that have been cancelled using the STATUS variable (cancelled tests have STATUS= “X”;)
    2. Use the X_SAMPLE_CATEGORY to select the general area of the tests you are interested in. Categories to choose from include:
      1. CHEMISTRY
      2. MICRO
      3. SEROLOGY
      4. VIROLOGY
    3. The sample date-time variable (SAMPLED_DTTM) can be used as a proxy for date of diagnosis. Some observations will have missing sample dates. To handle this you can use the earliest of sampled, received, or login date-time values.
      dx_date= (DATEPART(MIN(SAMPLE_DTTM, RECD_DTTM, LOGIN_DTTM))

  2. The second step is to link samples to the TEST data using SAMPLE_NUMBER. Creating a sample_number format is a simple way to select the tests for your samples. A single sample_number can be linked to multiple tests (a one-to-many linkage). Additionally you should:
    1. Exclude tests that have been cancelled using the STATUS variable (STATUS NE “X”) the same was as with the SAMPLE data.
    2. Select the tests you are interested in using the ANALYSIS variable. There are hundreds of different values for this variable and determining the relevant ones can be difficult. These values are generally abbreviated and require some domain specific knowledge to interpret. Using PROC FREQ to look through the different types of analysis, knowing the various names (and abbreviations) of the organisms you are looking for, and Googling (or using the search engine of your choice) the different test names is often useful.
      1. Often there are multiple values of ANALYSIS that sound like the are all tests for the same thing. For example, there are >10 ANALYSIS values that start with “HIV”. Don’t worry, some of these refer to different steps/tests done on one sample as part of the testing procedure, so there can be multiple observations for a single HIV test, and each will have their own test number (but all the same sample number). The main test observation will be linked to these “sub tests” through the PARENT_NUMBER variable. The main observation will have PARENT_TEST= “0”, while the “sub tests” have PARENT_TEST values equal to the TEST_NUMBER of the main test observation. We typically only need the overall result to determine a positive/negative test result.
      2. To select the main test observation use:
        1. PARENT_TEST= “0” and
        2. X_REPORTABLE= “T”. An observation being reportable means that it appears on final report sent to a physician. If an observation has X_REPORTABLE= “F” it means it does not appear on the final report and should not be interpreted by us as it may have been overridden or had an ambiguous outcome so another test was done on it, etc.
    3. Using the main test observation, we can often determine what the final determination is without having to link to the RESULTS table. There are two variables in the TEST data that come from the RESULT data, these are IN_SPEC and IN_CONTROL, both of which contain a Boolean T/F value.
      1. IN_CONTROL refers to whether that control part of the test worked. If IN_CONTROL= “F” then the test did not work properly, while IN_CONTROL= “T” means the control was successful
      2. IN_SPEC refers to whether the test on the sample was within the specification for a negative result (IN_SPEC= “T” is a negative test), while IN_SPEC= “F” indicates a positive diagnosis.
      3. A positive test results will thus have IN_CONTROL= “T” and IN_SPEC = “F”

  3. Sometimes we need to look at the RESULT table, for example to determine a HIV positive patients viral load, which is a numeric result. TESTS can be linked to RESULTS by using the TEST_NUMBER. One test is often linked to several results.
    1. To interpret the results of a test with a positive vs negative outcome we can IN_SPEC/IN_CONTROL variables as before.
    2. Alternatively, or when numeric or more complex results are required, we can use the FORMATTED_ENTRY variable which contains text. Using FORMATTED_ENTRY can be complicated as a positive test could be reported as “POS”, “POSITIVE”, “POSITIVE/POSITIVE”, or “NEGATIVE/POSITIVE.
    3. To make it more fun, not all the results will be what people typically think of as a lab test. For example, for HIV, some observations contain information on whether an individual has had previous HIV tests in the LIMS data in the past or their current and past HIV status. The REPORTED_NAME variable contains information on what the result data is for. For example, a syphilis test result can have “components” of “History”, “Current-History”, “Syphilis” (which is a final, overall result), and “RPR Reading” (which refers to a type of antibody test).

  4. For analysts with internal access to the Programmers website on the UM SharePoint site, there is example code available on using LIMS data for HIV, syphilis, and chlamydia/gonorrhea (see the Data Analysts Presentations available in the Links section below - internal access only.)

Related concepts 

Related terms 

Links