1 Introduction

Training doctors to find the best diagnostic and treatment for each clinical case is one of the biggest challenges in medical education. To become a good clinician, medical students need to apply the best scientific evidence in caring for patients. Medical educators need to design pedagogical strategies that offer medical students the opportunity to repeat the clinical tasks to develop expertise while guaranteeing the safety of patients. Among the main competencies, medical students need to foster is clinical reasoning, the mental strategies to reach a diagnosis and plan a therapeutic intervention. Developing reasoning skills is particularly important for emergency physicians who work under time pressure in situations potentially fatal. In summary, emergency training requires the student to master the spectrum of knowledge of a generalist physician in the shortest possible time.

In a previous successful experience, which is the starting point of this research [6], an e-learning environment directed to teach emergency medicine through the solution of clinical cases has shown to improve the engagement of students and their performance.

However, this solution lacks support in three main aspects: narrative, evidence, and evaluation/feedback. The environment to build the narrative of clinical cases, presented to the students, was adapted in an e-learning platform (Moodle), being limited to the possibilities offered by its forum and quiz tools. Clinical cases are manually crafted by tutors (physicians) based on evidence of real-world cases, their own experience, and facts reported in the literature. The system pipeline is still highly dependent on the action of professors to evaluate and give feedback to each answer or decision of the students, hampering the scalability of the system.

Building the narrative of a game for clinical cases training is a challenge encompassing two dimensions. On the one hand, there is a real dimension, as the game aims at training real doctors, each scenario – with diseases, symptoms, medications, etc. – must be supported by real-world phenomena. On the other hand, there is a fantasy dimension, in which the author is not constrained by preexisting evidence, having the freedom of introducing elements of an engaging narrative that do not compete with the real dimension.

In this paper, we present our approach to align these two dimensions through a scripting language that combines the freedom of composing narratives, blending them with data backed by scientific evidence. It is the kernel of an environment for authoring and playing educational health games.

The remainder of the paper is organized as follows: Sect. 2 introduces the main challenges and background of this research; Sect. 3 summarizes the health education scenario based on narratives and simulations of clinical cases; Sect. 4 explains how narrative scripting languages are used in the game industry in order to help authoring of stories; Sect. 5 proposes a pipeline using analytical design principles and narrative languages to produce realistic cases aided with data; Sect. 6 details implementation of a system that materializes our proposed design approach; and Sect. 7 presents the discussion of main results and future work.

2 Motivation

Real-world cases are the best source to build possible and reliable scenarios, given the complexity of a human body and its interaction with the environment. However, clinical experience and data from the literature are fundamental to enrich the case with alternative paths to the solution and assess student decision-solving capabilities.

The amount of tutor work to build the cases is paramount and relying on data-driven solutions would boost the capacity of the system to generate clinical cases while saving tutoring time. To address the real dimension we have been building an analytical design backed system, in which the authoring process is the result of an interaction between a human author and an information system. Following a data-driven approach, the system extracts, combines and analyzes health data coming from different data sources. It helps the enrichment of the case, suggesting and advising; the verification of consistency on information; and the production of machine-interpretable outputs to automatize students tracking, evaluation and feedback.

Tufte in 2006 coined the six principles of analytical design [15]. According to Tufte, allowing the viewer to establish: comparisons, causality or mechanism, multivariate analysis, integration of evidence, documentation and rich content, in graphical data is the main quality of good evidence display and reliable scientific data exposition [15]. A clinical case writer needs to gather evidence from different medical data sources, understand the mechanisms governing the diseases in the case, compare a case with many others used in class, and provide feedback based on a narrative content known by the student. Therefore, although these analytical design principles were originally asserted for graphics, they can be transported to measure the quality of a well written clinical case and guide the development of data-driven e-learning system that allows effective creation of such cases.

There is a tight coupling between the narrative and the computational resources necessary to render it in rich interactive scenarios. This demands a close interaction among health professionals (authors of cases), IT professionals, and designers.

