Added fix for HAPI CDS Hooks request extensions element json parsing error

This commit is contained in:
c-schuler
2023-11-22 12:37:04 -07:00
parent aaa8a1f8cc
commit c0b89800f1
2 changed files with 10 additions and 1 deletions

View File

@@ -0,0 +1,9 @@
package ca.uhn.fhir.jpa.starter.cdshooks;
import ca.uhn.hapi.fhir.cdshooks.api.json.CdsServiceRequestJson;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@JsonIgnoreProperties({ "extension" })
public class CdsHooksRequest extends CdsServiceRequestJson {
}

View File

@@ -86,7 +86,7 @@ public class CdsHooksServlet extends HttpServlet {
String service = request.getPathInfo().replace("/", ""); String service = request.getPathInfo().replace("/", "");
String requestJson = request.getReader().lines().collect(Collectors.joining()); String requestJson = request.getReader().lines().collect(Collectors.joining());
CdsServiceRequestJson cdsHooksRequest = objectMapper.readValue(requestJson, CdsServiceRequestJson.class); CdsHooksRequest cdsHooksRequest = objectMapper.readValue(requestJson, CdsHooksRequest.class);
logRequestInfo(cdsHooksRequest, requestJson); logRequestInfo(cdsHooksRequest, requestJson);
CdsServiceResponseJson serviceResponseJson = cdsServiceRegistry.callService(service, cdsHooksRequest); CdsServiceResponseJson serviceResponseJson = cdsServiceRegistry.callService(service, cdsHooksRequest);