Tutorials › Population Pharmacokinetics › Converting Medication Histories into PK Covariates

Sex, Race, Genetics and Co-medications · Tutorial 261 of 599

Converting Medication Histories into PK Covariates

Build auditable, model-ready medication covariates from heterogeneous records without confusing documented prescriptions with actual exposure.

Intermediate 12 min read

What You'll Learn

  • Distinguish active ingredient, product, formulation, and route when identifying a co-medication.
  • Define exposure relative to a PK sample or collection interval using explicit start and stop conventions.
  • Separate prescribed medication from administration evidence and record uncertainty rather than guessing.
  • Convert dose strength, amount per administration, and schedule into consistent dose fields.
  • Compare ever-exposed, point-in-time, and interval-based medication summaries.
  • Check harmonized records for date, route, dose, and duplicate-record problems.

Why Medication Records Need Deliberate Translation

Medication histories are not usually ready to enter a population pharmacokinetic (PK) data set as a single covariate. A chart may contain a brand name, a generic name, a product strength, a route, an order date, and an end date, but these fields do not necessarily establish which drug a participant received at the time relevant to a PK observation. A carefully constructed covariate therefore begins with a precise question: which medication, by which route, during what exposure window, and at what dose?

Those choices affect the meaning of any later model result. For example, an indicator for “ever recorded” is not equivalent to an indicator for use at a blood-sampling time. Similarly, a medication order is evidence of a prescription, not necessarily evidence that doses were taken. The purpose here is to make those distinctions explicit and preserve them in the analysis data.

Definition: A medication-derived PK covariate is a variable constructed from medication records to describe a participant’s documented medication identity, route, exposure status, dose, or related feature at a defined time or over a defined interval. Its meaning depends on the source records, harmonization rules, and exposure window used to create it.

Define the Medication Before Defining Exposure

A medication record can identify several different things: an active ingredient, a branded product, a formulation, or a package. These are not interchangeable levels of description. For a PK covariate, specify the level that matches the scientific question. If the question concerns use of an active ingredient, records for its generic and brand products may be harmonized to that ingredient. If formulation or release characteristics matter to the question, retain those distinctions rather than merging products automatically.

Route should usually be recorded separately from drug identity. Oral and topical products with the same ingredient are not automatically equivalent exposure descriptions. A useful data structure preserves at least the normalized ingredient, product or formulation when available, route, and the original recorded name. Keeping the source name makes the harmonization auditable; keeping route prevents a broad ingredient label from concealing materially different ways of use.

A combination product also requires an explicit rule. It may be represented by each of its active ingredients, by a combination-product category, or by both, depending on the analysis question. The choice should avoid counting the same record twice in a covariate intended to represent one exposure. Do not infer an ingredient from an ambiguous brand name without checking a reliable medication dictionary or source documentation.

Represent Start, Stop, and Exposure Windows

Exposure status is meaningful only in relation to a time reference. Let \(s\) denote the documented start time, \(e\) the documented stop time, and \(t\) the time of a PK observation. A clear convention is to represent a medication episode as the half-open interval \([s,e)\): the medication is considered covered from the start time up to, but not including, the stop time. Under this convention, a point-in-time indicator is

$$ I(t)= \begin{cases} 1, & s \leq t < e,\\ 0, & t < s \text{ or } t \geq e. \end{cases} $$

The half-open convention assigns a boundary time to at most one adjacent episode. If one record stops at 10:00 and a new record starts at 10:00, the time 10:00 belongs to the new episode, not both. The convention is a data rule, not proof that a dose was taken or that a pharmacologic effect ended exactly at the recorded stop time.

Medication systems differ in how they encode dates. A stop date may mean the final day on which medication was available, the final scheduled dose, the date an order was discontinued, or something else. When source dates have day-level precision, the analyst must document how that convention maps to the analysis timeline. If a stop date is defined as inclusive through that calendar day, converting it to the next day’s boundary can implement a half-open interval; this conversion is not appropriate unless the source definition supports it. Missing stop dates should be retained as missing or explicitly classified as open-ended according to a prespecified rule, not silently treated as proof of continued use.

The time reference also matters. A covariate at the sample time \(t\) answers a point-in-time question. A covariate over a collection interval answers a different question: whether, or for how long, the medication record overlapped that interval. For a PK interval \([a,b)\), the overlap duration is

