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"]
32 changes: 22 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,21 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>co.elastic.logging</groupId>
<artifactId>logback-ecs-encoder</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
</dependency>
<!-- Swagger -->
<dependency>
<groupId>org.springdoc</groupId>
Expand Down Expand Up @@ -425,6 +425,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>
<dependencyManagement>
Expand Down
4 changes: 3 additions & 1 deletion src/main/environment/common_ci.properties
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ serverFolder=MMUSync
getServerCredentialURL=@env.MMU_API@fileSyncController/getServerCredential
tmReferCheckValue=TM
### Redis IP
spring.redis.host=localhost
spring.redis.host=@env.REDIS_HOST@

jwt.secret=@env.JWT_SECRET_KEY@

Expand All @@ -85,3 +85,5 @@ logging.file.name=@env.MMU_API_LOGGING_FILE_NAME@

springdoc.api-docs.enabled=@env.SWAGGER_DOC_ENABLED@
springdoc.swagger-ui.enabled=@env.SWAGGER_DOC_ENABLED@

cors.allowed-origins=@env.CORS_ALLOWED_ORIGINS@
87 changes: 87 additions & 0 deletions src/main/environment/common_docker.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# local env
# DB Connections
spring.datasource.url=${DATABASE_URL}
spring.datasource.username=${DATABASE_USERNAME}
spring.datasource.password=${DATABASE_PASSWORD}
spring.datasource.driver-class-name=com.mysql.jdbc.Driver

## Carestream URLs, local
carestreamOrderCreateURL=${COMMON_API}carestream/createOrder

## Identity - Common URLs
# Registration
registrationUrl =${COMMON_API}beneficiary/createBeneficiary

registrarQuickSearchByIdUrl =${COMMON_API}beneficiary/searchUserByID

registrarQuickSearchByPhoneNoUrl =${COMMON_API}beneficiary/searchUserByPhone

getBenImageFromIdentity =${IDENTITY_API_BASE_URL}id/benImageByBenRegID

beneficiaryEditUrl =${COMMON_API}beneficiary/updateBenefciaryDetails

registrarAdvanceSearchUrl =${COMMON_API}beneficiary/searchBeneficiary

## Data Sync API, central
dataSyncUploadUrl=${MMU_CENTRAL_SERVER}dataSync/van-to-server

## Data download API, central
dataSyncDownloadUrl=${MMU_CENTRAL_SERVER}dataSync/server-to-van

## TC specialist slot booking, # not required
tcSpecialistSlotBook=${TM_API}schedule/bookSlot

## TC specialist slot cancelling, # not required
tcSpecialistSlotCancel=${TM_API}schedule/cancelBookedSlot

## benGenUrl, common, central
benGenUrlCentral=${COMMON_API_OPEN_SYNC}beneficiary/generateBeneficiaryIDs

## benImportUrl, identity, local
benImportUrlLocal=${IDENTITY_API_BASE_URL}id/saveGeneratedBenIDToLocalServer
mmucentralserver = ${MMU_CENTRAL_SERVER}common/get/Case-sheet/centralServerTMCaseSheet

tmCentralServer = ${TM_CENTRAL_SERVER}common/get/Case-sheet/printData

specialistSign=${COMMON_API}signature1/getSignClass

## inventory transaction download URL, central, mmu
dataSyncTransactionDownloadUrl=${MMU_CENTRAL_SERVER}dataSync/server-to-van-transactional

## inventory transaction processed flag update URL, central, mmu
dataSyncProcessedFlagUpdate=${MMU_CENTRAL_SERVER}dataSync/updateProcessedFlagPostDownload


fileBasePath =${MMU_FILE_BASE_PATH}

## data sync batch size
BATCH_SIZE=30
snomedCTPageSize=10
nurseWL=7
docWL=7
pharmaWL=7
labWL=7
radioWL=7
oncoWL=7

