{'fraction_non_alphanumeric': 0.02434247341913822, 'fraction_numerical': 0.005236229914461587, 'mean_word_length': 5.377517206219729, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Development of an algorithm to detect and reduce complexity of drug treatment and its technical realisation

Background The increasing complexity of current drug therapies jeopardizes patient adherence. While individual needs to simplify a medication regimen vary from patient to patient, a straightforward approach to integrate the patients’ perspective into decision making for complexity reduction is still lacking. We therefore aimed to develop an electronic, algorithm-based tool that analyses complexity of drug treatment and supports the assessment and consideration of patient preferences and needs regarding the reduction of complexity of drug treatment. Methods Complexity factors were selected based on literature and expert rating and specified for integration in the automated assessment. Subsequently, distinct key questions were phrased and allocated to each complexity factor to guide conversation with the patient and personalize the results of the automated assessment. Furthermore, each complexity factor was complemented with a potential optimisation measure to facilitate drug treatment (e.g. a patient leaflet). Complexity factors, key questions, and optimisation strategies were technically realized as tablet computer-based application, tested, and adapted iteratively until no further technical or content-related errors occurred. Results In total, 61 complexity factors referring to the dosage form, the dosage scheme, additional instructions, the patient, the product, and the process were considered relevant for inclusion in the tool; 38 of them allowed for automated detection. In total, 52 complexity factors were complemented with at least one key question for preference assessment and at least one optimisation measure. These measures included 29 recommendations for action for the health care provider (e.g. to suggest a dosage aid), 27 training videos, 44 patient leaflets, and 5 algorithms to select and suggest alternative drugs. Conclusions Both the set-up of an algorithm and its technical realisation as computer-based app was successful. The electronic tool covers a wide range of different factors that potentially increase the complexity of drug treatment. For the majority of factors, simple key questions could be phrased to include the patients’ perspective, and, even more important, for each complexity factor, specific measures to mitigate or reduce complexity could be defined.


(Continued from previous page)
Conclusions: Both the set-up of an algorithm and its technical realisation as computer-based app was successful. The electronic tool covers a wide range of different factors that potentially increase the complexity of drug treatment. For the majority of factors, simple key questions could be phrased to include the patients' perspective, and, even more important, for each complexity factor, specific measures to mitigate or reduce complexity could be defined.
Keywords: Clinical decision support systems, Shared decision making, Polypharmacy, Self-administration, Medication regimen complexity Background Complexity of drug treatment arises from different characteristics in the medication regimen or external circumstances that may encumber drug administration for a patient. These complexity factors are manifold [1] and can potentially lead to nonadherence [2] and unplanned hospitalisations [3,4]. They can be assigned to six categories depending on whether they are related to the dosage form (e.g. the use of transdermal patches [5]), the dosage scheme (e.g. an once weekly administration [6]), additional instructions concerning the use of a drug such as the coordination of the drug administration with a meal [7], the patient (e.g. swallowing difficulties [8]), the product (e.g. an intricate packaging [9]), or the medication process itself (e.g. frequently changing prescriptions [10]).
Besides consideration of single complexity factors such as the number of drugs in a medication regimen or the dosing frequency [11], the medication regimen complexity index (MRCI) is probably the most frequently used tool to assess complexity related to the medication regimen in a standardized way [12]. However, there is no tool currently available that covers all aspects potentially influencing complexity of drug treatment. Moreover, analysing and reducing the complexity of drug treatment remains time-consuming [13], even though the complexity in drug treatment could often be reduced significantly by simple measures [14]. In various health care settings, electronic tools have been developed to facilitate integration of decision aids in routine care [15] and also for reducing complexity in drug treatment it has been shown that individual complexity factors can be reduced by electronic decision aids [16]. Also the MRCI was transferred into an electronic decision aid [17] and tested in the home care setting [18]. Among patients in the intervention group, 8% of patients dropped below a MRCI score of 24.5 when the decision aid was used compared to 4.5% of patients when the decision aid was not used, suggesting that a tool that covers all areas of complexity would be even more successful.
However, there still remains the risk that patients do not adhere to the medication regimen after it has been changed, particularly if they have not been involved in the process of decision-making [19][20][21] and if complexity aspects relevant for the individual patient are not specifically addressed. Hence, a potential algorithm and its technical realisation should consider patient preferences to ensure that suggested changes and trainings are tailored to the patients' needs with maximum chance of acceptance.
The aim of this study was therefore to develop an algorithm as well as its technical realisation that comprehensively assesses and reduces complexity of drug treatment. To this end, complexity factors must be specified that could be considered in such an automated analysis, appropriate strategies to assess and integrate the patients' perspective must be developed and integrated, and, finally, feasible suggestions to mitigate complexity must be provided.

Methods
As a prerequisite to the tool development, four key functionalities were defined: Functionality I: Easy access to structured medication data. Functionality II: Comprehensive, automated analysis of the drug treatment's complexity based on distinct complexity factors.
Functionality III: Personalization of the automated analysis to the patient's perspective and actual problems.
Functionality IV: Suggestion of appropriate measures to reduce or mitigate the identified complexity factors.
The respective functionalities were developed as follows:

Access to structured medication data
In Germany, all patients with chronic medication intake are entitled to a nationally standardized medication schedule providing information on the active ingredient, the brand name, the dosage form, the strength, the dosing frequency, the unit, instructions for use, and the indication of each drug [22]. This paper-based document has a two-dimensional data matrix code which can be scanned to transfer the medication data and, thus, offers an easy access to structured prescription data (XML-data). After starting the tool, the user should be able to scan the data matrix code of medication schedules to upload the medication data for analysis.

Automated assessment of complexity factors
Based on all available information of a medication schedule, the tool should comprehensively assess complexity factors that actually represent a relevant problem for patients in routine care and, thus, should be considered in the automated analysis. To do so, we combined a literature-based with a qualitative approach. As described previously by our group, 91 complexity factors were identified [1] which had to be rated for their relevance by experts to decide upon their inclusion in the tool. We therefore formed an expert panel of 10 experts (clinical pharmacologists, general practitioners, and pharmacists involved in the development of the electronic tool and their colleagues) to rate factors previously characterised in the literature as having little relevance (1 point), medium relevance (2 points), and high relevance (3 points). Complexity factors rated with less than 25 points were subsequently discussed within the expert panel to decide whether or not they should be further considered in the development process of the tool. If during the expert discussion new complexity factors were identified, these factors could be included in the final list if all experts agreed. The adapted set of complexity factors was then rated in a second round by another six experts to verify the result. The final decision on the factors that should be considered in the automated assessment was made by the authors based on the results of the expert ratings and the influence of each complexity factor on complexity of drug treatment. For example, some complexity factors only indirectly influence complexity and therefore could not or only with difficulty be optimised within routine care (e.g. a lack of interest in drug treatment or a low income). For the final set of complexity factors, feasibility of automated detection was checked and respective rules and criteria for automated detection were specified whenever possible.

Personalization of the analysis to patient needs
The patients' perspective on the identified complexity factors and, thus, the relevance for the individual patient should be assessed interactively and stored in the tool. To do so, we allocated so called key questions to all factors that could be automatically detected by the tool. For example if a patient had to use an inhaler, a key question addressing problems with correct inhaling was phrased.
These key questions were developed following a previously described approach [23]. Briefly, it is a five-step process involving patients and health care professionals to develop and validate key questions. Thereby it can be ensured that the key questions are specific to a complexity factor, comprehensible for patients, suitable to indeed identify a patients difficulties and implementable in patient visits.
For factors that could not be detected automatically (e.g. cognitive impairment), distinct questions should be phrased to assess whether this factor was relevant for the patient. Consequently these distinct questions cannot be linked to the automated detection of complexity factors but allow to consider additional factors besides the automated analysis when reducing complexity of drug treatment with the tool. As an example, swallowing problems cannot be detected from a medication schedule, but were identified as a relevant complexity factor.

Suggestion of optimisation measures tailored to the patient's needs
Based on the patients' responses to key questions, optimisation measures should be proposed selectively for factors that are relevant for the patient. Hence, at least one potential strategy to reduce or mitigate the respective complexity factor was allocated to each factor and a key question or a distinct question for its detection was phrased. The strategies belonged to one of the following three categories: Recommendations for action of the health care provider, e.g. to recommend a dosage aid Training material, e.g. patient leaflets Algorithms to modify the medication regimen, e.g. by selecting an alternative drug with less frequent dosing

Technical implementation of the functionalities
The functionalities were then implemented in a windowsbased computer app using the programming language C Sharp (.NET 4.5) and the GUI toolkit Windows Forms. This app can access current medication data on all drugs available in Germany in a Microsoft SQL database, meaning that the XML-data obtained from the medication schedule can be compared with this database to identify matching entries. On the medication level this was done via the so-called "Pharmazentralnummer" (Pharmacy Product Number) which is an ID unique to each medicinal product in Germany. Consequently, additional information about a medication (e.g. the type of inhaler) can be retrieved, which is important for the targeted proposal of key questions and optimisation measures. Moreover, appropriate alternative drugs can be suggested by the algorithms as an optimisation measure in this way.
For some complexity factors, identification is based on key words in the free texts of the medication schedule. To this end, respective keywords were defined, allowing the XML-Data of the medication schedule to be screened for them.
To ensure the reliable and error-free performance, the tool was tested with exemplary medication schedules to find potential technical or content-related errors.
Therefore fictional medication schedules were created to ensure that automated detection of each complexity factor could be iteratively checked. Thereby, the user interface design was optimised for the intended use by ensuring a sufficient font size, a clear presentation, and the ease of use. Testing was independently and iteratively performed by two pharmacists.

Access to structured medication information
The tool was made available on tablet computers. Via a specific scanner, the data matrix code of the medication schedules could be scanned (Fig. 1).

Automated assessment of complexity factors
Out of the 91 factors increasing treatment complexity [1] 34 complexity factors were excluded due to a low relevance according to the expert panel. Four complexity factors were additionally included based on expert opinion, i.e. diverse storage conditions of the patient's individual drugs; administration of only one drug at one specific point in time, as a challenging dosage scheme; the same active ingredient in different preparations, which might potentially confuse the patient; and occasional, episodic treatment with a drug, e.g. an antibiotic.
Accordingly, the final list of complexity factors comprised a total of 61 factors (Table 1), which where almost evenly distributed amongst all six categories [1]: 13 factors were assigned to the category dosage form, 14 to the category dosage scheme, eight to the category additional instructions, ten to the category patient, five to the category product, and 11 to the category process.
Of 61 complexity factors, 38 (62%) could be identified automatically from the structured medication data of a   These capsules are to be opened before use.
Training material medication schedule, either by using structured information, such as the dosage scheme, or by searching index words in free-text fields. For instance, for the complexity factor "Meal-dependent administration", the detection was based on the keywords "meal", "food", "eat", "breakfast", "lunch", or "dinner".

Personalization of analysis to patients' needs
For every complexity factor that allowed for automated detection, at least one specific key question was developed (Table 1 [ 23];). For three dosage forms different devices are available that differ substantially in their way of use. Therefore, it was necessary to develop different key questions for the different devices. For 14 of the remaining 23 complexity factors, which could not be identified automatically, eight distinct questions were developed and implemented in the software that allowed for detection of the respective factors (e.g. swallowing difficulties). Hence, a total of 52 complexity factors could ultimately be considered in the analysis of treatment complexity by the electronic tool. The remaining nine complexity factors were too vague to be included as single complexity factors. However, we phrased an openended question inviting the patients to report any further difficulties with their drug treatment that have not been addressed by the previously identified complexity factors (i.e. "Is there anything else that is difficult for you in using your medication?").

Recommendation of optimisation measures tailored to the patients' needs
A total of 105 optimisation measures to reduce or mitigate treatment complexity were newly developed or adapted for inclusion in the tool (Table 1).
These included five algorithms suggesting alternative treatments (e.g. different dosage forms or drugs with different dose strengths), 44 patient leaflets (e.g. illustrating how to use a particular dosage form), which were developed based on already existing educational material [24][25][26], 27 training videos from the Deutsche Atemwegsliga e.V. (German Airway League, a registered, charitable association informs patients and doctors about respiratory and lung diseases and is not sponsored by the pharmaceutical industry) for inhaler devices [25] and, 29 recommendations for action referring to three topics: I) Recommendations of aids that facilitate medication administration and therefore could be proposed to the patient, for instance a spacer. II) Recommendations to explain a certain aspect of medication administration to the patient, for example the administration of dosage forms for oropharyngeal use. III) Recommendations to review a certain aspect of the medication regimen and to consider changing the medication regimen, for example to change the time of administration.

