-
Notifications
You must be signed in to change notification settings - Fork 41
Merge Release 3.6.1 to main #146
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
0c3b09a
Elasticsearch implementation for Beneficiary Search (#123)
vanitha1822 c7a52a4
fix: age issue while moving to nurse worklist (#130)
vanitha1822 cce05f3
Optimize the Elasticsearch for better Response Time (#131)
vanitha1822 2ad699b
fix: remove the bean function to create the index automatically (#133)
vanitha1822 64e89b8
Fix ES Issue in the Query (#137)
vanitha1822 39debc2
Nd/vs/fix es (#138)
vanitha1822 cbe8fe2
fix: enable multi-word fuzzy search requirement (#139)
vanitha1822 0590a0c
fix: multi-word search (#140)
vanitha1822 8b862a8
Fix the column mismatch issue in beneficiary search (#142)
vanitha1822 1cf6c07
add new column in rmnch table for death and child record
SauravBizbRolly c32deba
add new column in rmnch table for death and child record
SauravBizbRolly a6818d4
Merge pull request #144 from PSMRI/add/new_column_in_rmnch
SauravBizbRolly 3703ac6
Cherry-pick health and version API enhancements to release-3.6.1 (#145)
DurgaPrasad-54 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
src/main/java/com/iemr/common/identity/config/ElasticsearchConfig.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| /* | ||
| * AMRIT β Accessible Medical Records via Integrated Technology | ||
| * Integrated EHR (Electronic Health Records) Solution | ||
| * | ||
| * Copyright (C) "Piramal Swasthya Management and Research Institute" | ||
| * | ||
| * This file is part of AMRIT. | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License as published by | ||
| * the Free Software Foundation, either version 3 of the License, or | ||
| * (at your option) any later version. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with this program. If not, see https://www.gnu.org/licenses/. | ||
| */ | ||
| package com.iemr.common.identity.config; | ||
|
|
||
| import java.io.IOException; | ||
|
|
||
| import co.elastic.clients.elasticsearch.ElasticsearchClient; | ||
| import co.elastic.clients.json.jackson.JacksonJsonpMapper; | ||
| import co.elastic.clients.transport.ElasticsearchTransport; | ||
| import co.elastic.clients.transport.rest_client.RestClientTransport; | ||
| import org.slf4j.Logger; | ||
| import org.slf4j.LoggerFactory; | ||
|
|
||
| import org.apache.http.HttpHost; | ||
| import org.apache.http.auth.AuthScope; | ||
| import org.apache.http.auth.UsernamePasswordCredentials; | ||
| import org.apache.http.impl.client.BasicCredentialsProvider; | ||
| import org.elasticsearch.client.RestClient; | ||
| import org.springframework.beans.factory.annotation.Value; | ||
| import org.springframework.context.annotation.Bean; | ||
| import org.springframework.context.annotation.Configuration; | ||
|
|
||
| @Configuration | ||
| public class ElasticsearchConfig { | ||
|
|
||
| private static final Logger logger = LoggerFactory.getLogger(ElasticsearchConfig.class); | ||
|
|
||
| @Value("${elasticsearch.host}") | ||
| private String esHost; | ||
|
|
||
| @Value("${elasticsearch.port}") | ||
| private int esPort; | ||
|
|
||
| @Value("${elasticsearch.username}") | ||
| private String esUsername; | ||
|
|
||
| @Value("${elasticsearch.password}") | ||
| private String esPassword; | ||
|
|
||
| @Value("${elasticsearch.index.beneficiary}") | ||
| private String indexName; | ||
|
|
||
| @Bean | ||
| public ElasticsearchClient elasticsearchClient() { | ||
| BasicCredentialsProvider credentialsProvider = new BasicCredentialsProvider(); | ||
| credentialsProvider.setCredentials( | ||
| AuthScope.ANY, | ||
| new UsernamePasswordCredentials(esUsername, esPassword) | ||
| ); | ||
|
|
||
| RestClient restClient = RestClient.builder( | ||
| new HttpHost(esHost, esPort, "http") | ||
| ).setHttpClientConfigCallback(httpClientBuilder -> | ||
| httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider) | ||
| ).build(); | ||
|
|
||
| ElasticsearchTransport transport = new RestClientTransport( | ||
| restClient, | ||
| new JacksonJsonpMapper() | ||
| ); | ||
|
|
||
| return new ElasticsearchClient(transport); | ||
| } | ||
|
|
||
|
|
||
| } |
79 changes: 79 additions & 0 deletions
79
src/main/java/com/iemr/common/identity/config/ElasticsearchSyncConfig.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| /* | ||
| * AMRIT β Accessible Medical Records via Integrated Technology | ||
| * Integrated EHR (Electronic Health Records) Solution | ||
| * | ||
| * Copyright (C) "Piramal Swasthya Management and Research Institute" | ||
| * | ||
| * This file is part of AMRIT. | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License as published by | ||
| * the Free Software Foundation, either version 3 of the License, or | ||
| * (at your option) any later version. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with this program. If not, see https://www.gnu.org/licenses/. | ||
| */ | ||
| package com.iemr.common.identity.config; | ||
|
|
||
| import java.util.concurrent.Executor; | ||
|
|
||
| import org.springframework.context.annotation.Bean; | ||
| import org.springframework.context.annotation.Configuration; | ||
| import org.springframework.scheduling.annotation.EnableAsync; | ||
| import org.springframework.scheduling.annotation.EnableScheduling; | ||
| import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | ||
|
|
||
| /** | ||
| * Configuration for async processing and scheduling | ||
| */ | ||
| @Configuration | ||
| @EnableAsync | ||
| @EnableScheduling | ||
| public class ElasticsearchSyncConfig { | ||
|
|
||
| /** | ||
| * Thread pool for Elasticsearch sync operations | ||
| * Configured for long-running background jobs | ||
| */ | ||
| @Bean(name = "elasticsearchSyncExecutor") | ||
| public Executor elasticsearchSyncExecutor() { | ||
| ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); | ||
|
|
||
| // Only 1-2 sync jobs should run at a time to avoid overwhelming DB/ES | ||
| executor.setCorePoolSize(2); | ||
| executor.setMaxPoolSize(4); | ||
| executor.setQueueCapacity(100); | ||
| executor.setThreadNamePrefix("es-sync-"); | ||
| executor.setKeepAliveSeconds(60); | ||
| executor.setWaitForTasksToCompleteOnShutdown(true); | ||
| executor.setAwaitTerminationSeconds(60); | ||
|
|
||
| // Handle rejected tasks | ||
| executor.setRejectedExecutionHandler((r, executor1) -> { | ||
| throw new RuntimeException("Elasticsearch sync queue is full. Please wait for current job to complete."); | ||
| }); | ||
|
|
||
| executor.initialize(); | ||
| return executor; | ||
| } | ||
|
|
||
| /** | ||
| * General purpose async executor | ||
| */ | ||
| @Bean(name = "taskExecutor") | ||
| public Executor taskExecutor() { | ||
| ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); | ||
| executor.setCorePoolSize(5); | ||
| executor.setMaxPoolSize(10); | ||
| executor.setQueueCapacity(100); | ||
| executor.setThreadNamePrefix("async-"); | ||
| executor.initialize(); | ||
| return executor; | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
Check notice
Code scanning / SonarCloud
Credentials should not be hard-coded Low