Skip to contents

This dataset contains information about medication prescriptions (ordinations) and their administrations within 24 hours of arrival for patients in the SEM cohort from the Melior journal system.

Usage

melior_sem_medications_24h()

Format

A data frame with 305,688 observations and 38 variables:

contact_id

Character. Unique identifier for each healthcare contact/encounter, serves as a foreign key to link with other datasets. 102,838 unique values. Original field name: KontaktId

patient_id

Integer. Patient pseudonym identifier, serves as a foreign key to link with other patient-level data. Original field name: Alias

prescription_id

Integer. Unique identifier for each medication prescription. Range: 2 to 224,177. Original field name: OrdinationId

prescription_start_date

POSIXct. Date/time when the medication was prescribed. Date range: 2010-01-01 to 2018-12-31, with 86.4% from 2017-2018. Original field name: Ordination_InsattDatum

prescription_end_date

POSIXct. Date/time when the medication prescription was discontinued. 134,397 NA values (44%). Date range: 2017-01-01 to 2021-03-22, with 99.4% from 2017-2018. Original field name: Ordination_UtsattDatum

prescription_end_reason

Integer. Numeric code for the reason for discontinuation of the medication. Values range from 0 to 14, with most common values being 0 and 1. The specific meaning of these codes is not documented in the available metadata. Original field name: Ordination_UtsattOrsak

medication_atc_code

Character. ATC (Anatomical Therapeutic Chemical) classification code. 6,979 NA values (2.3%). 821 unique values, with top codes being N02BE01 (Paracetamol, 11.6%), B05BB01 (Electrolytes, 9.4%), and J01DD01 (Cefotaxime, 9.0%). Original field name: Ordination_ATCKod

medication_npl_id

Numeric. NPL (National Product List) identifier for the medication. 53 NA values (0%). Original field name: Ordination_NPLId

medication_full_name

Character. Complete medication name including form, strength, and manufacturer. 3,939 unique values. Original field name: Ordination_SammansattLakemedelNamn

medication_name

Character. Brand name of the medication. 2,133 unique values. Most common: Cefotaxim Sandoz (8.9%), Alvedon (7.8%), Ringer-Acetat Baxter Viaflo (6.9%). Original field name: Ordination_PreparatNamn

medication_form

Character. Pharmaceutical form of the medication (e.g., tablet, injection). 6,486 NA values (2.1%). 136 unique values, with most common being Filmdragerad tablett (17.9%), Infusionsvätska, lösning (17.7%), and Pulver till injektions-/infusionsvätska, lösning (13.5%). Original field name: Ordination_BeredningForm

medication_form_group

Integer. Code for grouping similar medication forms. Values range from 0 to 141. Original field name: Ordination_BeredningFormGrupp

container_id

Integer. Identifier for the medication container. Range: 1 to 224,176. Original field name: Ordination_Container

main_prescription_id

Integer. Identifier linking to the main prescription if this is part of a series. Range: 2 to 224,177. Original field name: HuvudordinationId

medication_generic_name

Character. Generic name of the medication. 298,691 NA values (97.7%). 48 unique values with most common being E00327 (2.0%). Original field name: Ordination_Lakemedel

administration_route_code

Integer. Code for route of administration. Values range from 1 to 17. Based on correlations with administration_method, common codes appear to include values for different administration routes, but the exact mapping of all codes is not explicitly documented in the metadata. Original field name: Ordination_Administration

administration_group_code

Integer. Code grouping similar administration routes. Values range from 30400 to 30432. The specific grouping mechanism is not documented in the available metadata. Original field name: Ordination_AdministrationGrupp

prescriber_id

Integer. Identifier for the healthcare professional who prescribed the medication. Range: 73 to 65,979. Original field name: Ordination_Insattare

dose_unit_code

Integer. Code for the unit of dose measurement. Values range from 1 to 17. Original field name: Ordination_Dosenhet

prescription_comment

Character. Free-text comments on the prescription. 304,361 NA values (99.6%). 872 unique values among non-NA entries. Original field name: Ordination_Kommentar

prescription_reason

Character. Reason for prescribing the medication. 209,043 NA values (68.4%). 12,998 unique values among non-NA entries, with top reasons being "smärta" (pain, 1.5%), "." (1.5%), and "infektion" (infection, 1.3%). Original field name: Ordination_OrdinationOrsak

is_new_prescription

Logical. Flag indicating if this is a newly initiated medication (TRUE) or continuation of previous therapy (FALSE). 60.9% are newly initiated (TRUE), 39.1% are continuations (FALSE). Original field name: Ordination_Nyinsatt

ward_standard_prescription

Integer. Flag indicating if this is a ward-level standard prescription that allows nurses to administer certain medications without individual physician orders (1) or a regular patient-specific prescription (0). Nearly all values are 0, with some outliers. Original field name: Ordination_ArGenerellOrdination

replaced_prescription_id

Integer. Identifier for the prescription that replaced this one. Mostly 0, with some specific IDs. Original field name: Ordination_ErsattOrdinationId

planned_prescription_id

