Skip to main content

Healthcare costs

Where costs per person come from, and how to read the DRG (Diagnosis Related Groups) registers at Statistics Denmark (DST)

Healthcare costs from Danish registers: DRG-priced hospital contacts at Statistics Denmark (DST), the tariff year in the LPR3 DRG files, contact or hospital-course prices, and what a DRG price covers.
Last modified

December 4, 2026

Use this page if your study needs healthcare costs per person. The registers hold no single cost variable: costs are assembled from several sources, each priced in its own way. This page says where the costs are, and how to read the DRG (Diagnosis Related Groups) registers at Statistics Denmark (DST), which put a price on hospital contacts.

Before this page: cohort, one row per person with pnr, index_date and censor_date (Join extracts and define follow-up).

Looking for how to analyse costs once you have them: models, censoring, price year? That is on Analysing costs.

Check your own delivery. The registers and years below were checked against DST’s register overview in November 2026. The Danish Health Data Authority (Sundhedsdatastyrelsen, SDS) changes the tariffs and the grouping logic every year, so column names and years can change. Compare with colnames() in your own data.

Where costs come from

  • Somatic hospital contacts (all hospital contacts outside psychiatry): priced by DRG. SDS places each hospital contact in a DRG group and sets a tariff (a fixed price) for each group every year: the average operating cost of a patient in that group (SDS DRG rates). In the LPR2 period (the National Patient Register before 2019, see Understand LPR), inpatients were grouped by DRG and outpatients by DAGS (Dansk Ambulant Grupperings System, the Danish outpatient grouping system) (SDS, DRG-grouped LPR). Today somatic patients treated at the main and regional function levels are settled (priced for payment between regions) with DRG tariffs, while treatment at the highly specialised level is settled at rates set locally (Takstvejledning 2024, sections 1 and 3.1). A DRG price is therefore the tariff system’s unit price for the activity, not always what was paid. Which registers DST holds is in DRG data at DST.
  • Psychiatric hospital contacts: are not settled by DRG. Inpatients are settled with a bed-day rate and outpatient visits with a visit rate. SDS calculated indicative DRG and DAGS tariffs for psychiatry up to tariff system 2018 (Takstvejledning 2024, section 3.2), and DST holds them in DRGPSYK_HEL and DRGPSYK_AMB. Whether the current DRG registers hold psychiatric activity is unclear, see Psychiatry in the LPR3 DRG registers (LPR3 is the patient register from 2019). Keep somatic and psychiatric costs apart.
  • Primary sector (general practice, specialists etc.): fees in sysi/sssy (Registers and variables). These are the fees tied to a service. General practitioners are also paid a basic fee and a practice fee per listed patient, and these are not in sssy (“basishonoraret ikke angivet i SSSY”, DST, Lægebesøg, statistical processing). DST spreads them over the patients in a separate aggregated fee, BRUHONAGG in SSHO (2005 onwards, DST, BRUHON). From 2018 the chronic-care fee (kronikerhonorar) is missing as well: it is paid manually, “hvorfor det ikke kan ses i sygesikringsregistret”, and the services it covers are not registered (DST, Lægebesøg, comparability). General practice costs from sssy are therefore too low, and from 2018 most for patients with chronic disease. If your exposed group has more chronic disease, that biases a difference in costs.
  • Prescription medication: patient co-payment and reimbursement in the prescription register, LMDB (Lægemiddeldatabasen).
  • Medication given in hospital: Hospital medication (the Hospital Medication Register, SMR), but read What a DRG price covers before you add it to DRG prices.

DRG data at DST

DST holds the DRG-grouped data in a separate set of registers for each period, so a study period that crosses 2018 needs more than one set (DST’s register overview):

Register Content Years Status
DRGSOMA_HEL, DRGSOMA_AMB LPR2, inpatients and outpatients (dates) 2002-2017 Closed 15 January 2024
DRGSOMA_KONTAKT, DRGSOMA_SGHFORLOB, DRGSOMA_PROCEDURE Contacts, hospital courses and procedures 2018 Closed 15 January 2024
DRGPSYK_HEL, DRGPSYK_AMB Indicative psychiatric tariffs 2004-2018 Closed 15 January 2024
DRG_KONTAKTER, DRG_SGHFORLOB LPR3, contacts and hospital courses Tariff years 2021-2025 Updated yearly
DRG_DIAGNOSE, DRG_PROCEDURE and three more LPR3, diagnoses, procedures and internal codes Tariff years 2022-2025 Updated yearly