## For File Sync
serverIP=${FILE_SYNC_SERVER_IP}
serverDomain=${FILE_SYNC_SERVER_DOMAIN}
serverUserName=${FILE_SYNC_SERVER_USERNAME}
serverPassword=${FILE_SYNC_SERVER_PASSWORD}
localFolderToSync=${LOCAL_FOLDER_TO_SYNC}
serverFolder=MMUSync
getServerCredentialURL=${MMU_API}fileSyncController/getServerCredential
tmReferCheckValue=TM
### Redis IP
spring.redis.host=${REDIS_HOST}

jwt.secret=${JWT_SECRET_KEY}


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

springdoc.api-docs.enabled=${SWAGGER_DOC_ENABLED}
springdoc.swagger-ui.enabled=${SWAGGER_DOC_ENABLED}
5 changes: 4 additions & 1 deletion src/main/environment/common_example.properties
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,7 @@ getServerCredentialURL=http://10.208.122.34:1040/mmuapi-v1.0/fileSyncController/
spring.redis.host=localhost
jwt.secret=my-32-character-ultra-secure-and-ultra-long-secret
logging.path=logs/
logging.file.name=logs/mmu-api.log
logging.file.name=logs/mmu-api.log


cors.allowed-origins=http://localhost:*
32 changes: 5 additions & 27 deletions src/main/java/com/iemr/mmu/controller/anc/ANCController.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.CrossOrigin;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
Expand All @@ -42,28 +42,21 @@

import io.swagger.v3.oas.annotations.Operation;


/**
* @Objective Saving ANC data for Nurse and Doctor.
*/

