Skip to content

Commit 11158f7

Browse files
authored
Merge pull request #35 from PSMRI/develop
latest pull
2 parents 8fd8761 + 15ecbb5 commit 11158f7

74 files changed

Lines changed: 1298 additions & 675 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# --- Stage 1: Build the application using Maven ---
2+
FROM maven:3.9.6-eclipse-temurin-17 AS build
3+
4+
WORKDIR /app
5+
6+
COPY . .
7+
8+
# Build the application while caching Maven dependencies to speed up future builds
9+
RUN --mount=type=cache,target=/root/.m2 \
10+
mvn clean package -DENV_VAR=docker -DskipTests -Dgit.skip=true
11+
12+
# --- Stage 2: Run the application with a minimal JRE image ---
13+
FROM eclipse-temurin:17-jre
14+
15+
WORKDIR /app
16+
17+
# Copy the built WAR file from the build stage
18+
COPY --from=build /app/target/*.war app.war
19+
20+
EXPOSE 8080
21+
22+
ENTRYPOINT ["java", "-jar", "app.war"]

pom.xml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@
5959
<groupId>org.springframework.boot</groupId>
6060
<artifactId>spring-boot-starter</artifactId>
6161
<exclusions>
62+
<exclusion>
63+
<groupId>org.springframework.boot</groupId>
64+
<artifactId>spring-boot-starter-logging</artifactId>
65+
</exclusion>
6266
<exclusion>
6367
<groupId>org.springframework</groupId>
6468
<artifactId>spring-core</artifactId>
@@ -503,11 +507,6 @@
503507
<groupId>org.apache.maven.plugins</groupId>
504508
<artifactId>maven-jar-plugin</artifactId>
505509
</plugin>
506-
507-
<plugin>
508-
<groupId>org.springframework.boot</groupId>
509-
<artifactId>spring-boot-maven-plugin</artifactId>
510-
</plugin>
511510
<plugin>
512511
<groupId>org.apache.maven.plugins</groupId>
513512
<artifactId>maven-compiler-plugin</artifactId>
@@ -654,6 +653,18 @@
654653
</execution>
655654
</executions>
656655
</plugin>
656+
<plugin>
657+
<groupId>org.springframework.boot</groupId>
658+
<artifactId>spring-boot-maven-plugin</artifactId>
659+
<version>3.2.2</version>
660+
<executions>
661+
<execution>
662+
<goals>
663+
<goal>repackage</goal>
664+
</goals>
665+
</execution>
666+
</executions>
667+
</plugin>
657668
</plugins>
658669
</build>
659670
<reporting>

src/main/environment/common_ci.properties

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ sms-password=@env.SMS_PASSWORD@
3737
send-message-url=@env.SMS_MESSAGE_URL@
3838

3939
###SMS Scheduler configurations
40-
start-sms-scheduler=false
40+
start-sms-scheduler=true
4141
cron-scheduler-sms=0 0/1 * * * ? *
4242

4343
#### Email Configuration
@@ -61,12 +61,11 @@ cron-scheduler-ctidatacheck=0 10 00 * * *
6161
### generate Beneficiary Config
6262
genben-api= @env.BEN_GEN_API_URL@
6363

64-
### file Base Path
65-
---------------------------
64+
### file Base Path ---------------------------
6665
fileBasePath =@env.MMU_FILE_BASE_PATH@
6766

6867
### Redis IP
69-
spring.redis.host=localhost
68+
spring.redis.host=@env.REDIS_HOST@
7069

7170
##---------------------------------------------------------------------------------------------------------------
7271
###CTI data sync schedular
@@ -168,11 +167,18 @@ springdoc.api-docs.enabled=false
168167
springdoc.swagger-ui.enabled=false
169168

170169

171-
isProduction=false
170+
isProduction=@env.IS_PRODUCTION@
172171
grievanceAllocationRetryConfiguration=3
173172

174-
start-grievancedatasync-scheduler=false
173+
start-grievancedatasync-scheduler=true
175174
cron-scheduler-grievancedatasync=0 0/2 * * * ?
176175

176+
captcha.secret-key=@env.CAPTCHA_SECRET_KEY@
177+
captcha.verify-url=@env.CAPTCHA_VERIFY_URL@
178+
captcha.enable-captcha=@env.ENABLE_CAPTCHA@
177179

180+
cors.allowed-origins=@env.CORS_ALLOWED_ORIGINS@
178181

182+
video-call-url=@env.VIDEO_CALL_URL@
183+
jibri.output.path=@env.JIBRI_OUTPUT_PATH@
184+
video.recording.path=@env.VIDEO_RECORDING_PATH@
Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
# local env
2+
# DB Connections
3+
spring.datasource.url=${DATABASE_URL}
4+
spring.datasource.username=${DATABASE_USERNAME}
5+
spring.datasource.password=${DATABASE_PASSWORD}
6+
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
7+
8+
secondary.datasource.username=${REPORTING_DATABASE_USERNAME}
9+
secondary.datasource.password=${REPORTING_DATABASE_PASSWORD}
10+
secondary.datasource.url=${REPORTING_DATABASE_URL}
11+
secondary.datasource.driver-class-name=com.mysql.jdbc.Driver
12+
13+
## KM Configuration
14+
km-base-protocol=${KM_API_BASE_PROTOCOL}
15+
km-username=${KM_USERNAME}
16+
km-password=${KM_PASSWORD}
17+
km-base-url=${KM_API_BASE_URL}
18+
km-base-path=${KM_API_BASE_PATH}
19+
km-root-path=/okm:personal/users/
20+
km-guest-user=${KM_GUEST_USER}
21+
km-guest-password=${KM_GUEST_PASSWORD}
22+
23+
# CTI Config
24+
cti-server-ip=${CTI_SERVER_IP}
25+
cti-logger_base_url=${CTI_SERVER_LOGGER_BASE}/logger
26+
27+
# Identity Config
28+
identity-api-url = ${IDENTITY_API_URL}
29+
identity-1097-api-url = ${IDENTITY_1097_API_URL}
30+
31+
#### SMS Configuration
32+
send-sms=${SEND_SMS}
33+
sendSMSUrl = ${SEND_SMS_URL}
34+
source-address=${SMS_SOURCE_ADDRESS}
35+
sms-username=${SMS_USERNAME}
36+
sms-password=${SMS_PASSWORD}
37+
send-message-url=${SMS_MESSAGE_URL}
38+
39+
###SMS Scheduler configurations
40+
start-sms-scheduler=true
41+
cron-scheduler-sms=0 0/1 * * * ? *
42+
43+
#### Email Configuration
44+
send-email=${SEND_EMAIL}
45+
spring.mail.host=${MAIL_HOST}
46+
spring.mail.port=${MAIL_PORT}
47+
spring.mail.username=${MAIL_USERNAME}
48+
spring.mail.password=${MAIL_PASSWORD}
49+
spring.mail.properties.mail.smtp.auth=true
50+
spring.mail.properties.mail.smtp.starttls.enable=true
51+
52+
###Email Scheduler configurations
53+
start-email-scheduler=true
54+
cron-scheduler-email=0 0/1 * * * ? *
55+
56+
###cti data check with call detail report Scheduler
57+
#Runs at everyday 12:10AM
58+
start-ctidatacheck-scheduler=true
59+
cron-scheduler-ctidatacheck=0 10 00 * * *
60+
61+
### generate Beneficiary Config
62+
genben-api= ${BEN_GEN_API_URL}
63+
64+
### file Base Path
65+
---------------------------
66+
fileBasePath =${MMU_FILE_BASE_PATH}
67+
68+
### Redis IP
69+
spring.redis.host=${REDIS_HOST}
70+
71+
##---------------------------------------------------------------------------------------------------------------
72+
###CTI data sync schedular
73+
cz-duration=40
74+
##---------------------------------------------------------------------------------------------------------------
75+
## prescription template
76+
TMprescriptionTemplate=TMPrescription
77+
##---------------------------------------------------------------------------------------------------------------
78+
##duration for everwell calender
79+
everwellCalendarDuration=15
80+
##---------------------------------------------------------------------------------------------------------------
81+
##lonic variables
82+
lonicPageSize=10
83+
##---------------------------------------------------------------------------------------------------------------
84+
#snomedcti
85+
snomedCTPageSize=10
86+
##---------------------------------------------------------------------------------------------------------------
87+
#call retry count
88+
callRetryConfiguration=3
89+
##---------------------------------------------------------------------------------------------------------------
90+
#avni registration Duration
91+
avniRegistrationLimit=7
92+
93+
#--------------------------NHM Agent Real Time Data----------------------------
94+
nhm.agent.real.time.data.url=${NHM_AGENT_REAL_TIME_DATA_URL}
95+
nhm.agent.real.time.data.cron.scheduler=0 */2 * ? * *
96+
nhm.agent.real.time.data.cron.flag=true
97+
98+
##missing commits
99+
100+
carestream_socket_ip = ${CARESTREAM_SOCKET_IP}
101+
carestream_socket_port = ${CARESTREAM_SOCKET_PORT}
102+
103+
## everwell variables
104+
everwellUserName = ${EVERWELL_USERNAME}
105+
everwellPassword = ${EVERWELL_PASSWORD}
106+
amritUserName = ${EVERWELL_AMRIT_USERNAME}
107+
amritPassword = ${EVERWELL_AMRIT_PASSWORD}
108+
109+
## everwell API call
110+
everwellAddSupportAction = ${EVERWELL_BASE_URL}/Api/Patients/AddSupportAction
111+
everwellEditDoses = ${EVERWELL_BASE_URL}/Api/Patients/EditManualDoses
112+
everwellEditMissedDoses = ${EVERWELL_BASE_URL}/Api/Patients/EditMissedDoses
113+
everwellGetPatientAdherenceUrl = ${EVERWELL_BASE_URL}/Api/Patients/CurrentMonthMissedAdherence?Page=
114+
everwellEditSecondaryPhoneNo = ${EVERWELL_BASE_URL}/Api/Patients/EditPhoneNumber
115+
everwell1097userAuthenticate = ${COMMON_API_BASE_URL}user/userAuthenticate
116+
everwelluserAuthenticate = ${EVERWELL_BASE_URL}/token
117+
everwellRegisterBenficiary = ${COMMON_API_BASE_URL}/beneficiary/create
118+
119+
120+
## LungAssessment credentials
121+
lungAssessmentEmail = ${SWAASA_EMAIL}
122+
lungAssessmentPassword =${SWAASA_PASSWORD}
123+
124+
125+
## SWASSA APIs
126+
lungAssessmentAdminLogin = ${SWAASA_BASE_URL}/api/adminLogin
127+
lungAssessmentValidateCough = ${SWAASA_BASE_URL}/api/verifycough
128+
lungAssessmentStartAssesment = ${SWAASA_BASE_URL}/api/assessment
129+
lungAssessmentGetAssesment = ${SWAASA_BASE_URL}/api/getAssessment
130+
131+
#E- Sanjeevani user authenticate creds
132+
eSanjeevani.url: ${ESANJEEVANI_URL}
133+
eSanjeevani.userName: ${ESANJEEVANI_USERNAME}
134+
eSanjeevani.password: ${ESANJEEVANI_PASSWORD}
135+
eSanjeevani.salt: ${ESANJEEVANI_SALT}
136+
eSanjeevani.source: ${ESANJEEVANI_SOURCE}
137+
eSanjeevani.registerPatient: ${ESANJEEVANI_REGISTER_PATIENT_URL}
138+
eSanjeevani.routeUrl: ${ESANJEEVANI_ROUTE_URL}
139+
140+
biometric.discover.url = ${BIOMETRIC_URL}
141+
biometric.deviceInfo.url = ${BIOMETRIC_URL}/rd/info
142+
biometric.capture.url = ${BIOMETRIC_URL}/rd/capture
143+
eAusadhaUrl=${EAUSADHA_URL}
144+
145+
eausadhaAuthorization=${EAUSADHA_AUTHORIZATION_KEY}
146+
spring.main.allow-bean-definition-overriding=true
147+
spring.main.allow-circular-references=true
148+
149+
jwt.secret=${JWT_SECRET_KEY}
150+
151+
152+
#ELK logging file name
153+
logging.path=logs/
154+
logging.file.name=${COMMON_API_LOGGING_FILE_NAME}
155+
156+
157+
##grievance API call
158+
updateGrievanceDetails = ${GRIEVANCE_API_BASE_URL}/grsbepro/igemr1097/public/api/v1/state-wise/grievance-list?page=PageNumber&currentpage=1
159+
updateGrievanceTransactionDetails=${GRIEVANCE_API_BASE_URL}/grsbepro/igemr1097/public/api/v1/grievance_details/
160+
## grievance variables
161+
162+
grievanceUserName = ${GRIEVANCE_USERNAME}
163+
grievancePassword = ${GRIEVANCE_PASSWORD}
164+
grievanceUserAuthenticate = ${GRIEVANCE_USER_AUTHENTICATE}
165+
grievanceDataSyncDuration = ${GRIEVANCE_DATA_SYNC_DURATION}
166+
167+
springdoc.api-docs.enabled=false
168+
springdoc.swagger-ui.enabled=false
169+
170+
171+
isProduction=${IS_PRODUCTION}
172+
grievanceAllocationRetryConfiguration=3
173+
174+
start-grievancedatasync-scheduler=false
175+
cron-scheduler-grievancedatasync=0 0/2 * * * ?
176+
177+
captcha.secret-key=${CAPTCHA_SECRET_KEY}
178+
captcha.verify-url=${CAPTCHA_VERIFY_URL}
179+
captcha.enable-captcha=${ENABLE_CAPTCHA}
180+
181+
cors.allowed-origins=${CORS_ALLOWED_ORIGINS}
182+
183+
video-call-url=${VIDEO_CALL_URL}
184+
jibri.output.path={JIBRI_OUTPUT_PATH}
185+
video.recording.path={VIDEO_RECORDING_PATH}