The columns of DRG_KONTAKTER and DRG_SGHFORLOB are listed on Registers and variables. Column names on this page are in lower case, as after rename_with(tolower).

The LPR2 registers, and stays that crossed into LPR3 in 2019
  • In DRGSOMA_HEL and DRGSOMA_AMB, v_pris is given in 1,000 kr. (“Angivet i 1.000 kr.”), and for inpatients v_aar is the year of discharge from the last contact of the course, so costs follow the discharge year (SDS, DRG-grouped LPR).
  • A stay that crossed the change to LPR3 in 2019 is priced once, in the LPR3 course table. SDS groups its LPR2 part and its LPR3 part and keeps the group with the higher tariff; overgangskontakt_dyreste says which part the result came from (LPR2 or LPR3). The LPR2 course gets the group 90UA07 “Flyttet til DRG LPR3” (moved to DRG LPR3) (SDS, DRG-grouped LPR3 data, tariff system 2019, sections 3.4.3.1 to 3.4.3.3).

LPR2 DRG costs: dates, and the link to LPR

To use a cost from DRGSOMA_HEL or DRGSOMA_AMB in a study you need to know when it happened: before or after the index date, inside or outside follow-up. A delivery often holds only a few of these registers’ columns, such as pnr, v_aar, the prices, recnum and the DRG group. Those give a cost a year (for inpatients v_aar is the year of discharge, see above) but no date.

Do not join the DRG registers to LPR on recnum. Both carry a recnum labelled “LPR-identnummer”, so it looks like the key, but DST states that it is not. The DRG registers were formed from the yearly locked version of LPR that SDS uses for settlement, while DST delivers the living LPR, which is corrected back in time: “Anvendelsen af det levende LPR betyder at LPR og DRG ikke kan kobles på RECNUM” (DST, Nyt fra Forskningsservice, 4th quarter 2017, pages 4-5). A join on recnum can find no contact, or potentially the contact of another person, and the join itself gives no sign of which. If you have already joined on recnum, check how many rows found a contact, year by year.

Order the dates with the DRG data. The registers hold them even when a delivery does not. DST’s variable list for DRGSOMA_HEL includes d_inddto and d_uddto (start and end of the contact), and DRGSOMA_AMB has both as well as d_ambdto (the date of the outpatient visit), for every year from 2002 to 2017 (DRGSOMA_HEL, DRGSOMA_AMB). With the dates in the DRG data, each cost can be placed in time without any link to LPR.

To match DRG rows to LPR contacts, for instance to add diagnoses, use the contact key DST gives instead: pnr, c_pattype, c_sgh, c_afd, d_inddto, v_indtime and v_indminut. All seven are in the DRG registers and in lpr_adm, but not in every year: DRGSOMA_HEL has v_indminut only from 2005 and DRGSOMA_AMB has v_indtime only from 2003, so in the earliest years the key is not complete.

With only v_aar, a cost can be placed by year only. A follow-up window that starts or ends during a year then needs a rule for that year, for example spreading the year’s cost evenly over its days. Such a rule understates costs that cluster on one date, such as an admission at diagnosis, so state which rule you used and what it does to the first year. When you add to an LPR delivery, ask for all of it again (Understand LPR).

Check a recnum join in your own delivery

The share of DRG rows whose pnr and recnum are found together in lpr_adm, year by year. A year far below the others means the keys do not match there. Even a high share shows only that a contact with that recnum exists for the person, not that it is the contact the DRG row priced.

library(fastreg) # read_register()
library(dplyr)

lpr_keys <- read_register("lpr_adm") %>%
  rename_with(tolower) %>%
  distinct(pnr, recnum) %>%
  mutate(found = TRUE)

read_register("drgsoma_hel") %>%
  rename_with(tolower) %>%
  select(pnr, recnum, v_aar) %>%
  left_join(lpr_keys, by = c("pnr", "recnum")) %>%
  group_by(v_aar) %>%
  summarise(rows = n(), share_found = mean(!is.na(found))) %>%
  arrange(v_aar) %>%
  collect()

