-
Notifications
You must be signed in to change notification settings - Fork 72
ENG-268 Consolidated search by keyword #3814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThis update introduces a comprehensive refactor and modularization of the OpenSearch-based search and ingestion infrastructure for consolidated FHIR resources. Key changes include the introduction of new modules for lexical search, resource indexing, and ingestion, as well as the removal or relocation of legacy and redundant files. The API is updated to delegate consolidated patient operations to a new internal router, and environment/configuration handling is improved for search endpoints and index names. Additional enhancements include improved logging, new utility functions for text processing, and expanded test coverage for codeable concept formatting. Changes
Sequence Diagram(s)Lexical Ingestion FlowsequenceDiagram
participant API
participant IngestLexical
participant OpenSearchTextIngestor
participant S3
participant Config
API->>IngestLexical: ingestLexical({ patient, onItemError? })
IngestLexical->>Config: get OpenSearch config
IngestLexical->>OpenSearchTextIngestor: new OpenSearchTextIngestor(config)
IngestLexical->>S3: getConsolidatedAsText(patient)
IngestLexical->>OpenSearchTextIngestor: delete({ cxId, patientId })
IngestLexical->>OpenSearchTextIngestor: ingestBulk({ cxId, patientId, resources })
OpenSearchTextIngestor-->>IngestLexical: Map of error counts
IngestLexical-->>API: Log result
Lexical Search FlowsequenceDiagram
participant API
participant SearchConsolidatedDirect
participant OpenSearchLexicalSearcher
participant S3
API->>SearchConsolidatedDirect: search({ patient, query })
alt query present
SearchConsolidatedDirect->>OpenSearchLexicalSearcher: search({ cxId, patientId, query })
OpenSearchLexicalSearcher-->>SearchConsolidatedDirect: SearchResult[]
SearchConsolidatedDirect->>S3: Upload search result and query
S3-->>SearchConsolidatedDirect: Signed URL
SearchConsolidatedDirect-->>API: { url, resourceCount }
else no query
SearchConsolidatedDirect->>getConsolidatedPatientData: getConsolidatedPatientData({ patient })
getConsolidatedPatientData-->>SearchConsolidatedDirect: Bundle
SearchConsolidatedDirect->>S3: Upload result
S3-->>SearchConsolidatedDirect: Signed URL
SearchConsolidatedDirect-->>API: { url, resourceCount }
end
API Router Delegation for Consolidated Patient OperationssequenceDiagram
participant API_Router
participant PatientConsolidatedRouter
participant DB
participant OpenSearch
API_Router->>PatientConsolidatedRouter: POST /internal/patient/consolidated/query or /search/ingest
PatientConsolidatedRouter->>DB: Query/update consolidated queries, patients
PatientConsolidatedRouter->>OpenSearch: Ingest consolidated resources (if /search/ingest)
PatientConsolidatedRouter-->>API_Router: JSON response
Possibly related PRs
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
npm warn config production Use Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. ✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
7eca2da
to
6eef068
Compare
91b6c81
to
876006a
Compare
6eef068
to
cc24edb
Compare
876006a
to
207a162
Compare
207a162
to
2710ec3
Compare
cc24edb
to
4af4911
Compare
2e93ca9
to
a350d94
Compare
4af4911
to
c131be2
Compare
83ca5fe
to
1e795c2
Compare
Dependencies
Description
Consolidated search by keyword.
Downstream PRs have
Testing
Release Plan
This has to be merged along downstream - it won't break anything is shipped without it, just that we shouldn't use the ingestion/search in production w/o downstream.
Summary by CodeRabbit
New Features
Improvements
Bug Fixes
Refactor
Chores