Giter VIP home page Giter VIP logo

fhir's People

Contributors

cmoesel avatar eedrummer avatar eug48 avatar richbraman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fhir's Issues

Enable searching through all resources

According to the FHIR search spec, seaching all resources that match a provided parameter is possible:

All resource types: GET [base]?parameter(s) (parameters common to all types). If the _type parameter is included, all other search parameters SHALL be common to all provided types. If _type is not included, all parameters SHALL be common to all resource types.

https://www.hl7.org/fhir/search.html#Introduction

Currently, it doesn't seem that this is supported in this server implementation.

Alternatively, what other ways do I have currently to GET all resources specific to a Patient?

Parallel writes end up in write conflicts

When multiple processes try to write to the fhir server, the requests fail with write conflicts. I am able to work around this issue by using the X-Mutex-Name header documented here but I was wondering whether this issue is meant to be fixed appropriately by having some sort of deterministic concurrency control baked into the server.

ps.1 The writes in the server are independent resources in my case (they are all resource creations).

ps.2 I am using the all-in-one image that bakes Mongo in it.

handlePanics: recovered: (WriteConflict) WriteConflict
MongoDB operation error (/go/src/github.com/eug48/fhir/server/mongo_data_access.go:434)
github.com/eug48/fhir/server.convertMongoErr
	/go/src/github.com/eug48/fhir/server/mongo_data_access.go:1148
github.com/eug48/fhir/server.(*mongoSession).PostWithID
	/go/src/github.com/eug48/fhir/server/mongo_data_access.go:434
github.com/eug48/fhir/server.(*BatchController).doRequest
	/go/src/github.com/eug48/fhir/server/batch_controller.go:417
github.com/eug48/fhir/server.(*BatchController).Post
	/go/src/github.com/eug48/fhir/server/batch_controller.go:303
github.com/eug48/fhir/server.(*BatchController).Post-fm
	/go/src/github.com/eug48/fhir/server/routing.go:128
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109
github.com/eug48/fhir/fhir-server/middleware.ClientSpecifiedMutexesMiddleware.func2
	/go/src/github.com/eug48/fhir/fhir-server/middleware/client_specified_mutexes.go:95
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109
github.com/eug48/fhir/server.AbortNonFhirXMLorJSONRequestsMiddleware
	/go/src/github.com/eug48/fhir/server/middleware.go:43
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109
github.com/eug48/fhir/server.EnableXmlToJsonConversionMiddleware.func1
	/go/src/github.com/eug48/fhir/server/middleware.go:14
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.RecoveryWithWriter.func1
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/recovery.go:76
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.LoggerWithWriter.func1
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/logger.go:84
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/gin.go:383
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/gin.go:349
net/http.serverHandler.ServeHTTP
	/usr/local/go/src/net/http/server.go:2697
net/http.(*conn).serve
	/usr/local/go/src/net/http/server.go:1830
runtime.goexit
	/usr/local/go/src/runtime/asm_amd64.s:2361
failed to create Encounter
github.com/eug48/fhir/server.(*BatchController).doRequest
	/go/src/github.com/eug48/fhir/server/batch_controller.go:419
github.com/eug48/fhir/server.(*BatchController).Post
	/go/src/github.com/eug48/fhir/server/batch_controller.go:303
github.com/eug48/fhir/server.(*BatchController).Post-fm
	/go/src/github.com/eug48/fhir/server/routing.go:128
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109
github.com/eug48/fhir/fhir-server/middleware.ClientSpecifiedMutexesMiddleware.func2
	/go/src/github.com/eug48/fhir/fhir-server/middleware/client_specified_mutexes.go:95
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109
github.com/eug48/fhir/server.AbortNonFhirXMLorJSONRequestsMiddleware
	/go/src/github.com/eug48/fhir/server/middleware.go:43
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109
github.com/eug48/fhir/server.EnableXmlToJsonConversionMiddleware.func1
	/go/src/github.com/eug48/fhir/server/middleware.go:14
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.RecoveryWithWriter.func1
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/recovery.go:76
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.LoggerWithWriter.func1
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/logger.go:84
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/gin.go:383
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/gin.go:349
net/http.serverHandler.ServeHTTP
	/usr/local/go/src/net/http/server.go:2697
