Skip to content

How the baseline is calculated

Kantemir Tvorogov edited this page Aug 9, 2023 · 1 revision

How the baseline is calculated

Baseline value is the result value for date of baseline (date of the closest prior measurement to first drug dose date. OR if this does not exist, then the first measurement of post-first dose date). To identify the baseline correctly you need to go through the following steps:

  1. Split all records by pat_id and measurement name.
  2. Sort the values:
  3. first by tst_date <= pat_baseline_date (rows with tst_date <= pat_baseline_date go first, then all others);
  4. then by absolute value of difference of tst_date and pat_baseline_date
  5. Assign a rank to each row.
  6. Select the max lab_value between rows with min rank. Example Get the following data using sql-query: !bb1

select PAT_IP_DOSE_FIRST_DATE, tst_date, (trunc(TST_DATE)-trunc(PAT_IP_DOSE_FIRST_DATE)) as amountOfDays, lab_value, util_labcode_lookup.LCL_TEST_NAME from result_laboratory inner join result_test on tst_id = lab_tst_id inner join result_patient on pat_id = tst_pat_id left join result_randomisation on rnd_pat_id = pat_id inner join result_study on std_id = pat_std_id INNER JOIN map_study_rule ON (std_name = msr_study_code) LEFT JOIN map_custom_labcode_lookup ON (upper(lab_code) = upper(cll_labcode) AND cll_msr_id = msr_id AND msr_use_alt_lab_codes = 1) LEFT JOIN util_labcode_lookup ON (upper(lab_code) = upper(lcl_labcode)) LEFT JOIN util_labcode_synonym ON (upper(COALESCE(cll_test_name, lcl_test_name, lab_code)) = upper(lcs_synonym)) LEFT JOIN util_labcode_dictionary ON (lcs_lcd_id = lcd_id) where std_name = 'D1234C00001' and result_patient.PAT_SUBJECT = 'E000010010' and util_labcode_lookup.LCL_TEST_NAME = 'Alanine Aminotransferase';

As we can see here, the baseline is 0.32

bb2

Clone this wiki locally