$$ \max\{0,\ \min(e,b)-\max(s,a)\}. $$

This calculation describes record overlap; it does not by itself establish the duration of biological effect. Any lag, washout period, or effect persistence requires a separate scientific rationale and explicit definition.

Worked Example: Identifying a Drug and Route at the Sample Time

Suppose a hypothetical participant has two records: an oral tablet containing ingredient X, recorded from March 10 at 08:00 through March 14 at 08:00, and a topical product containing ingredient X, recorded from March 11 at 09:00 through March 13 at 09:00. A PK sample is collected March 12 at 09:00. The analysis question is whether the participant has documented oral use of ingredient X at the sample time.

First, harmonize the oral brand and generic entries, if present, to the same ingredient X while retaining the product name. Keep the topical record’s route distinct from the oral record. For the oral record, \(s=\) March 10 at 08:00, \(e=\) March 14 at 08:00, and \(t=\) March 12 at 09:00. Since \(s \leq t < e\), the oral-use indicator is \(I(t)=1\). The topical record does not change this answer because the requested covariate is specifically oral use.

The resulting covariate can be described as “documented oral ingredient X use at the PK sample time.” It should not be described as confirmed ingestion unless the source includes administration evidence. A separate ingredient-X-any-route covariate would include the topical record too, but that would answer a different question.

Prescribed Dose Is Not the Same as Administered Dose

Dose fields need units and a clear interpretation. Product strength is the amount of active ingredient in one unit, such as one tablet. Dose per administration is the amount intended or recorded for one dosing event. Frequency describes how often that amount is scheduled. For example, two 50 mg tablets per administration correspond to \(2 \times 50=100\) mg per administration. For a regular schedule of one administration every 8 hours, there are \(24/8=3\) scheduled administrations in 24 hours, giving a nominal prescribed daily amount of \(100 \times 3=300\) mg/day.

That arithmetic describes the order, not necessarily the amount taken. If administration records are available, retain a field that identifies whether the dose comes from the prescription or from an administration record. For “as needed” orders, the maximum permitted daily amount is not the actual daily amount. For a taper or a changed order, preserve the time-specific dose rather than applying one dose to the whole medication episode. Where units differ, convert only with a valid conversion and retain the original value and unit for checking.

Worked Example: Deriving a Nominal Daily Dose

A hypothetical order states: ingredient Y, oral tablets, 50 mg per tablet, two tablets per administration, every 8 hours. Assume the order is scheduled regularly and the question is the nominal prescribed amount per 24 hours.

The amount per administration is \(50\ \text{mg/tablet} \times 2\ \text{tablets}=100\ \text{mg}\). The schedule gives \(24\ \text{hours/day} \div 8\ \text{hours/administration}=3\) administrations per day. Therefore,

$$ 100\ \text{mg/administration}\times 3\ \text{administrations/day} =300\ \text{mg/day}. $$

The model-ready dose fields can record 100 mg per administration and 300 mg/day as the nominal prescribed daily amount, with oral route and the order’s dates. If the record is an “as needed” order, 300 mg/day would not be justified as an amount actually received; it would at most be a schedule-based maximum if the order explicitly permits that maximum. If actual administrations are documented, those records should be used to describe administered amounts instead.

Choose a Covariate Definition That Matches the Question

Several summaries can be built from the same medication history. An “ever recorded” indicator is 1 if any qualifying record exists in a specified study period. A point-in-time indicator is 1 when a qualifying record covers a specified time. An interval summary can indicate any overlap with a defined PK interval, or quantify the recorded overlap duration. A dose summary may describe prescribed dose, administered dose, or a dose category. These summaries are alternatives, not interchangeable versions of one universal medication variable.

The choice should follow the scientific question and be stated in the variable definition. “Ever use during the study” can classify someone as exposed even when the medication began after the PK sample. A point-in-time indicator can be 0 at a sample even when exposure occurred earlier in the sample’s collection interval. A dose category can conceal substantial differences if the underlying dose, route, or frequency is discarded. Preserve the underlying fields where possible so alternative summaries can be checked without reconstructing them from a single coarse label.

Worked Example: Point-in-Time Status Versus Interval Overlap

In a hypothetical record, a medication episode begins April 6 at 20:00 and stops April 8 at 08:00. The PK collection interval is April 7 at 10:00 to April 8 at 10:00, and the sample is collected at the interval endpoint, April 8 at 10:00. Use the half-open interval convention.

