Merge branch 'term_svc'
This commit is contained in:
commit
eabf0039ba
|
@ -18,10 +18,10 @@ import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.hl7.fhir.dstu3.model.CodeType;
|
import org.hl7.fhir.dstu3.model.CodeType;
|
||||||
import org.hl7.fhir.dstu3.model.StringType;
|
|
||||||
import org.hl7.fhir.dstu3.model.Conformance.ConformanceRestComponent;
|
import org.hl7.fhir.dstu3.model.Conformance.ConformanceRestComponent;
|
||||||
import org.hl7.fhir.dstu3.model.Conformance.ConformanceRestResourceComponent;
|
import org.hl7.fhir.dstu3.model.Conformance.ConformanceRestResourceComponent;
|
||||||
import org.hl7.fhir.dstu3.model.Conformance.ConformanceRestResourceSearchParamComponent;
|
import org.hl7.fhir.dstu3.model.Conformance.ConformanceRestResourceSearchParamComponent;
|
||||||
|
import org.hl7.fhir.dstu3.model.StringType;
|
||||||
import org.hl7.fhir.instance.model.api.IBaseBundle;
|
import org.hl7.fhir.instance.model.api.IBaseBundle;
|
||||||
import org.hl7.fhir.instance.model.api.IBaseConformance;
|
import org.hl7.fhir.instance.model.api.IBaseConformance;
|
||||||
import org.hl7.fhir.instance.model.api.IBaseResource;
|
import org.hl7.fhir.instance.model.api.IBaseResource;
|
||||||
|
@ -32,7 +32,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import ca.uhn.fhir.context.FhirContext;
|
import ca.uhn.fhir.context.FhirContext;
|
||||||
import ca.uhn.fhir.context.FhirVersionEnum;
|
import ca.uhn.fhir.context.FhirVersionEnum;
|
||||||
import ca.uhn.fhir.context.RuntimeResourceDefinition;
|
import ca.uhn.fhir.context.RuntimeResourceDefinition;
|
||||||
import ca.uhn.fhir.model.api.Bundle;
|
|
||||||
import ca.uhn.fhir.model.api.ExtensionDt;
|
import ca.uhn.fhir.model.api.ExtensionDt;
|
||||||
import ca.uhn.fhir.model.api.Include;
|
import ca.uhn.fhir.model.api.Include;
|
||||||
import ca.uhn.fhir.model.dstu.resource.Conformance;
|
import ca.uhn.fhir.model.dstu.resource.Conformance;
|
||||||
|
@ -515,16 +514,16 @@ public class Controller extends BaseController {
|
||||||
addCommonParams(theServletRequest, theRequest, theModel);
|
addCommonParams(theServletRequest, theRequest, theModel);
|
||||||
|
|
||||||
CaptureInterceptor interceptor = new CaptureInterceptor();
|
CaptureInterceptor interceptor = new CaptureInterceptor();
|
||||||
GenericClient client = theRequest.newClient(theServletRequest, getContext(theRequest), myConfig, interceptor);
|
FhirContext context = getContext(theRequest);
|
||||||
|
GenericClient client = theRequest.newClient(theServletRequest, context, myConfig, interceptor);
|
||||||
|
|
||||||
String body = preProcessMessageBody(theRequest.getTransactionBody());
|
String body = preProcessMessageBody(theRequest.getTransactionBody());
|
||||||
|
|
||||||
Bundle bundle;
|
|
||||||
try {
|
try {
|
||||||
if (body.startsWith("{")) {
|
if (body.startsWith("{")) {
|
||||||
bundle = getContext(theRequest).newJsonParser().parseBundle(body);
|
// JSON content
|
||||||
} else if (body.startsWith("<")) {
|
} else if (body.startsWith("<")) {
|
||||||
bundle = getContext(theRequest).newXmlParser().parseBundle(body);
|
// XML content
|
||||||
} else {
|
} else {
|
||||||
theModel.put("errorMsg", "Message body does not appear to be a valid FHIR resource instance document. Body should start with '<' (for XML encoding) or '{' (for JSON encoding).");
|
theModel.put("errorMsg", "Message body does not appear to be a valid FHIR resource instance document. Body should start with '<' (for XML encoding) or '{' (for JSON encoding).");
|
||||||
return "home";
|
return "home";
|
||||||
|
@ -538,8 +537,8 @@ public class Controller extends BaseController {
|
||||||
ResultType returnsResource = ResultType.BUNDLE;
|
ResultType returnsResource = ResultType.BUNDLE;
|
||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
try {
|
try {
|
||||||
ourLog.info(logPrefix(theModel) + "Executing transaction with {} resources", bundle.size());
|
ourLog.info(logPrefix(theModel) + "Executing transaction");
|
||||||
client.transaction().withBundle(bundle).execute();
|
client.transaction().withBundle(body).execute();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
returnsResource = handleClientException(client, e, theModel);
|
returnsResource = handleClientException(client, e, theModel);
|
||||||
}
|
}
|
||||||
|
|
|
@ -237,6 +237,9 @@
|
||||||
<action type="add">
|
<action type="add">
|
||||||
Update DSTU2 InstanceValidator to latest version from upstream
|
Update DSTU2 InstanceValidator to latest version from upstream
|
||||||
</action>
|
</action>
|
||||||
|
<action type="fix">
|
||||||
|
Web Testing UI was not able to correctly post an STU3 transaction
|
||||||
|
</action>
|
||||||
</release>
|
</release>
|
||||||
<release version="1.5" date="2016-04-20">
|
<release version="1.5" date="2016-04-20">
|
||||||
<action type="fix" issue="339">
|
<action type="fix" issue="339">
|
||||||
|
|
Loading…
Reference in New Issue