10:10:20.043 [http-nio-8090-exec-6] WARN c.u.f.r.s.i.ExceptionHandlingInterceptor - Failure during REST processing: ca.uhn.fhir.rest.server.exceptions.InvalidRequestException: This is the base URL of FHIR server. Unable to handle this request, as it does not contain a resource type or operation name.
client.transaction()
.withResources(of(bloodPressureObservation, meanBloodPressureObservation, heartRateObservation))
.execute();
{"resourceType":"Bundle","type":"transaction","entry":[{"resource":{"resourceType":"Observation","meta":{"profile":["http://fhir.org/guides/argonaut/StructureDefinition/argo-vitalsigns"]},"status":"final","category":{"coding":[{"system":"http://hl7.org/fhir/observation-category","code":"vital-signs"}]},"code":{"coding":[{"system":"http://loinc.org","code":"55284-4"}]},"effectiveDateTime":"2019-09-15T12:22:48+02:00","component":[{"code":{"coding":[{"system":"http://loinc.org","code":"8462-4"}]},"valueQuantity":{"value":77.0,"unit":"mmHg","system":"http://unitsofmeasure.org","code":"mm[Hg]"}},{"code":{"coding":[{"system":"http://loinc.org","code":"8480-6"}]},"valueQuantity":{"value":127.0,"unit":"mmHg","system":"http://unitsofmeasure.org","code":"mm[Hg]"}}]},"request":{"method":"POST","url":"Observation"}},{"resource":{"resourceType":"Observation","meta":{"profile":["http://fhir.org/guides/argonaut/StructureDefinition/argo-vitalsigns"]},"status":"final","category":{"coding":[{"system":"http://hl7.org/fhir/observation-category","code":"vital-signs"}]},"code":{"coding":[{"system":"http://loinc.org","code":"8478-0"}]},"effectiveDateTime":"2019-09-15T12:22:48+02:00","valueQuantity":{"value":0.0,"unit":"mmHg","system":"http://unitsofmeasure.org","code":"mm[Hg]"}},"request":{"method":"POST","url":"Observation"}},{"resource":{"resourceType":"Observation","meta":{"profile":["http://fhir.org/guides/argonaut/StructureDefinition/argo-vitalsigns"]},"status":"final","category":{"coding":[{"system":"http://hl7.org/fhir/observation-category","code":"vital-signs"}]},"code":{"coding":[{"system":"http://loinc.org","code":"8867-4"}]},"effectiveDateTime":"2019-09-15T12:22:48+02:00","valueQuantity":{"value":89,"unit":"{beats}/min","system":"http://unitsofmeasure.org","code":"{beats}/min"}},"request":{"method":"POST","url":"Observation"}}]}
{ "resourceType": "OperationOutcome", "issue": [ { "severity": "error", "code": "processing", "diagnostics": "This is the base URL of FHIR server. Unable to handle this request, as it does not contain a resource type or operation name." } ]}--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/175599ad-4fbc-4b13-afee-75e21ff23e72%40googlegroups.com.
@Configuration
@RequiredArgsConstructor
class RestfulServerConfig implements FhirRestfulServerCustomizer {
private final JpaSystemProviderDstu2 mySystemProviderDstu2;
@Override
public void customize(final RestfulServer restfulServer) {
restfulServer.registerProvider(mySystemProviderDstu2);
}
}
--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/5c2c1fc9-8d26-4717-9bbb-fcbcd12a4b44%40googlegroups.com.
/*
* Create a FhirContext object that uses the version of FHIR
* specified in the properties file.
*/
ApplicationContext appCtx = (ApplicationContext) getServletContext()
.getAttribute("org.springframework.web.context.WebApplicationContext.ROOT");
/*
* ResourceProviders are fetched from the Spring context
*/
FhirVersionEnum fhirVersion = properties.getVersion();
ResourceProviderFactory resourceProviders;
Object systemProvider;
if (fhirVersion == FhirVersionEnum.DSTU2) {
resourceProviders = appCtx.getBean("myResourceProvidersDstu2", ResourceProviderFactory.class);
systemProvider = appCtx.getBean("mySystemProviderDstu2", JpaSystemProviderDstu2.class);
} else if (fhirVersion == FhirVersionEnum.DSTU3) {
resourceProviders = appCtx.getBean("myResourceProvidersDstu3", ResourceProviderFactory.class);
systemProvider = appCtx.getBean("mySystemProviderDstu3", JpaSystemProviderDstu3.class);
} else if (fhirVersion == FhirVersionEnum.R4) {
resourceProviders = appCtx.getBean("myResourceProvidersR4", ResourceProviderFactory.class);
systemProvider = appCtx.getBean("mySystemProviderR4", JpaSystemProviderR4.class);
} else if (fhirVersion == FhirVersionEnum.R5) {
resourceProviders = appCtx.getBean("myResourceProvidersR5", ResourceProviderFactory.class);
systemProvider = appCtx.getBean("mySystemProviderR5", JpaSystemProviderR5.class);
} else {
throw new IllegalStateException();
}
setFhirContext(appCtx.getBean(FhirContext.class));
registerProviders(resourceProviders.createProviders());
registerProvider(systemProvider);