Add enriched_results field for AI-extracted insurance card data #162
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for enriched insurance card data extracted by the GeminiDataEnrichmentProcessor in the cardscan-infrastructure backend.
Changes Made
enriched_resultsfield toCardApiResponseschema to expose AI-extracted dataGeminiDataEnrichmentProcessoroutput format:EnrichedAddressResultInner: includeslabel,type,company_name,address,scoreEnrichedPhoneNumberResultInner: includeslabel,type,number,scoreEnrichedCopayResultInner: includesservice,category,value(number),scoredetailsfield:AddressResult,PhoneNumberResult,CopayResultprocessed_sidesindicator showing which card sides were processed (front_only,both)Background
The backend
GeminiDataEnrichmentProcessorextracts structured data from insurance cards using AI and stores it inCardModel.enrichment_results. This data gets exposed viaCardModel.to_summary()asenriched_resultsbut was missing from the OpenAPI specification.Data Structure Differences
The new enriched schemas have important differences from the legacy OCR-based schemas:
score(string) vs multiplescores(array)company_nameandaddressfieldsnumberfield vsvaluefieldcopays_deductiblesvscopaysTesting
🤖 Generated with Claude Code