Technical implementation of the functionalities
The four functionalities were integrated and aligned in the tool (Fig. 2) in a way that the user is automatically guided through the application (Fig. 3). The tool was tested with approximately 50 exemplary medication schedules until no further technical or content-related errors occurred. Testing revealed that the tool reliably identifies complexity factors and, thus, proposes targeted optimisation measures to reduce complexity in drug treatment.

Discussion
The developed electronic tool comprised 52 complexity factors covering a wide range of factors contributing to treatment complexity. Thereby, almost two in three complexity factors could be automatically detected if structured medication data was entered as provided by a medication schedule. This applied in particular to the complexity factors related to the dosage form, the dosage scheme, or additional instructions, thereby confirming the results of the MRCI decision aid [12,17]. In contrast, most complexity factors relating to the patient, the product, or the medication process could not be detected by the electronic tool, either because this information could not be deduced from data currently stored on the medication schedules or structured information to develop respective algorithms is currently not Fig. 2 Technical realisation of functionalities II-IV available. Hence, to integrate also these factors, either alternative data sources such as electronic health records would be needed (e.g. to have access to the patients' diseases) and more thorough information particularly on product characteristics would be required, e.g. on the packaging of each drug or individual tablet shape and size. With such information, the medication schedule could for instance be searched for packages that are difficult to open such as child-resistant containers [9] and algorithm-based packages that are easier to open could be suggested.
Moreover, to develop more complex algorithms, e.g. for the automated detection of sound-alike drugs, either structured data on resembling drug names could be integrated or an algorithm to identify such drug pairs based on linguistic approaches, such as an analysis of orthographic and phonetic similarities of all drug names in a medication regimen, could be specified [27]. In total, about one third of the complexity factors considered relevant by the experts could not be automatically evaluated by our complexity tool. To compensate this shortcoming in the short term, we used distinct questions that complemented the automated assessment and address potential problems of the patient with the current treatment regimen. This approach proved to be sufficient for many relevant challenges in a patient's life such as swallowing difficulties, diverse storage conditions, or complicated packaging. However, factors relating to the patients' capabilities, their health literacy or their life style could not be assessed by a single question and hence were not considered in our assessment even though they were rated as important by the experts in the first place.
Nevertheless, the inclusion of health care professionals in the selection of the complexity factors considered in the tool and the development of the key questions ensures that the final electronic tool meets the needs of routine care. Thus, it should be made sure that the tool can be implemented easily in patient care and that relevant patient problems are addressed, which can be solved or mitigated directly by a health care professional. However, in order to reduce the influence of the professional background and the personal experiences in patient care of each individual on the final algorithm, several health care professionals with different professions or specialisations have been involved. In general, the included key questions clearly distinguish the analysis with our electronic tool from a simple complexity assessment and allow for patient-specific selection of optimisation measures (personalized intervention). The actual impact of this approach on routine care will be tested in a prospective pilot study and compared to other approaches to reduce treatment complexity that do not consider the patient preferences. A future widespread use of the tool in the health care system is conceivable because it could be used in different settings, such as pharmacies, ambulatory care and, also hospitals. Even individualization of the recommended optimisation measures to the setting appears possible; for use in a pharmacy, an algorithm to change the dosage form could for example be replaced by the recommendation for action to contact a doctor and suggest an alternative drug. Furthermore, specific patient populations might need adapted optimisation measures, such as blind or visually handicapped patients who will benefit less from standard information brochures but might need materials with verbal explanations. This work has several limitations. First, the analysis of complexity of drug treatment is based on structured medication data from the nationally standardized medication schedule and, thus, there is a risk that not all of the patient's drugs are considered, e.g. because the medication schedule is not up-to-date or not comprehensive. In particular, pro re nata (as needed) medication and non-prescription drugs might not be included in the medication schedule, for example because they are forgotten or not considered as relevant by health care professionals and patients. However, in order to comprehensively assess and reduce treatment complexity with the electronic tool, it would be essential to include all medications used by the patient in the medication schedule.
Second, the automated identification of complexity factors is partly based on the identification of index words in the free text fields of the medication schedule. Therefore, accurate identification depends on the correctness and comprehensiveness of the medication schedule and correct spelling of the index words. Moreover the definition of index words might not be comprehensive enough to cover all possible notations health care professionals might use. In particular, the use of non-standard abbreviations in the free text fields of the medication schedule could result in complexity factors not being detected in the automated analysis. Third, the tool was tested with a limited number of exemplary medication schedules. It is, therefore, possible that not all possible cases are considered when specifying criteria for the automated detection of individual factors; hence, some complexity factors may have escaped detection by the electronic tool. However, the tool will be tested in a pilot study with a large number of actual medication schedules issued by different prescribers allowing further optimisation of the electronic tool and adaptation to routine care.

Conclusions
We developed an algorithm-based electronic tool that covered a wide range of different factors that are known to increase complexity of drug treatment. The majority of factors could be identified in an automated analysis by the tool and key questions could be phrased to assess whether these complexity factors indeed pose a problem for a specific patient. Relevant complexity factors that were not suitable for an automated detection were considered by distinct questions and a general, open-ended question. The electronic tool combines an automated screening with a personalized intervention to comprehensively assess, mitigate, or antagonize treatment complexity. This electronic tool is designed to tailor medication regimens to the needs of the individual patient and is now ready for testing in a prospective pilot study.