At the sample time, \(t=\) April 8 at 10:00 is later than the stop time April 8 at 08:00. Thus \(I(t)=0\): the record does not cover the sample time. For the collection interval, the overlap starts at the later of April 6 at 20:00 and April 7 at 10:00, which is April 7 at 10:00. It ends at the earlier of April 8 at 08:00 and April 8 at 10:00, which is April 8 at 08:00. The overlap is therefore 22 hours, so the interval-overlap indicator is 1 and the recorded overlap duration is 22 hours.

Both statements are correct because they answer different questions. Neither establishes that a dose was taken during those 22 hours or that a pharmacologic effect ceased at 08:00. The chosen summary should be named precisely in the analysis data.

Build and Check an Auditable Record

A practical medication-derived data set retains the link between raw records and derived covariates. At a minimum, keep the source record identifier, original medication name, normalized ingredient, product or formulation when available, route, start and stop values with their precision, dose amount and unit, schedule, and whether the source represents an order or an administration. Then record the exposure-window rule and the derived value. This structure makes it possible to trace a covariate back to its evidence.

Useful checks include the following:

  • Flag records with a stop time earlier than the start time, impossible dose units, or a dose amount that cannot be interpreted from the recorded product strength.
  • Review duplicate entries and overlapping episodes. Duplicates may reflect repeated documentation rather than separate exposure; do not sum or count them without a rule.
  • Check whether route and formulation are missing or inconsistent across records that were harmonized to one ingredient.
  • Tabulate missing start dates, stop dates, dose fields, and administration status. Missingness should remain visible rather than being converted automatically to “not exposed.”
  • Inspect records near PK sampling times, where date precision or a boundary convention can change the derived indicator.

An important limitation is that medication records measure documentation. Even a correctly harmonized prescription history may not establish dispensing, adherence, ingestion, absorption, or the relevant concentration at sampling. Conversely, an absent record does not prove that no medication was used. Analyses should use the most defensible source available and describe what the resulting covariate represents.

Common Mistakes and Practical Comparisons

Choice or mistakeWhat it representsCorrection or limitation
Use “ever recorded” as if it meant current useAny qualifying record in a stated periodDefine the period; use a time-specific or interval summary when that is the question.
Merge all records with the same ingredientPotentially combines products and routesRetain route and relevant formulation distinctions; harmonize only to the level justified.
Treat a prescription as a confirmed doseDocumented intended useLabel the source as prescribed or administered; do not infer adherence.
Replace a missing stop date with the study endAssumed continued record coverageUse an explicit open-ended or unknown-date rule and assess its implications.

A common error is to reason, “The medication appears in the chart, so the participant was exposed at every later PK sample.” That conclusion does not follow unless the start and stop information support coverage at those times, and even then it describes record-based coverage rather than confirmed use. The correction is to define the time reference, apply the documented interval rule, and preserve uncertainty about actual administration.

Key takeaway: A useful medication covariate is not merely a drug name converted to a number. It is a documented, reproducible definition of medication identity, route, time window, and dose source, tied to the PK time or interval relevant to the question.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions.

  1. A record covers June 2 at 09:00 through June 5 at 09:00, using the half-open convention. Is it active at June 5 at 09:00?
  2. A tablet contains 25 mg per tablet, and the order is for three tablets twice daily. What is the nominal prescribed daily amount?
  3. Why should an oral product and a topical product with the same active ingredient not automatically be treated as the same route-specific covariate?
  4. A medication order has no stop date. What can and cannot be concluded from that missing value?
  5. A medication overlaps a PK collection interval but stops before the sample time. Can the interval-overlap and point-in-time indicators differ? Explain.

Solutions. (1) No. The interval excludes its stop boundary, so June 5 at 09:00 is not covered. (2) Each administration is \(25 \times 3=75\) mg; twice daily gives \(75 \times 2=150\) mg/day prescribed. This does not establish the amount taken. (3) Route is part of the exposure description, and the same ingredient recorded by different routes does not answer a route-specific question in the same way. (4) The record lacks a documented stop value; continued use cannot be established from that missing value alone. Apply a stated missing-stop rule and retain the uncertainty. (5) Yes. The interval indicator can be 1 because some recorded coverage overlaps the collection interval, while the point-in-time indicator is 0 because the record does not cover the sample time.

Clinical Biostats