From c09e53b225fdd3dbfb2b698b22e831c8ab5483c5 Mon Sep 17 00:00:00 2001 From: Rahul Ramesh Date: Sun, 11 Feb 2024 21:11:22 +0530 Subject: [PATCH] [Rahul] | BAH-3558 | Add. Support for postalCode --- .../bahmni/feed/openerp/domain/OpenMRSPersonAddress.java | 8 +++++++- .../event/OpenERPCustomerServiceEventWorkerTest.java | 2 +- .../java/org/bahmni/feed/openerp/worker/JsonifyTest.java | 2 +- .../src/test/resources/patientResource.xml | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/openerp-atomfeed-service/src/main/java/org/bahmni/feed/openerp/domain/OpenMRSPersonAddress.java b/openerp-atomfeed-service/src/main/java/org/bahmni/feed/openerp/domain/OpenMRSPersonAddress.java index ccafd476..91387a2d 100644 --- a/openerp-atomfeed-service/src/main/java/org/bahmni/feed/openerp/domain/OpenMRSPersonAddress.java +++ b/openerp-atomfeed-service/src/main/java/org/bahmni/feed/openerp/domain/OpenMRSPersonAddress.java @@ -18,11 +18,12 @@ public class OpenMRSPersonAddress implements Jsonify { private String countyDistrict; private String stateProvince; private String country; + private String postalCode; public OpenMRSPersonAddress() { } - public OpenMRSPersonAddress(String address1, String address2, String address3, String cityVillage, String countyDistrict, String stateProvince, String country) { + public OpenMRSPersonAddress(String address1, String address2, String address3, String cityVillage, String countyDistrict, String stateProvince, String country, String postalCode) { this.address1 = address1; this.address2 = address2; this.address3 = address3; @@ -30,6 +31,7 @@ public OpenMRSPersonAddress(String address1, String address2, String address3, S this.countyDistrict = countyDistrict; this.stateProvince = stateProvince; this.country = country; + this.postalCode = postalCode; } public String getCountry() { @@ -88,6 +90,10 @@ public void setStateProvince(String stateProvince) { this.stateProvince = stateProvince; } + public String getPostalCode() { return postalCode; } + + public void setPostalCode(String postalCode) { this.postalCode = postalCode; } + @Override public String toJsonString() { try { diff --git a/openerp-atomfeed-service/src/test/java/org/bahmni/feed/openerp/event/OpenERPCustomerServiceEventWorkerTest.java b/openerp-atomfeed-service/src/test/java/org/bahmni/feed/openerp/event/OpenERPCustomerServiceEventWorkerTest.java index cde67fb0..d4ca6d65 100644 --- a/openerp-atomfeed-service/src/test/java/org/bahmni/feed/openerp/event/OpenERPCustomerServiceEventWorkerTest.java +++ b/openerp-atomfeed-service/src/test/java/org/bahmni/feed/openerp/event/OpenERPCustomerServiceEventWorkerTest.java @@ -63,7 +63,7 @@ private OpenERPRequest createOpenERPRequest(Event event) { addToParametersIfNotEmpty(parameters,"attributes", "{\"healthCenter\":\"2\",\"givenNameLocal\":\"राम बाई\",\"class\":\"ST\"}"); addToParametersIfNotEmpty(parameters,"preferredAddress", "{\"address1\":\"address1\",\"address2\":\"address2\"," + "\"address3\":\"address3\",\"cityVillage\":\"cityVillage\",\"countyDistrict\":\"countyDistrict\"," + - "\"stateProvince\":\"stateProvince\",\"country\":\"country\"}"); + "\"stateProvince\":\"stateProvince\",\"country\":\"country\",\"postalCode\":\"postalCode\"}"); addToParametersIfNotEmpty(parameters,"category", "create.customer"); diff --git a/openerp-atomfeed-service/src/test/java/org/bahmni/feed/openerp/worker/JsonifyTest.java b/openerp-atomfeed-service/src/test/java/org/bahmni/feed/openerp/worker/JsonifyTest.java index 911a2849..b734ae5c 100644 --- a/openerp-atomfeed-service/src/test/java/org/bahmni/feed/openerp/worker/JsonifyTest.java +++ b/openerp-atomfeed-service/src/test/java/org/bahmni/feed/openerp/worker/JsonifyTest.java @@ -26,7 +26,7 @@ public void setUp() throws Exception { openMRSPersonAttributes.add(attr2); openMRSPersonAttributes.add(attr3); openMRSPersonAddress = new OpenMRSPersonAddress("address1", "address2", "address3", "cityVillage", - "countyDistrict", "stateProvince", "country"); + "countyDistrict", "stateProvince", "country", "postalCode"); } @Test diff --git a/openerp-atomfeed-service/src/test/resources/patientResource.xml b/openerp-atomfeed-service/src/test/resources/patientResource.xml index 2259a8ec..2014e84d 100644 --- a/openerp-atomfeed-service/src/test/resources/patientResource.xml +++ b/openerp-atomfeed-service/src/test/resources/patientResource.xml @@ -71,7 +71,7 @@ "cityVillage": "cityVillage", "stateProvince": "stateProvince", "country": "country", - "postalCode": null, + "postalCode": "postalCode", "countyDistrict": "countyDistrict", "address3": "address3", "address4": null,