Run it for drgsoma_amb as well. The block is marked as DST-only because the synthetic registers the guide’s code is tested on do not include the DRG registers of LPR2.

The year of an LPR3 DRG file is the tariff year

SDS publishes a new set of tariffs every year, the tariff system for that year (Takstsystem 2025, for example). LPR3 is the National Patient Register from 2019. In DRG_KONTAKTER and DRG_SGHFORLOB the year in the file name is the tariff year (“Takståret”), not the year the activity took place. Each yearly file holds that year and the two years before it, given by aktivitetsaar (DST, register note for DRG_KONTAKTER). The first release grouped tariff system 2021 with activity years 2019 to 2021 and tariff system 2022 with 2020 to 2022 (DST, register history for DRG_KONTAKTER, 14 May 2024). aktivitetsaar is the year the last contact of the hospital course ended (SDS, DRG-grouped LPR3 data, tariff system 2025, section 3).

  • Do not stack the yearly files. Most activity is in three files, priced each time with a different tariff system.
  • Prices compare within one tariff system. Tariffs hold for one calendar year, and SDS groups several activity years in each file so that the years “kan sammenlignes i samme takstsystem” (can be compared in the same tariff system) (SDS, tariff system 2025, section 6.3).
  • Prices are in the tariff year’s price level, not the activity year’s. A tariff system gives its tariffs in that year’s price and wage level, for example “2024 pris- og lønniveau” in Takstvejledning 2024 (section 3.1). A 2019 contact in the 2021 file is in 2021 prices. Bring all years to one price year before you sum or compare across years, and use the tariff year as the year you convert from (how).

Use each year’s own tariffs: take each activity year from the file with the same tariff year (aktivitetsaar equal to the year in the file name, which fastreg gives you as year). There are no files for tariff years 2019 and 2020, so take those two activity years from the 2021 file. This follows from how DST builds the files; it is not a DST recommendation. The recipe below does this.

The other consistent way: one tariff system

Take one file and its three activity years. The prices then compare across those years without a price index, but you get three years at most, so it only fits a study whose costs all fall within three years.

Price per contact or per hospital course: use one, not both

LPR3 records a hospital stay as one or more contacts: a patient moved from one department to another has a contact in each. SDS joins the contacts of one person at the same hospital, in the same course of illness and each starting at most four hours after the previous one ended, into one hospital course (DRG-sygehusforløb) (SDS, tariff system 2025, section 3). Both are priced:

  • DRG_KONTAKTER has one row per contact. pris_drg is the tariff of the contact’s DRG group.
  • DRG_SGHFORLOB has one row per hospital course. pris_drg_drgsghf is the tariff of the course’s DRG group.

totalpris_drg and totalpris_drgsghf add the long-stay price, an extra payment for each day beyond the group’s trim point, the maximum number of bed days the tariff covers (Takstsystem 2026, section 3.1.1.2) (SDS, tariff system 2025, Tabel 25). The two registers price the same hospital activity, so adding the contact prices and the course prices counts it twice. Choose one of them.

Use the hospital course unless you have a reason not to. Somatic hospital treatment is settled “pr. DRG-sygehusforløb” (per DRG hospital course) (Takstsystem 2026, section 3.1.1), so totalpris_drgsghf is the price the tariff system sets for the course. A contact price comes from grouping that contact on its own. It helps when you need to place costs at a date within a long course, but the sum of the contact prices need not equal the course price.

What a DRG price covers

A tariff reflects the calculated direct costs of treating the patient and of rehabilitation. It does not include, for example, civil-servant pensions, interest or depreciation (Takstvejledning 2024, section 3.1).

Medication can go wrong in both directions:

  • Ordinary hospital medicine is in the DRG price. Medicine treatment is itself grouped and priced in DRG, for example in the groups 34PR01 to 34PR10 “Medicin-behandling” (Takstsystem 2026, Bilag B3.2). Adding costs from the Hospital Medication Register on top of DRG prices can count it twice.
  • Medicine handed out to take home, above 1,000 kr. a day, is not. This is medicine the hospital hands out to patients (“Udleveret medicin til patienter for mere end 1.000 kr. pr. dag”), and a supply for a period counts as one day. It is a special service (særydelse, SYD02), settled separately at cost (Takstsystem 2026, Bilagstabel 7 and its footnote 11), so the DRG price leaves it out. DST’s variable lists for DRG_KONTAKTER and DRG_SGHFORLOB have no column for special services. Expensive medicine given at the hospital is a different matter: it is in the medicine groups in the bullet above.

