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

BAH-3558 | Add. Support for PostalCode #101

Merged
merged 1 commit into from
Feb 12, 2024
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 @@ -18,18 +18,20 @@ 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;
this.cityVillage = cityVillage;
this.countyDistrict = countyDistrict;
this.stateProvince = stateProvince;
this.country = country;
this.postalCode = postalCode;
}

public String getCountry() {
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"cityVillage": "cityVillage",
"stateProvince": "stateProvince",
"country": "country",
"postalCode": null,
"postalCode": "postalCode",
"countyDistrict": "countyDistrict",
"address3": "address3",
"address4": null,
Expand Down
Loading