Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
18b0c3b
general checkup
SauravBizbRolly Oct 19, 2026
3eddc56
general checkup save get api
SauravBizbRolly Oct 20, 2026
a06bc27
general checkup save get api
SauravBizbRolly Oct 20, 2026
894da33
general checkup save get api
SauravBizbRolly Oct 20, 2026
82a9197
update response
SauravBizbRolly Oct 20, 2026
2a8806c
update response
SauravBizbRolly Oct 20, 2026
c45ec8c
update response
SauravBizbRolly Oct 20, 2026
3b007e3
update response
SauravBizbRolly Oct 20, 2026
bd45c87
update response
SauravBizbRolly Oct 20, 2026
516f75b
update response
SauravBizbRolly Oct 20, 2026
fc62b95
update response
SauravBizbRolly Oct 20, 2026
8a665b9
update response
SauravBizbRolly Oct 20, 2026
3767fc5
Merge remote-tracking branch 'upstream/main' into sm/3.11.1
SauravBizbRolly Oct 27, 2026
32855a3
Add api for general checkup follow up
SauravBizbRolly Oct 28, 2026
f52c4c6
Add api for general checkup follow up
SauravBizbRolly Oct 28, 2026
585b824
Add api for general checkup follow up
SauravBizbRolly Oct 28, 2026
0063bd1
Make multiple followUp in HWC referal
SauravBizbRolly Oct 29, 2026
21de33b
Make multiple followUp in HWC referal
SauravBizbRolly Oct 29, 2026
d2aa09b
Make multiple followUp in HWC referal
SauravBizbRolly Oct 29, 2026
0c2c97e
Add new column is_recommended_for_tpt
SauravBizbRolly Nov 2, 2026
c71a112
Add new column is_recommended_for_tpt
SauravBizbRolly Nov 2, 2026
da09863
Add new column is_recommended_for_tpt
SauravBizbRolly Nov 3, 2026
bbbe871
Add new column is_recommended_for_tpt
SauravBizbRolly Nov 3, 2026
7a63bac
Add new column is_recommended_for_tpt
SauravBizbRolly Nov 3, 2026
b2f6a15
Add new column is_recommended_for_tpt
SauravBizbRolly Nov 3, 2026
10f72b8
Merge pull request #399 from PSMRI/feature/general_check_up_api
SauravBizbRolly Nov 4, 2026
3379e00
fix code merge issue
SauravBizbRolly Nov 4, 2026
ba3efea
Merge pull request #403 from PSMRI/fix/code_merge_issue
vishwab1 Nov 4, 2026
43585fb
comment unwanted method
SauravBizbRolly Nov 4, 2026
90db37b
Merge pull request #404 from PSMRI/fix/comment_unwanted_method
SauravBizbRolly Nov 4, 2026
b593f28
incentive hot fixes
SauravBizbRolly Nov 5, 2026
9a4e751
incentive hot fixes
SauravBizbRolly Nov 5, 2026
defce81
incentive hot fixes
SauravBizbRolly Nov 5, 2026
205d234
incentive hot fixes
SauravBizbRolly Nov 5, 2026
be46233
incentive hot fixes
SauravBizbRolly Nov 5, 2026
69fd4cf
incentive hot fixes
SauravBizbRolly Nov 5, 2026
c110035
fix hwc referal incentive issue
SauravBizbRolly Nov 6, 2026
579e7f5
fix hwc referal incentive issue
SauravBizbRolly Nov 6, 2026
9dfb7cc
Merge pull request #406 from PSMRI/fix/feild_testing_issue
vishwab1 Nov 6, 2026
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
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
@Autowired
private DiseaseControlService diseaseControlService;

@Autowired

Check warning on line 52 in src/main/java/com/iemr/flw/controller/DiseaseControlController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this field injection and use constructor injection instead.

See more on https://sonarcloud.io/project/issues?id=PSMRI_FLW-API&issues=AaHOLEBUqTrsVVLTbWYP&open=AaHOLEBUqTrsVVLTbWYP&pullRequest=412
private ObjectMapper objectMapper;


@RequestMapping(value = "malaria/saveAll", method = RequestMethod.POST, consumes = "application/json", produces = "application/json",headers = "Authorization")
public ResponseEntity<Map<String, Object>> saveMalaria(@RequestBody MalariaDTO malariaDTO) {
Expand Down Expand Up @@ -283,7 +286,7 @@
return ResponseEntity.ok(response);
} else {
response.put("statusCode", HttpStatus.NOT_FOUND.value());
response.put("message", "No records found");

Check failure on line 289 in src/main/java/com/iemr/flw/controller/DiseaseControlController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "No records found" 3 times.

See more on https://sonarcloud.io/project/issues?id=PSMRI_FLW-API&issues=AaHOLEBUqTrsVVLTbWYO&open=AaHOLEBUqTrsVVLTbWYO&pullRequest=412
return ResponseEntity.status(HttpStatus.NOT_FOUND).body(response);
}

