Skip to content

Commit 42b8161

Browse files
Merge pull request #248 from toarunmishra/fix_identity_varibale
Fix identity variable
2 parents 5939168 + 61c13a1 commit 42b8161

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/main/java/com/iemr/common/service/beneficiary/IdentityBeneficiaryServiceImpl.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public class IdentityBeneficiaryServiceImpl implements IdentityBeneficiaryServic
5252
private InputMapper inputMapper = new InputMapper();
5353
private String identityBaseURL = ConfigProperties.getPropertyByName("identity-api-url");
5454
private String identity1097BaseURL = ConfigProperties.getPropertyByName("identity-1097-api-url");
55-
private static final String IDENTITY_BASE_URL = "IDENTITY_BASE_URL";
55+
private static final String IDENTITY_BASE_URL = "https://amritdemo.piramalswasthya.org";
5656

5757
private static final String BEN_GEN = ConfigProperties.getPropertyByName("genben-api");
5858
private static final String BEN_GEN_API_URL = ConfigProperties.getPropertyByName("generateBeneficiaryIDs-api-url");
@@ -79,8 +79,9 @@ public List<BeneficiariesDTO> getBeneficiaryListByIDs(HashSet benIdList, String
7979
header.put("Authorization", auth);
8080
}
8181

82+
8283
result = httpUtils.post(ConfigProperties.getPropertyByName("identity-api-url-getByBenRegIdList").replace(
83-
IDENTITY_BASE_URL, (is1097 ? identity1097BaseURL : identityBaseURL)), benIdList.toString(), header);
84+
IDENTITY_BASE_URL, (is1097 ? identity1097BaseURL : "https://amritdemo.piramalswasthya.org")), benIdList.toString(), header);
8485
OutputResponse identityResponse = inputMapper.gson().fromJson(result, OutputResponse.class);
8586
if (identityResponse != null && identityResponse.getStatusCode() == OutputResponse.USERID_FAILURE) {
8687
throw new IEMRException(identityResponse.getErrorMessage());
@@ -401,9 +402,9 @@ public String getIdentityResponse(String request, String auth, Boolean is1097) t
401402
if (auth != null) {
402403
header.put("Authorization", auth);
403404
}
404-
String baseUrl = is1097 ? identity1097BaseURL : identityBaseURL;
405-
String apiUrl = baseUrl + ConfigProperties.getPropertyByName("identity-api-url-benCreate");
406405

406+
String apiUrl = ConfigProperties.getPropertyByName("identity-api-url-benCreate")
407+
.replace(IDENTITY_BASE_URL, (is1097 ? identity1097BaseURL : identityBaseURL));
407408

408409
logger.info("Calling URL: {}", apiUrl);
409410
logger.info("Request Payload: {}", request);

0 commit comments

Comments
 (0)