One of the challenges in such interaction is the lack of common ground among health professionals, IT professionals, and designers. In several authoring systems, health professionals can produce a great narrative on their cases but are not able to transform them on interactive learning experiences. Such challenge of integrating the creator (author), the developer, and the designer is also tackled by the computer game industry [8]. An effort to soften the gap between the content creator and the game development process is the introduction of a narrative scripting language, for example, Ink [14] or March22 [8] languages. Such languages allow the writer to build a narrative closer to a natural language but with lightweight markups that can be compiled in an interactive game ready for the user.

In this work, we have blended elements of Analytical Design with a narrative scripting language, which is the kernel of our authoring and execution system. A third central component is a template-based authoring process. It addresses a natural problem of decision-based games that produces an alternative scenario for each action of the player. The consequence is an unmanageable explosion of alternative scenarios, which are even harder to produce when the alternatives must be backed by evidence data. To circumvent such problem we have developed an authoring method, in which the creative process is conducted by templates. Templates guide the author, avoiding the explosion of alternatives, and also embed the experience of several years in health education from physicians.

Following this approach, we were able to produce case scripts and to turn them into playable cases, following proved educational templates. The developed application can be improved using more data sources, better human-computer interaction and better artificial intelligence. Nevertheless, the design pipeline has shown to be consistent with the goals of physicians health education.

3 Narrative and Simulation in Health Education

We consider three main components in an approach to support producing clinical scenarios to train doctors: (i) a proper analogy to real-world health phenomena; (ii) an engaging narrative; (iii) rich interactive content to present the case. Components (i) and (ii) have been explored in health education and they are detailed in this section; components (ii) and (iii) have been explored in games development, presented in the next section.

Flexnerian education [3] refers to the actual health care education approach, in which students start by receiving science-based medical knowledge, usually through traditional lectures and/or problem-based learning approaches. Frenk et al. [5] consider the introduction of Problem-based Learning (PBL) and disciplinarily integrated curricula the second generation of reforms in health care education. It moves the focus to the problem and the patient, early promoting the articulation among several disciplines, usually through focusing on real-life scenarios. In fact, throughout the diversity of PBL methods, the usual approach consists of a small group of students working in a real-life based case, evaluating the problem and making decisions [10]. Case-based learning techniques – i.e., based on the resolution of clinical cases – have been a widespread PBL approach to learn clinical reasoning [7]. The narrative of each case is the key to blend technical health aspects and engaging properties.

PBL introduced the concept of Standardized Patients – i.e., individuals trained to act as real patients, simulating their behaviors and complaints [5]. Simulated patients offer the possibility of bringing complexity to students in a stepwise fashion, adapting the task to students developmental level, optimizing the cognitive load.

The information technology has been contributing to the advance of analogies and simulations through the introduction of computer-based clinical scenarios – the Virtual Patients (VP) [2] – as well as high-fidelity Human Patient Simulators (HPS) [1], based on automated mannequins. A VP runs a clinical scenario behind a computer screen, with variable interaction levels – from textual narratives accompanied by static images to 2D or 3D interactive simulations. An HPS simulates physical characteristics that resemble real persons – one can auscultate the mannequin; inject drugs; try cardiopulmonary resuscitation, etc.

The route of a case in a VP or a simulation in an HPS is still authored manually by a specialist, which is not ready yet due to the complexity of creating algorithms that properly simulate the dynamics of a human body and possible variations. This route usually takes the form of a graph, with nodes representing case states and edges representing transitions triggered according to actions. State nodes will contain free-text descriptions, for those VPs based on narratives, and will contain structured data that drive HPSs or VPs with interactive simulations.

As shown in Fig. 1, these instructional modalities can be seen as complementary in a continuum of competency [2]. Narratives and the analogy to real-world health phenomena will play important roles in each modality.

Fig. 1.
figure 1

Instructional modalities with desired outcomes [2].

