For register-based research on hospital-related information, the type of patient–hospital contact (ie, emergency, inpatient, or outpatient contact) can be important when determining both validity and severity of specific diagnoses. For studies of disease incidence and prevalence, changes in registration practice over time may subsequently affect conclusions, and thereby which research results are implemented in clinical practice. Thus, it is essential which method is used to define patient-hospital contacts, and how it affects the distribution of patient-hospital contacts. The Danish National Patient Registry (DNPR) contains detailed information on hospital contacts, including diagnoses according to the International Classification of Disease (ICD) coding and administrative information for the Danish population.1,2 The second version of DNPR (DNPR2) was gradually updated to a third version (DNPR3) between February and March 2019. Major changes in the registration of patient–hospital contacts were introduced with this update.2–4 Part of this change was to no longer include the patient type variable containing information on the type of hospital contact (inpatient, outpatient, or emergency) and instead introduce exact timestamps for the start and end of individual department contacts. In DNPR2, two variables have previously been used to determine the type of patient–hospital contact. These two variables defined the type of contact (inpatient: yes/no) and whether the entry of the contact was acute or elective. Only the latter is available in DNPR3 (Supplementary Table S3.1 describes the relevant variables).
Historically, updates in the registration practice of patient–hospital contacts for DNPR have occurred before the introduction of DNPR3. The latest update occurred in 2014, where an emergency contact was no longer registered as an emergency contact, but rather as an acute outpatient contact (detailed description in Supplementary material S1). After the introduction of DNPR3 various algorithms have been introduced to distinguish between the type of hospital contacts.4–6 However, to our knowledge, no studies have compared the suggested methods.
In 2022, Skjøth et al introduced and validated an algorithm to identify hospital departments as inpatient, outpatient, or emergency clinics in DNPR3.4 With the assumption that no elective non-inpatient contact in DNPR2 was overnight, the algorithm proposed by Skjøth et al can be applied to both DNPR2 and DNPR3. Each contact type was identified by the type of department reporting the contact. The type of the visit may subsequently be derived from the series of contact types.
Another algorithm for defining the type of hospital contact in DNPR3 was proposed by the Danish Ministry of Health and Elderly and is based on the patient-specific contact pattern and not related to the clinical departments.3,6 This method combines all contacts with 4 hours or less between one another and then defines the combined sequence of contacts from entering the hospital to leaving the hospital (hospital visit) of 12 hours or more as inpatient contacts and hospital visits shorter than 12 hours as outpatient contacts.
Gregersen et al recently (November 2024) introduced a new consensus-driven algorithm.5 The algorithm aimed to define Danish hospital care episodes by separating hospital contacts into acute inpatient, elective inpatient, acute outpatient, and elective outpatient in both DNPR2 and DNPR3, based on the length and type of hospital stay by combining contacts with less than 4 hours between them. Conceptually, the algorithm is based on the length of a hospital visit, similar to the algorithm suggested by the Danish Ministry of Health and Elderly, although more detailed considerations regarding contact start and stop times are included in the consensus-driven algorithm.5
This study aimed to present the number of monthly hospital visits from 2006 to 2021 and across DNPR2 and DNPR3 using different algorithm approaches to define emergency, inpatient, and outpatient contacts.
Materials and MethodsWe used all somatic hospital contacts in DNPR between 2006 and 2021 to compare the number of hospital visits when using four different approaches.
1) The algorithm proposed by Skjøth et al, 2) A modified version of the algorithm recommended by the Danish Ministry of Health and Elderly, 3) The latter combined with the patient type variables traditionally used in DNPR2, and 4) The consensus-driven method proposed by Gregersen et al.(Supplementary Tables S1.1–S1.3 elaborate on these approaches, including a list of pros and cons).4,6 We included contacts from 2005 to ensure the correct classification of hospital visits for patients with hospital visits crossing New Year’s Eve 2005–2006. For approach 1–3, all contacts to psychiatric departments as well as all non-physical contacts in DNPR3 were removed. The non-physical contacts were removed to avoid including excess contacts from emergency calls in the Capital Region of Denmark. For clarity, we distinguished between patient–hospital contacts (any contact registered in DNPR) and a hospital visit (the sequence of contacts from entering the hospital to leaving the hospital) (see Figure 1).
Figure 1 Illustration of a patient with multiple hospital contacts within one hospital visit.
In DNPR3, a hospital contact is registered every time a patient is in contact with a hospital department (including calls for the emergency phone 1813 in the Capital Region of Denmark).3 All of these contacts are registered with a start and end time and may overlap. A simple situation is illustrated in Figure 1, where, for each transfer, a new hospital contact will be registered. In DNPR2 the structure is similar, except that outpatient contacts are sometimes registered differently. Instead of logging each contact separately, multiple contacts to the same outpatient clinic were combined into a single entry, showing only one start and end date. This means that in case several outpatient contacts occurred between the start and end date, only the overall period was recorded (as illustrated in Skjøth et al’s Figure 2).4 This difference between DNPR2 and DNPR3 naturally affects the number of outpatient visits. It is important to note that DNPR2 contains a supplementary data table with information on the date of each outpatient visit, these data tables were included in the current study.7 Further, in DNPR2, registration of timestamp for end and start of contact was not mandatory for all types of contact; thus, we defined timestamps for contacts in DNPR2, as suggested by Skjøth et al (Supplementary material S1), for both approach 1 and 2.
Figure 2 Number of types of all hospital visits per 1000 citizens using a modified version of the algorithm suggested by the Ministry of Health and Elderly on the Danish National Patient Registry.
The approach recommended by the Ministry of Health and Elderly did not clarify how to define emergency contacts. Hence, we applied a modification to the version used in the main part of the study (approach 2 and 3), where a patient was considered an emergency contact if their first hospital contact was acute. The method without emergency contacts was presented in Supplementary material S1.
For approach 3, we combined two methods to define the type of hospital visit, on DNPR3 we used the modified version of the algorithm suggested by the Ministry of Health and Elderly, and on DNPR2, we used the patient-type variables available in DNPR2 (see Supplementary material S1 for definition).
In approach 4, suggested by Gregersen et al, the SAS code for the algorithm was published with the article5 and automatically included the necessary data; however, since we did not have access to all variables used in the algorithm, we implemented a modified version (Supplementary material S1). Further approach 4 identify four patient groups acute and elective in- and outpatients. We translated the patient groups into emergency, inpatient, and outpatients in three different manners for comparison with the three other approaches used in this study.
To compare the algorithms, we examined the fluctuations in the number of patient-hospital visits per 1000 citizens for each month in the calendar years from 2006 to 2021. The number of citizens was updated every year according to data from Statistics Denmark.8 We allowed each visit to be categorized as inpatient, outpatient, or emergency, although some of the approaches allowed for multiple contact types during one visit. For visits with multiple contacts, we used the hierarchal approach suggested by Skjøth et al where inpatient > outpatient > emergency visits. That is, hospital visits that contained contacts of all three types were categorized as inpatient visits. Further, for algorithms based on same data structure, we created pairwise 3*3 tables in Supplementary Table S2.1–S2.3 presenting exact differences in how visits were categorized.
In the study by Skjøth et al, different time-gaps between consecutive contacts were considered.4 Because the Ministry of Health recommended a 4-hour gap, we applied a 4-hour gap to both algorithms to make the results directly comparable. For approach 4, slightly different data were used (Supplementary material S1); therefore, the number of visits from this algorithm was not directly comparable to approach 1–3.
For illustrative purposes, we presented all hospital visits for three different patient groups: all patients, patients with rheumatoid arthritis (RA), as identified in the nationwide Danish Rheumatology Quality Register (DANBIO),9 and visits with at least one contact diagnosis indicating infection (see Supplementary S4 and S5 for ICD-10 codes). The two patient groups with RA and diagnosed infectious diseases were chosen as methodological examples of the algorithms. The results were summarized in figures according to the month and year of contact. Analysis and data management was performed in the programs R version 4.2.2 or SAS version 9.4.
Ethical Considerations and Data AvailabilityNeither patient consent nor permission from an ethical committee are required for registry-based research in Denmark. The study was approved by the regional Danish Data Protection Agency (ID-nr. F2024-165), and all handling of data complied with relevant data protection regulation and was conducted in accordance with the Declaration of Helsinki. All patient data were anonymized and accessed through Statistics Denmark in a protected research environment, and therefore it was not possible to publish patient data directly.
ResultsThe algorithm suggested by the Danish Ministry of Health and Elderly (approach 2) indicated little variation across calendar years when applied to both DNPR2 and DNPR3 for all patients, although a gradual increase in the number of outpatient visits over time was observed (Figure 2). In approach 3 (Figure 3), the addition of the patient type variables available in DNPR2 demonstrated a threefold increase in inpatient visits and a 50% decrease in emergency visits from 2006 to March 2019 when compared with approach 2.
Figure 3 Number of types of all hospital visits per 1000 citizens using a modified version of the algorithm suggested by the Ministry of Health and Elderly on the Danish National Patient Registry version 3, and the patient type variables on the second version of the Danish National Patient Registry.
The algorithm proposed by Skjøth et al (approach 1, Figure 4) showed a gradual increase in the number of emergency visits and a gradual decrease in the number of inpatient visits over time. The algorithm mainly differed from the algorithm suggested by the Danish Ministry of Health and Elderly (approach 2, Figure 2) for emergency and inpatient visits, with a two to three times higher number of inpatient visits and a lower number of emergency visits of about 10 visits per 1000 citizen. The number of hospital visits from 2006 to 2018 from the algorithm suggested by Skjøth et al was more in line with the results of approach 3 (Figure 3) when using the patient type variables of DNPR2, although the algorithm by Skjøth et al yielded approximately five inpatient visits per 1000 citizen less.
Figure 4 Number of types of all hospital visits per 1000 citizens using Skjøth’s algorithm on the Danish National Patient Registry with 4 hours between consecutive contacts.
Changing the 4-hour gaps in the algorithm from Skjøth et al to only combining overlapping contacts resulted in a higher number of contacts but did not change the structure (Figure S2.1).
Approach 4 by Gregersen et al showed results similar to those of approach 2 and sometimes in between approach 1 and 2 depending on the translation of elective in- and outpatient, and acute in- and outpatient visits to emergency, inpatient, and outpatient visits (Figure S2.9–S2.11).
For patients with RA, similar fluctuations in hospital visits were seen for approach 2 (Figure S2.2), approach 3 (Figure S2.3), and approach 1 (Figure S2.4) compared to the full population. For patients hospitalized due to infection, changes in the number of emergency visits were observed at specific calendar years where an update in DNPR was introduced (2014 and 2019) (Figure S2.5). Using approach 2 compared to approach 3 showed large difference in the number of emergency and inpatient contacts before 2019 (Figure S2.6). With the approach suggested by Skjøth et al, a similar gap was seen in 2014 (Figure S2.7), otherwise the same tendency was observed for the full population.
Using only the 12-hour rule for the full population, as originally suggested by the Ministry of Health and Elderly (Figure S2.8), the number of inpatient visits increased but was still less than that of the algorithm suggested by Skjøth et al.
DiscussionIn this study, comparing methods for classification of hospital visits, we found that the algorithm suggested by the Danish Ministry of Health and Elderly (approach 2) showed a consistent number of hospital visits per 1000 citizens over time (Figure 2) and across DNPR2 and DNPR3. The algorithm published by Skjøth et al (approach 1) showed a slightly higher variation and with a decreasing trend in inpatient visits over time (Figure 4), but the algorithm yielded inpatient results from 2006 to 2018 more similar to the patient type variables traditionally used to define contacts in DNPR2.
The larger variation seen for the algorithm suggested by Skjøth et al (approach 1, Figures 4 and S2.1) compared to the algorithm suggested by the Danish Ministry of Health and Elderly (approach 2), may be explained by a decrease in the number of hospital beds as well as a decreased hospitalization duration for most diagnoses and procedures over time.10 Thus, fewer and shorter inpatient visits per 1000 citizen would be expected, in which case, the results of Skjøth´s algorithm could be more in line with changes in clinical practice.
The patient type variables in DNPR2, as was recorded directly in the clinic for each contact, may also be in line with clinical practice. However, register guidelines suggest that registration practice has differed across clinical departments,11 which may be problematic if the visits are used for analysis. A patient is registered as an inpatient in one department at a specific hospital, that the same patient might have been registered as an acute outpatient had the patient (under similar conditions) been in contact with another department (possibly at a different hospital). Thus, patients would not be registered similarly across departments, and the results could be systematically biased by department in any registry study using this definition.
When we combined the modified algorithm from the Danish Ministry of Health and Elderly with the patient type variables in DNPR2 (approach 3), a substantial difference in the number of visits per 1000 citizens for emergency and inpatient visits across calendar years of DNPR2 and DNPR3 was observed compared with approach 2 (Figure 3 vs Figure 2). This difference decreased but did not disappear when using only the 12-hour rule without emergency visits (Figure S2.8). Although differences were still present when comparing the patient type variables of DNPR2 with those of approach 1, the two approaches showed more similar results for inpatient and emergency visits (Figures 3 and 4). This may further suggest, that trying to identify department types provided a closer estimate of the clinic or that both approaches used the hierarchical definition of inpatient > outpatient > emergency. The hierarchical approach implies that emergency visits would only be categorized as emergency if no outpatient or inpatient contact were registered during the hospital visit. This could explain part of the difference seen for emergency and inpatient visits for approach 1 (Figure 4) compared to approach 2 (Figure 2) and is supported by Table S2.1–S2.3 presenting how the same hospital visit is categorized differently using the algorithm suggested by Skjøth et al and the modified version of the approach suggested by the Ministry of Health and Elderly. However, applying the 12-hour rule only (Figure S2.8), and thus completely avoiding the hierarchical definition, did not explain the whole difference.
The problem with need for the hierarchical definition in approach 1, was not present in the approach suggested by the Ministry of Health and Elderly. However, as we introduced emergency visits in the modified version of the approach suggested by the Ministry of Health and Elderly, a similar problem for emergency visits was introduced.
Conceptually, approach 1 and 2 differed substantially and had strengths and weaknesses under various circumstances. Approach 1 would misclassify contacts to departments that had a mix of patient types (ie, emergency, inpatient, and outpatient). However, for the rheumatology department of Aalborg University Hospital, which consists of two subdepartments, one that receives outpatients and one that has beds for overnight patients, the two subdepartments were categorized differently with the validated algorithm from Skjøth et al (Table S2.4). In case that, like the rheumatologic department, other departments are divided into similar subdepartments, the problem with mixed patient types should be small as was also suggested by the validation of the algorithm. In contrast, the algorithm suggested by the Ministry of Health and Elderly, would misclassify visits if patients behaved differently than expected. An example would be a hospital visit with an inpatient admission lasting less than 12 hours, or an outpatient visit lasting longer than 12 hours. Table 1 presents the situations in which the approaches differ. These situations should be considered when determining which algorithm should be used in a given context. Any misclassification of the patients will not directly affect patient safety however it may affect conclusions in studies including the respective algorithms, and subsequently which study results are implemented in clinical practice.
Table 1 Situations Where the Algorithms Suggested for the Danish National Registry Results in Different Type of Hospital Visit
The algorithm suggested by Gregersen et al (approach 4) was conceptually similar to approach 2, using a 12-hour role to distinguish between inpatients and outpatients. The number of hospital visits also indicated similarity, with variations depending on how the types of visits were translated to emergency, outpatient, and inpatient visits (Supplementary S2). Categorizing acute outpatient visits as emergency contacts (Figure S2.9) diverged mostly from approach 2, with the number of contacts somewhere between approach 1 and approach 2. Due to the differences in the algorithms the total number of hospital visits was not similar between approach 4 and approach 1–3. This removed some of the direct comparability.
The time by which consecutive contacts were interjoined to one hospital visit varied in the algorithm suggested by Skjøth et al. We presented both the results for contacts with 4 hours between each other (Figure 4) and for overlapping contacts (Figure S2.1). The main difference was that the 4-hour gap reduced the number of emergency contacts in DNPR3. Skjøth et al suggested that the validity is highest for 6-hour gaps.4 However, we chose to use the 4-hour gaps instead, as this meant that the total number of patient-hospital visits, ie across calendar years and adding together the three visit types was the same as for the algorithm suggested by the Danish Ministry of Health and Elderly, making the result directly comparable, and allowing us to create Table S2.1–S2.3.
For patients with RA the results were similar to the full population except for a noticeable peak in inpatient contacts in April 2018, when using the algorithm suggested by Skjøth et al (Figure S2.4). This peak was not observed elsewhere (Figure S2.2 and S2.3). An influenza epidemic occurred late in Denmark in the winter between 2017 and 2018,12 and since patients with RA are more susceptible to infections, this might explain the peak in April 2018. For infections, we also saw similar trends as for the entire population (Figure S2.5–S2.7). The main difference for infections was a noticeable increase in emergency visits after the update of emergency visit registration in 2014 (Table S3.1).
Both the algorithm suggested by the Danish Ministry of Health and Elderly and the algorithm suggested by Skjøth et al are relatively easy to implement if the necessary data is available but time consuming to run due to the huge amount of data points. The algorithm by Skjøth et al requires extra coding and access to data on all hospital contacts due to the process of defining the department type. A compelling solution could be that department classifications are derived and published from the data providers, ie Statistics Denmark or the Danish Health Data Authority, making the information usable for projects with access to limited populations. Further, both algorithms suffer from the lack of timestamps in DNPR2, and the results on DNPR2 will depend on how the missing timestamps are defined. This may be the most compelling argument for using the traditional methods for defining patient type in DNPR2.
For implementation of approach 4, Gregersen et al published the SAS code for the algorithm together with the article,5 however the code required some modification as we did not have access to all variables used in the algorithm and will need some small updates before it becomes valid after April 2025 (Supplementary material S1).
The main weakness of this study was that we did not have access to all variables used in all articles presenting the algorithms; to accommodate this limitation we adapted the algorithms to the available data (detailed explanation in Supplementary material S1). The main strength was the large data availability throughout different calendar years, allowing to apply the algorithm on the whole Danish population and see changes in patient type through time.
ConclusionComparing the methods for the classification of patient-hospital visits, the choice of the algorithm used to define hospital visits should be based on both technical considerations and the population of interest. The algorithm suggested by Skjøth et al and the modified version of the algorithm proposed by the Ministry of Health and Elderly differ greatly in the number of inpatient and emergency contacts per 1000 citizen. Using the same algorithm across DNPR2 and DNPR3 data structures and calendar years is the best solution for a consistent number of visits over time, but the choice of algorithm may greatly influence a research question. Thus, further research on the best algorithm for defining patient type in different diseases and patient groups and how it subsequently affects conclusions are needed. Given that the algorithm suggested by Skjøth et al was validated in a DNPR3 setting, we suggest this method for future register-based research studies using DNPR3.
AbbreviationsDNPR, Danish National Patient Registry; ICD, International Classification of Disease; RA, Rheumatic arthritis; DANBIO, Danish Rheumatology Quality Register.
AcknowledgmentWe would like to thank Lone Frøkjær Christensen for helping with registry information about DNPR, and Peter Enemark Lund for help with coding and debugging in SAS.
FundingKirsten S. Duch and Lene Wohlfahrt Dreyer received funding from the Independent Research Fund Denmark (grant ID: 10.46540/3101-00146B) and the Danish Rheumatism Association. The funding had no influence on the design or content of the study.
DisclosureKirsten S. Duch, Flemming Skjøth, Bergur Magnussen, and Rasmus Westermann report no conflicts of interest in this work. Lene Wohlfahrt Dreyer reports contracts with BMS and AbbVie outside the submitted work, support for attending meetings and/or travel from Janssen, UCB, and Boehringer Ingelheim, being chair of the scientific committee of the Danish Rheumatism Association, and a member of the steering committee for DANBIO, which receives public funding from the hospital owners and funding from pharmaceutical companies.
References1. Schmidt M, Schmidt SAJ, Sandegaard JL, Ehrenstein V, Pedersen L, Sørensen HT. The Danish National Patient Registry: a review of content, data quality, and research potential. Clin Epidemiol. 2015;7:449. doi:10.2147/CLEP.S91125
2. Sundhedsdatastyrelsen. Vejledning til LPR3_F. 2023. Available from: https://sundhedsdatastyrelsen.dk/-/media/sds/filer/Forskerservice/VejledningtilLPR3_F. Accessed June6, 2024.
3. Sundhedsdatastyrelsen. Afrapportering Fra Teknikergruppe Om Opgørelse Af Indlæggelsesforløb Baseret På Landspatientregisteret.; 2017.
4. Skjøth F, Nielsen H, Bodilsen J. Validity of algorithm for classification of in-and outpatient hospital contacts in the Danish National Patient Registry. Clin Epidemiol. 2022;Volume 14:1561–1570. doi:10.2147/CLEP.S380023
5. Gregersen R, Fox Maule C, Bjørn Jensen C, et al. Algorithm for forming hospital care episodes by combining attendance contacts in the Danish National Patient Register: a methodological consensus-driven study. Scand J Public Health. 2024;(June):14034948241284712. doi:10.1177/14034948241284711
6. Folketingets Sundheds- og Ældreudvalg. Orientering om ny indlæggelsesdefinition. folketinget. 2018. Available from: https://www.ft.dk/samling/20191/almdel/suu/spm/736/svar/1663045/2196925.pdf. Accessed May17, 2024.
7. Sundhedsdatastyrelsen. Dokumentation af registre. 2016. Available from: https://www.esundhed.dk/Dokumentation/DocumentationExtended?id=5. Accessed September2, 2024.
8. Danmarks Statistik. Statistikbanken. 2024. Available from: http://www.dst.dk/.www.statistikbanken.dk/BEFOLK2. Accessed June6, 2024.
9. Ibfelt EH, Sørensen J, V JD, et al. Validity and completeness of rheumatoid arthritis diagnoses in the nationwide DANBIO clinical register and the Danish National Patient Registry. Clin Epidemiol. 2017;Volume 9:627–632. doi:10.2147/CLEP.S141438
10. Sundheds- og Ældreudvalget. SUU Alm.del - endeligt svar på spørgsmål 658. 2020. Available from: Sundheds-ogÆldreudvalget2019-20. Accessed June6, 2024.
11. Sundhedsdatastyrelsen. Landspatientregisteret. 2021. Available from: https://www.dst.dk/Site/Dst/SingleFiles/GetArchiveFile.aspx?fi=7143686406&fo=0&ext=forskning. Accessed September4, 2024.
12. Statens Serums Institut. Influenzasæsonen - opgørelse over sygdomsforekomst 2017/18. 2018. Available from: https://www.ssi.dk/sygdomme-beredskab-og-forskning/sygdomsovervaagning/i/influenzasaesonen-opgoerelse-over-sygdomsforekomst-2017-18. Accessed June6, 2024.
Comments (0)