1 Introduction

This lab will focus on reporting on lab orders and results. medications and medication orders. We will use admissions for COPD exacerbations as a sample case, building on code from prior labs.

2 WBC

How many times does the term “WBC” show up in the LabComponentResultFact table? Look at the ComponentName column and use “LIKE” to identify them. The percent sign (%) is a wildcard.

3 Relevant WBCs

How many different ways can a patient’s serum white blood cell count be measured (the WBC count measured in a patient’s blood, not any other body fluids, such as urine, CSF, etc, and not descriptions of the white blood cells themselves)? You should be able to narrow it down to a small-ish list with a query, and from that list, pick the relevant ones. Show your query for the near-final list, and then enter your final number.

4 Top 4 WBC

List the top 4 most common serum WBC tests for ALL patients? If there is something in the top of your list that you dont think belongs, you can exclude it using a WHERE clause.

5 WBC in COPD

How many WBC tests (for this exercise, use LabComponentKey 994 and 6482) were done during the admissions for patient with a COPD Exacerbation (ICD-10 J44.1) since 2016?

6 WBC Per Patient

How many WBC tests were ordered for each patient above? Your result should have one row per patient per admission (the same patient may have been admitted multiple times), with one column that counts the total number of WBC that patient had.

7 WBC Results

Generate a table that shows the result of all of the WBC results for the patients in the previous question, along with the units, expected ranges, if it was abnormal, and any flags

8 Lab Counts

Count the number of each type of lab (using ComponentName) that was performed for patients admitted with a COPD exacerbation during their admission.

9 Own Project

9.1 Writing

Modify the Measurements section to include at least two different lab-related measurements, and specify how they relate to your project observations in terms of a date range, encounter linkage, etc. In the exercise, the admission and discharge dates were used as the date range for lab values of interest; you’ll need to try something different if you are working with outpatient data.

9.2 Planning/Presenting Results

Before you start coding, modify your Table 1 design to include rows for the two or more lab-related measurements. Decide whether you want to dichotomize the lab results (e.g., “LDL > 130 mg/dl, n(%)”) or present the mean+-SD or median IQR, or both, etc.

9.3 Coding

Refine your Table 1 SQL/R/Stata code to obtain the results needed to fill in the new lab-related rows in your Table 1.