Narratives usually come from specialists that write PBL cases, VP scenarios or Standardized Patient scripts; the analogy to real-world phenomena can be seen as part of a bigger scenario, comprising data collected from the real-world to drive predictions, inferences, and discoveries. Even though they are treated as distinct and sometimes alternative disciplines [4], in the Analytical Design perspective, proposed here, both are treated as interdependent.

Our focus in this paper is in the VP tools context. Existing tools are still highly limited in the support to author engaging narratives when compared to game authoring approaches and lack support to add rich interactive content. In the next section, it will be presented with game authoring approaches, which we exploited to enrich our solution.

4 Narrative Scripting Languages

Many aspects of clinical cases authoring, described in the previous session, are shared with the development of interactive narratives for games. One of the challenges is the entry barrier of the case writer and the software-based platform that executes it. Also, effective approaches in problem-based learning rely on a narrative format [6], therefore common tools can be used. Complex narratives have the drawback of not being suitable for tools like cognitive maps and stories on sticky labels because they branch exponentially for each decision point a user can make.

In Fig. 2-A (left), we can see a standard pipeline performed by an author to insert their clinical cases in a web-based e-Learning system, adapted from Lynch et al. [8]. First, the writer gathers information about real clinical cases, the diseases in such cases and relevant references. After the complete case is written, the script is sent to a developer that turns it into an interactive code. Web-designers or game artists create the environment and animations necessary for an interesting learning experience. If the developer does not fulfill the requirements of the author or produce a code with errors the interaction with the author/physician continues. Looking at this pipeline, we can see that the author is decoupled of the game production environment, possibly raising the following problems: many errors can arise due to the difference in the background of the physician and the developer; the feedback in the authoring cycle is too slow, i.e., writers cannot preview the result of their narrative decisions, therefore, they are not able to try different ways to present the case during its conception.

Fig. 2.
figure 2

Pipelines for clinical case writing in e-Learning systems.

Some initiatives, like Ink [14], March22 [8] and INDIeAuthor [12] rely on textual languages that bridge the narratives with the control of the flow according to decisions. More specifically, in [14] and [8] is created a narrative scripting language. It is a markup language that allows the writer to script a narrative in a way closer to a natural language but with a structure machine-interpretable, so it can be compiled into a software. In the game context, it can be compiled to an interactive game ready for the player. Usually, these languages are lightweight markup languages enriched with common narrative directives like branching, variables, choices and conditional content. In Fig. 2-B (right), we see how a narrative language changes the pipeline of case writing. The main change is more integration of the author through the process of editing and compiling of the narrative language and development team more free to focus on graphical design issues.

5 Analytical Design of Clinical Cases

Even though the adoption of narrative scripting languages is a design improvement to create clinical cases, the existing approaches, coming from the game development context, are geared towards fantasy stories. Therefore, they lack proper support to represent structured technical information, fundamental to create realistic clinical cases.

5.1 Information Layers

To address this limitation we have designed a system backed by a languageFootnote 1 that blends the three components mentioned in Sect. 3. They are organized in information layers as presented in Fig. 3.

Fig. 3.
figure 3

Information layers of our system.

Narrative Layer - We designed a language derived from Markdown, which adds elements that represent an extra semantics to build scenarios and the control flow of the game. This language has some structures based on Ink [14]. We further present some elements of the language in Table 1.

Table 1. Main narrative language constructs for case writing.

Data-Driven Layer - Elements from the Narrative Layer are annotated and connected to structured data and knowledge structures defined in the Data-driven Layer, as dictionaries and ontologies. These structures are connected with external knowledge bases, e.g., MeSH - Medical Subject Headings. This layer is designed to be consumed by machines to support the automation of tasks as evaluation and feedback. It is also part of a future project to build a full fledged intelligent tutor.

Presentation Layer - The document in the Narrative Layer is compiled to the final product, which is a game. Each node is related to a theme that guides its conversion to the final presentation. Interactive elements are mapped to web components, based in the Digital Content Component Model (DCC) developed by us [13].

