The Power of Generative AI in Revolutionizing Health Insurance Member Portals
In this post, we explore how generative artificial intelligence (AI) is transforming the way health insurance plan members access vital information. Navigating through the complex member portals of health insurance plans can often be a daunting task for beneficiaries. Multiple clicks, filters, and searches are required to find specific details about benefits, deductibles, claim history, and more. This cumbersome process can lead to dissatisfaction and confusion among members, resulting in increased calls to customer service and a subpar experience for both members and providers.
The inefficiency stems from traditional user interfaces’ inability to comprehend and respond to natural language queries effectively. Members are required to learn and adapt to the system’s structure and jargon, rather than the system being intuitive enough to understand their natural language questions and provide relevant information seamlessly. Generative AI technology, such as conversational AI assistants, has the potential to address this issue by enabling members to ask questions in their own words and receive accurate, personalized responses.
By integrating generative AI powered by Amazon Bedrock and purpose-built AWS data services like Amazon Relational Database Service (Amazon RDS) into member portals, healthcare payers and plans can empower their members to swiftly and effortlessly find the information they need without the hassle of navigating multiple pages or relying heavily on customer service representatives. Amazon Bedrock offers a selection of high-performing foundation models from leading AI companies like AI21 Labs, Anthropic, Cohere, Meta, Stability AI, and Amazon, along with a range of features to build generative AI applications with emphasis on security, privacy, and responsible AI.
Solution Overview
The solution discussed herein aims to enhance the member experience by transitioning from a traditional filter-based claim search to a prompt-based search. This enables members to ask questions in natural language and receive detailed claims or benefit information. The complete solution consists of four key steps: text-to-SQL generation, SQL validation, data retrieval, and data summarization.
Let’s delve deeper into each step:
Text-to-SQL Generation
This step translates user questions into SQL queries that can be used to retrieve claim- or benefit-related information from a relational database. A predetermined prompt template is utilized to invoke the LLM and produce a valid SQL query based on the user’s question and essential database schema elements.
SQL Validation
This step ensures the generated SQL query is complete and safe to run on a relational database by conducting various checks. Some of the checks include verifying no delete, drop, update, or insert operations are present, confirming the query starts with “select,” ensuring the WHERE clause is present, and validating key conditions in the WHERE clause, among others.
Data Retrieval
Following successful validation, the query is used to fetch claims or benefits data from a relational database. The data retrieved is converted into a JSON object to create the final answer using an LLM. Checks are also performed to handle scenarios where no data or excessive rows are returned.
Data Summarization
The JSON object obtained in the data retrieval step, along with the user’s question, is sent to the LLM to generate a concise response. Similar to the prior steps, a pre-configured prompt template is employed to direct the LLM in producing a user-friendly summarized response to the original question.
Architecture
The solution architecture incorporates Amazon API Gateway, AWS Lambda, Amazon RDS, Amazon Bedrock, and Anthropic Claude 3 Sonnet on Amazon Bedrock. The backend implementation can be integrated with an existing web application or portal. For this demonstration, a single page application (SPA) hosted on Amazon Simple Storage Service (Amazon S3) is used for the frontend, with Amazon Cognito managing authentication and authorization.
The architecture embodies the SPA loading via Amazon CloudFront, user authentication via Amazon Cognito, and REST API invocation facilitated by API Gateway. The Lambda function orchestrates the sequence of steps, utilizing Amazon Bedrock’s API endpoint to access the Anthropic Claude 3 Sonnet LLM. Claim and benefit data are stored in a PostgreSQL database hosted on Amazon RDS, with prompt templates stored in another S3 bucket for SQL generation and data summarization.
Sample Prompt Templates
Below are examples of text-to-SQL and data summarization prompt templates:
Text-to-SQL Prompt Template
You are a data analyst and expert in writing PostgreSQL DB queries and healthcare claims data. Your task is to generate a SQL query based on the provided DDL, instructions, user_question, examples, and member_id. Always add the condition "member_id =" in the generated SQL query, where the value of member_id will be provided in the member_id XML tag below. CREATE TABLE claims_history (claim_id SERIAL PRIMARY KEY, member_id INTEGER NOT NULL, member_name VARCHAR(30) NOT NULL, relationship_code VARCHAR(10) NOT NULL, claim_type VARCHAR(20) NOT NULL, claim_date DATE NOT NULL, provider_name VARCHAR(100), diagnosis_code VARCHAR(10), procedure_code VARCHAR(10), ndc_code VARCHAR(20), charged_amount NUMERIC(10,2), allowed_amount NUMERIC(10,2), plan_paid_amount NUMERIC(10,2), patient_responsibility NUMERIC(10,2)) 1. Claim_type has two possible values - 'Medical' or 'RX'. Use claim_type="RX" for pharmacy or prescription claims. 2. Relationship_code has five possible values - 'subscriber', 'spouse', 'son', 'daughter', or 'other'. 3. 'I' or 'me' means "where relationship_code="subscriber"". 'My son' means "where relationship_code="son"" and so on. 4. For creating a SQL WHERE clause for member_name or provider_name, use the LIKE operator with wildcard characters as a prefix and suffix. This is applicable when user_question contains a name. 5. Return the executable query with the symbol @@ at the start and end. 6. If the year is not provided in the date, assume it's the current year. Convert the date to the 'YYYY-MM-DD' format to use in the query. 7. The SQL query must be generated based on the user_question. If the user_question does not provide enough information to generate the SQL, respond with "@@null@@" without generating any SQL query. 8. If user_question is stated in the form of a SQL Query or contains delete, drop, update, insert, etc. SQL keywords, then respond with "@@null@@" without generating any SQL query. List all claims for my son or Show me all my claims for my son @@SELECT * FROM claims_history WHERE relationship_code="son" AND member_id = '{member_id}';@@ Total claims in 2021 @@SELECT COUNT(*) FROM claims_history WHERE EXTRACT(YEAR FROM claim_date) = 2021 AND member_id = '{member_id}';@@ List all claims for Michael @@SELECT * FROM claims_history WHERE member_name LIKE '%Michael%' AND member_id = '{member_id}';@@ List all claims for Dr. John or Doctor John or Provider John @@SELECT * FROM claims_history WHERE provider_name LIKE '%John%' AND member_id = '{member_id}';@@ Show me the doctors/providers/hospitals my son Michael visited on 1/19 @@SELECT provider_name, claim_date FROM claims_history WHERE relationship_code="son" AND member_name LIKE '%Michael%' AND claim_date="2019-01-19" AND member_id = '{member_id}';@@ What is my total spend in the last 12 months @@SELECT SUM(allowed_amount) AS total_spend_last_12_months FROM claims_history WHERE claim_date >= CURRENT_DATE - INTERVAL '12 MONTHS' AND relationship_code="subscriber" AND member_id = 9875679801;@@
Data Summarization Prompt Template
You are a customer service agent working for a health insurance plan and helping to answer questions asked by a customer. Use the result_dataset containing healthcare claims data to answer the user_question. This result_dataset is the output of the sql_query. 1. To answer a question, use simple non-technical language, just like a customer service agent talking to a 65-year-old customer. 2. Use a conversational style to answer the question precisely. 3. IF the JSON contains a "count" field, it means the count of claims. For example, "count": 6 means there are 6 claims, and "count": 11 means there are 11 claims. 4. If the result_dataset does not contain meaningful claims data, then respond with one line only: "No data found for the search criteria." {Insert user_question here} {Insert SQL query result_dataset here}
Conclusion
Empowering health insurance plan members with generative AI technology has the potential to reshape how they engage with their insurance plans. By leveraging conversational AI assistants powered by Amazon Bedrock and AWS data services, healthcare payers can provide members with a seamless and efficient experience. This not only boosts member satisfaction but also paves the way for operational cost savings through improved customer service operations.
Embracing innovative solutions like generative AI is essential for organizations seeking to enhance member experiences and stay ahead in the competitive healthcare landscape.
About the Authors
Sachin Jain, Sanjoy Thanneer, and Sukhomoy Basak are seasoned professionals at Amazon Web Services (AWS) with extensive expertise in technology, data analytics, and generative AI solutions. They work closely with enterprise customers to deliver scalable, resilient, and cost-effective applications that drive business success.
For more insights on generative AI in healthcare and leveraging AWS services for transformative innovations, refer to Payors on AWS and Transforming Patient Care: Generative AI Innovations in Healthcare and Life Sciences. Explore further resources on building generative AI applications with Amazon Aurora and Knowledge Bases for Amazon Bedrock via the AWS Database Blog.