@CrossOrigin
@RestController
@RequestMapping(value = "/ANC", headers = "Authorization", consumes = "application/json", produces = "application/json")
public class ANCController {
private Logger logger = LoggerFactory.getLogger(this.getClass().getSimpleName());
@Autowired
private ANCService ancService;



/**
* @Objective Save ANC data for nurse.
* @param JSON requestObj
* @return success or failure response
*/

@CrossOrigin
@Operation(summary = "Save ANC nurse data")
@PostMapping(value = { "/save/nurseData" })
public String saveBenANCNurseData(@RequestBody String requestObj) {
Expand Down Expand Up @@ -96,7 +89,6 @@ public String saveBenANCNurseData(@RequestBody String requestObj) {
* @param JSON requestObj
* @return success or failure response
*/
@CrossOrigin
@Operation(summary = "Save ANC doctor data")
@PostMapping(value = { "/save/doctorData" })
public String saveBenANCDoctorData(@RequestBody String requestObj,
Expand All @@ -122,7 +114,6 @@ public String saveBenANCDoctorData(@RequestBody String requestObj,
return response.toString();
}

@CrossOrigin()
@Operation(summary = "Get beneficiary visit details from nurse ANC")
@PostMapping(value = { "/getBenVisitDetailsFrmNurseANC" })
@Transactional(rollbackFor = Exception.class)
Expand Down Expand Up @@ -153,7 +144,6 @@ public String getBenVisitDetailsFrmNurseANC(
* @param benRegID and benVisitID
* @return anc care details in JSON format
*/
@CrossOrigin()
@Operation(summary = "Get beneficiary ANC care details from nurse ANC")
@PostMapping(value = { "/getBenANCDetailsFrmNurseANC" })
@Transactional(rollbackFor = Exception.class)
Expand Down Expand Up @@ -186,7 +176,6 @@ public String getBenANCDetailsFrmNurseANC(
* @param benRegID and benVisitID
* @return history details in JSON format
*/
@CrossOrigin()
@Operation(summary = "Get beneficiary ANC history details from nurse to doctor ")
@PostMapping(value = { "/getBenANCHistoryDetails" })

Expand Down Expand Up @@ -218,7 +207,6 @@ public String getBenANCHistoryDetails(
* @param benRegID and benVisitID
* @return vital details in JSON format
*/
@CrossOrigin()
@Operation(summary = "Get beneficiary ANC vital details from nurse ANC")
@PostMapping(value = { "/getBenANCVitalDetailsFrmNurseANC" })
public String getBenANCVitalDetailsFrmNurseANC(
Expand Down Expand Up @@ -250,7 +238,6 @@ public String getBenANCVitalDetailsFrmNurseANC(
* @param benRegID and benVisitID
* @return examination details in JSON format
*/
@CrossOrigin()
@Operation(summary = "Get beneficiary ANC examination details from nurse to doctor ")
@PostMapping(value = { "/getBenExaminationDetailsANC" })

Expand Down Expand Up @@ -282,7 +269,6 @@ public String getBenExaminationDetailsANC(
* @param benRegID and benVisitID
* @return doctor entered details in JSON format
*/
@CrossOrigin()
@Operation(summary = "Get beneficiary doctor entered details")
@PostMapping(value = { "/getBenCaseRecordFromDoctorANC" })
@Transactional(rollbackFor = Exception.class)
Expand All @@ -309,7 +295,6 @@ public String getBenCaseRecordFromDoctorANC(
return response.toString();
}

@CrossOrigin()
@Operation(summary = "Check high risk pregnancy status for ANC beneficiary")
@PostMapping(value = { "/getHRPStatus" })
@Transactional(rollbackFor = Exception.class)
Expand Down Expand Up @@ -339,7 +324,6 @@ public String getHRPStatus(
return response.toString();
}

@CrossOrigin
@Operation(summary = "Update ANC care data in doctor screen")
@PostMapping(value = { "/update/ANCScreen" })
public String updateANCCareNurse(@RequestBody String requestObj) {
Expand Down Expand Up @@ -370,8 +354,6 @@ public String updateANCCareNurse(@RequestBody String requestObj) {
* @objective Replace ANC History Data entered by Nurse with the details entered
* by Doctor
*/

@CrossOrigin
@Operation(summary = "Update ANC history data in doctor screen")
@PostMapping(value = { "/update/historyScreen" })
public String updateANCHistoryNurse(@RequestBody String requestObj) {
Expand Down Expand Up @@ -401,8 +383,6 @@ public String updateANCHistoryNurse(@RequestBody String requestObj) {
* @objective Replace ANC Vital Data entered by Nurse with the details entered
* by Doctor
*/

@CrossOrigin
@Operation(summary = "Update ANC vital data in doctor screen")
@PostMapping(value = { "/update/vitalScreen" })
public String updateANCVitalNurse(@RequestBody String requestObj) {
Expand Down Expand Up @@ -433,8 +413,6 @@ public String updateANCVitalNurse(@RequestBody String requestObj) {
* @objective Replace ANC History Data entered by Nurse with the details entered
* by Doctor
*/

@CrossOrigin
@Operation(summary = "Update ANC examination data in doctor screen")
@PostMapping(value = { "/update/examinationScreen" })
public String updateANCExaminationNurse(@RequestBody String requestObj) {
Expand Down Expand Up @@ -465,7 +443,6 @@ public String updateANCExaminationNurse(@RequestBody String requestObj) {
* @objective Replace ANC doctor data for the doctor next visit
*
*/
@CrossOrigin
@Operation(summary = "Update ANC doctor data")
@PostMapping(value = { "/update/doctorData" })
public String updateANCDoctorData(@RequestBody String requestObj,
Expand All @@ -489,8 +466,9 @@ public String updateANCDoctorData(@RequestBody String requestObj,

return response.toString();
}

private JsonObject parseJsonRequest(String requestObj) {
JsonElement jsonElement = JsonParser.parseString(requestObj);
return jsonElement.getAsJsonObject();
}
JsonElement jsonElement = JsonParser.parseString(requestObj);
return jsonElement.getAsJsonObject();
}
}
Loading
Loading