net/http.(*conn).serve
	/usr/local/go/src/net/http/server.go:1830
runtime.goexit
	/usr/local/go/src/runtime/asm_amd64.s:2361
    goroutine 15 [running]:
runtime/debug.Stack(0x149e000, 0xc42066da00, 0x149e000)
	/usr/local/go/src/runtime/debug/stack.go:24 +0xa7
github.com/eug48/fhir/server.ErrorToOpOutcome(0xf54200, 0xc421e3ac80, 0xc4214e1580, 0x1)
	/go/src/github.com/eug48/fhir/server/errors.go:29 +0x474
github.com/eug48/fhir/server.(*BatchController).Post(0xc4200f9b80, 0xc4217ac370)
	/go/src/github.com/eug48/fhir/server/batch_controller.go:318 +0x25f4
github.com/eug48/fhir/server.(*BatchController).Post-fm(0xc4217ac370)
	/go/src/github.com/eug48/fhir/server/routing.go:128 +0x34
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next(0xc4217ac370)
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109 +0x43
github.com/eug48/fhir/fhir-server/middleware.ClientSpecifiedMutexesMiddleware.func2(0xc4217ac370)
	/go/src/github.com/eug48/fhir/fhir-server/middleware/client_specified_mutexes.go:95 +0xbc
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next(0xc4217ac370)
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109 +0x43
github.com/eug48/fhir/server.AbortNonFhirXMLorJSONRequestsMiddleware(0xc4217ac370)
	/go/src/github.com/eug48/fhir/server/middleware.go:43 +0x1c7
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next(0xc4217ac370)
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109 +0x43
github.com/eug48/fhir/server.EnableXmlToJsonConversionMiddleware.func1(0xc4217ac370)
	/go/src/github.com/eug48/fhir/server/middleware.go:14 +0x9e
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next(0xc4217ac370)
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109 +0x43
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.RecoveryWithWriter.func1(0xc4217ac370)
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/recovery.go:76 +0x5a
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next(0xc4217ac370)
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109 +0x43
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.LoggerWithWriter.func1(0xc4217ac370)
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/logger.go:84 +0xcc
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next(0xc4217ac370)
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109 +0x43
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Engine).handleHTTPRequest(0xc420386000, 0xc4217ac370)
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/gin.go:383 +0x586
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Engine).ServeHTTP(0xc420386000, 0x14a4f60, 0xc420384fc0, 0xc4210a2800)
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/gin.go:349 +0x153
net/http.serverHandler.ServeHTTP(0xc4200a9a00, 0x14a4f60, 0xc420384fc0, 0xc4210a2800)
	/usr/local/go/src/net/http/server.go:2697 +0xbc
net/http.(*conn).serve(0xc4214fd680, 0x14a71a0, 0xc42270f640)
	/usr/local/go/src/net/http/server.go:1830 +0x651
created by net/http.(*Server).Serve
	/usr/local/go/src/net/http/server.go:2798 +0x27b
[GIN] 2019/05/22 - 11:08:34 | 500 |    322.9276ms |       10.1.11.3 | POST     /


2019/05/22 11:08:34 [Recovery] 2019/05/22 - 11:08:34 panic recovered:
POST / HTTP/1.1
Host: fhirserver:3001
Accept-Encoding: gzip
Content-Length: 1117334
Content-Type: application/json
User-Agent: Go-http-client/1.1


session.Finish error: (NoSuchTransaction) Transaction 1 has been aborted.
/usr/local/go/src/runtime/panic.go:502 (0x4344b8)
/go/src/github.com/eug48/fhir/server/mongo_data_access.go:115 (0xd7df3f)
/go/src/github.com/eug48/fhir/server/batch_controller.go:321 (0xd76e85)
/go/src/github.com/eug48/fhir/server/routing.go:128 (0xd99813)
/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109 (0x947e52)
/go/src/github.com/eug48/fhir/fhir-server/middleware/client_specified_mutexes.go:95 (0x9a37eb)
/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109 (0x947e52)
/go/src/github.com/eug48/fhir/server/middleware.go:43 (0xd7d0b6)
/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109 (0x947e52)
/go/src/github.com/eug48/fhir/server/middleware.go:14 (0xd98dbd)
/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109 (0x947e52)
/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/recovery.go:76 (0x959d69)
/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109 (0x947e52)
/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/logger.go:84 (0x958bbb)
/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109 (0x947e52)
/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/gin.go:383 (0x950a25)
/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/gin.go:349 (0x9502b2)
/usr/local/go/src/net/http/server.go:2697 (0x68bc0b)
/usr/local/go/src/net/http/server.go:1830 (0x687d40)
/usr/local/go/src/runtime/asm_amd64.s:2361 (0x460df0)

