Skip to content

Commit 90a931a

Browse files
authored
Merge pull request #133 from PSMRI/amm-2175
feat: amm-2175 dockendra ecg abnormal findings feature added
2 parents 537cedf + 833d8b9 commit 90a931a

9 files changed

Lines changed: 346 additions & 0 deletions

File tree

src/main/java/com/iemr/tm/controller/common/master/CommonMasterController.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,14 @@ public String DoctorMasterData(@PathVariable("visitCategoryID") Integer visitCat
106106
return response.toString();
107107
}
108108

109+
@Operation(summary = "Get ECG abnormal findings master data")
110+
@GetMapping(value = "/ecgAbnormalFindings", produces = MediaType.APPLICATION_JSON)
111+
public String getECGAbnormalFindings() {
112+
logger.info("getECGAbnormalFindings ...");
113+
OutputResponse response = new OutputResponse();
114+
response.setResponse(commonMasterServiceImpl.getECGAbnormalFindings());
115+
logger.info("ECG abnormal findings" + response.toString());
116+
return response.toString();
117+
}
118+
109119
}
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
/*
2+
* AMRIT – Accessible Medical Records via Integrated Technology
3+
* Integrated EHR (Electronic Health Records) Solution
4+
*
5+
* Copyright (C) "Piramal Swasthya Management and Research Institute"
6+
*
7+
* This file is part of AMRIT.
8+
*
9+
* This program is free software: you can redistribute it and/or modify
10+
* it under the terms of the GNU General Public License as published by
11+
* the Free Software Foundation, either version 3 of the License, or
12+
* (at your option) any later version.
13+
*
14+
* This program is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
* GNU General Public License for more details.
18+
*
19+
* You should have received a copy of the GNU General Public License
20+
* along with this program. If not, see https://www.gnu.org/licenses/.
21+
*/
22+
package com.iemr.tm.data.labModule;
23+
24+
import java.sql.Timestamp;
25+
26+
import jakarta.persistence.Column;
27+
import jakarta.persistence.Entity;
28+
import jakarta.persistence.GeneratedValue;
29+
import jakarta.persistence.GenerationType;
30+
import jakarta.persistence.Id;
31+
import jakarta.persistence.Table;
32+
33+
import com.google.gson.annotations.Expose;
34+
35+
@Entity
36+
@Table(name = "m_ecgAbnormalFindings")
37+
public class ECGAbnormalFindingMaster {
38+
39+
@Id
40+
@GeneratedValue(strategy = GenerationType.IDENTITY)
41+
@Expose
42+
@Column(name = "FindingID")
43+
private Integer findingID;
44+
45+
@Expose
46+
@Column(name = "FindingName")
47+
private String findingName;
48+
49+
@Expose
50+
@Column(name = "Deleted", insertable = false, updatable = false)
51+
private Boolean deleted;
52+
53+
@Expose
54+
@Column(name = "Processed", insertable = false, updatable = false)
55+
private String processed;
56+
57+
@Expose
58+
@Column(name = "CreatedBy")
59+
private String createdBy;
60+
61+
@Expose
62+
@Column(name = "CreatedDate", insertable = false, updatable = false)
63+
private Timestamp createdDate;
64+
65+
@Expose
66+
@Column(name = "ModifiedBy")
67+
private String modifiedBy;
68+
69+
@Expose
70+
@Column(name = "LastModDate", insertable = false)
71+
private Timestamp lastModDate;
72+
73+
public Integer getFindingID() {
74+
return findingID;
75+
}
76+
77+
public void setFindingID(Integer findingID) {
78+
this.findingID = findingID;
79+
}
80+
81+
public String getFindingName() {
82+
return findingName;
83+
}
84+
85+
public void setFindingName(String findingName) {
86+
this.findingName = findingName;
87+
}
88+
89+
public Boolean getDeleted() {
90+
return deleted;
91+
}
92+
93+
public void setDeleted(Boolean deleted) {
94+
this.deleted = deleted;
95+
}
96+
97+
public String getProcessed() {
98+
return processed;
99+
}
100+
101+
public void setProcessed(String processed) {
102+
this.processed = processed;
103+
}
104+
105+
public String getCreatedBy() {
106+
return createdBy;
107+
}
108+
109+
public void setCreatedBy(String createdBy) {
110+
this.createdBy = createdBy;
111+
}
112+
113+
public Timestamp getCreatedDate() {
114+
return createdDate;
115+
}
116+
117+
public void setCreatedDate(Timestamp createdDate) {
118+
this.createdDate = createdDate;
119+
}
120+
121+
public String getModifiedBy() {
122+
return modifiedBy;
123+
}
124+
125+
public void setModifiedBy(String modifiedBy) {
126+
this.modifiedBy = modifiedBy;
127+
}
128+
129+
public Timestamp getLastModDate() {
130+
return lastModDate;
131+
}
132+
133+
public void setLastModDate(Timestamp lastModDate) {
134+
this.lastModDate = lastModDate;
135+
}
136+
}