Expand Down Expand Up @@ -375,4 +378,72 @@
}


@RequestMapping(value = "generalCheckUp/getAll", method = RequestMethod.POST)

Check warning on line 381 in src/main/java/com/iemr/flw/controller/DiseaseControlController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace "@RequestMapping(method = RequestMethod.POST)" with "@PostMapping"

See more on https://sonarcloud.io/project/issues?id=PSMRI_FLW-API&issues=AaHOLEBUqTrsVVLTbWYQ&open=AaHOLEBUqTrsVVLTbWYQ&pullRequest=412
public ResponseEntity<Map<String, Object>> getGeneralCheckUp(@RequestBody GetBenRequestHandler getBenRequestHandler,@RequestHeader(value = "JwtToken") String token) {

Map<String, Object> response = new LinkedHashMap<>();

try {
List<GeneralCheckUpDto> result =
diseaseControlService.getGeneralCheckUp(token);

if (result != null && !result.isEmpty()) {
response.put("statusCode", HttpStatus.OK.value());
response.put("data", result);
return ResponseEntity.ok(response);
} else {
response.put("statusCode", HttpStatus.NOT_FOUND.value());
response.put("message", "No records found");
return ResponseEntity.status(HttpStatus.NOT_FOUND).body(response);
}

} catch (Exception e) {
logger.error("Error fetching Chronic Disease Visit :", e);
response.put("statusCode", HttpStatus.INTERNAL_SERVER_ERROR.value());
response.put("errorMessage", e.getMessage());
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(response);
}
}


@RequestMapping(value = "generalCheckUp/saveAll", method = RequestMethod.POST)

Check warning on line 409 in src/main/java/com/iemr/flw/controller/DiseaseControlController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace "@RequestMapping(method = RequestMethod.POST)" with "@PostMapping"