We have been exploring this connection between the Narrative and Data-driven Layers to provide automatic support to produce and enrich cases. The analyses of existing cases and their bridge with structured data supports the discovery of patterns of narrating, for example, the symptoms of a disease and the respective treatment. These patterns can be applied in finding extra knowledge to enrich the case in narrative-based data sources, as scientific papers repositories.

5.2 Analytical Design Pipeline

To generalize the concepts presented in the previous section, we propose an analytical design pipeline (Fig. 4), which fulfills most of the requirements of an application to write clinical cases. Besides a method based on the three layers model, another key feature in this pipeline is the introduction of a case template. A template is a previously defined pattern in the system that guides the creation of new scenes or groups of scenes. It defines a fixed backbone structure with spots to be filled or elements to be configured by the author. In the health context, the doctors of our team developed templates based on their long term experience in medical education, as described by  [6].

Our pipeline has as design guidance the principles of analytical design as specified in [15]. We enumerate below the principles and how they are ensured by our pipeline:

  1. 1.

    Comparisons - The author can start a case choosing from many different templates or cases to derive. Results achieved from previous adoptions of cases/templates will enable to choose which case is better for her educational intention.

  2. 2.

    Causality, Mechanism, Explanations - The Data-driven Layer enables the production of cases derived from Evidence-based Medicine, which unveils the mechanisms of relating symptoms to diagnostics. Such mechanisms could be useful to increment the case realism even in a fantasy story, once able to mix narrative and data coming from scientific literature, The system also tracks all actions of the users during a case. From its analysis, the author can understand the mechanism for presenting a concept.

  3. 3.

    Multivariate Analysis - The proposed design generates three types of data: medical, player and educational. Each type has multiple dimensions that must be shown to the author.

  4. 4.

    Integration of Evidence - Our three information layers model enables to integrate into a narrative different type of data and makes accessible to the authoring process the best scientific foundation to the case.

  5. 5.

    Documentation - Each case is indexed by its authors, keywords, and data coming from the data-driven layer, as each medical evidence the case is based (e.g. papers, study cases).

  6. 6.

    Content - A template ensures that the case has a health education theory as background and it has educational efficacy proven. Moreover, annotations connected with external bases enable to track their provenance.

Fig. 4.
figure 4

Analytical Design pipeline for clinical case writing in e-Learning systems.

In the next section, we describe how we implemented the Analytical Design pipeline and our continuous effort to develop a system that allows easy creation of clinical cases for medical educational games.

6 Implementation

The analytical pipeline was materialized under a system called HarenaFootnote 2\(^,\)Footnote 3. The system is a web-based application following microservice architecture where every microservice is a REST API. The system allows authoring cases and the generation of games built from the cases.

The system has two main environments: the author and the player. In the author mode, scenes can be edited in the visual or textual mode. In Fig. 5 we see the visual authoring mode of the system. In this mode, the user can see: the structure of the case in a tree form (left); a preview of the scene node as it will be presented to the player (middle); and attributes of the currently selected scene or element inside it (right). The textual authoring mode switch the preview for a text box where the same scene can be edited using the narrative scripting language. Every change in the narrative script is automatically updated in the visual mode, therefore, we provide two ways of editing one more visual suitable to beginners and a textual mode for advanced users.

Fig. 5.
figure 5

System visual authoring view of a case. In the left the narrative scenes tree, in the middle the current scene to edit and on right attributes of the scene.

The player view has the same look of the visual authoring mode preview because both are compilations of a narrative script. The player mode follows the route defined by the author and every interaction of the player is converted to messages stored in a JSON document, further recorded in a database. Such approach allows further data analysis of the player behavior.

The authoring environment and respective games produced on it were tested in workshops developed at the Interactive Science Museum of Unicamp. We have conducted 3 workshops where we tested two modalities of the games. One of the games was manually crafted in conjunction with doctors and the second one was automatically generated, as further described.