handlePanics: recovered: (WriteConflict) WriteConflict
MongoDB operation error (/go/src/github.com/eug48/fhir/server/mongo_data_access.go:434)
github.com/eug48/fhir/server.convertMongoErr
	/go/src/github.com/eug48/fhir/server/mongo_data_access.go:1148
github.com/eug48/fhir/server.(*mongoSession).PostWithID
	/go/src/github.com/eug48/fhir/server/mongo_data_access.go:434
github.com/eug48/fhir/server.(*BatchController).doRequest
	/go/src/github.com/eug48/fhir/server/batch_controller.go:417
github.com/eug48/fhir/server.(*BatchController).Post
	/go/src/github.com/eug48/fhir/server/batch_controller.go:303
github.com/eug48/fhir/server.(*BatchController).Post-fm
	/go/src/github.com/eug48/fhir/server/routing.go:128
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109
github.com/eug48/fhir/fhir-server/middleware.ClientSpecifiedMutexesMiddleware.func2
	/go/src/github.com/eug48/fhir/fhir-server/middleware/client_specified_mutexes.go:95
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109
github.com/eug48/fhir/server.AbortNonFhirXMLorJSONRequestsMiddleware
	/go/src/github.com/eug48/fhir/server/middleware.go:43
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109
github.com/eug48/fhir/server.EnableXmlToJsonConversionMiddleware.func1
	/go/src/github.com/eug48/fhir/server/middleware.go:14
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.RecoveryWithWriter.func1
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/recovery.go:76
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.LoggerWithWriter.func1
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/logger.go:84
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/gin.go:383
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/gin.go:349
net/http.serverHandler.ServeHTTP
	/usr/local/go/src/net/http/server.go:2697
net/http.(*conn).serve
	/usr/local/go/src/net/http/server.go:1830
runtime.goexit
	/usr/local/go/src/runtime/asm_amd64.s:2361
failed to create Encounter
github.com/eug48/fhir/server.(*BatchController).doRequest
	/go/src/github.com/eug48/fhir/server/batch_controller.go:419
github.com/eug48/fhir/server.(*BatchController).Post
	/go/src/github.com/eug48/fhir/server/batch_controller.go:303
github.com/eug48/fhir/server.(*BatchController).Post-fm
	/go/src/github.com/eug48/fhir/server/routing.go:128
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109
github.com/eug48/fhir/fhir-server/middleware.ClientSpecifiedMutexesMiddleware.func2
	/go/src/github.com/eug48/fhir/fhir-server/middleware/client_specified_mutexes.go:95
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109
github.com/eug48/fhir/server.AbortNonFhirXMLorJSONRequestsMiddleware
	/go/src/github.com/eug48/fhir/server/middleware.go:43
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109
github.com/eug48/fhir/server.EnableXmlToJsonConversionMiddleware.func1
	/go/src/github.com/eug48/fhir/server/middleware.go:14
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.RecoveryWithWriter.func1
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/recovery.go:76
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.LoggerWithWriter.func1
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/logger.go:84
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/gin.go:383
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Engine).ServeHTTP
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/gin.go:349
net/http.serverHandler.ServeHTTP
	/usr/local/go/src/net/http/server.go:2697
net/http.(*conn).serve
	/usr/local/go/src/net/http/server.go:1830
runtime.goexit
	/usr/local/go/src/runtime/asm_amd64.s:2361
    goroutine 52 [running]:
runtime/debug.Stack(0x149e000, 0xc420365600, 0x149e000)
	/usr/local/go/src/runtime/debug/stack.go:24 +0xa7
github.com/eug48/fhir/server.ErrorToOpOutcome(0xf54200, 0xc4203fba00, 0xc421e27580, 0x1)
	/go/src/github.com/eug48/fhir/server/errors.go:29 +0x474