src/main/environment/common_example.properties

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ cti-server-ip=10.208.122.99
3030
cti-logger_base_url=http://10.208.122.99/logger
3131

3232
# Identity Config
33-
identity-api-url = http://localhost:8094/
33+
identity-api-url = http://localhost:8094
3434
#Verify whether 1097 and identity are same?
35-
identity-1097-api-url = http://localhost:8095/
35+
identity-1097-api-url = http://localhost:8095
3636
##Generate Benificiary Config
37-
genben-api=http://localhost:8092/
37+
genben-api=http://localhost:8092
3838

3939
#### SMS Configuration
4040
send-sms=false
41-
sendSMSUrl = http://localhost:8080/sms/sendSMS
41+
sendSMSUrl = http://localhost:8083/sms/sendSMS
4242
source-address=AIDSHL
4343
sms-username=<Enter SMS username>
4444
sms-password=<Enter SMS password>
@@ -198,3 +198,13 @@ grievanceAllocationRetryConfiguration=3
198198
logging.path=logs/
199199
logging.file.name=logs/common-api.log
200200

201+
video-call-url=https://vc.piramalswasthya.org/
202+
jibri.output.path=/srv/jibri/recordings
203+
video.recording.path=/srv/recordings
204+
205+
captcha.secret-key= <Enter Cloudflare Secret Key>
206+
captcha.verify-url= https://challenges.cloudflare.com/turnstile/v0/siteverify
207+
captcha.enable-captcha=true
208+
209+
cors.allowed-origins=http://localhost:*
210+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.iemr.common.config;
2+
3+
import org.springframework.context.annotation.Configuration;
4+
import org.springframework.web.servlet.config.annotation.CorsRegistry;
5+
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
6+
import java.util.Arrays;
7+
import org.springframework.beans.factory.annotation.Value;
8+
9+
@Configuration
10+
public class CorsConfig implements WebMvcConfigurer {
11+
12+
@Value("${cors.allowed-origins}")
13+
private String allowedOrigins;
14+
15+
@Override
16+
public void addCorsMappings(CorsRegistry registry) {
17+
registry.addMapping("/**")
18+
.allowedOriginPatterns(
19+
Arrays.stream(allowedOrigins.split(","))
20+
.map(String::trim)
21+
.toArray(String[]::new))
22+
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
23+
.allowedHeaders("*")
24+
.exposedHeaders("Authorization", "Jwttoken")
25+
.allowCredentials(true)
26+
.maxAge(3600);
27+
}
28+
}

src/main/java/com/iemr/common/controller/abdmfacility/AbdmFacilityController.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import org.slf4j.Logger;
44
import org.slf4j.LoggerFactory;
55
import org.springframework.beans.factory.annotation.Autowired;
6-
import org.springframework.web.bind.annotation.CrossOrigin;
76
import org.springframework.web.bind.annotation.GetMapping;
87
import org.springframework.web.bind.annotation.PathVariable;
98
import org.springframework.web.bind.annotation.RequestHeader;
@@ -25,7 +24,6 @@ public class AbdmFacilityController {
2524
@Autowired
2625
private AbdmFacilityService abdmFacilityService;
2726

28-
@CrossOrigin
2927
@Operation(summary = "Get Abdm facility mapped to worklocation")
3028
@GetMapping(value = { "/getWorklocationMappedAbdmFacility/{workLocationId}" })
3129
public String getAbdmFacilityDetails(@PathVariable int workLocationId, @RequestHeader(value = "Authorization") String Authorization) {

0 commit comments

Comments
 (0)