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
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,14 @@ public String DoctorMasterData(@PathVariable("visitCategoryID") Integer visitCat
return response.toString();
}

@Operation(summary = "Get ECG abnormal findings master data")
@GetMapping(value = "/ecgAbnormalFindings", produces = MediaType.APPLICATION_JSON)
public String getECGAbnormalFindings() {
logger.info("getECGAbnormalFindings ...");
OutputResponse response = new OutputResponse();
response.setResponse(commonMasterServiceImpl.getECGAbnormalFindings());
logger.info("ECG abnormal findings" + response.toString());
return response.toString();
}

}
136 changes: 136 additions & 0 deletions src/main/java/com/iemr/tm/data/labModule/ECGAbnormalFindingMaster.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
/*
* 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/.
*/
package com.iemr.tm.data.labModule;

import java.sql.Timestamp;

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 com.google.gson.annotations.Expose;

@Entity
@Table(name = "m_ecgAbnormalFindings")
public class ECGAbnormalFindingMaster {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Expose
@Column(name = "FindingID")
private Integer findingID;

@Expose
@Column(name = "FindingName")
private String findingName;

@Expose
@Column(name = "Deleted", insertable = false, updatable = false)
private Boolean deleted;

@Expose
@Column(name = "Processed", insertable = false, updatable = false)
private String processed;

@Expose
@Column(name = "CreatedBy")
private String createdBy;

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

@Expose
@Column(name = "ModifiedBy")
private String modifiedBy;

@Expose
@Column(name = "LastModDate", insertable = false)
private Timestamp lastModDate;

public Integer getFindingID() {
return findingID;
}

public void setFindingID(Integer findingID) {
this.findingID = findingID;
}

public String getFindingName() {
return findingName;
}

public void setFindingName(String findingName) {
this.findingName = findingName;
}

public Boolean getDeleted() {
return deleted;
}

public void setDeleted(Boolean deleted) {
this.deleted = deleted;
}

public String getProcessed() {
return processed;
}

public void setProcessed(String processed) {
this.processed = processed;
}

public String getCreatedBy() {
return createdBy;
}

public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}

public Timestamp getCreatedDate() {
return createdDate;
}

public void setCreatedDate(Timestamp createdDate) {
this.createdDate = createdDate;
}

public String getModifiedBy() {
return modifiedBy;
}

public void setModifiedBy(String modifiedBy) {
this.modifiedBy = modifiedBy;
}

public Timestamp getLastModDate() {
return lastModDate;
}

public void setLastModDate(Timestamp lastModDate) {
this.lastModDate = lastModDate;
}
}
31 changes: 31 additions & 0 deletions src/main/java/com/iemr/tm/data/labModule/LabResultEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import java.util.Map;

import jakarta.persistence.Column;
import jakarta.persistence.Convert;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
Expand All @@ -42,6 +43,7 @@
import jakarta.persistence.Transient;

import com.google.gson.annotations.Expose;
import com.iemr.tm.utils.IntegerListConverter;

@Entity
@Table(name = "t_lab_testresult")
Expand Down Expand Up @@ -97,6 +99,11 @@ public class LabResultEntry {
@Expose
private String remarks;

@Expose
@Column(name = "abnormal_findings", columnDefinition = "json")
@Convert(converter = IntegerListConverter.class)
private List<Integer> abnormalFindings;

@Transient
private List<Map<String, String>> compList;

Expand Down Expand Up @@ -278,6 +285,7 @@ public static ArrayList<LabResultEntry> getLabResultEntry(ArrayList<LabResultEnt
tmpOBJ.setProcedureName(obj.getProcedureData().getProcedureName());
tmpOBJ.setProcedureType(obj.getProcedureData().getProcedureType());
tmpOBJ.setCreatedDate(obj.getCreatedDate());
tmpOBJ.setAbnormalFindings(obj.getAbnormalFindings());

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

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

// Add abnormal findings for ECG procedures
if (obj.getProcedureData() != null && obj.getProcedureData().getProcedureName() != null
&& obj.getProcedureData().getProcedureName().equalsIgnoreCase("ECG")
&& obj.getAbnormalFindings() != null) {
compDetails.put("abnormalFindings", obj.getAbnormalFindings());
}

componentList = new ArrayList<>();
componentList.add(compDetails);
tmpOBJ.setComponentList(componentList);
Expand Down Expand Up @@ -341,6 +356,14 @@ public static ArrayList<LabResultEntry> getLabResultEntry(ArrayList<LabResultEnt
}

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

// Add abnormal findings for ECG procedures
if (obj.getProcedureData() != null && obj.getProcedureData().getProcedureName() != null
&& obj.getProcedureData().getProcedureName().equalsIgnoreCase("ECG")
&& obj.getAbnormalFindings() != null) {
compDetails.put("abnormalFindings", obj.getAbnormalFindings());
}

componentList.add(compDetails);
}
}
Expand Down Expand Up @@ -473,6 +496,14 @@ public void setRemarks(String remarks) {
this.remarks = remarks;
}

public List<Integer> getAbnormalFindings() {
return abnormalFindings;
}

public void setAbnormalFindings(List<Integer> abnormalFindings) {
this.abnormalFindings = abnormalFindings;
}

