• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Clinical Encounters

  • Home
  • About
  • Blog
  • Contact
Home › Development › Handling Images

Handling Images

Jul 13, 2018 | Ian McKinnon

Clinical Encounters is an immersive patient encounter experience whereby you are relying on an EHR framework to diagnose and treat a virtual patient. In order to achieve this, some integration of visuals alongside the text is necessary to create an informative patient case. Here, one of our programmers details how we’ve utilized images within Clinical Encounters.


Why Do We Need Images?

What users see to upload images

Images are something that can add value to almost any case. They offer users to upload custom content that could explain much more than words ever could. Think of MRI scans, x-rays, educational diagrams, example photos, healthy vs unhealthy comparisons, and many more examples. As they say, a picture is worth a thousand words. Not only can they be educational, but they act to spice up the case as well as keep it interesting and lively. So, with image integration, we hope to expand the flexibility of what case creators can show others while improving the case reading experience.

We give users the option to add images in several locations on numerous different tabs. Wherever we allow images to be added, we present users with the shown “Add Image” button. From there, they can select and add any image they have locally saved into their case. Clicking on previews of uploaded images also brings up a bigger version of the image.

Concerns With Handling These Images

Our main concerns were how to handle the image data storage, referencing images correctly, image file size, and which image formats we would allow.

Early on, we decided that the images would be stored separately from the XML that stores the rest of the case. Yet, since we use XML everywhere else, we wanted to keep the consistency and have chosen to store all images in their own XML file. This was chosen for a few reasons. It helped during development when we needed to parse through cases by hand to see where issues were being caused. This would have been a pain, to say the least, if we had to parse through the additional overhead from images as well. It also lets us handle the images separately if we ever want to since a case’s images are usually a good deal larger than the other saved data.

There are some downsides to keeping the images separate, such as having to manage two files instead of only one, but overall the pros outweigh cons.

The Biggest Struggle

The biggest difficulty with images came from keeping a reference to each image. The initial system gave each image a reference name based on where it could be found in the hierarchy. Each section, each tab, and each entry or sub-entry would have a unique name, so we used this information to construct a reference to the exact spot the image could be found. This worked well at first, but the biggest enemy to a system like this was the ability to rearrange entries.

Example hierarchy structure leading to an image

Let’s look at an example. I have two images, one attached to the first entry on a tab and the second attached to the second. Now, each entry has a name which references its position and also the actual position. In the beginning, entry 0 would be in position 0 and entry 1 would be in position 1. Switch them and entry 0 is at position 1 and vice versa. When we save this tab, the images have to update their references to point to their new position or else they wouldn’t move with the rest of their entry.

Now, what if we rearrange the entries and then try to overwrite an image before saving the tab? Then we have to use the name of its parent entry instead of its position to figure out what to overwrite. Combine this with images within pinned quizzes, where images have an even more complex reference name – not to mention the additional complexities with setting up the reference – and you’ve got yourself a real mess to handle.

A New Referencing System

At this point we realized that the current system wasn’t cutting it, so we redid it. The new approach was to create a random, but unique reference name for each image and then store that alongside the rest of the case data. This way, when loading data into each tab, the software could see the reference ID of the image, look it up in the accompanying image dictionary, and load that image. To generate random names we used the GUID class, or more specifically, a string representation of a new GUID instance.

So now, instead of having the following reference to deal with and constantly update (PATIENT INTRO SECTION > PERSONAL INFO TAB > ENTRY: 0), it’s now (C6BF4B8884) and is kept alongside the rest of the data making it easy to find and load.

The Aftermath

Overall, it was definitely worth switching over to this method as there have been hardly any problems since. Most of the issues with the other system never even came up while testing the new one. Image compression and data format are still being worked on today, but those issues will be tackled soon!

You can read more about the Clinical Encounters platform at its website.

Category: Development Tagged: dev-blog game-based learning

Health Impact Studio logo

About Health Impact Studio

We are a dedicated team of developers and researchers with the mission to improve the health of individuals through novel technology including games, virtual reality, and role-playing simulations. We welcome input from the full range of stakeholders to create a customer experience with the broadest applicability to improving health outcomes.

Clinical Tools – Spring 2021 Digital Health Awards® Winner

Jun 8, 2021

Clinical Tools Wins $200K SBIR Award to Decrease Vaping Behavior in Adolescents and Young Adults

Sep 30, 2019

Mindfulness and Patient Communication

Nov 19, 2018

Previous Post: « Reworking Dialogue
Next Post: How We Display Cases »

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Ian McKinnon

Ian is a Unity Programmer working with C# primarily. Ian is a runner, dog lover, gamer, and is a pretty good juggler (The Circus is always his backup plan in life)

More Posts

Primary Sidebar

Keep Reading

  • Clinical Tools – Spring 2021 Digital Hea…
    Jun 8, 2021
  • Clinical Tools Wins $200K SBIR Award to …
    Sep 30, 2019
  • Mindfulness and Patient Communication
    Nov 19, 2018
  • Contact Us
  • Copyright & Reproduction Guidelines
  • Privacy Policy
  • Terms of Service
  • Technology Requirements
  • 508 Compliance

Footer

developed & maintained by
ClinicalTools

The Clinical Encounters Training Group: SBIRT Training | BupPractice | PainTx Challenge | CE:Vaping | CE:Alcohol | CE:Obesity | Lift

Clinical Encounters | Reader

Clinical Encounters | Platform

Group Training

  • Facebook
  • LinkedIn
  • Twitter
clinicaltoolsinc@gmail.com

101 A Market St Chapel Hill, NC 27516
919-960-8118

Contact Us

© 2026 · Clinical Tools, Inc · Log In

Walkthrough of a Clinical Encounters | Decisions Interactive Patient Case

Welcome!

If you have an account, please log in! Or create an account now!

Create an Account!
Log In

Forgot Password?
Register New Account
Don’t have an account?
Register now!
Register
  • Hidden
  • By registering, you agree to the Terms of Service and Privacy Policy. If you are a part of a group, you understand your participation information can be provided to the group organizer.
  • This field is for validation purposes and should be left unchanged.
Sign up for our Newsletter!

Want to keep up to date on HealthImpact.Studio developments? Enter your information below and we’ll let you know when we have new products or open research studies, and what we’re working on for the future.

  • Hidden