6.1 Automatic Generation of Cases

The first experiment we performed with the Analytical Design approach was a test for the narrative scripting language, case templates, and the communication between the three information layers. The output was a children’s game that confronted them with simple clinical reasoning. Thus, we developed the game ZombieHealth, which is a decision game where the player is a doctor who needs to treat zombies examining their symptoms to identify a disease to be treated.

The generated game was derived from a causal model and its goal was to verify if the children will learn the correlation between causes (diseases) and effects (symptoms) modeled in the game.

Each zombie in the game has a generated name and disease. Each disease is based on a causal model, as defined in [11], so the disease is the cause of a set of symptoms (effects). The model is as simple as possible but each disease entails a different probabilistic distribution of symptoms from its model. Three diseases and six symptoms were modeled for the game using the probabilistic programming framework PyroFootnote 4. In the game, a zombie has an equal probability of having one of the three diseases and each disease has its symptoms distribution. A set of case attributes were generated from a set of samples following the probabilistic distribution. Thus, models and case attributes form the Data-driven Layer for this experiment.

Provided the case attributes set that form the Data-driven layer in this game, we can proceed to the Narrative Layer. Therefore, we wrote a template in the narrative scripting language and defined multimedia assets to be compiled for the complete game on the Presentation Layer. The script of every case has the same pattern of symptom inquiry, so features of the case can be substituted in the narrative script placeholders. In Fig. 6 we can see a scene of an automatically generated case.

Fig. 6.
figure 6

Player view of an automatic generated case for ZombieHealth game.

Despite the simple interaction, the narrative setup and the uncertainty aspect of each case were enough to engage the children on playing and fostering clinical reasoning of cause and effect.

6.2 Authoring of Complex Cases

Besides automatically generated cases, we tested the system in much more complex scenarios. Health professionals were able to translate the interaction of [6] to the new system. Figure 4 shows a scene of one of these cases written using Harena. An important new feature of this transition is the possibility of organizing the inner structure of cases as cycles of evidence gathering and a case as a composition of these cycles. Such approach can guide the creation of complex cases in progressive levels of detail. This structure follows the best practices of medical education. New elements as gamified reward, leaderboard or interactive media can be added given tested benefits in medical education. More complex cases are being written to be organized in a course structure to integrate class curriculum at the University of Campinas.

There is an ongoing effort in defining how to assess students performance using Harena. There is an increasing interest in psychometrics in health education and, in the context of this work, it needs to be integrated with game-based assessment. Therefore, future work includes student assessment using complex cases. Harena currently has the infrastructure for evidence-centered assessment, capturing and storing data concerning students evolution suitable for assessment – known in the educational assessments as work products [9]. It can also store in data stream log files, case-specific data using variables and contextual data like timestamp, identifier, actions, and game state. Defined the assessment methodology, these logs can be used for rigorous assessment and psychometrics.

7 Conclusion

The development of a system, following the Analytical Design pipeline, allowed us to test many of the pipelines characteristics and produced a new potential for the development of serious games. The use of a narrative scripting language bridges the role of the case author and game development, as shown by the creation of complex cases by specialists. It also bridges the cases with a data-driven layer that enables their automatic interpretation by machines, which in turn use this knowledge to evaluate and give feedback to the user. The application of transformations in the narrative script, based on themes combined with software components, enabled the automatic production of a final web product and a preview suitable for visual editing. The complex cases created using our pipeline indicate that templates help manage the narrative complexity and physicians can focus more on the learning goals than the narrative. Users interaction are captured and stored by our system, as defined in the Analytical Design pipeline. Future work will explore techniques of user assessment, template enhancement, automated feedback and gamification testing in the system. The Analytical Design pipeline and its principles can enable computer scientists and physicians to jointly conduct research under the same system and context in medical education, serious games, data-intensive applications, and artificial intelligence.