You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am receiving unexpected results when I try to create a Patient resource with a certain extension on the Blaze server. The command I've executed to create the resource is curl -H "Content-Type: application/fhir+json" -d @patient.json https://{BASE_URL}/Patient
with the file patient.json containing the following resource:
The result varies depending on the version of Blaze being used:
When using the image samply/blaze:0.16 I receive the response {"meta":{"versionId":"3","lastUpdated":"2022-07-08T07:43:31.733Z"},"resourceType":"Patient","extension":[{"extension":[{"url":"dateTimeOfDocumentation"},{"url":"age","valueAge":{"system":"http://unitsofmeasure.org","unit":"years","value":135.52,"code":"a"}}],"url":"https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/age"}],"id":"DAO4YOFUWCD7FEPY"}
When I then query the newly created resource via a GET request to https://{BASE_URL}/fhir/Patient/DAO4YOFUWCD7FEPY, I obtain the following:
As can be seen, the extension included in the resource returned differs from the extension in the original resource, which is not what I would have expected.
When using the image samply/blaze:0.17 I get an issue with severity "error" as a reply from the server and see the following in the logs of the docker container running Blaze (with log level set to debug):
2022-07-08T07:30:13.803Z 6d3362f6db6a resource-store-kv-2 ERROR [blaze.handler.util:138] -
java.lang.Thread.run Thread.java: 833
java.util.concurrent.ThreadPoolExecutor$Worker.run ThreadPoolExecutor.java: 635
java.util.concurrent.ThreadPoolExecutor.runWorker ThreadPoolExecutor.java: 1136
java.util.concurrent.CompletableFuture$AsyncSupply.run CompletableFuture.java: 1768
blaze.async.comp//reify/get comp.clj: 141
blaze.db.resource-store.kv/get-and-parse-async/fn kv.clj: 94
blaze.db.resource-store.kv/get-and-parse kv.clj: 90
blaze.db.resource-store.kv/parse-and-conform-cbor kv.clj: 73
blaze.db.resource-store.kv/conform-cbor kv.clj: 62
blaze.fhir.spec/conform-cbor spec.clj: 75
clojure.alpha.spec/conform spec.clj: 241
clojure.alpha.spec/conform spec.clj: 245
clojure.alpha.spec.impl/and-spec-impl/reify/conform* impl.clj: 910
clojure.alpha.spec.impl/and-spec-impl/fn impl.clj: 888
clojure.alpha.spec.impl/schema-impl/reify/conform* impl.clj: 435
clojure.alpha.spec.impl/every-impl/reify/conform* impl.clj: 1087
blaze.fhir.spec.impl.specs/json-object-impl/reify/conform* specs.clj: 262
clojure.core/reduce-kv core.clj: 6919
clojure.core.protocols/fn/G protocols.clj: 175
clojure.core/fn core.clj: 6908
...
blaze.fhir.spec.impl.specs/json-object-impl/reify/fn specs.clj: 264
clojure.alpha.spec.impl/every-impl/reify/conform* impl.clj: 1087
blaze.fhir.spec.impl.specs/json-object-impl/reify/conform* specs.clj: 262
clojure.core/reduce-kv core.clj: 6919
clojure.core.protocols/fn/G protocols.clj: 175
clojure.core/fn core.clj: 6908
...
blaze.fhir.spec.impl.specs/json-object-impl/reify/fn specs.clj: 264
blaze.fhir.spec.impl.specs/cbor-primitive-impl/reify/conform* specs.clj: 171
blaze.fhir.spec.type/fn/fn type.clj: 806
blaze.fhir.spec.type/parse-date-time-value type.clj: 782
blaze.fhir.spec.type.system/parse-date-time* system.clj: 416
java.time.Year.parse Year.java: 279
java.time.Year.parse Year.java: 294
java.time.format.DateTimeFormatter.parse DateTimeFormatter.java: 1951
java.util.Objects.requireNonNull Objects.java: 233
java.lang.NullPointerException: text
Jul 08, 2022 7:30:13 AM com.github.benmanes.caffeine.cache.LocalAsyncCache lambda$handleCompletion$7
WARNING: Exception thrown during asynchronous load
java.util.concurrent.CompletionException: java.lang.NullPointerException: text
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1770)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.NullPointerException: text
at java.base/java.util.Objects.requireNonNull(Objects.java:233)
at java.base/java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1951)
at java.base/java.time.Year.parse(Year.java:294)
at java.base/java.time.Year.parse(Year.java:279)
at blaze.fhir.spec.type.system$parse_date_time_STAR_.invokeStatic(system.clj:416)
at blaze.fhir.spec.type.system$parse_date_time_STAR_.invoke(system.clj:407)
at blaze.fhir.spec.type$parse_date_time_value.invokeStatic(type.clj:782)
at blaze.fhir.spec.type$parse_date_time_value.invoke(type.clj:780)
at blaze.fhir.spec.type$fn__16256$fn__16257.invoke(type.clj:806)
at blaze.fhir.spec.impl.specs$cbor_primitive_impl$reify__18854.conform_STAR_(specs.clj:171)
at blaze.fhir.spec.impl.specs$json_object_impl$reify__18923$fn__18924.invoke(specs.clj:264)
at clojure.lang.PersistentHashMap$NodeSeq.kvreduce(PersistentHashMap.java:1307)
at clojure.lang.PersistentHashMap$BitmapIndexedNode.kvreduce(PersistentHashMap.java:802)
at clojure.lang.PersistentHashMap.kvreduce(PersistentHashMap.java:236)
at clojure.core$fn__8525.invokeStatic(core.clj:6908)
at clojure.core$fn__8525.invoke(core.clj:6888)
at clojure.core.protocols$fn__8257$G__8252__8266.invoke(protocols.clj:175)
at clojure.core$reduce_kv.invokeStatic(core.clj:6919)
at clojure.core$reduce_kv.invoke(core.clj:6910)
at blaze.fhir.spec.impl.specs$json_object_impl$reify__18923.conform_STAR_(specs.clj:262)
at clojure.alpha.spec.impl$every_impl$reify__13850.conform_STAR_(impl.clj:1087)
at blaze.fhir.spec.impl.specs$json_object_impl$reify__18923$fn__18924.invoke(specs.clj:264)
at clojure.lang.PersistentHashMap$NodeSeq.kvreduce(PersistentHashMap.java:1307)
at clojure.lang.PersistentHashMap$BitmapIndexedNode.kvreduce(PersistentHashMap.java:802)
at clojure.lang.PersistentHashMap.kvreduce(PersistentHashMap.java:236)
at clojure.core$fn__8525.invokeStatic(core.clj:6908)
at clojure.core$fn__8525.invoke(core.clj:6888)
at clojure.core.protocols$fn__8257$G__8252__8266.invoke(protocols.clj:175)
at clojure.core$reduce_kv.invokeStatic(core.clj:6919)
at clojure.core$reduce_kv.invoke(core.clj:6910)
at blaze.fhir.spec.impl.specs$json_object_impl$reify__18923.conform_STAR_(specs.clj:262)
at clojure.alpha.spec.impl$every_impl$reify__13850.conform_STAR_(impl.clj:1087)
at clojure.alpha.spec.impl$schema_impl$reify__13384.conform_STAR_(impl.clj:435)
at clojure.alpha.spec.impl$and_spec_impl$fn__13698.invoke(impl.clj:888)
at clojure.alpha.spec.impl$and_spec_impl$reify__13713.conform_STAR_(impl.clj:910)
at clojure.alpha.spec$conform.invokeStatic(spec.clj:245)
at clojure.alpha.spec$conform.invoke(spec.clj:237)
at clojure.alpha.spec$conform.invokeStatic(spec.clj:241)
at clojure.alpha.spec$conform.invoke(spec.clj:237)
at blaze.fhir.spec$conform_cbor.invokeStatic(spec.clj:75)
at blaze.fhir.spec$conform_cbor.invoke(spec.clj:65)
at blaze.db.resource_store.kv$conform_cbor.invokeStatic(kv.clj:62)
at blaze.db.resource_store.kv$conform_cbor.invoke(kv.clj:61)
at blaze.db.resource_store.kv$parse_and_conform_cbor.invokeStatic(kv.clj:73)
at blaze.db.resource_store.kv$parse_and_conform_cbor.invoke(kv.clj:70)
at blaze.db.resource_store.kv$get_and_parse.invokeStatic(kv.clj:90)
at blaze.db.resource_store.kv$get_and_parse.invoke(kv.clj:89)
at blaze.db.resource_store.kv$get_and_parse_async$fn__27940.invoke(kv.clj:94)
at blaze.async.comp$$reify__9476.get(comp.clj:141)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
... 3 more
It would be excellent if there would be a way to successfully create the resource in a recent version of Blaze in such a way that it can then be retrieved with the extension preserved exactly as it was in the original resource.
The text was updated successfully, but these errors were encountered:
alexanderkiel
changed the title
Unexpected results when creating a Patient resource with a certain extension
Fix Deserialisation of Primitive Values in Extensions
Jul 13, 2022
HI @RaffaelBild thanks for reporting. If you have already imported your data, you have to start with an empty database, because the Blaze was storing the data wrong. If you like preserve your data, please file a new issue or contact me at chat.fhir.org.
Hello,
I am receiving unexpected results when I try to create a Patient resource with a certain extension on the Blaze server. The command I've executed to create the resource is
curl -H "Content-Type: application/fhir+json" -d @patient.json https://{BASE_URL}/Patient
with the file patient.json containing the following resource:
The result varies depending on the version of Blaze being used:
samply/blaze:0.16
I receive the response{"meta":{"versionId":"3","lastUpdated":"2022-07-08T07:43:31.733Z"},"resourceType":"Patient","extension":[{"extension":[{"url":"dateTimeOfDocumentation"},{"url":"age","valueAge":{"system":"http://unitsofmeasure.org","unit":"years","value":135.52,"code":"a"}}],"url":"https://www.netzwerk-universitaetsmedizin.de/fhir/StructureDefinition/age"}],"id":"DAO4YOFUWCD7FEPY"}
When I then query the newly created resource via a GET request to
https://{BASE_URL}/fhir/Patient/DAO4YOFUWCD7FEPY
, I obtain the following:As can be seen, the extension included in the resource returned differs from the extension in the original resource, which is not what I would have expected.
samply/blaze:0.17
I get an issue with severity "error" as a reply from the server and see the following in the logs of the docker container running Blaze (with log level set to debug):It would be excellent if there would be a way to successfully create the resource in a recent version of Blaze in such a way that it can then be retrieved with the extension preserved exactly as it was in the original resource.
The text was updated successfully, but these errors were encountered: