Improving Virtual Patient Interaction Tools in Pharmacy Education
With the rapid advancement of AI technology, institutions are increasingly exploring its potential in pharmacy education to better equip students for real-world patient interactions. Existing patient simulation tools allow pharmacy students to practice interviewing skills but are sometimes limited to static case materials, generalized interaction styles, and scheduling constraints. As the field of pharmacy evolves, there is a growing demand for more dynamic, interactive, and personalized learning tools to help students refine critical communication and diagnostic skills.
To meet this need, the Faculty of Pharmaceutical Sciences at the University of British Columbia (UBC) collaborated with the UBC Cloud Innovation Centre (CIC) to enhance existing simulation methods and develop an innovative, AI-driven solution. This interactive platform leverages generative AI to simulate patient-pharmacist interactions, offering adaptive scenarios, real-time feedback, and tailored guidance to enhance students’ interviewing techniques.
Approach
The solution integrates generative AI and natural language processing (NLP) within a web-based platform to allow pharmacy students to practice virtual patient interviews. The platform employs a large language model (LLM) to simulate realistic text-based responses, creating an engaging and dynamic learning environment.
Students interact with AI-driven virtual patients, navigating clinical scenarios based on simulated patient case materials, such as medical notes, test results, and treatment plans. The system tailors its interactions to each student’s inputs, offering opportunities to practice effective skills in patient interviewing, empathy, communication, and decision-making. Educators can upload and manage patient case files, monitor student progress through detailed dashboards, and evaluate student interactions for further guidance.
By transforming static training methods into an engaging, AI-powered experience, this prototype enhances students’ confidence and preparedness for patient care while maintaining a controlled, risk-free learning environment.
Screenshots of UI
Student View
A pharmacy student wanting to practice their interviewing skills can log into and see the dashboard, showing the simulation groups the student is enrolled in.
Once logged in, the student can select the simulation group they wish to interact with, they can view different patients along with their review status, instructor evaluation status, and LLM evaluation status.
Once the student has entered the conversation with the virtual patient, the solution prompts the student to begin the conversation with a question. Students have access to patient info, which contains important medical information about the virtual patient. They can also record notes for each session and if they are stuck, they can reveal the answer.
Instructor View
Upon entering the app, an instructor using this tool can select a simulation group they wish to edit. Instructors can only edit simulation groups that they are a part of.
After selecting a simulation group, the instructor can view useful analytics and insights into each patient.
Instructors can edit patients as well as the patient files that will be ingested by the LLM and those that will be directly displayed to the student.
The instructor can also edit the prompt settings for the simulation group and manage the students.
Administrator View
Administrators can view instructors and add new instructors.
They can also view and edit simulation groups, as well as create new ones.
Architecture Diagram
To learn more about the architecture diagram, checkout the Architecture Deep Dive on GitHub.
Technical Details
The solution utilizes a serverless architecture designed to deliver seamless, scalable, and cost-efficient training experiences for pharmacy students. It leverages AWS services to simulate realistic patient-pharmacist interactions while minimizing the complexity of infrastructure management.
The application is hosted on AWS Amplify, which provides a scalable, serverless environment for user interaction. Amplify connects to the backend through Amazon API Gateway, facilitating secure communication with underlying services. Instructors upload patient case materials, such as medical notes or test results, which are stored in Amazon S3 buckets using pre-signed URLs to ensure secure file transfers.
Uploaded files are processed by AWS Lambda functions, which extract and prepare text for further analysis. The text is divided into smaller chunks and embedded into vectors using the Amazon Titan Text Embeddings V2 model. These vectors are stored in an Amazon Relational Database Service (Amazon RDS) for PostgreSQL, augmented with pg_vector for rapid data retrieval.
When students interact with virtual patients, their inputs are sent to the backend, triggering additional Lambda functions. These functions query the database using retrieval-augmented generation (RAG) architecture to retrieve relevant case details. Responses are generated using the Llama-3-70b-Instruct LLM hosted on Amazon Bedrock, providing accurate and contextually rich feedback.
Checkout the solution on GitHub.
Infographic
Video
Acknowledgements
Project Sponsor: UBC Faculty of Pharmaceutical Sciences.
Student team: Development by Aman Prakash and Nikhil Sinclaire. Project assistance by Miranda Newell.
Photo by Tima Miroshnichenko on Pexels.
About the University of British Columbia Cloud Innovation Centre (UBC CIC)
The UBC CIC is a public-private collaboration between UBC and Amazon Web Services (AWS). A CIC identifies digital transformation challenges, the problems or opportunities that matter to the community, and provides subject matter expertise and CIC leadership.
Using Amazon’s innovation methodology, dedicated UBC and AWS CIC staff work with students, staff and faculty, as well as community, government or not-for-profit organizations to define challenges, to engage with subject matter experts, to identify a solution, and to build a Proof of Concept (PoC). Through co-op and work-integrated learning, students also have an opportunity to learn new skills which they will later be able to apply in the workforce.