github.com/eug48/fhir/server.(*BatchController).Post(0xc4200f9b80, 0xc4217ac420)
	/go/src/github.com/eug48/fhir/server/batch_controller.go:318 +0x25f4
github.com/eug48/fhir/server.(*BatchController).Post-fm(0xc4217ac420)
	/go/src/github.com/eug48/fhir/server/routing.go:128 +0x34
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next(0xc4217ac420)
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109 +0x43
github.com/eug48/fhir/fhir-server/middleware.ClientSpecifiedMutexesMiddleware.func2(0xc4217ac420)
	/go/src/github.com/eug48/fhir/fhir-server/middleware/client_specified_mutexes.go:95 +0xbc
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next(0xc4217ac420)
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109 +0x43
github.com/eug48/fhir/server.AbortNonFhirXMLorJSONRequestsMiddleware(0xc4217ac420)
	/go/src/github.com/eug48/fhir/server/middleware.go:43 +0x1c7
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next(0xc4217ac420)
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109 +0x43
github.com/eug48/fhir/server.EnableXmlToJsonConversionMiddleware.func1(0xc4217ac420)
	/go/src/github.com/eug48/fhir/server/middleware.go:14 +0x9e
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next(0xc4217ac420)
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109 +0x43
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.RecoveryWithWriter.func1(0xc4217ac420)
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/recovery.go:76 +0x5a
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next(0xc4217ac420)
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109 +0x43
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.LoggerWithWriter.func1(0xc4217ac420)
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/logger.go:84 +0xcc
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Context).Next(0xc4217ac420)
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109 +0x43
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Engine).handleHTTPRequest(0xc420386000, 0xc4217ac420)
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/gin.go:383 +0x586
github.com/eug48/fhir/vendor/github.com/gin-gonic/gin.(*Engine).ServeHTTP(0xc420386000, 0x14a4f60, 0xc420385180, 0xc4210a2a00)
	/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/gin.go:349 +0x153
net/http.serverHandler.ServeHTTP(0xc4200a9a00, 0x14a4f60, 0xc420385180, 0xc4210a2a00)
	/usr/local/go/src/net/http/server.go:2697 +0xbc
net/http.(*conn).serve(0xc422cde460, 0x14a71a0, 0xc42270f8c0)
	/usr/local/go/src/net/http/server.go:1830 +0x651
created by net/http.(*Server).Serve
	/usr/local/go/src/net/http/server.go:2798 +0x27b
[GIN] 2019/05/22 - 11:08:34 | 500 |    249.0425ms |       10.1.11.6 | POST     /


2019/05/22 11:08:34 [Recovery] 2019/05/22 - 11:08:34 panic recovered:
POST / HTTP/1.1
Host: fhirserver:3001
Accept-Encoding: gzip
Content-Length: 1117334
Content-Type: application/json
User-Agent: Go-http-client/1.1


session.Finish error: (NoSuchTransaction) Transaction 1 has been aborted.
/usr/local/go/src/runtime/panic.go:502 (0x4344b8)
/go/src/github.com/eug48/fhir/server/mongo_data_access.go:115 (0xd7df3f)
/go/src/github.com/eug48/fhir/server/batch_controller.go:321 (0xd76e85)
/go/src/github.com/eug48/fhir/server/routing.go:128 (0xd99813)
/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109 (0x947e52)
/go/src/github.com/eug48/fhir/fhir-server/middleware/client_specified_mutexes.go:95 (0x9a37eb)
/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109 (0x947e52)
/go/src/github.com/eug48/fhir/server/middleware.go:43 (0xd7d0b6)
/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109 (0x947e52)
/go/src/github.com/eug48/fhir/server/middleware.go:14 (0xd98dbd)
/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109 (0x947e52)
/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/recovery.go:76 (0x959d69)
/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109 (0x947e52)
/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/logger.go:84 (0x958bbb)
/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/context.go:109 (0x947e52)
/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/gin.go:383 (0x950a25)
/go/src/github.com/eug48/fhir/vendor/github.com/gin-gonic/gin/gin.go:349 (0x9502b2)
/usr/local/go/src/net/http/server.go:2697 (0x68bc0b)
/usr/local/go/src/net/http/server.go:1830 (0x687d40)
/usr/local/go/src/runtime/asm_amd64.s:2361 (0x460df0)