Integer. Identifier for planned future prescriptions related to this one. Nearly all values are 0 (99.99%), with few exceptions (-10, -11). Original field name: Ordination_PlaneradFranOrdinationId

dispensing_date

POSIXct. Date/time when the medication was dispensed/administered to the patient. Date range: 2017-01-01 to 2018-12-31. Distribution by year: 2017 (50.3%), 2018 (49.7%). Original field name: Utdelning_UtdeladDatum

administration_method

Character. Description of the administration method. 17 unique values, with most common being "Adm.sätt, perorala" (oral, 45.4%), "Adm.sätt, ny inf" (new infusion, 27.1%), and "Adm.sätt, ny inj" (new injection, 23.6%). Original field name: Administrationssätt

dispensed_dose

Numeric. Actual dose of medication dispensed to the patient. Most values are 0, with mean of 36.64 and max of 50,000. Original field name: Utdelning_UtdeladDos

prescribed_dose

Numeric. Prescribed dose of the medication. Most values are 0, with mean of 20.29 and max of 50,000. Original field name: Dosering_Dosering

dose_text

Character. Textual representation of the prescribed dose. 1,809 unique values. Most common: "=" (25.9%), "1x1" (12.0%), "1x2" (7.2%). Original field name: Dosering_Dostext

dose_type

Integer. Code indicating the type of dosing regimen. Values: 0 (74.0%), 1 (22.4%), 3 (3.0%), 2 (0.6%), 6 (rare, <0.1%). While specific meanings are not documented in the metadata, these codes likely represent different dosing regimen types. Original field name: Dosering_DosTyp

dosing_schedule

Character. Schedule for medication administration. 29,598 NA values (9.7%). 89 unique values, with most common being "dag" (daily, 89.9%) followed by "3dag" (0.1%, could mean either "every 3 days" or "3 times a day"), "vad" (0.1%), and "mof" (0.1%). Original field name: Ordination_Schema

responsible_staff_id

Integer. Identifier for the healthcare professional responsible for the care. Range: 73 to 65,979. Original field name: AnsvarigPersonalId

medication_strength_unit

Character. Unit of measurement for medication strength (e.g., mg, ml). 6,736 NA values (2.2%). 30 unique values, with most common being "mg" (42.1%), "Ospecificerad" (unspecified, 31.0%), and "mg/ml" (16.8%). Original field name: Ordination_StyrkaEnhet

medication_strength_numeric

Character. Numeric value of medication strength. 252 unique values. Most common: "0.000000" (32.7%), "500.000000" (7.1%), "10.000000" (6.9%). Original field name: Ordination_StyrkaNumeriskt

medication_strength_text

Character. Complete textual representation of medication strength. 77,024 NA values (25.2%). 513 unique values, with most common being "500 mg" (9.6%), "5 mg" (6.5%), and "10 mg/ml" (4.4%). Original field name: Ordination_StyrkaAlfanumeriskt

Source

Melior

Details

This file was extracted from the Melior electronic health record system. The original filename indicates it contains information about medication prescriptions (Ordinationer) and administrations (Utdelningar) recorded within 24 hours from patient arrival (Inom24TimmarFrånAnkomst). The dataset provides comprehensive medication information for the SEM cohort patients during the critical first 24 hours of their healthcare encounter.

Note

  • This dataset includes medications administered during the first 24 hours after patient arrival, which represents a critical period for initial treatment and stabilization

  • Medication administration during this period often reflects acute interventions and initial therapeutic decisions

  • The dataset shows that 60.9% of prescriptions are newly initiated medications (is_new_prescription=TRUE), while 39.1% are continuations of pre-existing medication regimens

  • The most commonly administered medications based on ATC codes are:

    • N02BE01 (Paracetamol/Acetaminophen) - 11.6%

    • B05BB01 (Electrolytes) - 9.4%

    • J01DD01 (Cefotaxime, an antibiotic) - 9.0%

  • Administration methods are primarily oral ("Adm.sätt, perorala", 45.4%), new infusion ("Adm.sätt, ny inf", 27.1%), and new injection ("Adm.sätt, ny inj", 23.6%)

  • Most medications (89.9%) are administered on a daily schedule ("dag")

  • For dose_type values: The most common value is 0 (74.0%), followed by 1 (22.4%), 3 (3.0%), and 2 (0.6%). While exact meanings are not documented, these likely correspond to different dosing regimen types

  • Nearly half (44%) of prescriptions do not have an end date recorded, suggesting they may have continued beyond the hospitalization

  • The prescription_end_date field contains a small number of future dates (9 records from 2020-2021), which may be valid for long-term prescriptions

  • The field "first_dosing_day" (Ordination_ForstaDoseringDag) has been removed as it contains almost exclusively zeros (99.99%) with just one exception, providing minimal analytical value

  • The field "replaced_prescription" (Ordination_Ersatt) has been removed as it contains only NA values

  • For proper analysis, this dataset should be considered in conjunction with other 24-hour datasets such as sem_lab_tests_24h.csv to understand the complete clinical picture

Examples