public Boolean getDeleted() {
return deleted;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* 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/.
*/
package com.iemr.tm.repo.labModule;

import java.util.List;

import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import com.iemr.tm.data.labModule.ECGAbnormalFindingMaster;

@Repository
public interface ECGAbnormalFindingMasterRepo extends CrudRepository<ECGAbnormalFindingMaster, Integer> {

List<ECGAbnormalFindingMaster> findByDeleted(Boolean deleted);
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.iemr.tm.service.labtechnician.LabTechnicianServiceImpl;

@Service
public class CommonMasterServiceImpl implements CommonMaterService {

Expand All @@ -34,12 +36,18 @@ public class CommonMasterServiceImpl implements CommonMaterService {
private NCDScreeningMasterServiceImpl ncdScreeningServiceImpl;
private QCMasterDataServiceImpl qCMasterDataServiceImpl;
private NCDCareMasterDataServiceImpl ncdCareMasterDataServiceImpl;
private LabTechnicianServiceImpl labTechnicianServiceImpl;

@Autowired
public void setNcdCareMasterDataServiceImpl(NCDCareMasterDataServiceImpl ncdCareMasterDataServiceImpl) {
this.ncdCareMasterDataServiceImpl = ncdCareMasterDataServiceImpl;
}

@Autowired
public void setLabTechnicianServiceImpl(LabTechnicianServiceImpl labTechnicianServiceImpl) {
this.labTechnicianServiceImpl = labTechnicianServiceImpl;
}

@Autowired
public void setqCMasterDataServiceImpl(QCMasterDataServiceImpl qCMasterDataServiceImpl) {
this.qCMasterDataServiceImpl = qCMasterDataServiceImpl;
Expand Down Expand Up @@ -221,4 +229,9 @@ public String getMasterDataForDoctor(Integer visitCategoryID, Integer providerSe
return doctorMasterData;
}

@Override
public String getECGAbnormalFindings() {
return labTechnicianServiceImpl.getECGAbnormalFindings();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ public interface CommonMaterService {
public String getMasterDataForDoctor(Integer visitCategoryID, Integer providerServiceMapID, String gender,
Integer facilityID, Integer vanID);

public String getECGAbnormalFindings();

}
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.iemr.tm.data.labModule.ECGAbnormalFindingMaster;
import com.iemr.tm.data.labModule.LabResultEntry;
import com.iemr.tm.data.labModule.WrapperLabResultEntry;
import com.iemr.tm.data.labtechnician.V_benLabTestOrderedDetails;
import com.iemr.tm.repo.labModule.ECGAbnormalFindingMasterRepo;
import com.iemr.tm.repo.labModule.LabResultEntryRepo;
import com.iemr.tm.repo.labtechnician.V_benLabTestOrderedDetailsRepo;
import com.iemr.tm.service.benFlowStatus.CommonBenStatusFlowServiceImpl;
Expand All @@ -47,6 +49,7 @@
public class LabTechnicianServiceImpl implements LabTechnicianService {
private V_benLabTestOrderedDetailsRepo v_benLabTestOrderedDetailsRepo;
private LabResultEntryRepo labResultEntryRepo;
private ECGAbnormalFindingMasterRepo ecgAbnormalFindingMasterRepo;
private CommonBenStatusFlowServiceImpl commonBenStatusFlowServiceImpl;

@Autowired
Expand All @@ -59,6 +62,11 @@ public void setLabResultEntryRepo(LabResultEntryRepo labResultEntryRepo) {
this.labResultEntryRepo = labResultEntryRepo;
}

@Autowired
public void setEcgAbnormalFindingMasterRepo(ECGAbnormalFindingMasterRepo ecgAbnormalFindingMasterRepo) {
this.ecgAbnormalFindingMasterRepo = ecgAbnormalFindingMasterRepo;
}

@Autowired
public void setV_benLabTestOrderedDetailsRepo(V_benLabTestOrderedDetailsRepo v_benLabTestOrderedDetailsRepo) {
this.v_benLabTestOrderedDetailsRepo = v_benLabTestOrderedDetailsRepo;
Expand Down Expand Up @@ -417,6 +425,7 @@ public Integer saveLabTestResult(WrapperLabResultEntry wrapperLabResults) {
LabResultEntry labCompResult = new LabResultEntry();
labCompResult.setPrescriptionID(labResult.getPrescriptionID());
labCompResult.setProcedureID(labResult.getProcedureID());
labCompResult.setAbnormalFindings(labResult.getAbnormalFindings());

if (null != comp.get("testComponentID") && !comp.get("testComponentID").toString().isEmpty()
&& ((null != comp.get("testResultValue") && !comp.get("testResultValue").toString().isEmpty())
Expand Down Expand Up @@ -502,4 +511,9 @@ public String getLabResultForVisitcode(Long benRegID, Long visitCode) {
ArrayList<LabResultEntry> labResultList = getLabResultDataForBen(benRegID, visitCode);
return new Gson().toJson(labResultList);
}

public String getECGAbnormalFindings() {
List<ECGAbnormalFindingMaster> findings = ecgAbnormalFindingMasterRepo.findByDeleted(false);
return new Gson().toJson(findings);
}
}
Loading