Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# --- Stage 1: Build the application using Maven ---
FROM maven:3.9.6-eclipse-temurin-17 AS build

WORKDIR /app

COPY . .

# Build the application while caching Maven dependencies to speed up future builds
RUN --mount=type=cache,target=/root/.m2 \
mvn clean package -DENV_VAR=docker -DskipTests -Dgit.skip=true

# --- Stage 2: Run the application with a minimal JRE image ---
FROM eclipse-temurin:17-jre

WORKDIR /app

# Copy the built WAR file from the build stage
COPY --from=build /app/target/*.war app.war

EXPOSE 8080

ENTRYPOINT ["java", "-jar", "app.war"]
12 changes: 12 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,18 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>3.2.2</version>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<reporting>
Expand Down
3 changes: 3 additions & 0 deletions src/main/environment/1097_ci.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ tm-url=@TM_API@

# FHIR Config
fhir-url=@FHIR_API@

# Redis Config
spring.redis.host=@env.REDIS_HOST@
22 changes: 22 additions & 0 deletions src/main/environment/1097_docker.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# DataSource settings: set here your own configurations for the database
spring.datasource.url=${DATABASE_1097_IDENTITY_URL}
spring.datasource.username=${DATABASE_IDENTITY_USERNAME}
spring.datasource.password=${DATABASE_IDENTITY_PASSWORD}
spring.datasource.driver-class-name=com.mysql.jdbc.Driver

#ELK logging file name
logging.path=logs/
logging.file.name=${IDENTITY_API_1097_LOGGING_FILE_NAME}

springdoc.api-docs.enabled=${SWAGGER_DOC_ENABLED}
springdoc.swagger-ui.enabled=${SWAGGER_DOC_ENABLED}

jwt.secret=${JWT_SECRET_KEY}
# TM Config
tm-url=${TM_API}

# FHIR Config
fhir-url=${FHIR_API}

# Redis Config
spring.redis.host=${REDIS_HOST}
5 changes: 4 additions & 1 deletion src/main/environment/1097_example.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ logging.file.name=logs/1097identity-api.log
tm-url=http://localhost:8089/

# FHIR Config
fhir-url=http://localhost:8093/
fhir-url=http://localhost:8093/

# Redis Config
spring.redis.host=localhost
3 changes: 3 additions & 0 deletions src/main/environment/common_ci.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ tm-url=@TM_API@

# FHIR Config
fhir-url=@FHIR_API@

# Redis Config
spring.redis.host=@env.REDIS_HOST@
23 changes: 23 additions & 0 deletions src/main/environment/common_docker.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# DataSource settings: set here your own configurations for the database
spring.datasource.url=${DATABASE_IDENTITY_URL}
spring.datasource.username=${DATABASE_IDENTITY_USERNAME}
spring.datasource.password=${DATABASE_IDENTITY_PASSWORD}
spring.datasource.driver-class-name=com.mysql.jdbc.Driver

#ELK logging file name
logging.path=logs/
logging.file.name=${IDENTITY_API_LOGGING_FILE_NAME}

springdoc.api-docs.enabled=${SWAGGER_DOC_ENABLED}
springdoc.swagger-ui.enabled=${SWAGGER_DOC_ENABLED}

jwt.secret=${JWT_SECRET_KEY}

# TM Config
tm-url=${TM_API}

# FHIR Config
fhir-url=${FHIR_API}

# Redis Config
spring.redis.host=${REDIS_HOST}
5 changes: 4 additions & 1 deletion src/main/environment/common_example.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ logging.file.name=logs/identity-api.log
tm-url=http://localhost:8089/

# FHIR Config
fhir-url=http://localhost:8093/
fhir-url=http://localhost:8093/

# Redis Config
spring.redis.host=localhost
43 changes: 22 additions & 21 deletions src/main/java/com/iemr/common/identity/service/IdentityService.java
Original file line number Diff line number Diff line change
Expand Up @@ -1047,31 +1047,31 @@ private MBeneficiarydetail convertIdentityEditDTOToMBeneficiarydetail(IdentityEd
public BeneficiaryCreateResp createIdentity(IdentityDTO identity) {
logger.info("IdentityService.createIdentity - start");

List<MBeneficiaryregidmapping> list = null;
MBeneficiaryregidmapping regMap = null;
synchronized (queue) {
if (queue.isEmpty()) {
logger.info("fetching 10000 rows");
list = regIdRepo.findTop10000ByProvisionedAndReserved(false, false);
logger.info("Adding SynchronousQueue start-- ");
for (MBeneficiaryregidmapping map : list) {
queue.add(map);
List<MBeneficiaryregidmapping> list = null;
MBeneficiaryregidmapping regMap = null;
synchronized (queue) {
if (queue.isEmpty()) {
logger.info("fetching 10000 rows");
list = regIdRepo.findTop10000ByProvisionedAndReserved(false, false);
logger.info("Adding SynchronousQueue start-- ");
for (MBeneficiaryregidmapping map : list) {
queue.add(map);
}
logger.info("Adding SynchronousQueue end-- ");
}
logger.info("Adding SynchronousQueue end-- ");
regMap = queue.removeFirst();
}
regMap.setReserved(true);
if (regMap.getCreatedDate() == null) {
SimpleDateFormat sdf = new SimpleDateFormat(CREATED_DATE_FORMAT);
String dateToStoreInDataBase = sdf.format(new Date());
Timestamp ts = Timestamp.valueOf(dateToStoreInDataBase);
regMap.setCreatedDate(ts);
}
regMap = queue.removeFirst();
}
regMap.setReserved(true);
if (regMap.getCreatedDate() == null) {
SimpleDateFormat sdf = new SimpleDateFormat(CREATED_DATE_FORMAT);
String dateToStoreInDataBase = sdf.format(new Date());
Timestamp ts = Timestamp.valueOf(dateToStoreInDataBase);
regMap.setCreatedDate(ts);
}

regIdRepo.save(regMap);
regIdRepo.save(regMap);

regMap.setProvisioned(true);
regMap.setProvisioned(true);

logger.info("IdentityService.createIdentity - saving Address");
ObjectMapper objectMapper = new ObjectMapper();
Expand Down Expand Up @@ -1332,6 +1332,7 @@ private MBeneficiarydetail convertIdentityDTOToMBeneficiarydetail(IdentityDTO dt
beneficiarydetail.setOccupationId(dto.getOccupationId());
beneficiarydetail.setPhcId(dto.getPhcId());
beneficiarydetail.setPlaceOfWork(dto.getPlaceOfWork());
beneficiarydetail.setPreferredLanguageId(dto.getPreferredLanguageId());
beneficiarydetail.setPreferredLanguage(dto.getPreferredLanguage());
beneficiarydetail.setReligion(dto.getReligion());
if (dto.getFaceEmbedding() != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public String editFamilyDetails(String request) throws IEMRException {
if (benFamilyRS != null) {
if (benFamilyObj.getIsHeadOfTheFamily() != null
&& benFamilyObj.getMemberName() != null) {
if(benFamilyRS.getFamilyHeadName().trim().equals(benFamilyObj.getMemberName().trim()) && Boolean.TRUE.equals(!benFamilyObj.getIsHeadOfTheFamily()))
if(null != benFamilyRS.getFamilyHeadName() && benFamilyRS.getFamilyHeadName().trim().equals(benFamilyObj.getMemberName().trim()) && Boolean.TRUE.equals(!benFamilyObj.getIsHeadOfTheFamily()))
benFamilyRS.setFamilyHeadName("");
else
benFamilyRS.setFamilyHeadName(benFamilyObj.getMemberName());
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQLDialect
#Below lines are added for security reasons

spring.session.store-type=redis
spring.redis.host=localhost
spring.redis.password=
spring.redis.port=6379

Expand Down
Loading