map = new HashMap<>();
+ map.put(FlwConstants.STATE_ID, getStateId());
+ map.put(FlwConstants.DISTRICT_ID, getDistrictId());
+ map.put(FlwConstants.DISTRICT_NAME, getDistrictName());
+ map.put(FlwConstants.TALUKA_ID, getTalukaId());
+ map.put(FlwConstants.TALUKA_NAME, getTalukaName());
+ map.put(FlwConstants.HEALTH_BLOCK_ID, getHealthBlockId());
+ map.put(FlwConstants.HEALTH_BLOCK_NAME, getHealthBlockName());
+ map.put(FlwConstants.PHC_ID, getPhcId());
+ map.put(FlwConstants.PHC_NAME, getPhcName());
+ map.put(FlwConstants.SUB_CENTRE_ID, getSubCentreId());
+ map.put(FlwConstants.SUB_CENTRE_NAME, getSubCentreName());
+ map.put(FlwConstants.CENSUS_VILLAGE_ID, getVillageId());
+ map.put(FlwConstants.VILLAGE_NAME, getVillageName());
+ map.put(FlwConstants.GF_ID, getGfId() == null ? null : getGfId().toString());
+ map.put(FlwConstants.MOBILE_NO, getMobileNo() == null ? null : Long.parseLong(getMobileNo()));
+ map.put(FlwConstants.GF_NAME, getGfName());
+ map.put(FlwConstants.GF_TYPE, getGfType());
+ map.put(FlwConstants.EXEC_DATE, "".equals(getExecDate()) ? null : LocalDate.parse(getExecDate(), DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ss.SSSZ")));
+ map.put(FlwConstants.GF_STATUS, getGfStatus());
+ return map;
+ }
+}
diff --git a/kilkari/src/main/java/org/motechproject/nms/kilkari/contract/RchChildRecord.java b/kilkari/src/main/java/org/motechproject/nms/kilkari/contract/RchChildRecord.java
new file mode 100644
index 000000000..6555bd6d3
--- /dev/null
+++ b/kilkari/src/main/java/org/motechproject/nms/kilkari/contract/RchChildRecord.java
@@ -0,0 +1,233 @@
+package org.motechproject.nms.kilkari.contract;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlType
+@XmlAccessorType(XmlAccessType.NONE)
+public class RchChildRecord {
+
+ private Long stateId;
+ private Long districtId;
+ private String districtName;
+ private String talukaId;
+ private String talukaName;
+ private Long healthBlockId;
+ private String healthBlockName;
+ private Long phcId;
+ private String phcName;
+ private Long subCentreId;
+ private String subCentreName;
+ private Long villageId;
+ private String villageName;
+ private String name;
+ private String mobileNo;
+ private String birthdate;
+ private String registrationNo;
+ private String motherRegistrationNo;
+ private Integer entryType;
+ private String mctsId;
+ private String mctsMotherIdNo;
+ private String execDate;
+
+ public Long getStateId() {
+ return stateId;
+ }
+
+
+ public String getDistrictName() {
+ return districtName;
+ }
+
+ @XmlElement(name = "District_Name")
+ public void setDistrictName(String districtName) {
+ this.districtName = districtName;
+ }
+
+ public String getTalukaId() {
+ return talukaId;
+ }
+
+ @XmlElement(name = "Taluka_ID")
+ public void setTalukaId(String talukaId) {
+ this.talukaId = talukaId;
+ }
+
+ @XmlElement(name = "StateID")
+ public void setStateId(Long stateId) {
+ this.stateId = stateId;
+ }
+
+ public Long getDistrictId() {
+ return districtId;
+ }
+
+ @XmlElement(name = "District_ID")
+ public void setDistrictId(Long districtId) {
+ this.districtId = districtId;
+ }
+
+ public String getTalukaName() {
+ return talukaName;
+ }
+
+ @XmlElement(name = "Taluka_Name")
+ public void setTalukaName(String talukaName) {
+ this.talukaName = talukaName;
+ }
+
+ public Long getHealthBlockId() {
+ return healthBlockId;
+ }
+
+ public String getSubCentreName() {
+ return subCentreName;
+ }
+
+ @XmlElement(name = "SubCentre_Name")
+ public void setSubCentreName(String subCentreName) {
+ this.subCentreName = subCentreName;
+ }
+
+ public Long getVillageId() {
+ return villageId;
+ }
+
+ public Long getSubCentreId() {
+ return subCentreId;
+ }
+
+ @XmlElement(name = "SubCentre_ID")
+ public void setSubCentreId(Long subCentreId) {
+ this.subCentreId = subCentreId;
+ }
+
+ @XmlElement(name = "Village_ID")
+ public void setVillageId(Long villageId) {
+ this.villageId = villageId;
+ }
+
+ @XmlElement(name = "HealthBlock_ID")
+ public void setHealthBlockId(Long healthBlockId) {
+ this.healthBlockId = healthBlockId;
+ }
+
+ public String getHealthBlockName() {
+ return healthBlockName;
+ }
+
+ @XmlElement(name = "HealthBlock_Name")
+ public void setHealthBlockName(String healthBlockName) {
+ this.healthBlockName = healthBlockName;
+ }
+
+ public Long getPhcId() {
+ return phcId;
+ }
+
+ @XmlElement(name = "PHC_ID")
+ public void setPhcId(Long phcId) {
+ this.phcId = phcId;
+ }
+
+ public String getPhcName() {
+ return phcName;
+ }
+
+ @XmlElement(name = "PHC_Name")
+ public void setPhcName(String phcName) {
+ this.phcName = phcName;
+ }
+
+ public String getVillageName() {
+ return villageName;
+ }
+
+ @XmlElement(name = "Village_Name")
+ public void setVillageName(String villageName) {
+ this.villageName = villageName;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ @XmlElement(name = "Name")
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getMobileNo() {
+ return mobileNo;
+ }
+
+ @XmlElement(name = "Mobile_no")
+ public void setMobileNo(String mobileNo) {
+ this.mobileNo = mobileNo;
+ }
+
+ public String getBirthdate() {
+ return birthdate;
+ }
+
+ @XmlElement(name = "Birthdate")
+ public void setBirthdate(String birthdate) {
+ this.birthdate = birthdate;
+ }
+
+ public String getRegistrationNo() {
+ return registrationNo;
+ }
+
+ @XmlElement(name = "Registration_no")
+ public void setRegistrationNo(String registrationNo) {
+ this.registrationNo = registrationNo;
+ }
+
+ public String getMotherRegistrationNo() {
+ return motherRegistrationNo;
+ }
+
+ @XmlElement(name = "Mother_Registration_no")
+ public void setMotherRegistrationNo(String motherRegistrationNo) {
+ this.motherRegistrationNo = motherRegistrationNo;
+ }
+
+ public String getMctsId() {
+ return mctsId;
+ }
+
+ @XmlElement(name = "MCTS_ID_No")
+ public void setMctsId(String mctsId) {
+ this.mctsId = mctsId;
+ }
+
+ public String getMctsMotherIdNo() {
+ return mctsMotherIdNo;
+ }
+
+ @XmlElement(name = "MCTS_Mother_ID_No")
+ public void setMctsMotherIdNo(String mctsMotherIdNo) {
+ this.mctsMotherIdNo = mctsMotherIdNo;
+ }
+
+ public Integer getEntryType() {
+ return entryType;
+ }
+
+ @XmlElement(name = "Entry_Type")
+ public void setEntryType(Integer entryType) {
+ this.entryType = entryType;
+ }
+
+ public String getExecDate() {
+ return execDate;
+ }
+
+ @XmlElement(name = "Exec_Date")
+ public void setExecDate(String execDate) {
+ this.execDate = execDate;
+ }
+}
diff --git a/kilkari/src/main/java/org/motechproject/nms/kilkari/contract/RchDistrictRecord.java b/kilkari/src/main/java/org/motechproject/nms/kilkari/contract/RchDistrictRecord.java
new file mode 100644
index 000000000..bb91ce4a6
--- /dev/null
+++ b/kilkari/src/main/java/org/motechproject/nms/kilkari/contract/RchDistrictRecord.java
@@ -0,0 +1,47 @@
+package org.motechproject.nms.kilkari.contract;
+
+import org.joda.time.DateTime;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * Created by vishnu on 13/7/18.
+ */
+@XmlType
+@XmlAccessorType(XmlAccessType.NONE)
+public class RchDistrictRecord {
+
+ private Long districtCode;
+ private String districtName;
+ private DateTime execDate;
+
+ public Long getDistrictCode() {
+ return districtCode;
+ }
+
+ @XmlElement(name = "District_ID")
+ public void setDistrictCode(Long districtCode) {
+ this.districtCode = districtCode;
+ }
+
+ public String getDistrictName() {
+ return districtName;
+ }
+
+ @XmlElement(name = "District_Name")
+ public void setDistrictName(String districtName) {
+ this.districtName = districtName;
+ }
+
+ public DateTime getExecDate() {
+ return execDate;
+ }
+
+ @XmlElement(name = "Exec_Date")
+ public void setExecDate(DateTime execDate) {
+ this.execDate = execDate;
+ }
+}
diff --git a/kilkari/src/main/java/org/motechproject/nms/kilkari/contract/RchHealthBlockRecord.java b/kilkari/src/main/java/org/motechproject/nms/kilkari/contract/RchHealthBlockRecord.java
new file mode 100644
index 000000000..64ad36761
--- /dev/null
+++ b/kilkari/src/main/java/org/motechproject/nms/kilkari/contract/RchHealthBlockRecord.java
@@ -0,0 +1,68 @@
+package org.motechproject.nms.kilkari.contract;
+
+import org.joda.time.DateTime;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * Created by vishnu on 29/6/18.
+ */
+
+@XmlType
+@XmlAccessorType(XmlAccessType.NONE)
+public class RchHealthBlockRecord {
+
+ private Long districtCode;
+ private String talukaCode;
+ private Long healthBlockCode;
+ private String healthBlockName;
+ private DateTime execDate;
+
+ public String getHealthBlockName() {
+ return healthBlockName;
+ }
+
+ @XmlElement(name = "HealthBlock_Name")
+ public void setHealthBlockName(String healthBlockName) {
+ this.healthBlockName = healthBlockName;
+ }
+
+ public Long getDistrictCode() {
+ return districtCode;
+ }
+
+ public DateTime getExecDate() {
+ return execDate;
+ }
+
+ @XmlElement(name = "Exec_Date")
+ public void setExecDate(DateTime execDate) {
+ this.execDate = execDate;
+ }
+
+ @XmlElement(name = "District_ID")
+ public void setDistrictCode(Long districtCode) {
+ this.districtCode = districtCode;
+ }
+
+ public String getTalukaCode() {
+ return talukaCode;
+ }
+
+ @XmlElement(name = "Taluka_ID")
+ public void setTalukaCode(String talukaCode) {
+ this.talukaCode = talukaCode;
+ }
+
+ public Long getHealthBlockCode() {
+ return healthBlockCode;
+ }
+
+ @XmlElement(name = "HealthBlock_ID")
+ public void setHealthBlockCode(Long healthBlockCode) {
+ this.healthBlockCode = healthBlockCode;
+ }
+}
diff --git a/kilkari/src/main/java/org/motechproject/nms/kilkari/contract/RchHealthFacilityRecord.java b/kilkari/src/main/java/org/motechproject/nms/kilkari/contract/RchHealthFacilityRecord.java
new file mode 100644
index 000000000..0e245fed2
--- /dev/null
+++ b/kilkari/src/main/java/org/motechproject/nms/kilkari/contract/RchHealthFacilityRecord.java
@@ -0,0 +1,79 @@
+package org.motechproject.nms.kilkari.contract;
+
+import org.joda.time.DateTime;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * Created by vishnu on 13/7/18.
+ */
+
+@XmlType
+@XmlAccessorType(XmlAccessType.NONE)
+public class RchHealthFacilityRecord {
+
+ private Long districtCode;
+ private String talukaCode;
+ private Long healthBlockCode;
+ private Long healthFacilityCode;
+ private String healthFacilityName;
+ private DateTime execDate;
+
+ public Long getHealthBlockCode() {
+ return healthBlockCode;
+ }
+
+ @XmlElement(name = "HealthBlock_ID")
+ public void setHealthBlockCode(Long healthBlockCode) {
+ this.healthBlockCode = healthBlockCode;
+ }
+
+ public Long getHealthFacilityCode() {
+ return healthFacilityCode;
+ }
+
+ @XmlElement(name = "HealthFacility_ID")
+ public void setHealthFacilityCode(Long healthFacilityCode) {
+ this.healthFacilityCode = healthFacilityCode;
+ }
+
+ public String getHealthFacilityName() {
+ return healthFacilityName;
+ }
+
+ @XmlElement(name = "HealthFacility_Name")
+ public void setHealthFacilityName(String healthFacilityName) {
+ this.healthFacilityName = healthFacilityName;
+ }
+
+ public Long getDistrictCode() {
+ return districtCode;
+ }
+
+ @XmlElement(name = "District_ID")
+ public void setDistrictCode(Long districtCode) {
+ this.districtCode = districtCode;
+ }
+
+ public DateTime getExecDate() {
+ return execDate;
+ }
+
+ @XmlElement(name = "Exec_Date")
+ public void setExecDate(DateTime execDate) {
+ this.execDate = execDate;
+ }
+
+ public String getTalukaCode() {
+ return talukaCode;
+ }
+
+ @XmlElement(name = "Taluka_ID")
+ public void setTalukaCode(String talukaCode) {
+ this.talukaCode = talukaCode;
+ }
+
+}
diff --git a/kilkari/src/main/java/org/motechproject/nms/kilkari/contract/RchHealthSubFacilityRecord.java b/kilkari/src/main/java/org/motechproject/nms/kilkari/contract/RchHealthSubFacilityRecord.java
new file mode 100644
index 000000000..9b999a16d
--- /dev/null
+++ b/kilkari/src/main/java/org/motechproject/nms/kilkari/contract/RchHealthSubFacilityRecord.java
@@ -0,0 +1,80 @@
+package org.motechproject.nms.kilkari.contract;
+
+import org.joda.time.DateTime;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * Created by beehyv on 18/7/18.
+ */
+@XmlType
+@XmlAccessorType(XmlAccessType.NONE)
+public class RchHealthSubFacilityRecord {
+
+ private Long districtCode;
+ private String talukaCode;
+ private Long healthFacilityCode;
+ private Long healthSubFacilityCode;
+ private String healthSubFacilityName;
+ private DateTime execDate;
+
+ public Long getDistrictCode() {
+ return districtCode;
+ }
+
+ @XmlElement(name = "District_ID")
+ public void setDistrictCode(Long districtCode) {
+ this.districtCode = districtCode;
+ }
+
+ public String getHealthSubFacilityName() {
+ return healthSubFacilityName;
+ }
+
+ @XmlElement(name = "HealthSubFacility_Name")
+ public void setHealthSubFacilityName(String healthSubFacilityName) {
+ this.healthSubFacilityName = healthSubFacilityName;
+ }
+
+ public Long getHealthSubFacilityCode() {
+ return healthSubFacilityCode;
+ }
+
+ @XmlElement(name = "HealthSubFacility_ID")
+ public void setHealthSubFacilityCode(Long healthSubFacilityCode) {
+ this.healthSubFacilityCode = healthSubFacilityCode;
+ }
+
+ public DateTime getExecDate() {
+ return execDate;
+ }
+
+ @XmlElement(name = "Exec_Date")
+ public void setExecDate(DateTime execDate) {
+ this.execDate = execDate;
+ }
+
+ public String getTalukaCode() {
+ return talukaCode;
+ }
+
+ @XmlElement(name = "Taluka_ID")
+ public void setTalukaCode(String talukaCode) {
+ this.talukaCode = talukaCode;
+ }
+
+ public Long getHealthFacilityCode() {
+ return healthFacilityCode;
+ }
+
+ @XmlElement(name = "HealthFacility_ID")
+ public void setHealthFacilityCode(Long healthFacilityCode) {
+ this.healthFacilityCode = healthFacilityCode;
+ }
+
+
+
+}
diff --git a/kilkari/src/main/java/org/motechproject/nms/kilkari/contract/RchMotherRecord.java b/kilkari/src/main/java/org/motechproject/nms/kilkari/contract/RchMotherRecord.java
new file mode 100644
index 000000000..bba33bcb2
--- /dev/null
+++ b/kilkari/src/main/java/org/motechproject/nms/kilkari/contract/RchMotherRecord.java
@@ -0,0 +1,253 @@
+package org.motechproject.nms.kilkari.contract;
+
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlElement;
+
+@XmlType
+@XmlAccessorType(XmlAccessType.NONE)
+public class RchMotherRecord {
+
+ private Long stateId;
+ private Long districtId;
+ private String districtName;
+ private String talukaId;
+ private String talukaName;
+ private Long healthBlockId;
+ private String healthBlockName;
+ private Long phcId;
+ private String phcName;
+ private Long subCentreId;
+ private String subCentreName;
+ private Long villageId;
+ private String villageName;
+ private String mctsIdNo;
+ private String registrationNo;
+ private Long caseNo;
+ private String name;
+ private String mobileNo;
+ private String lmpDate;
+ private String birthDate;
+ private String abortionType;
+ private String deliveryOutcomes;
+ private Integer entryType;
+ private String execDate;
+
+ public Long getStateId() {
+ return stateId;
+ }
+
+ @XmlElement(name = "StateID")
+ public void setStateId(Long stateId) {
+ this.stateId = stateId;
+ }
+
+ public Long getDistrictId() {
+ return districtId;
+ }
+
+ @XmlElement(name = "District_ID")
+ public void setDistrictId(Long districtId) {
+ this.districtId = districtId;
+ }
+
+ public Long getHealthBlockId() {
+ return healthBlockId;
+ }
+
+ @XmlElement(name = "HealthBlock_ID")
+ public void setHealthBlockId(Long healthBlockId) {
+ this.healthBlockId = healthBlockId;
+ }
+
+ public String getHealthBlockName() {
+ return healthBlockName;
+ }
+
+ @XmlElement(name = "HealthBlock_Name")
+ public void setHealthBlockName(String healthBlockName) {
+ this.healthBlockName = healthBlockName;
+ }
+
+ public Long getPhcId() {
+ return phcId;
+ }
+
+ public String getDistrictName() {
+ return districtName;
+ }
+
+ @XmlElement(name = "District_Name")
+ public void setDistrictName(String districtName) {
+ this.districtName = districtName;
+ }
+
+ public String getTalukaId() {
+ return talukaId;
+ }
+
+ @XmlElement(name = "Taluka_ID")
+ public void setTalukaId(String talukaId) {
+ this.talukaId = talukaId;
+ }
+
+ public String getTalukaName() {
+ return talukaName;
+ }
+
+ @XmlElement(name = "Taluka_Name")
+ public void setTalukaName(String talukaName) {
+ this.talukaName = talukaName;
+ }
+
+ @XmlElement(name = "PHC_ID")
+ public void setPhcId(Long phcId) {
+ this.phcId = phcId;
+ }
+
+ public String getPhcName() {
+ return phcName;
+ }
+
+ @XmlElement(name = "PHC_Name")
+ public void setPhcName(String phcName) {
+ this.phcName = phcName;
+ }
+
+ public Long getSubCentreId() {
+ return subCentreId;
+ }
+
+ @XmlElement(name = "SubCentre_ID")
+ public void setSubCentreId(Long subCentreId) {
+ this.subCentreId = subCentreId;
+ }
+
+ public String getSubCentreName() {
+ return subCentreName;
+ }
+
+ @XmlElement(name = "SubCentre_Name")
+ public void setSubCentreName(String subCentreName) {
+ this.subCentreName = subCentreName;
+ }
+
+ public Long getVillageId() {
+ return villageId;
+ }
+
+ @XmlElement(name = "Village_ID")
+ public void setVillageId(Long villageId) {
+ this.villageId = villageId;
+ }
+
+ public String getVillageName() {
+ return villageName;
+ }
+
+ @XmlElement(name = "Village_Name")
+ public void setVillageName(String villageName) {
+ this.villageName = villageName;
+ }
+
+ public String getMctsIdNo() {
+ return mctsIdNo;
+ }
+
+ @XmlElement(name = "MCTS_ID_No")
+ public void setMctsIdNo(String mctsIdNo) {
+ this.mctsIdNo = mctsIdNo;
+ }
+
+ public String getRegistrationNo() {
+ return registrationNo;
+ }
+
+ @XmlElement(name = "Registration_no")
+ public void setRegistrationNo(String registrationNo) {
+ this.registrationNo = registrationNo;
+ }
+
+ public Long getCaseNo() {
+ return caseNo;
+ }
+
+ @XmlElement(name = "Case_no")
+ public void setCaseNo(Long caseNo) {
+ this.caseNo = caseNo;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ @XmlElement(name = "Name")
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getMobileNo() {
+ return mobileNo;
+ }
+
+ @XmlElement(name = "Mobile_no")
+ public void setMobileNo(String mobileNo) {
+ this.mobileNo = mobileNo;
+ }
+
+ public String getLmpDate() {
+ return lmpDate;
+ }
+
+ @XmlElement(name = "LMP_Date")
+ public void setLmpDate(String lmpDate) {
+ this.lmpDate = lmpDate;
+ }
+
+ public String getBirthDate() {
+ return birthDate;
+ }
+
+ @XmlElement(name = "Birthdate")
+ public void setBirthDate(String birthDate) {
+ this.birthDate = birthDate;
+ }
+
+ public String getAbortionType() {
+ return abortionType;
+ }
+
+ @XmlElement(name = "Abortion_Type")
+ public void setAbortionType(String abortionType) {
+ this.abortionType = abortionType;
+ }
+
+ public String getDeliveryOutcomes() {
+ return deliveryOutcomes;
+ }
+
+ @XmlElement(name = "Delivery_Outcomes")
+ public void setDeliveryOutcomes(String deliveryOutcomes) {
+ this.deliveryOutcomes = deliveryOutcomes;
+ }
+
+ public Integer getEntryType() {
+ return entryType;
+ }
+
+ @XmlElement(name = "Entry_Type")
+ public void setEntryType(Integer entryType) {
+ this.entryType = entryType;
+ }
+
+ public String getExecDate() {
+ return execDate;
+ }
+
+ @XmlElement(name = "Exec_Date")
+ public void setExecDate(String execDate) {
+ this.execDate = execDate;
+ }
+}
diff --git a/kilkari/src/main/java/org/motechproject/nms/kilkari/contract/RchTalukaHealthBlockRecord.java b/kilkari/src/main/java/org/motechproject/nms/kilkari/contract/RchTalukaHealthBlockRecord.java
new file mode 100644
index 000000000..bcb751eef
--- /dev/null
+++ b/kilkari/src/main/java/org/motechproject/nms/kilkari/contract/RchTalukaHealthBlockRecord.java
@@ -0,0 +1,48 @@
+package org.motechproject.nms.kilkari.contract;
+
+import org.joda.time.DateTime;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * Created by vishnu on 3/7/18.
+ */
+
+@XmlType
+@XmlAccessorType(XmlAccessType.NONE)
+public class RchTalukaHealthBlockRecord {
+
+ private String talukaCode;
+ private Long healthBlockCode;
+ private DateTime execDate;
+
+ public String getTalukaCode() {
+ return talukaCode;
+ }
+
+ @XmlElement(name = "Taluka_ID")
+ public void setTalukaCode(String talukaCode) {
+ this.talukaCode = talukaCode;
+ }
+
+ public Long getHealthBlockCode() {
+ return healthBlockCode;
+ }
+
+ @XmlElement(name = "HealthBlock_ID")
+ public void setHealthBlockCode(Long healthBlockCode) {
+ this.healthBlockCode = healthBlockCode;
+ }
+
+ public DateTime getExecDate() {
+ return execDate;
+ }
+
+ @XmlElement(name = "Exec_Date")
+ public void setExecDate(DateTime execDate) {
+ this.execDate = execDate;
+ }
+}
diff --git a/kilkari/src/main/java/org/motechproject/nms/kilkari/contract/RchTalukaRecord.java b/kilkari/src/main/java/org/motechproject/nms/kilkari/contract/RchTalukaRecord.java
new file mode 100644
index 000000000..dc8b68e07
--- /dev/null
+++ b/kilkari/src/main/java/org/motechproject/nms/kilkari/contract/RchTalukaRecord.java
@@ -0,0 +1,57 @@
+package org.motechproject.nms.kilkari.contract;
+
+import org.joda.time.DateTime;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * Created by vishnu on 27/6/18.
+ */
+@XmlType
+@XmlAccessorType(XmlAccessType.NONE)
+public class RchTalukaRecord {
+
+ private Long districtCode;
+ private String talukaCode;
+ private String talukaName;
+ private DateTime execDate;
+
+ public Long getDistrictCode() {
+ return districtCode;
+ }
+
+ @XmlElement(name = "District_ID")
+ public void setDistrictCode(Long districtCode) {
+ this.districtCode = districtCode;
+ }
+
+ public String getTalukaCode() {
+ return talukaCode;
+ }
+
+ @XmlElement(name = "Taluka_ID")
+ public void setTalukaCode(String talukaCode) {
+ this.talukaCode = talukaCode;
+ }
+
+ public String getTalukaName() {
+ return talukaName;
+ }
+
+ @XmlElement(name = "Taluka_Name")
+ public void setTalukaName(String talukaName) {
+ this.talukaName = talukaName;
+ }
+
+ public DateTime getExecDate() {
+ return execDate;
+ }
+
+ @XmlElement(name = "Exec_Date")
+ public void setExecDate(DateTime execDate) {
+ this.execDate = execDate;
+ }
+}
diff --git a/kilkari/src/main/java/org/motechproject/nms/kilkari/contract/RchVillageHealthSubFacilityRecord.java b/kilkari/src/main/java/org/motechproject/nms/kilkari/contract/RchVillageHealthSubFacilityRecord.java
new file mode 100644
index 000000000..5f5042921
--- /dev/null
+++ b/kilkari/src/main/java/org/motechproject/nms/kilkari/contract/RchVillageHealthSubFacilityRecord.java
@@ -0,0 +1,57 @@
+package org.motechproject.nms.kilkari.contract;
+
+import org.joda.time.DateTime;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * Created by beehyv on 18/7/18.
+ */
+@XmlType
+@XmlAccessorType(XmlAccessType.NONE)
+public class RchVillageHealthSubFacilityRecord {
+
+ private Long districtCode;
+ private Long villageCode;
+ private Long healthSubFacilityCode;
+ private DateTime execDate;
+
+ public Long getDistrictCode() {
+ return districtCode;
+ }
+
+ @XmlElement(name = "District_ID")
+ public void setDistrictCode(Long districtCode) {
+ this.districtCode = districtCode;
+ }
+
+ public Long getVillageCode() {
+ return villageCode;
+ }
+
+ @XmlElement(name = "Village_ID")
+ public void setVillageCode(Long villageCode) {
+ this.villageCode = villageCode;
+ }
+
+ public Long getHealthSubFacilityCode() {
+ return healthSubFacilityCode;
+ }
+
+ @XmlElement(name = "HealthSubFacility_ID")
+ public void setHealthSubFacilityCode(Long healthSubFacilityCode) {
+ this.healthSubFacilityCode = healthSubFacilityCode;
+ }
+
+ public DateTime getExecDate() {
+ return execDate;
+ }
+
+ @XmlElement(name = "Exec_Date")
+ public void setExecDate(DateTime execDate) {
+ this.execDate = execDate;
+ }
+}
diff --git a/kilkari/src/main/java/org/motechproject/nms/kilkari/contract/RchVillageRecord.java b/kilkari/src/main/java/org/motechproject/nms/kilkari/contract/RchVillageRecord.java
new file mode 100644
index 000000000..713e5545d
--- /dev/null
+++ b/kilkari/src/main/java/org/motechproject/nms/kilkari/contract/RchVillageRecord.java
@@ -0,0 +1,67 @@
+package org.motechproject.nms.kilkari.contract;
+
+import org.joda.time.DateTime;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * Created by beehyv on 18/7/18.
+ */
+@XmlType
+@XmlAccessorType(XmlAccessType.NONE)
+public class RchVillageRecord {
+
+ private Long districtCode;
+ private String talukaCode;
+ private Long villageCode;
+ private String villageName;
+ private DateTime execDate;
+
+ public Long getDistrictCode() {
+ return districtCode;
+ }
+
+ @XmlElement(name = "District_ID")
+ public void setDistrictCode(Long districtCode) {
+ this.districtCode = districtCode;
+ }
+
+ public String getTalukaCode() {
+ return talukaCode;
+ }
+
+ @XmlElement(name = "Taluka_ID")
+ public void setTalukaCode(String talukaCode) {
+ this.talukaCode = talukaCode;
+ }
+
+ public Long getVillageCode() {
+ return villageCode;
+ }
+
+ @XmlElement(name = "Village_ID")
+ public void setVillageCode(Long villageCode) {
+ this.villageCode = villageCode;
+ }
+
+ public String getVillageName() {
+ return villageName;
+ }
+
+ @XmlElement(name = "Village_Name")
+ public void setVillageName(String villageName) {
+ this.villageName = villageName;
+ }
+
+ public DateTime getExecDate() {
+ return execDate;
+ }
+
+ @XmlElement(name = "Exec_Date")
+ public void setExecDate(DateTime execDate) {
+ this.execDate = execDate;
+ }
+}
diff --git a/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/DeactivatedBeneficiary.java b/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/DeactivatedBeneficiary.java
new file mode 100644
index 000000000..64ed9b33e
--- /dev/null
+++ b/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/DeactivatedBeneficiary.java
@@ -0,0 +1,92 @@
+package org.motechproject.nms.kilkari.domain;
+
+import org.joda.time.DateTime;
+import org.motechproject.mds.annotations.Entity;
+import org.motechproject.mds.annotations.Field;
+
+import javax.jdo.annotations.Column;
+import javax.validation.constraints.NotNull;
+
+/**
+ * Record for users who are deactivated or completed their subscriptions.
+ *
+ * Created by ajai on 5/6/17.
+ */
+@Entity(tableName = "nms_deactivated_beneficiary")
+public class DeactivatedBeneficiary {
+
+
+ @Field
+ @NotNull
+ private String externalId;
+
+ @Field
+ @Column(allowsNull = "false")
+ @NotNull
+ private SubscriptionOrigin origin;
+
+ @Field
+ private DeactivationReason deactivationReason;
+
+ @Field
+ private boolean completedSubscription;
+
+ @Field
+ private DateTime serviceStartDate;
+
+ @Field
+ private DateTime deactivationDate;
+
+ public DeactivatedBeneficiary() {
+
+ }
+
+ public String getExternalId() {
+ return externalId;
+ }
+
+ public void setExternalId(String externalId) {
+ this.externalId = externalId;
+ }
+
+ public SubscriptionOrigin getOrigin() {
+ return origin;
+ }
+
+ public void setOrigin(SubscriptionOrigin origin) {
+ this.origin = origin;
+ }
+
+ public DeactivationReason getDeactivationReason() {
+ return deactivationReason;
+ }
+
+ public void setDeactivationReason(DeactivationReason deactivationReason) {
+ this.deactivationReason = deactivationReason;
+ }
+
+ public boolean isCompletedSubscription() {
+ return completedSubscription;
+ }
+
+ public void setCompletedSubscription(boolean completedSubscription) {
+ this.completedSubscription = completedSubscription;
+ }
+
+ public DateTime getServiceStartDate() {
+ return serviceStartDate;
+ }
+
+ public void setServiceStartDate(DateTime serviceStartDate) {
+ this.serviceStartDate = serviceStartDate;
+ }
+
+ public DateTime getDeactivationDate() {
+ return deactivationDate;
+ }
+
+ public void setDeactivationDate(DateTime deactivationDate) {
+ this.deactivationDate = deactivationDate;
+ }
+
+}
diff --git a/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/MctsChild.java b/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/MctsChild.java
index bfe9e1f4a..76c8f0e49 100644
--- a/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/MctsChild.java
+++ b/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/MctsChild.java
@@ -21,6 +21,10 @@ public MctsChild(String beneficiaryId) {
super(beneficiaryId);
}
+ public MctsChild(String rchId, String beneficiaryId) {
+ super(rchId, beneficiaryId);
+ }
+
public MctsChild(String beneficiaryId, String name, MctsMother mother) {
super(beneficiaryId, name);
this.mother = mother;
diff --git a/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/ReactivatedBeneficiaryAudit.java b/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/ReactivatedBeneficiaryAudit.java
new file mode 100644
index 000000000..b68466a76
--- /dev/null
+++ b/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/ReactivatedBeneficiaryAudit.java
@@ -0,0 +1,86 @@
+package org.motechproject.nms.kilkari.domain;
+
+import org.joda.time.DateTime;
+import org.motechproject.mds.annotations.Entity;
+import org.motechproject.mds.annotations.Field;
+
+import javax.jdo.annotations.Column;
+import javax.validation.constraints.NotNull;
+
+
+@Entity(tableName = "nms_reactivated_beneficiary")
+public class ReactivatedBeneficiaryAudit {
+
+
+ @Field
+ @NotNull
+ private String externalId;
+
+ @Field
+ @Column(allowsNull = "false")
+ private SubscriptionOrigin origin;
+
+ @Field
+ private DeactivationReason deactivationReason;
+
+ @Field
+ private DateTime serviceReactivationDate;
+
+ @Field
+ private SubscriptionPack subscriptionPack;
+
+ @Field
+ private DateTime deactivationDate;
+
+ public ReactivatedBeneficiaryAudit() {
+
+ }
+
+ public String getExternalId() {
+ return externalId;
+ }
+
+ public void setExternalId(String externalId) {
+ this.externalId = externalId;
+ }
+
+ public SubscriptionOrigin getOrigin() {
+ return origin;
+ }
+
+ public void setOrigin(SubscriptionOrigin origin) {
+ this.origin = origin;
+ }
+
+ public DeactivationReason getDeactivationReason() {
+ return deactivationReason;
+ }
+
+ public void setDeactivationReason(DeactivationReason deactivationReason) {
+ this.deactivationReason = deactivationReason;
+ }
+
+ public DateTime getServiceReactivationDate() {
+ return serviceReactivationDate;
+ }
+
+ public void setServiceReactivationDate(DateTime serviceReactivationDate) {
+ this.serviceReactivationDate = serviceReactivationDate;
+ }
+
+ public DateTime getDeactivationDate() {
+ return deactivationDate;
+ }
+
+ public void setDeactivationDate(DateTime deactivationDate) {
+ this.deactivationDate = deactivationDate;
+ }
+
+ public SubscriptionPack getSubscriptionPack() {
+ return subscriptionPack;
+ }
+
+ public void setSubscriptionPack(SubscriptionPack subscriptionPack) {
+ this.subscriptionPack = subscriptionPack;
+ }
+}
diff --git a/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/RejectionReasons.java b/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/RejectionReasons.java
new file mode 100644
index 000000000..57abff7f5
--- /dev/null
+++ b/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/RejectionReasons.java
@@ -0,0 +1,27 @@
+package org.motechproject.nms.kilkari.domain;
+
+/**
+ * Created by vishnu on 17/7/17.
+ */
+public enum RejectionReasons {
+ FLW_TYPE_NOT_ASHA,
+ INVALID_LOCATION,
+ MOBILE_NUMBER_ALREADY_IN_USE,
+ UPDATED_RECORD_ALREADY_EXISTS,
+ FLW_IMPORT_ERROR,
+ INVALID_LMP_DATE,
+ ACTIVE_CHILD_PRESENT,
+ INVALID_CASE_NO,
+ ALREADY_LINKED_WITH_A_DIFFERENT_MOTHER_ID,
+ INVALID_DOB,
+ GF_STATUS_INACTIVE,
+ MOBILE_NUMBER_ALREADY_SUBSCRIBED,
+ ABORT_STILLBIRTH_DEATH,
+ ALREADY_SUBSCRIBED,
+ DUPLICATE_MOBILE_NUMBER_IN_DATASET,
+ MOBILE_NUMBER_EMPTY_OR_WRONG_FORMAT,
+ GF_STATUS_EMPTY_OR_WRONG_FORMAT,
+ FIELD_NOT_PRESENT,
+ DATA_INTEGRITY_ERROR,
+ CHILD_DEATH
+}
diff --git a/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/Subscriber.java b/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/Subscriber.java
index e5a378ca9..84958c004 100644
--- a/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/Subscriber.java
+++ b/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/Subscriber.java
@@ -1,7 +1,9 @@
package org.motechproject.nms.kilkari.domain;
-import org.codehaus.jackson.annotate.JsonIgnore;
-import org.codehaus.jackson.annotate.JsonManagedReference;
+
+import com.fasterxml.jackson.annotation.JsonBackReference;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonManagedReference;
import org.joda.time.DateTime;
import org.motechproject.mds.annotations.Entity;
import org.motechproject.mds.annotations.Field;
diff --git a/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/SubscriberMsisdnTracker.java b/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/SubscriberMsisdnTracker.java
index 497d7234c..b5eefe2a5 100644
--- a/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/SubscriberMsisdnTracker.java
+++ b/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/SubscriberMsisdnTracker.java
@@ -19,7 +19,7 @@ public class SubscriberMsisdnTracker {
@Field
@Min(value = 1000000000L, message = "callingNumber must be 10 digits")
@Max(value = 9999999999L, message = "callingNumber must be 10 digits")
- @Column(length = 10, allowsNull = "false")
+ @Column(length = 10, allowsNull = "true")
private Long oldCallingNumber;
@Field
diff --git a/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/Subscription.java b/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/Subscription.java
index 17bf028f8..d85c4fef6 100644
--- a/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/Subscription.java
+++ b/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/Subscription.java
@@ -1,6 +1,6 @@
package org.motechproject.nms.kilkari.domain;
-import org.codehaus.jackson.annotate.JsonBackReference;
+import com.fasterxml.jackson.annotation.JsonBackReference;
import org.joda.time.DateTime;
import org.joda.time.Days;
import org.motechproject.mds.annotations.Entity;
@@ -126,6 +126,10 @@ public void setStatus(SubscriptionStatus status) {
}
}
+ public void setReactivationStatus() {
+ this.status = SubscriptionStatus.ACTIVE;
+ }
+
public SubscriptionOrigin getOrigin() { return origin; }
public void setOrigin(SubscriptionOrigin origin) { this.origin = origin; }
diff --git a/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/SubscriptionPack.java b/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/SubscriptionPack.java
index 873010daf..c74825527 100644
--- a/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/SubscriptionPack.java
+++ b/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/SubscriptionPack.java
@@ -109,9 +109,9 @@ public String isReferenceDateValidForPack(DateTime date) {
return String.format("Reference date is after now: %s", date.toString());
}
- int packLengthInDays = weeks * DAYS_IN_WEEK;
+ int packLengthInDays = weeks * DAYS_IN_WEEK; //72 weeks
int minDaysLeftInPack = MIN_MSG_WEEKS * DAYS_IN_WEEK; // BBC requirement to have at least 12 weeks of messages to send
- DateTime startDate = (type == SubscriptionPackType.PREGNANCY) ? date.plusDays(THREE_MONTHS) : date;
+ DateTime startDate = (type == SubscriptionPackType.PREGNANCY) ? date.plusDays(THREE_MONTHS) : date; //add 3 months to lmp
DateTime cutOff = DateUtil.now().plusDays(minDaysLeftInPack + 1); // plus 1 since we start calling people the next day
// Cutoff date is the minimum days left in pack for us to deliver 12 weeks worth of messages
@@ -123,6 +123,8 @@ public String isReferenceDateValidForPack(DateTime date) {
return "";
}
+
+
@Ignore
public boolean hasMessageWithWeekId(String weekId) {
for (SubscriptionPackMessage message : messages) {
diff --git a/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/SubscriptionRejectionReason.java b/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/SubscriptionRejectionReason.java
index 85e8d12d5..8a96b16f7 100644
--- a/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/SubscriptionRejectionReason.java
+++ b/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/SubscriptionRejectionReason.java
@@ -16,5 +16,6 @@ public enum SubscriptionRejectionReason {
INVALID_CASE_NO,
WEEKLY_CALLS_NOT_ANSWERED,
ABORT_STILLBIRTH_DEATH,
- ACTIVE_CHILD_PRESENT;
+ ACTIVE_CHILD_PRESENT,
+ MSISDN_WITH_ONE_ACTIVE_SUBCRIPTION_PRESENT
}
diff --git a/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/ThreadProcessorObject.java b/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/ThreadProcessorObject.java
new file mode 100644
index 000000000..16fd90e25
--- /dev/null
+++ b/kilkari/src/main/java/org/motechproject/nms/kilkari/domain/ThreadProcessorObject.java
@@ -0,0 +1,40 @@
+package org.motechproject.nms.kilkari.domain;
+
+import java.util.Map;
+
+/**
+ * Custom object used by each thread while processing a csv or xml.
+ * rejectedBeneficiaries is a map of RCH/MCTS id and rejected beneficiaries
+ * rejectionStatus is a map of RCH/MCTS id and rejection status of beneficiary
+ * Created by beehyv on 25/4/18.
+ */
+public class ThreadProcessorObject {
+
+ private Map rejectedBeneficiaries;
+ private Map rejectionStatus;
+ private Integer recordsProcessed;
+
+ public Map getRejectedBeneficiaries() {
+ return rejectedBeneficiaries;
+ }
+
+ public void setRejectedBeneficiaries(Map rejectedBeneficiaries) {
+ this.rejectedBeneficiaries = rejectedBeneficiaries;
+ }
+
+ public Map getRejectionStatus() {
+ return rejectionStatus;
+ }
+
+ public void setRejectionStatus(Map rejectionStatus) {
+ this.rejectionStatus = rejectionStatus;
+ }
+
+ public Integer getRecordsProcessed() {
+ return recordsProcessed;
+ }
+
+ public void setRecordsProcessed(Integer recordsProcessed) {
+ this.recordsProcessed = recordsProcessed;
+ }
+}
diff --git a/kilkari/src/main/java/org/motechproject/nms/kilkari/dto/CallSummaryRecordDto.java b/kilkari/src/main/java/org/motechproject/nms/kilkari/dto/CallSummaryRecordDto.java
index 985741d52..a8dd8202e 100644
--- a/kilkari/src/main/java/org/motechproject/nms/kilkari/dto/CallSummaryRecordDto.java
+++ b/kilkari/src/main/java/org/motechproject/nms/kilkari/dto/CallSummaryRecordDto.java
@@ -35,6 +35,7 @@ public class CallSummaryRecordDto implements Serializable {
public CallSummaryRecordDto() { }
+ //CHECKSTYLE:OFF
public CallSummaryRecordDto(String subscriptionId, int statusCode, int finalStatus, String contentFileName,
String weekId, String languageCode, String circleName, String targetFileTimeStamp) {
this.subscriptionId = subscriptionId;
@@ -63,6 +64,7 @@ public CallSummaryRecordDto(Subscription subscription, StatusCode statusCode, Fi
);
}
+ //CHECKSTYLE:ON
public String getSubscriptionId() {
return subscriptionId;
}
diff --git a/kilkari/src/main/java/org/motechproject/nms/kilkari/handler/SubscriptionManagerHandler.java b/kilkari/src/main/java/org/motechproject/nms/kilkari/handler/SubscriptionManagerHandler.java
index 816abd5b0..fbbfc6b4e 100644
--- a/kilkari/src/main/java/org/motechproject/nms/kilkari/handler/SubscriptionManagerHandler.java
+++ b/kilkari/src/main/java/org/motechproject/nms/kilkari/handler/SubscriptionManagerHandler.java
@@ -77,7 +77,7 @@ public void upkeepSubscriptions(MotechEvent event) {
subscriptionService.completePastDueSubscriptions();
Timer timer = new Timer();
- subscriptionService.activatePendingSubscriptionsUpTo(tomorrow);
+ subscriptionService.activatePendingSubscriptionsUpTo(tomorrow, maxActiveSubscriptions);
LOGGER.debug("Activated all pending subscriptions up to {} in {}", tomorrow, timer.time());
subscriptionService.toggleMctsSubscriptionCreation(maxActiveSubscriptions);
diff --git a/kilkari/src/main/java/org/motechproject/nms/kilkari/repository/DeactivatedBeneficiaryDataService.java b/kilkari/src/main/java/org/motechproject/nms/kilkari/repository/DeactivatedBeneficiaryDataService.java
new file mode 100644
index 000000000..4c6c28e88
--- /dev/null
+++ b/kilkari/src/main/java/org/motechproject/nms/kilkari/repository/DeactivatedBeneficiaryDataService.java
@@ -0,0 +1,18 @@
+package org.motechproject.nms.kilkari.repository;
+
+import org.motechproject.mds.annotations.Lookup;
+import org.motechproject.mds.annotations.LookupField;
+import org.motechproject.mds.service.MotechDataService;
+import org.motechproject.nms.kilkari.domain.DeactivatedBeneficiary;
+
+import java.util.List;
+
+/**
+ * Created by ajai on 5/6/17.
+ */
+public interface DeactivatedBeneficiaryDataService extends MotechDataService {
+
+ @Lookup
+ List findByExternalId(@LookupField(name = "externalId") String externalId);
+
+}
diff --git a/kilkari/src/main/java/org/motechproject/nms/kilkari/repository/MctsChildDataService.java b/kilkari/src/main/java/org/motechproject/nms/kilkari/repository/MctsChildDataService.java
index 29f7ba0a4..a2b1f632f 100644
--- a/kilkari/src/main/java/org/motechproject/nms/kilkari/repository/MctsChildDataService.java
+++ b/kilkari/src/main/java/org/motechproject/nms/kilkari/repository/MctsChildDataService.java
@@ -10,4 +10,6 @@ public interface MctsChildDataService extends MotechDataService {
@Lookup
MctsChild findByBeneficiaryId(@LookupField(name = "beneficiaryId") String beneficiaryId);
+ @Lookup
+ MctsChild findByRchId(@LookupField(name = "rchId") String rchId);
}
diff --git a/kilkari/src/main/java/org/motechproject/nms/kilkari/repository/ReactivatedBeneficiaryAuditDataService.java b/kilkari/src/main/java/org/motechproject/nms/kilkari/repository/ReactivatedBeneficiaryAuditDataService.java
new file mode 100644
index 000000000..a76d3ee2c
--- /dev/null
+++ b/kilkari/src/main/java/org/motechproject/nms/kilkari/repository/ReactivatedBeneficiaryAuditDataService.java
@@ -0,0 +1,8 @@
+package org.motechproject.nms.kilkari.repository;
+
+import org.motechproject.mds.service.MotechDataService;
+import org.motechproject.nms.kilkari.domain.ReactivatedBeneficiaryAudit;
+
+
+public interface ReactivatedBeneficiaryAuditDataService extends MotechDataService {
+}
diff --git a/kilkari/src/main/java/org/motechproject/nms/kilkari/service/ActionFinderService.java b/kilkari/src/main/java/org/motechproject/nms/kilkari/service/ActionFinderService.java
new file mode 100644
index 000000000..7d5cf2a69
--- /dev/null
+++ b/kilkari/src/main/java/org/motechproject/nms/kilkari/service/ActionFinderService.java
@@ -0,0 +1,17 @@
+package org.motechproject.nms.kilkari.service;
+
+import org.motechproject.nms.kilkari.contract.ChildRecord;
+import org.motechproject.nms.kilkari.contract.MotherRecord;
+import org.motechproject.nms.kilkari.contract.RchMotherRecord;
+
+/**
+ * Created by beehyv on 25/7/17.
+ */
+public interface ActionFinderService {
+
+ String motherActionFinder(MotherRecord record);
+
+ String rchMotherActionFinder(RchMotherRecord record);
+
+ String childActionFinder(ChildRecord record);
+}
diff --git a/kilkari/src/main/java/org/motechproject/nms/kilkari/service/ChildCsvThreadProcessor.java b/kilkari/src/main/java/org/motechproject/nms/kilkari/service/ChildCsvThreadProcessor.java
new file mode 100644
index 000000000..5f83f5f8e
--- /dev/null
+++ b/kilkari/src/main/java/org/motechproject/nms/kilkari/service/ChildCsvThreadProcessor.java
@@ -0,0 +1,108 @@
+package org.motechproject.nms.kilkari.service;
+
+import org.motechproject.metrics.service.Timer;
+import org.motechproject.nms.kilkari.domain.MctsChild;
+import org.motechproject.nms.kilkari.domain.RejectionReasons;
+import org.motechproject.nms.kilkari.domain.SubscriptionOrigin;
+import org.motechproject.nms.kilkari.domain.ThreadProcessorObject;
+import org.motechproject.nms.kilkari.utils.KilkariConstants;
+import org.motechproject.nms.region.domain.LocationFinder;
+import org.motechproject.nms.rejectionhandler.domain.ChildImportRejection;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.Callable;
+
+import static org.motechproject.nms.kilkari.utils.RejectedObjectConverter.childRejectionRch;
+import static org.motechproject.nms.kilkari.utils.RejectedObjectConverter.convertMapToRchChild;
+
+/**
+ * Created by beehyv on 25/4/18.
+ */
+ public class ChildCsvThreadProcessor implements Callable {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(ChildCsvThreadProcessor.class);
+ private List