Skip to content
Open
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
3 changes: 3 additions & 0 deletions src/main/environment/common_ci.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ fhir-url=@env.FHIR_API@
# Redis Config
spring.redis.host=@env.REDIS_HOST@

# Stop TB: when true, RMNCH data sync fails with an error if camp (vanID) is not configured
stoptb.enforce.vanid=@env.STOPTB_ENFORCE_VANID@

cors.allowed-origins=@env.CORS_ALLOWED_ORIGINS@

# Elasticsearch Configuration
Expand Down
3 changes: 3 additions & 0 deletions src/main/environment/common_docker.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ fhir-url=${FHIR_API}
# Redis Config
spring.redis.host=${REDIS_HOST}

# Stop TB: when true, RMNCH data sync fails with an error if camp (vanID) is not configured
stoptb.enforce.vanid=${STOPTB_ENFORCE_VANID}

cors.allowed-origins=${CORS_ALLOWED_ORIGINS}

# Elasticsearch Configuration
Expand Down
5 changes: 5 additions & 0 deletions src/main/environment/common_example.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ fhir-url=http://localhost:8093/

# Redis Config
spring.redis.host=localhost

# Stop TB: when true, RMNCH data sync fails with an error if camp (vanID) is not
# configured instead of silently skipping vanID stamping
stoptb.enforce.vanid=false

cors.allowed-origins=http://localhost:*

# Elasticsearch Configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,11 @@ public String createIdentity(@Param(value = "{\r\n" + " \"eventTypeName\": \"St
+ " \"createdDate\": \"Timestamp\"\r\n" + " \"faceEmbedding\": [\"Float\"]\r\n" + "}") @RequestBody String identityData) throws IEMRException {
logger.info("IdentityController.createIdentity - start");

// Bare Gson matches Common-API's RegisterBenificiaryServiceImpl, which also
// serializes the outgoing identity payload with a bare new Gson(). dob relies
// on this symmetric default format; gpsTimestamp is still parsed correctly via
// its field-level @JsonAdapter(GpsTimestampAdapter.class) on Address, which
// works regardless of which Gson instance performs the parse.
IdentityDTO identity = new Gson().fromJson(identityData, IdentityDTO.class);
logger.info("identity hit: " + identity);
BeneficiaryCreateResp map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
import jakarta.persistence.Transient;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.JsonAdapter;
import com.iemr.common.identity.mapper.GpsTimestampAdapter;

import lombok.Data;

Expand Down Expand Up @@ -390,6 +392,9 @@ public class RMNCHBeneficiaryDetailsRmnch {
@Expose
@Transient
private String addressLine3;
@Expose
@Transient
private String pinCode;

// ----------------------------------------------

Expand Down Expand Up @@ -557,4 +562,45 @@ public class RMNCHBeneficiaryDetailsRmnch {
@Expose
@Transient
private String familyId;

// Anthropometry fields sent by Stop TB mobile app via beneficiaryDetails payload.
// i_beneficiarydetails_rmnch has no these columns β€” stored in i_beneficiarydetails.otherFields instead.
@Expose
@Transient
private Double height;
@Expose
@Transient
private Double weight;
@Expose
@Transient
private Double bmi;
@Expose
@Transient
private Double temperature; // stored as "temperatureValue" in otherFields to match getBeneficiaryData key

@Expose
@Column(name = "gpsLatitude")
private Double gpsLatitude;

@Expose
@Column(name = "gpsLongitude")
private Double gpsLongitude;

@Expose
@Column(name = "digipin")
private String digipin;

@Expose
@Column(name = "gpsTimestamp")
@JsonAdapter(GpsTimestampAdapter.class)
private Timestamp gpsTimestamp;

@Expose
@Column(name = "isGpsUnavailable", nullable = false, columnDefinition = "TINYINT(1) DEFAULT 0")
private Boolean isGpsUnavailable = false;

@Expose
@Column(name = "gpsUnavailableReason")
private String gpsUnavailableReason;

}
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
/*
* 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
* 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.common.identity.data.rmnch;

import java.sql.Timestamp;
Expand All @@ -31,11 +31,14 @@
import jakarta.persistence.Table;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.iemr.common.identity.mapper.GpsTimestampAdapter;

import lombok.Data;

/**
*
*
* @author de40034072
*
*/
Expand Down Expand Up @@ -359,4 +362,31 @@ public class RMNCHHouseHoldDetails {
@Column(name = "mohallaName")
private String mohallaName;

@Expose
@SerializedName("latitude")
@Column(name = "gpsLatitude")
private Double gpsLatitude;

@Expose
@SerializedName("longitude")
@Column(name = "gpsLongitude")
private Double gpsLongitude;

@Expose
@Column(name = "digipin")
private String digipin;

@Expose
@Column(name = "gpsTimestamp")
@JsonAdapter(GpsTimestampAdapter.class)
private Timestamp gpsTimestamp;

@Expose
@Column(name = "isGpsUnavailable", nullable = false, columnDefinition = "TINYINT(1) DEFAULT 0")
private Boolean isGpsUnavailable = false;

@Expose
@Column(name = "gpsUnavailableReason")
private String gpsUnavailableReason;

}
12 changes: 12 additions & 0 deletions src/main/java/com/iemr/common/identity/domain/Address.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@

import lombok.Data;

import java.sql.Timestamp;

import com.google.gson.annotations.JsonAdapter;
import com.iemr.common.identity.mapper.GpsTimestampAdapter;

public @Data class Address {
private String addrLine1;
private String addrLine2;
Expand Down Expand Up @@ -51,4 +56,11 @@

private Integer vanID;
private Integer parkingPlaceID;
private Double gpsLatitude;
private Double gpsLongitude;
private String digipin;
@JsonAdapter(GpsTimestampAdapter.class)
private Timestamp gpsTimestamp;
private Boolean isGpsUnavailable;
private String gpsUnavailableReason;
}
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
/*
* 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
* 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.common.identity.domain;

import java.io.Serializable;
Expand All @@ -39,7 +39,7 @@

/**
* The persistent class for the m_beneficiaryaddress database table.
*
*
*/
@Entity
@Table(name = "i_beneficiaryaddress")
Expand Down Expand Up @@ -260,6 +260,24 @@ public class MBeneficiaryaddress implements Serializable {

// END OF new column added for data sync

@Column(name = "gpsLatitude")
private Double gpsLatitude;

@Column(name = "gpsLongitude")
private Double gpsLongitude;

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

@Column(name = "gpsTimestamp")
private Timestamp gpsTimestamp;

@Column(name = "isGpsUnavailable", nullable = false, columnDefinition = "TINYINT(1) DEFAULT 0")
private Boolean isGpsUnavailable = false;

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

public MBeneficiaryaddress setCurrentAddress(Address address) {
this.currAddrLine1 = address.getAddrLine1();
this.currAddrLine2 = address.getAddrLine2();
Expand Down
Loading
Loading