/Patient/nonexistentid/$everything returns 200

When querying a non-existent ID with the patient ID as the last part of the path, 404 is returned correctly but when $everything is added in the end, 200 is returned instead of 404.

$ curl -vvv localhost:3001/Patient/X32824200X
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 3001 (#0)
> GET /Patient/X32824200X HTTP/1.1
> Host: localhost:3001
> User-Agent: curl/7.54.0
> Accept: */*
> 
< HTTP/1.1 404 Not Found
< Vary: Origin
< X-Mutex-Used: 0
< Date: Sun, 13 Oct 2019 20:05:38 GMT
< Content-Length: 0
< 
* Connection #0 to host localhost left intact

$ curl -vvv localhost:3001/Patient/X32824200X/\$everything
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 3001 (#0)
> GET /Patient/X32824200X/$everything HTTP/1.1
> Host: localhost:3001
> User-Agent: curl/7.54.0
> Accept: */*
> 
< HTTP/1.1 200 OK
< Content-Type: application/fhir+json; charset=utf-8
< Vary: Origin
< X-Mutex-Used: 0
< Date: Sun, 13 Oct 2019 20:06:05 GMT
< Content-Length: 378
< 
* Connection #0 to host localhost left intact
{"resourceType":"Bundle","meta":{"lastUpdated":"2019-10-13T20:06:05Z"},"type":"searchset","id":"5da383adfeec7576da2c0455","link":[{"relation":"self","url":"http://localhost:3001/Patient?_id=X32824200X&_offset=0&_count=100&_include=%2A&_revinclude=%2A"},{"relation":"first","url":"http://localhost:3001/Patient?_id=X32824200X&_offset=0&_count=100&_include=%2A&_revinclude=%2A"}]}

server log:

[GIN] 2019/10/13 - 20:05:44 | 404 |       7.187µs |      172.17.0.1 | GET      /Patient/X32824200X
[GIN] 2019/10/13 - 20:06:05 | 200 |    9.484635ms |      172.17.0.1 | GET      /Patient/X32824200X/$everything

docker build issue

Trying to build from a4169fa

Step 8/13 : RUN CGO_ENABLED=0 GOOS=linux go build
 ---> Running in 6f201fc092fd
middleware/file_logger.go:15:2: build constraints exclude all Go files in /go/src/github.com/eug48/fhir/vendor/github.com/DataDog/zstd
The command '/bin/sh -c CGO_ENABLED=0 GOOS=linux go build' returned a non-zero code: 1

docker build failure

$ docker build -f Dockerfile-with-mongo -t my-fhir-server-with-mongo:2018-07-12a .
Sending build context to Docker daemon  36.78MB
Step 1/13 : FROM golang:1.10.2 as builder
1.10.2: Pulling from library/golang
cc1a78bfd46b: Pull complete 
d2c05365ee2a: Pull complete 
231cb0e216d3: Pull complete 
3d2aa70286b8: Pull complete 
6b387538c1ae: Pull complete 
39f9c30eddc9: Pull complete 
f4e296016ab6: Pull complete 
Digest: sha256:8b3ed28f0d8bfc47159744481fa58b6f89867579de3b724bd328862a8dcded43
Status: Downloaded newer image for golang:1.10.2
 ---> 3f30f1fc3c43
Step 2/13 : RUN curl -fsSL -o /usr/local/bin/dep https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64 && chmod +x /usr/local/bin/dep
 ---> Running in 9ae80d1065cd
Removing intermediate container 9ae80d1065cd
 ---> b3a02514c22c
Step 3/13 : WORKDIR /go/src/github.com/eug48/fhir/
 ---> Running in 70bf47ad16fb
Removing intermediate container 70bf47ad16fb
 ---> cf980caccda9
Step 4/13 : COPY Gopkg.toml Gopkg.lock ./
 ---> 60a118db3b73
Step 5/13 : RUN dep ensure --vendor-only -v
 ---> Running in 690663e50d44
(1/62) Wrote github.com/modern-go/[email protected]
(2/62) Wrote github.com/manucorporat/stats@master
(3/62) Wrote github.com/pmezard/[email protected]
(4/62) Wrote github.com/mattn/[email protected]
(5/62) Wrote github.com/pebbe/util@master
(6/62) Wrote github.com/kr/[email protected]
(7/62) Wrote github.com/modern-go/[email protected]
(8/62) Wrote github.com/boj/[email protected]
(9/62) Wrote github.com/mitre/heart@master
(10/62) Wrote github.com/bitly/[email protected]
(11/62) Wrote github.com/pkg/[email protected]
(12/62) Wrote github.com/thinkerou/[email protected]
(13/62) Wrote github.com/buger/jsonparser@master
(14/62) Wrote golang.org/x/sync@master
(15/62) Wrote github.com/xdg/[email protected]
(16/62) Wrote golang.org/x/lint@master
(17/62) Wrote github.com/xdg/scram@master
(18/62) Wrote golang.org/x/oauth2@master
(19/62) Wrote github.com/DataDog/[email protected]
(20/62) Wrote gopkg.in/[email protected]
(21/62) Wrote gopkg.in/tomb.v2@v2
(22/62) Wrote github.com/stretchr/[email protected]
(23/62) Wrote gopkg.in/check.v1@v1
(24/62) Wrote github.com/corpix/uarand@master
(25/62) Wrote gopkg.in/go-playground/[email protected]
(26/62) Wrote github.com/davecgh/[email protected]
(27/62) Wrote github.com/dlclark/[email protected]
(28/62) Wrote google.golang.org/[email protected]
(29/62) Wrote github.com/dustin/go-broadcast@master
(30/62) Wrote gopkg.in/square/[email protected]
(31/62) Wrote github.com/dop251/goja@master
(32/62) Wrote github.com/garyburd/[email protected]
(33/62) Wrote github.com/gin-gonic/[email protected]
(34/62) Wrote github.com/gin-contrib/sse@master
(35/62) Wrote github.com/go-sourcemap/[email protected]
(36/62) Wrote github.com/gin-gonic/contrib@master
(37/62) Wrote github.com/ugorji/[email protected]
(38/62) Wrote github.com/google/[email protected]
(39/62) Wrote github.com/go-stack/[email protected]
(40/62) Wrote github.com/gorilla/[email protected]
(41/62) Wrote github.com/gorilla/[email protected]
(42/62) Wrote golang.org/x/crypto@master
(43/62) Wrote github.com/itsjamie/[email protected]
(44/62) Wrote github.com/gorilla/[email protected]
(45/62) Wrote github.com/jessevdk/go-assets@master
(46/62) Wrote github.com/client9/[email protected]
(47/62) Wrote golang.org/x/sys@master
(48/62) Wrote github.com/gin-gonic/gin@master
(49/62) Wrote github.com/juju/errors@master
(50/62) Wrote github.com/icrowley/fake@master
(51/62) Wrote github.com/kr/[email protected]
(52/62) Wrote github.com/golang/snappy@master
(53/62) Wrote github.com/json-iterator/[email protected]
(54/62) Wrote golang.org/x/net@master
(55/62) Wrote gopkg.in/mgo.v2@v2
(56/62) Wrote golang.org/x/tools@master
(57/62) Wrote google.golang.org/[email protected]
(58/62) Wrote github.com/mongodb/[email protected]
(59/62) Wrote github.com/campoy/[email protected]
(60/62) Wrote golang.org/x/[email protected]
(61/62) Wrote github.com/golang/[email protected]
(62/62) Wrote google.golang.org/genproto@master
Removing intermediate container 690663e50d44
 ---> 9fb21d84f96d
Step 6/13 : COPY . ./
 ---> 0e2f9838732c
Step 7/13 : WORKDIR /go/src/github.com/eug48/fhir/fhir-server
 ---> Running in 84582814c65a
Removing intermediate container 84582814c65a
 ---> 3253b1761677
Step 8/13 : RUN CGO_ENABLED=0 GOOS=linux go build
 ---> Running in 0e420c5c75ef
middleware/file_logger.go:14:2: build constraints exclude all Go files in /go/src/github.com/eug48/fhir/vendor/github.com/DataDog/zstd
The command '/bin/sh -c CGO_ENABLED=0 GOOS=linux go build' returned a non-zero code: 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.