Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetBenHealthIdDetails API changes #64

Open
wants to merge 27 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
41a4bc0
Modified tnxId keyword to txnId
Dec 13, 2024
55e4881
Abha-address search API changes
Dec 13, 2024
08f485f
Merge branch 'PSMRI:develop' into develop
helenKaryamsetty Dec 13, 2024
f3445cb
added validation for multiple phraddress
Dec 16, 2024
cb328f1
Merge branch 'PSMRI:develop' into develop
helenKaryamsetty Dec 16, 2024
f967118
Abha-address search response changes
Dec 17, 2024
8430a37
Save facility id variable change chnages
Jan 7, 2025
246bf2a
Merge branch 'develop' of https://github.com/helenKaryamsetty/FHIR-AP…
Jan 7, 2025
68a81b3
Added check to avoid multiple save of single care-context
Jan 9, 2025
65e3751
Merge branch 'develop' into develop
helenKaryamsetty Jan 9, 2025
44df923
removed unused variables
Jan 9, 2025
e329b5c
Merge branch 'develop' of https://github.com/helenKaryamsetty/FHIR-AP…
Jan 9, 2025
9c3b51f
Updated public key certificate API
Jan 30, 2025
82f88e6
Merge branch 'PSMRI:develop' into develop
helenKaryamsetty Jan 30, 2025
114cfff
Integrated Abha session v3 APIs and Profile login user verify APIs
Feb 24, 2025
e67eca9
Merge branch 'PSMRI:develop' into develop
helenKaryamsetty Feb 24, 2025
cc1b252
committed coderabitai suggested
Feb 25, 2025
cf66e78
Merge branch 'develop' of https://github.com/helenKaryamsetty/FHIR-AP…
Feb 25, 2025
c38d099
Revert "jwt implementation changes (#53)"
Feb 26, 2025
da3053d
data Sync for FLW API changes
Feb 26, 2025
c28dccb
Merge branch 'PSMRI:develop' into develop
helenKaryamsetty Feb 26, 2025
38dd846
Reapply "jwt implementation changes (#53)"
Feb 26, 2025
d9201ff
Merge branch 'develop' of https://github.com/helenKaryamsetty/FHIR-AP…
Feb 26, 2025
43d6b48
changed variable type default value as false
Feb 27, 2025
86a06f5
addition of isNewAbha in getHealthIdDetails API
Feb 27, 2025
c75dfdd
Merge branch 'PSMRI:develop' into develop
helenKaryamsetty Feb 27, 2025
4cbaf06
Merge branch 'develop' of https://github.com/helenKaryamsetty/FHIR-AP…
Feb 27, 2025
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
84 changes: 5 additions & 79 deletions src/main/java/com/wipro/fhir/data/healthID/BenHealthIDMapping.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import jakarta.persistence.Transient;
import lombok.Data;

import com.google.gson.annotations.Expose;
@Entity
@Table(name = "m_benhealthidmapping")
@Data
public class BenHealthIDMapping {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
Expand All @@ -57,13 +59,6 @@ public class BenHealthIDMapping {
@Expose
@Column(name = "AuthenticationMode")
String authenticationMode;

public String getAuthenticationMode() {
return authenticationMode;
}
public void setAuthenticationMode(String authenticationMode) {
this.authenticationMode = authenticationMode;
}
@Column(name = "Deleted", insertable = false, updatable = true)
private Boolean deleted = false;
@Expose
Expand All @@ -79,77 +74,8 @@ public void setAuthenticationMode(String authenticationMode) {
private String modifiedBy;
@Column(name = "LastModDate", insertable = false, updatable = false)
private Timestamp lastModDate;
public Integer getBenHealthID() {
return benHealthID;
}
public void setBenHealthID(Integer benHealthID) {
this.benHealthID = benHealthID;
}
public String getHealthIdNumber() {
return healthIdNumber;
}
public void setHealthIdNumber(String healthIdNumber) {
this.healthIdNumber = healthIdNumber;
}
public Integer getProviderServiceMapID() {
return providerServiceMapId;
}
public void setProviderServiceMapID(Integer providerServiceMapID) {
this.providerServiceMapId = providerServiceMapID;
}
public Long getBeneficiaryRegId() {
return beneficiaryRegID;
}
public void setBeneficiaryRegId(Long beneficiaryRegId) {
this.beneficiaryRegID = beneficiaryRegId;
}
public String getHealthId() {
return healthId;
}
public void setHealthId(String healthId) {
this.healthId = healthId;
}
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;
}
public Long getBeneficiaryID() {
return beneficiaryID;
}
public void setBeneficiaryID(Long beneficiaryID) {
this.beneficiaryID = beneficiaryID;
}

@Transient
private boolean isNewAbha;

}
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,8 @@ public interface BenHealthIDMappingRepo extends CrudRepository<BenHealthIDMappin
@Modifying
@Query(value = "UPDATE db_iemr.t_benvisitdetail SET AbdmFacilityID = :abdmFacilityId WHERE VisitCode= :visitCode", nativeQuery = true)
Integer updateFacilityIdForVisit(@Param("visitCode") BigInteger visitCode, @Param("abdmFacilityId") String abdmFacilityId);

@Query(value = "select isNewAbha from t_healthid where HealthIdNumber=:healthIdNumber order by 1 desc limit 1", nativeQuery = true)
boolean getIsNewAbha(@Param("healthIdNumber") String healthIdNumber);

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
Expand Down Expand Up @@ -61,14 +62,14 @@ public String mapHealthIDToBeneficiary(String request) throws FHIRException {
BenHealthIDMapping health = InputMapper.gson().fromJson(request, BenHealthIDMapping.class);
health = InputMapper.gson().fromJson(request, BenHealthIDMapping.class);
try {
if (health.getBeneficiaryRegId() == null && health.getBeneficiaryID() == null)
if (health.getBeneficiaryRegID() == null && health.getBeneficiaryID() == null)
throw new FHIRException("Error in mapping request");
if (health.getBeneficiaryRegId() != null)
if (health.getBeneficiaryRegID() != null)
health = benHealthIDMappingRepo.save(health);
else {
if (health.getBeneficiaryID() != null) {
Long check1 = benHealthIDMappingRepo.getBenRegID(health.getBeneficiaryID());
health.setBeneficiaryRegId(check1);
health.setBeneficiaryRegID(check1);
health = benHealthIDMappingRepo.save(health);
}
}
Expand Down Expand Up @@ -116,7 +117,18 @@ public String getBenHealthID(Long benRegID) {
Map<String, Object> resMap = new HashMap<>();

ArrayList<BenHealthIDMapping> healthDetailsList = benHealthIDMappingRepo.getHealthDetails(benRegID);
resMap.put("BenHealthDetails", new Gson().toJson(healthDetailsList));
ArrayList<BenHealthIDMapping> healthDetailsWithAbhaList = new ArrayList<>();

if(healthDetailsList.size() > 0) {
for(BenHealthIDMapping healthDetails: healthDetailsList) {
String healthIdNumber = healthDetails.getHealthIdNumber();
boolean isNewAbha = benHealthIDMappingRepo.getIsNewAbha(healthIdNumber);
healthDetails.setNewAbha(isNewAbha);

healthDetailsWithAbhaList.add(healthDetails);
}
}
resMap.put("BenHealthDetails", new Gson().toJson(healthDetailsWithAbhaList));

return resMap.toString();
}
Expand Down
Loading