Context
Smartabase is commonly used for injury and illness reporting workflows. These workflows may range from simple soreness and wellness measures entered by an athlete in their daily monitoring form to complete electronic medical record (EMR) systems involving multi-disciplinary teams, alerts and surveillance dashboards.
One of the building blocks of an EMR workflow is a body diagram field which allows practitioners to easily select relevant OSICS codes using both search boxes and selectable diagrams. The result of this field is a combination of the OSICS injury or medical code, a description of the diagnosis and information about the side, aspect and area affected. Whilst this is valuable information to collect, the real strength comes from the reporting capabilities.
Viewing a report of all of the injury or illness diagnoses in a group may provide an indication of the volume of incidents. However, a more detailed breakdown may be more actionable by facilitating conversations beyond the medical team to the coaches, sport scientists and other service providers. For example, a report showing that the group sustained more ankle injuries than any other body part might be useful in shaping the pre-conditioning exercises or overall training program for the group.
In order to create dashboards and report on the information contained within body diagram fields, it can be easiest to create automatic splits of the body diagram field results within event forms. You can split the diagnosis into smaller parts which allows for more detailed reporting and analysis of the medical data.
Goals
This tutorial will take you through the process of creating Option calculations and Text calculations to split out the diagnosis, side, aspect, body area and OSICS code from an OSICS diagram with medical field. We will then create a visualization of this information in a dashboard using a Categorical chart widget in the Dashboard builder.
Outcomes
- Create automatic splits of body diagram field results using Option calculations and Text calculations in an event form.
- Use Categorical chart widgets in the Dashboard builder to visualize injury data.
Outcome 1: Create automatic splits of body diagram field results
- In the builder interface, create an event form named Injury Record.
- Create an OSICS diagram with medical field named Body Diagram.
- Adjust the advanced properties to enable searching and set a maximum of one (1) item.
- Follow the steps below to calculate injury diagnosis, side, aspect, body area or medical code.
The same calculations can be used for OSICS injury diagram or OSICS injury diagram with medical fields.
Calculate injury diagnosis
- Add a Text calculation named Injury Diagnosis.
- Set the field's advanced properties.
- Use the following calculation:
split(split(Body Diagram, "|", 0),"|",2)
Calculate injury side
- Create an Option calculation named Injury Side.
- In the Options section of the sidebar, list Left and Right.
- Set the field's advanced properties.
- Use the following calculation:
if(or(contains(Body Diagram, "Medical Illness"), contains(Body Diagram, "Lumbar Spine")),
" ",
splitfirst(Body Diagram, " "))
Calculate injury aspect
- Add an Option calculation called Injury aspect.
- In the Options section of the sidebar, list Anterior and Posterior.
- Set the field's advanced properties.
- Use the following calculation:
if(contains(Body Diagram, "Medical Illness"), " ", if(contains(Body Diagram, "Anterior"), "Anterior", if(contains(Body Diagram, "Posterior"), "Posterior", if(or(contains(Body Diagram, "Knee"), contains(Body Diagram, "Hip"), contains(Body Diagram, "Trunk")),
"Anterior", if(or(contains(Body Diagram, "Pelvis"), contains(Body Diagram, "Spine"), contains(Body Diagram, "Neck")),
"Posterior",
" ")))))
Calculate injury body area
- Add an Option calculation called Injury Body Area.
- Copy the body area options from the reference list and add them as options in the sidebar.
- Set the field's advanced properties.
- Use the following calculation:
replaceall(split(split(Body Diagram, "|", 0),"|",0), " ",
"Left",
"Right",
"Anterior",
"Posterior")
Calculate injury medical code
- Add an Option calculation called Injury Medical Code.
- Copy the OSICS injury field codes and OSICS medical codes from the reference list and add them as options in the sidebar.
- Use the following calculation:
split(split(Body Diagram, "|", 0),"|",1)
Outcome 2: Create a categorical chart to display injured body area prevalence
- In the Dashboard builder, create a new dashboard or open an existing dashboard.
- Set the Injury Record event form as a data source in the dashboard.
- Create a new categorical chart widget using the Add widget button.
-
- In the Categories properties:
-
-
- Select the string data type as we will be using the body area options for the categories.
- Select the Injury Record data source.
- Select the Injured Body Area field for the categories.
- Apply any data filters if necessary (e.g. date picker or select box widgets). Note that these filters will impact which categories are displayed.
- Do not show null categories.
- In the Series properties:
- Rename the series to Total Injuries.
- Select the Injury Record data source.
- Select the About field to aggregate. We will be using this field to count the number of records within the category. You could choose a different field to use here, as long as the field has a value in every record.
- Set the category field to Injured Body Area to match the field in the Categories section.
- Apply any data filters if necessary. Note that these filters will impact the data that is displayed within each category.
- Select the Count aggregation.
- Select the Bar chart type.
- In the Advanced settings, set the decimal places to 0 and enable data labels.
- In the Categories Sort & Limit section:
- Sort the categories by data in descending order.
- Choose the Total Injuries series to sort the data by.
- In the Y-axis section:
- Label the axis Number of injuries.
- Set the decimal places to 0. Since the chart displays counts of the data, this should be reflected as a whole number.
- Set the top padding to 2. This allows the data label to be seen.
- In the Advanced properties section, increase the chart height to 300 px and rotate the axes.
-
Test your workflow
- Ensure that your role has permission to view the event form in the main interface.
- Enter some test data into the Injury Record event form.
- Check that the body diagram field works as expected and all of the injury calculation results are correct.
- Load the dashboard and check that the data is displayed correctly in the chart. If there are any Select box or Date picker widgets in the dashboard, check that the values in the chart change when you adjust the filtering widgets.