See more on https://sonarcloud.io/project/issues?id=PSMRI_FLW-API&issues=AaHOLEBUqTrsVVLTbWYR&open=AaHOLEBUqTrsVVLTbWYR&pullRequest=412
public ResponseEntity<Map<String, Object>> savGeneralCheckUp(
@RequestBody List<GeneralCheckUpDto> requestList,@RequestHeader(value = "JwtToken") String token) {

Map<String, Object> response = new LinkedHashMap<>();
logger.info("####################################################");
try {
logger.info("General Checkup Save Request: {}",
objectMapper.writerWithDefaultPrettyPrinter()
.writeValueAsString(requestList));

Check warning on line 418 in src/main/java/com/iemr/flw/controller/DiseaseControlController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Invoke method(s) only conditionally.

See more on https://sonarcloud.io/project/issues?id=PSMRI_FLW-API&issues=AaHOLEBUqTrsVVLTbWYN&open=AaHOLEBUqTrsVVLTbWYN&pullRequest=412
} catch (Exception e) {
logger.error("Failed to convert request to JSON", e);
}
logger.info("####################################################");

try {
List<GeneralCheckUpDto> savedList =
diseaseControlService.saveGeneralCheckUp(requestList,token);

if (savedList != null && !savedList.isEmpty()) {
response.put("statusCode", HttpStatus.OK.value());
response.put("message", "Data saved successfully");
response.put("data", savedList);
return ResponseEntity.ok(response);
} else {
response.put("statusCode", HttpStatus.BAD_REQUEST.value());
response.put("message", "No data saved");
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(response);
}

} catch (Exception e) {
logger.error("Error saving Chronic Disease Visit :", e);
response.put("statusCode", HttpStatus.INTERNAL_SERVER_ERROR.value());
response.put("errorMessage", e.getMessage());
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(response);
}
}



}
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
/*
* 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/.
*
/*
* AMRIT – Accessible Medical Records via Integrated Technology
*/
package com.iemr.flw.controller;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.iemr.flw.dto.identity.GetBenRequestHandler;
import com.iemr.flw.dto.iemr.*;
import com.iemr.flw.service.DiseaseControlService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping(value = "/generalCheckUpFollowUp",headers = "Authorization")
public class GeneralCheckUpFollowUpController {
private final Logger logger = LoggerFactory.getLogger(GeneralCheckUpFollowUpController.class);

@Autowired

Check warning on line 47 in src/main/java/com/iemr/flw/controller/GeneralCheckUpFollowUpController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this field injection and use constructor injection instead.

See more on https://sonarcloud.io/project/issues?id=PSMRI_FLW-API&issues=AaHOLD8TqTrsVVLTbWYJ&open=AaHOLD8TqTrsVVLTbWYJ&pullRequest=412
private DiseaseControlService diseaseControlService;

@Autowired

Check warning on line 50 in src/main/java/com/iemr/flw/controller/GeneralCheckUpFollowUpController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this field injection and use constructor injection instead.

See more on https://sonarcloud.io/project/issues?id=PSMRI_FLW-API&issues=AaHOLD8TqTrsVVLTbWYK&open=AaHOLD8TqTrsVVLTbWYK&pullRequest=412
private ObjectMapper objectMapper;



@RequestMapping(value = "getAll", method = RequestMethod.POST)

Check warning on line 55 in src/main/java/com/iemr/flw/controller/GeneralCheckUpFollowUpController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace "@RequestMapping(method = RequestMethod.POST)" with "@PostMapping"

See more on https://sonarcloud.io/project/issues?id=PSMRI_FLW-API&issues=AaHOLD8TqTrsVVLTbWYL&open=AaHOLD8TqTrsVVLTbWYL&pullRequest=412
public ResponseEntity<Map<String, Object>> getGeneralCheckUpFollowUp(@RequestBody GetBenRequestHandler getBenRequestHandler,@RequestHeader(value = "JwtToken") String token) {

Map<String, Object> response = new LinkedHashMap<>();

try {
List<GeneralCheckUpFollowUpDto> result =
diseaseControlService.getGeneralCheckUpFollowUp(token);

if (result != null && !result.isEmpty()) {
response.put("statusCode", HttpStatus.OK.value());

Check failure on line 65 in src/main/java/com/iemr/flw/controller/GeneralCheckUpFollowUpController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "statusCode" 6 times.

See more on https://sonarcloud.io/project/issues?id=PSMRI_FLW-API&issues=AaHOLD8TqTrsVVLTbWYI&open=AaHOLD8TqTrsVVLTbWYI&pullRequest=412
response.put("data", result);
return ResponseEntity.ok(response);
} else {
response.put("statusCode", HttpStatus.NOT_FOUND.value());
response.put("message", "No records found");

Check failure on line 70 in src/main/java/com/iemr/flw/controller/GeneralCheckUpFollowUpController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "message" 3 times.

See more on https://sonarcloud.io/project/issues?id=PSMRI_FLW-API&issues=AaHOLD8TqTrsVVLTbWYH&open=AaHOLD8TqTrsVVLTbWYH&pullRequest=412
return ResponseEntity.status(HttpStatus.NOT_FOUND).body(response);
}

} catch (Exception e) {
logger.error("Error fetching Chronic Disease Visit :", e);
response.put("statusCode", HttpStatus.INTERNAL_SERVER_ERROR.value());
response.put("errorMessage", e.getMessage());
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(response);
}
}


@RequestMapping(value = "saveAll", method = RequestMethod.POST)

Check warning on line 83 in src/main/java/com/iemr/flw/controller/GeneralCheckUpFollowUpController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace "@RequestMapping(method = RequestMethod.POST)" with "@PostMapping"

See more on https://sonarcloud.io/project/issues?id=PSMRI_FLW-API&issues=AaHOLD8TqTrsVVLTbWYM&open=AaHOLD8TqTrsVVLTbWYM&pullRequest=412
public ResponseEntity<Map<String, Object>> savGeneralCheckUpFollowUp(
@RequestBody List<GeneralCheckUpFollowUpDto> requestList,@RequestHeader(value = "JwtToken") String token) {

Map<String, Object> response = new LinkedHashMap<>();
logger.info("####################################################");
try {
logger.info("General Checkup Save Request: {}",
objectMapper.writerWithDefaultPrettyPrinter()
.writeValueAsString(requestList));

Check warning on line 92 in src/main/java/com/iemr/flw/controller/GeneralCheckUpFollowUpController.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Invoke method(s) only conditionally.

See more on https://sonarcloud.io/project/issues?id=PSMRI_FLW-API&issues=AaHOLD8TqTrsVVLTbWYG&open=AaHOLD8TqTrsVVLTbWYG&pullRequest=412
} catch (Exception e) {
logger.error("Failed to convert request to JSON", e);
}
logger.info("####################################################");

try {
List<GeneralCheckUpFollowUpDto> savedList =
diseaseControlService.saveGeneralCheckUpFollowUp(requestList,token);

if (savedList != null && !savedList.isEmpty()) {
response.put("statusCode", HttpStatus.OK.value());
response.put("message", "Data saved successfully");
response.put("data", savedList);
return ResponseEntity.ok(response);
} else {
response.put("statusCode", HttpStatus.BAD_REQUEST.value());
response.put("message", "No data saved");
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(response);
}

} catch (Exception e) {
logger.error("Error saving Chronic Disease Visit :", e);
response.put("statusCode", HttpStatus.INTERNAL_SERVER_ERROR.value());
response.put("errorMessage", e.getMessage());
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(response);
}
}

}
6 changes: 2 additions & 4 deletions src/main/java/com/iemr/flw/domain/iemr/AHDForm.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,11 @@ public class AHDForm {
@Column(name = "ahd_date")
private String ahdDate;

@Lob
@Column(name = "image1")
private byte[] image1;
private String image1;

@Lob
@Column(name = "image2")
private byte[] image2;
private String image2;

@Column(name = "user_id")
private Long userId;
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/com/iemr/flw/domain/iemr/DewormingForm.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,11 @@ public class DewormingForm {
@Column(name = "age_group")
private Integer ageGroup;

@Lob
@Column(name = "image1")
private byte[] image1;
private String image1;

@Lob
@Column(name = "image2")
private byte[] image2;
private String image2;

@Column(name = "user_id")
private Long userId;
Expand Down
72 changes: 72 additions & 0 deletions src/main/java/com/iemr/flw/domain/iemr/GeneralCheckUp.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
package com.iemr.flw.domain.iemr;

import java.sql.Timestamp;
import java.time.LocalDate;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Data;

@Entity
@Table(name = "general_check_up", schema = "db_iemr")
@Data
public class GeneralCheckUp {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;

@Column(name = "ben_id")
private Long benId;

@Column(name = "household_id")
private Long householdId;

@Column(name = "asha_id", nullable = false)
private Integer ashaId;

@Column(name = "checkup_date", nullable = false)
private LocalDate checkupDate;

@Column(name = "problem_type", length = 200)
private String problemType;

@Column(name = "problems", columnDefinition = "json")
private String problems;

@Column(name = "checkup_id", length = 50, unique = true)
private String checkupId;

@Column(name = "problem_type_label", length = 200)
private String problemTypeLabel;

@Column(name = "other_text", length = 500)
private String otherText;

@Column(name = "priority", length = 20)
private String priority;


@Column(name = "referral_reason", length = 500)
private String referralReason;

@Column(name = "referral_date")
private LocalDate referralDate;

@Column(name = "created_by", length = 100)
private String createdBy;

@Column(name = "created_date", insertable = false, updatable = false)
private Timestamp createdDate;

@Column(name = "synced_date")
private Timestamp syncedDate;

@Column(name = "updated_date", insertable = false, updatable = false)
private Timestamp updatedDate;
}
57 changes: 57 additions & 0 deletions src/main/java/com/iemr/flw/domain/iemr/GeneralCheckUpFollowUp.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package com.iemr.flw.domain.iemr;

import jakarta.persistence.*;
import lombok.Data;

import java.sql.Timestamp;
import java.time.LocalDate;

@Entity
@Table(name = "general_checkup_followup", schema = "db_iemr")
@Data
public class GeneralCheckUpFollowUp {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Long id;

@Column(name = "ben_id")
private Long benId;

@Column(name = "household_id")
private Long householdId;

@Column(name = "asha_id", nullable = false)
private Integer ashaId;

@Column(name = "follow_up_date", nullable = false)
private LocalDate followUpDate;

@Column(name = "followup_status", length = 200)
private String followupStatus;

@Column(name = "referred_to", columnDefinition = "json")
private String referredTo;

@Column(name = "created_by", length = 100)
private String createdBy;

@Column(name = "created_date", insertable = false, updatable = false)
private Timestamp createdDate;

@Column(name = "synced_date")
private Timestamp syncedDate;

@Column(name = "updated_date", insertable = false, updatable = false)
private Timestamp updatedDate;

@Column(name = "referralReason")
private String referralReason;

@Column(name = "referredOnDate")
private LocalDate referredOnDate;

@Column(name = "other_follow_up")
private String otherFollowUp;
}
6 changes: 2 additions & 4 deletions src/main/java/com/iemr/flw/domain/iemr/PHCReviewForm.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,11 @@ public class PHCReviewForm {
@Column(name = "no_of_beneficiaries_attended")
private Integer noOfBeneficiariesAttended;

@Lob
@Column(name = "image1")
private byte[] image1;
private String image1;

@Lob
@Column(name = "image2")
private byte[] image2;
private String image2;

@Column(name = "user_id")
private Long userId;
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/iemr/flw/domain/iemr/TBSuspected.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ public class TBSuspected {
@Column(name = "is_tb_confirmed")
private Boolean isTBConfirmed;

@Column(name = "is_recommended_for_tpt")
private Boolean isRecommendedForTpt;

@Column(name = "is_drtb_confirmed")
private Boolean isDRTBConfirmed;

Expand Down
Loading
Loading