Psychiatry in the LPR3 DRG registers

SDS writes that the DRG-grouped LPR3 data hold “Kun somatisk aktivitet” (somatic activity only) (SDS, tariff system 2025, section 3.4.1.2). DST’s register history for DRGPSYK_HEL says the register was closed because the psychiatric tariffs are now included with the somatic ones “i det nye DRG” (in the new DRG), in DRG_KONTAKTER and DRG_SGHFORLOB (DST, register history for DRGPSYK_HEL, 15 January 2024). The two statements do not agree. Tabulate speciale (the department’s specialty) in your own delivery before you assume that psychiatric contacts are present or absent.

If they are absent, one way to put a price on psychiatric hospital care from 2019 is SDS’s national rates for psychiatric patients: 4,174 kr. per bed day and 2,089 kr. per outpatient visit in 2024 prices (Takstvejledning 2024, section 3.2), applied to the psychiatric contacts in LPR3. These are the rates the regions pay each other for a psychiatric patient, not the cost of each patient, so say in your methods that you used them.

From the registers to a cost per person

The recipe below takes the hospital courses in DRG_SGHFORLOB (the course price), with each activity year priced in its own tariff year (see above). It keeps the courses that ended during each person’s follow-up, brings the prices to one price year and sums them per person. A course counts in the year it ended, as aktivitetsaar does. This is somatic hospital care only: add the other sources the same way, with their gaps in mind (where costs come from). For 2002 to 2017, the same filter on follow-up needs the dates of DRGSOMA_HEL and DRGSOMA_AMB, which a delivery may lack (LPR2 DRG costs). If your follow-up is longer than a year, discount each course before the sum (Discounting).

library(fastreg) # read_register()
library(dplyr)
library(readr)   # read_csv()

# cohort: one row per person with pnr, index_date and censor_date (the end of
# follow-up, defined on Join extracts and define follow-up)
# price_index: one row per year with the columns year and index, taken from
# StatBank PRIS8 or the Danish Regions' health price index (see Analysing costs)
price_index <- read_csv("path/to/price_index.csv")
PRICE_YEAR  <- 2024                                  # the price year you report in
base_index  <- price_index$index[price_index$year == PRICE_YEAR]

courses <- read_register("drg_sghforlob") %>%
  rename_with(tolower) %>%
  # year is the tariff year (the year in the file name). Keep each activity year
  # from the file with the same tariff year; 2019 and 2020 come from the 2021 file
  filter(year == aktivitetsaar | (aktivitetsaar %in% c(2019, 2020) & year == 2021)) %>%
  semi_join(cohort %>% select(pnr), by = "pnr", copy = TRUE) %>%
  select(pnr, tariff_year = year, course_end = udtidspunkt_drgsghf,
         cost = totalpris_drgsghf) %>%
  collect() %>%
  mutate(course_end = as.Date(course_end))          # datetime -> date, now in R

hospital_cost <- courses %>%
  inner_join(cohort %>% select(pnr, index_date, censor_date), by = "pnr") %>%
  filter(course_end > index_date, course_end <= censor_date) %>%   # ended during follow-up
  left_join(price_index, by = c("tariff_year" = "year")) %>%
  mutate(cost = cost * base_index / index) %>%      # from tariff-year prices to PRICE_YEAR prices
  group_by(pnr) %>%
  summarise(hospital_cost = sum(cost), .groups = "drop")

# A person with no course during follow-up has a cost of 0, not a missing value
cohort <- cohort %>%
  left_join(hospital_cost, by = "pnr") %>%
  mutate(hospital_cost = coalesce(hospital_cost, 0))

Check before you go on: count the courses per tariff_year (each activity year should come from one file only), and look at price_index for every tariff_year you have, since a year missing from it gives a missing cost. How to analyse the result is on Analysing costs.

See also

Back to top