Skip to main content

Guidance for Identifying Diagnosis Codes from Clinical Notes on AWS

Overview

This Guidance shows how to use generative artificial intelligence (generative AI) to summarize patient histories and identify likely medical conditions and diagnosis codes. Patient-provider interactions capture multiple types of documentary details, such as patient profile, clinical notes, and laboratory work. By juxtaposing this data with historical diagnosis knowledge bases and analyzing it with generative AI foundation models, you can generate summaries of likely medical conditions. You can then recommend these summaries and relevant International Classification of Diseases, Tenth Revision, Clinical Modification (ICD-10-CM) codes to providers, helping then improve patient care.

How it works

These technical details feature an architecture diagram to illustrate how to effectively use this solution. The architecture diagram shows the key components and their interactions, providing an overview of the architecture's structure and functionality step-by-step.

Deploy with confidence

Ready to deploy? Review the sample code on GitHub for detailed deployment instructions to deploy as-is or customize to fit your needs. 

Go to sample code

Well-Architected Pillars

The architecture diagram above is an example of a Solution created with Well-Architected best practices in mind. To be fully Well-Architected, you should follow as many Well-Architected best practices as possible.

Operational Excellence

Amazon CloudWatch collects and tracks metrics for AWS resources like Lambda, Amazon Bedrock, and Amazon Comprehend Medical in real time. Using CloudWatch logs, you can monitor your systems and applications, identify concerns early, and proactively troubleshoot and remediate issues.

Read the Operational Excellence whitepaper

Security

AWS Identity and Access Management (IAM) provides fine-grained access control to AWS services and resources under conditions you specify, supporting the principle of least privilege. Lake Formation helps you centrally govern and secure data and globally share it for analytics and machine learning. It also delivers fine-grained data access control, down to the row and column level, so you can provide users with specific data access. Additionally, AWS CloudTrail lets you record API calls made within your AWS account and provides an audit trail that you can use for compliance. Finally, Amazon Comprehend Medical detects protected health information in clinical text, supporting privacy protection.

Read the Security whitepaper

Reliability

This Guidance uses managed services with high built-in reliability, such as Athena, HealthLake, Amazon Bedrock, Amazon Comprehend Medical, and AWS HealthScribe. As another example, Amazon S3 is designed to provide 99.999999999 percent durability and 99.99 percent availability of objects.

Read the Reliability whitepaper

Well-Architected Pillars (continued)

Performance Efficiency

This Guidance provides high performance, helping you deliver impactful patient care. For example, serverless services like HealthLake, Amazon Comprehend Medical, and AWS HealthScribe provide managed scaling that doesn’t rely on any custom engineering in your code.

Read the Performance Efficiency whitepaper

Cost Optimization

This Guidance optimizes costs by using serverless services like Athena and Amazon Bedrock. Serverless services charge only for the resources used, so you don’t have to pay for idle server capacity. And because they automatically scale to handle varying loads, they reduce costs during low-traffic periods and support efficient resource use during peak times. These services also offer various cost optimization mechanisms. For example, Amazon S3 Lifecycle policies and Amazon S3 Intelligent-Tiering provide lower-cost storage options. Finally, serverless services shift operational responsibilities to AWS, lowering your total cost of ownership by empowering developers to focus on code rather than infrastructure maintenance.

Read the Cost Optimization whitepaper

Sustainability

This Guidance’s use of cloud-native serverless services—like Lambda, Athena, and Amazon Bedrock—can reduce a workload’s carbon footprint by 88 percent. This empowers you to pursue your environmental, social, and governance goals. Additionally, Amazon S3 enables data archival, and Lake Formation enables data classification so that you can define how long health records are retained. As a result, you can more easily achieve regulatory compliance while optimizing energy expenditures related to storage.

Read the Sustainability whitepaper

Disclaimer

The sample code; software libraries; command line tools; proofs of concept; templates; or other related technology (including any of the foregoing that are provided by our personnel) is provided to you as AWS Content under the AWS Customer Agreement, or the relevant written agreement between you and AWS (whichever applies). You should not use this AWS Content in your production accounts, or on production or other critical data. You are responsible for testing, securing, and optimizing the AWS Content, such as sample code, as appropriate for production grade use based on your specific quality control practices and standards. Deploying AWS Content may incur AWS charges for creating or using AWS chargeable resources, such as running Amazon EC2 instances or using Amazon S3 storage.