src/main/java/com/iemr/tm/data/labModule/LabResultEntry.java

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import java.util.Map;
3333

3434
import jakarta.persistence.Column;
35+
import jakarta.persistence.Convert;
3536
import jakarta.persistence.Entity;
3637
import jakarta.persistence.GeneratedValue;
3738
import jakarta.persistence.GenerationType;
@@ -42,6 +43,7 @@
4243
import jakarta.persistence.Transient;
4344

4445
import com.google.gson.annotations.Expose;
46+
import com.iemr.tm.utils.IntegerListConverter;
4547

4648
@Entity
4749
@Table(name = "t_lab_testresult")
@@ -97,6 +99,11 @@ public class LabResultEntry {
9799
@Expose
98100
private String remarks;
99101

102+
@Expose
103+
@Column(name = "abnormal_findings", columnDefinition = "json")
104+
@Convert(converter = IntegerListConverter.class)
105+
private List<Integer> abnormalFindings;
106+
100107
@Transient
101108
private List<Map<String, String>> compList;
102109

@@ -278,6 +285,7 @@ public static ArrayList<LabResultEntry> getLabResultEntry(ArrayList<LabResultEnt
278285
tmpOBJ.setProcedureName(obj.getProcedureData().getProcedureName());
279286
tmpOBJ.setProcedureType(obj.getProcedureData().getProcedureType());
280287
tmpOBJ.setCreatedDate(obj.getCreatedDate());
288+
tmpOBJ.setAbnormalFindings(obj.getAbnormalFindings());
281289

282290
compDetails = new HashMap<String, Object>();
283291
compDetails.put("testComponentID", obj.getTestComponentID());
@@ -306,6 +314,13 @@ public static ArrayList<LabResultEntry> getLabResultEntry(ArrayList<LabResultEnt
306314

307315
compDetails.put("remarks", obj.getRemarks());
308316

317+
// Add abnormal findings for ECG procedures
318+
if (obj.getProcedureData() != null && obj.getProcedureData().getProcedureName() != null
319+
&& obj.getProcedureData().getProcedureName().equalsIgnoreCase("ECG")
320+
&& obj.getAbnormalFindings() != null) {
321+
compDetails.put("abnormalFindings", obj.getAbnormalFindings());
322+
}
323+
309324
componentList = new ArrayList<>();
310325
componentList.add(compDetails);
311326
tmpOBJ.setComponentList(componentList);
@@ -341,6 +356,14 @@ public static ArrayList<LabResultEntry> getLabResultEntry(ArrayList<LabResultEnt
341356
}
342357

343358
compDetails.put("remarks", obj.getRemarks());
359+
360+
// Add abnormal findings for ECG procedures
361+
if (obj.getProcedureData() != null && obj.getProcedureData().getProcedureName() != null
362+
&& obj.getProcedureData().getProcedureName().equalsIgnoreCase("ECG")
363+
&& obj.getAbnormalFindings() != null) {
364+
compDetails.put("abnormalFindings", obj.getAbnormalFindings());
365+
}
366+
344367
componentList.add(compDetails);
345368
}
346369
}
@@ -473,6 +496,14 @@ public void setRemarks(String remarks) {
473496
this.remarks = remarks;
474497
}
475498

499+
public List<Integer> getAbnormalFindings() {
500+
return abnormalFindings;
501+
}
502+
503+
public void setAbnormalFindings(List<Integer> abnormalFindings) {
504+
this.abnormalFindings = abnormalFindings;
505+
}
506+
476507
public Boolean getDeleted() {
477508
return deleted;
478509
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* AMRIT – Accessible Medical Records via Integrated Technology
3+
* Integrated EHR (Electronic Health Records) Solution
4+
*
5+
* Copyright (C) "Piramal Swasthya Management and Research Institute"
6+
*
7+
* This file is part of AMRIT.
8+
*
9+
* This program is free software: you can redistribute it and/or modify
10+
* it under the terms of the GNU General Public License as published by
11+
* the Free Software Foundation, either version 3 of the License, or
12+
* (at your option) any later version.
13+
*
14+
* This program is distributed in the hope that it will be useful,
15+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
* GNU General Public License for more details.
18+
*
19+
* You should have received a copy of the GNU General Public License
20+
* along with this program. If not, see https://www.gnu.org/licenses/.
21+
*/
22+
package com.iemr.tm.repo.labModule;
23+
24+
import java.util.List;
25+
26+
import org.springframework.data.repository.CrudRepository;
27+
import org.springframework.stereotype.Repository;
28+
29+
import com.iemr.tm.data.labModule.ECGAbnormalFindingMaster;
30+
31+
@Repository
32+
public interface ECGAbnormalFindingMasterRepo extends CrudRepository<ECGAbnormalFindingMaster, Integer> {
33+
34+
List<ECGAbnormalFindingMaster> findByDeleted(Boolean deleted);
35+
}

src/main/java/com/iemr/tm/service/common/master/CommonMasterServiceImpl.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
import org.springframework.beans.factory.annotation.Autowired;
2525
import org.springframework.stereotype.Service;
2626

27+
import com.iemr.tm.service.labtechnician.LabTechnicianServiceImpl;
28+
2729
@Service
2830
public class CommonMasterServiceImpl implements CommonMaterService {
2931

@@ -34,12 +36,18 @@ public class CommonMasterServiceImpl implements CommonMaterService {
3436
private NCDScreeningMasterServiceImpl ncdScreeningServiceImpl;
3537
private QCMasterDataServiceImpl qCMasterDataServiceImpl;
3638
private NCDCareMasterDataServiceImpl ncdCareMasterDataServiceImpl;
39+
private LabTechnicianServiceImpl labTechnicianServiceImpl;
3740

3841
@Autowired
3942
public void setNcdCareMasterDataServiceImpl(NCDCareMasterDataServiceImpl ncdCareMasterDataServiceImpl) {
4043
this.ncdCareMasterDataServiceImpl = ncdCareMasterDataServiceImpl;
4144
}
4245

46+
@Autowired
47+
public void setLabTechnicianServiceImpl(LabTechnicianServiceImpl labTechnicianServiceImpl) {
48+
this.labTechnicianServiceImpl = labTechnicianServiceImpl;
49+
}
50+
4351
@Autowired
4452
public void setqCMasterDataServiceImpl(QCMasterDataServiceImpl qCMasterDataServiceImpl) {
4553
this.qCMasterDataServiceImpl = qCMasterDataServiceImpl;
@@ -221,4 +229,9 @@ public String getMasterDataForDoctor(Integer visitCategoryID, Integer providerSe
221229
return doctorMasterData;
222230
}
223231

232+
@Override
233+
public String getECGAbnormalFindings() {
234+
return labTechnicianServiceImpl.getECGAbnormalFindings();
235+
}
236+
224237
}

src/main/java/com/iemr/tm/service/common/master/CommonMaterService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,6 @@ public interface CommonMaterService {
3030
public String getMasterDataForDoctor(Integer visitCategoryID, Integer providerServiceMapID, String gender,
3131
Integer facilityID, Integer vanID);
3232

33+
public String getECGAbnormalFindings();
34+
3335
}

src/main/java/com/iemr/tm/service/labtechnician/LabTechnicianServiceImpl.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,11 @@
3535
import com.fasterxml.jackson.databind.ObjectMapper;
3636
import com.google.gson.Gson;
3737
import com.google.gson.JsonObject;
38+
import com.iemr.tm.data.labModule.ECGAbnormalFindingMaster;
3839
import com.iemr.tm.data.labModule.LabResultEntry;
3940
import com.iemr.tm.data.labModule.WrapperLabResultEntry;
4041
import com.iemr.tm.data.labtechnician.V_benLabTestOrderedDetails;
42+
import com.iemr.tm.repo.labModule.ECGAbnormalFindingMasterRepo;
4143
import com.iemr.tm.repo.labModule.LabResultEntryRepo;
4244
import com.iemr.tm.repo.labtechnician.V_benLabTestOrderedDetailsRepo;
4345
import com.iemr.tm.service.benFlowStatus.CommonBenStatusFlowServiceImpl;
@@ -47,6 +49,7 @@
4749
public class LabTechnicianServiceImpl implements LabTechnicianService {
4850
private V_benLabTestOrderedDetailsRepo v_benLabTestOrderedDetailsRepo;
4951
private LabResultEntryRepo labResultEntryRepo;
52+
private ECGAbnormalFindingMasterRepo ecgAbnormalFindingMasterRepo;
5053
private CommonBenStatusFlowServiceImpl commonBenStatusFlowServiceImpl;
5154

5255
@Autowired
@@ -59,6 +62,11 @@ public void setLabResultEntryRepo(LabResultEntryRepo labResultEntryRepo) {
5962
this.labResultEntryRepo = labResultEntryRepo;
6063
}
6164

65+
@Autowired
66+
public void setEcgAbnormalFindingMasterRepo(ECGAbnormalFindingMasterRepo ecgAbnormalFindingMasterRepo) {
67+
this.ecgAbnormalFindingMasterRepo = ecgAbnormalFindingMasterRepo;
68+
}
69+
6270
@Autowired
6371
public void setV_benLabTestOrderedDetailsRepo(V_benLabTestOrderedDetailsRepo v_benLabTestOrderedDetailsRepo) {
6472
this.v_benLabTestOrderedDetailsRepo = v_benLabTestOrderedDetailsRepo;
@@ -417,6 +425,7 @@ public Integer saveLabTestResult(WrapperLabResultEntry wrapperLabResults) {
417425
LabResultEntry labCompResult = new LabResultEntry();
418426
labCompResult.setPrescriptionID(labResult.getPrescriptionID());
419427
labCompResult.setProcedureID(labResult.getProcedureID());
428+
labCompResult.setAbnormalFindings(labResult.getAbnormalFindings());
420429

421430
if (null != comp.get("testComponentID") && !comp.get("testComponentID").toString().isEmpty()
422431
&& ((null != comp.get("testResultValue") && !comp.get("testResultValue").toString().isEmpty())
@@ -502,4 +511,9 @@ public String getLabResultForVisitcode(Long benRegID, Long visitCode) {
502511
ArrayList<LabResultEntry> labResultList = getLabResultDataForBen(benRegID, visitCode);
503512
return new Gson().toJson(labResultList);
504513
}
514+
515+
public String getECGAbnormalFindings() {
516+
List<ECGAbnormalFindingMaster> findings = ecgAbnormalFindingMasterRepo.findByDeleted(false);
517+
return new Gson().toJson(findings);
518+
}
505519
}

0 commit comments

Comments
 (0)