firelyteam / spark Goto Github PK
View Code? Open in Web Editor NEWFirely and Incendi's open source FHIR server
License: BSD 3-Clause "New" or "Revised" License
Firely and Incendi's open source FHIR server
License: BSD 3-Clause "New" or "Revised" License
When I do e.g.
http://spark.furore.com/fhir/DiagnosticReport/Diagnosticreport-example-dxa
Spark returns a 500 (internal server error), just because the report's id does not match the regex pattern for a valid id. This should return the appropriate 4xx (invalid request i think) status code instead. Also, the returned OperationOutcome is too cryptic.
(or incorrect)
I think Spark (or rather the WebApi2) will now return a 500 or something when you do a POST without a content-type. This is hard for users to understand and debug.
AppointmentResponse.ParticipantStatus ends with “_” to avoid overlapping names. The search index algorithm misses this.
In ElementQuery.cs some C#6 code has been introduced in the ParsePredicate function. Rework this to C#5.
Does this platform contains or supports an extension mechanism for logging or auditing?
I mean the product, not the FHIR standard.
I would like to register all the activity related to all ingoing and outgoing messages.
[16:05:23] Al Amyot: Ewout, I've also noticed that on your server, "birthdate=1945-01-01" returns 1 result and "birthDate=1945-01-01" returns ALL results. I've searched the FHIR spec for references to case sensitivity/capitalization and have not managed to find whether the terms should be case-sensitive or not. Is your server's behaviour correct? If the term should be case-sensitive, should the server return an error when the wrong one is supplied?
Finally got around to testing compressed request to FHIR server. Sorry Grahame, but it appears both your and Ewout's servers fail. It looks like both server are feeding the compressed content directly into XML processing without first decompressing the request content.
[14-6-2014 00:34:45] Richard Schneider:
PUT http://fhir.healthintersections.com.au/open/Profile/patient?_ignoreVersion=true HTTP/1.1
Category: http://hl7.fhir/example; label="FHIR example"; scheme="http://hl7.org/fhir/tag"
User-Agent: orchestral-client/0.80
Accept: application/atom+xml; q=1.0, application/xml+fhir; q=0.9, application/json+fhir; q=0.8, /; q=0.1
Content-Type: application/xml+fhir; charset=utf-8
Content-Encoding: gzip
Host: fhir.healthintersections.com.au
Content-Length: 6709
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
Spark returns this for a search inside Bundle:
<link> <relation value="self"/> <url value="http://spark-dstu2.furore.com/fhir/_snapshot?id=27e5683a-a9a5-4d98-a43d-f5e0c74f9d78&start=0&_count=20"/> </link>
The self link is supposed to contain the original query (next/prev etc. not necessarily), repeating the query parameters that have been understood by the server, so the client can determine which search params were taken into account.
If you insert ''5/3/1888" as a date for a patient, Spark will accept it.
[16-12-2014 16:44:15] Bill de Beaubien: I was playing around with pointing the SMART growth app at spark yesterday
[16-12-2014 16:44:31] Bill de Beaubien: of these requests..
[16-12-2014 16:44:33] Bill de Beaubien: http://spark.furore.com/fhir/Observation/_search?subject:Patient._id=1132446799
http://spark.furore.com/fhir/Observation/_search?subject:Patient=1132446799
[16-12-2014 16:44:52] Bill de Beaubien: it uses the 2nd form, which for some reason on spark finds nothing, though the first finds observations
[16-12-2014 16:44:56] Bill de Beaubien: is that expected?
(and maybe on search too?)
You can send a Resource to Spark with just one tag, with multiple resources inside it. This is a bug, probably due to a bug in the .NET API.
Question about Conformance - http://spark-dstu2.furore.com/fhir/Conformance lists the FHIR version as 0.2 in the first section, and then 0.4.0 in the other sections (which indicate a published date of April 2, 2015 -- 0.5.0)... Is this just a management oversight? :)
When trying to PUT a resource to a resourcetype without supplying an id, Spark returns a 405 Method not Allowed, but doesn't give the error back as an OperationOutcome. Instead, it just sends a text message {"Message":"The requested resource does not support http method 'PUT'."}
http://spark.furore.com/fhir/Profile?type=Observation seems to return observations, not profiles about Observation. Is that a bug?
Should/shouldn't they be?
When doing this:
http://spark.furore.com/fhir/DiagnosticReport?subject:Patient=pat2
the search will return all DiagnosticReports
However, when doing this:
http://spark.furore.com/fhir/DiagnosticReport?subject:Patient._id=pat2
search works correctly.
Search is also correct when doing this:
http://spark.furore.com/fhir/DiagnosticReport?subject=Patient/pat2
Currently Spark only accepts strong E-tags, but it MUST accept weak E-tags and SHOULD accept strong E-tags.
I'm using Microsoft Visual Studio Community Edition 2015, and I'm trying to compile DSTU2 so that it's like the server installed on http://spark-dstu2.furore.com/
This is probably not an issue with the software, but with my knowledge of compiling C# programs with NuGet, and my setup. But if you're able to help, that'd be great.
I'm able to build DSTU-1 with this IDE, but not DSTU-2.
I get the following error (incl a few others)
error : Unable to find version '0.50.1-alpha1' of package 'Hl7.Fhir.DSTU2'.
My Nuget explorer says that this version is installed however.
(Is there a forum where I could post this instead of posting it as an issue?)
I checked out the code like this:
git clone https://github.com/furore-fhir/spark.git spark2
cd spark2/
git checkout dstu2/master
and then I opened the spark.sln in my IDE and tried to do build all.
When using SPARK I am accessing the following : http://spark.furore.com/fhir/Patient?_include=Patient.managingOrganization and get the following
<OperationOutcome xmlns="http://hl7.org/fhir">
<issue>
<severity value="error" />
<details value="NullReferenceException: Object reference not set to an instance of an object." />
</issue>
<issue>
<severity value="information" />
<details value="at Spark.Store.MongoFhirStore.<FindByIds>b__7(Uri uri) in d:\temp\4iiddlmd.0bf\input\Spark.Store\MongoFhirStore.cs:line 138 at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext() at MongoDB.Bson.BsonArray.AddRange(IEnumerable`1 values) at MongoDB.Driver.Builders.Query.In(String name, IEnumerable`1 values) at Spark.Store.MongoFhirStore.FindByIds(IEnumerable`1 ids) in d:\temp\4iiddlmd.0bf\input\Spark.Store\MongoFhirStore.cs:line 137 at Spark.Store.MongoFhirStore.Include(Bundle bundle, String include) in d:\temp\4iiddlmd.0bf\input\Spark.Store\MongoFhirStore.cs:line 786 at Spark.Store.MongoFhirStore.Include(Bundle bundle, ICollection`1 includes) in d:\temp\4iiddlmd.0bf\input\Spark.Store\MongoFhirStore.cs:line 797 at Spark.Service.FhirService.Search(String collection, IEnumerable`1 parameters, Int32 pageSize) in d:\temp\4iiddlmd.0bf\input\Spark.Service\Service\FhirService.cs:line 222 at Spark.Controllers.FhirController.Search(String type) in d:\temp\4iiddlmd.0bf\input\Spark\Controllers\FhirController.cs:line 118 at lambda_method(Closure , Object , Object[] ) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeUsingResultConverterAsync>d__8.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.ApiController.<InvokeActionWithExceptionFilters>d__1.MoveNext()" />
</issue>
</OperationOutcome>
Martijn says:
Searching in spark has been reimplemented last month and the search without any (filtering) parameters gives the null pointer error. (known issue)
The following search
~/fhir/Encounter?patient=d1
resolves to normalized criteria {patient.internal_id=d1}
Where it should just resolve to {patient=Patient/d1}
Because the encounter should be found even if the patient is not present in the database.
Hi,
In DSTU2 when we GET search results for a resource in XML format , the response is not XML instead its wrapped in CDATA encoding. This needs to be taken care by XML parser to represent this data as XML upon retrieval. When we use tools like Fiddler or postman , this is automatically taken care by parser however when using Soap UI all my scripts which written for DSTU1 using XPath for Data validations fail.
This is observed only in case of Spark(DSTU2 code base and Test server) however when testing using Grahame's test server http://fhir-dev.healthintersections.com.au this is not observed
Thanks,
Revathy
Any plans to implement this product into Linux by using the new VS 2015 tools?
MongoDB supports Mono 3.x, so it is feasible.
Spark should retain the _count parameter, otherwise, while browsing through a result, the next/previous pages will return the default number of search results, in stead of the amount desired by the client.
I'm using your JsonFhirFormatter in my webapi application.
I've created an async DelegatingHandler which saves the response content to the database, but for some reason it keeps dead locking. I'm not certain which code is causing it (probably mine), but wondered if you had experienced this before?
This is the sample code I'm using for my Handler:
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request,
CancellationToken cancellationToken)
{
var response = await base.SendAsync(request, cancellationToken).ConfigureAwait(false);
string content = "";
if (response.Content != null)
{
var bytes = await response.Content.ReadAsByteArrayAsync().ConfigureAwait(false);
content = Encoding.UTF8.GetString(bytes);
}
//SAVE AUDIT TO DATABASE!
return response;
}
It seems to lock on the .ReadAsByteArrayAsync(). I'm not sure the .ConfigureAwait(false) is absolutely necessary, but seemed to resolve another deadlock issue I was having.
It might be useful, for me and others to include an Auditing handler in your server, as this could be a common scenario.
When creating, updating or deleting a Resource document, the result of commiting the transaction is not evaluated for failure. When the sweep() function is called to move the Resource document from 'queued' to 'current' the collection save result is not evaluated. When this fails no exception is raised and the transaction is not rolled back leaving the Resource document in the state of 'queued'.
Proposed fix is to evaluate the result of Transaction.cs line 144 to ensure the Update was successful and the documents affected is equal to 1. If this evaluation fails, the sweep() mehod will throw an exception with the details of the failure so that the transaction fails and the Rollback() method is called.
I've been trying to hit the http://spark-dstu2.furore.com/fhir/Patient endpoint since evening and I'm getting the following error -
at MongoDB.Driver.Internal.DirectMongoServerProxy.Connect(TimeSpan timeout, ReadPreference readPreference)\r\n at MongoDB.Driver.Internal.DirectMongoServerProxy.ChooseServerInstance(ReadPreference readPreference)\r\n at MongoDB.Driver.MongoServer.AcquireConnection(ReadPreference readPreference)\r\n at MongoDB.Driver.MongoCursor`1.MongoCursorConnectionProvider.AcquireConnection()\r\n at MongoDB.Driver.Operations.QueryOperation`1.GetFirstBatch(IConnectionProvider connectionProvider)\r\n at MongoDB.Driver.Operations.QueryOperation`1.Execute(IConnectionProvider connectionProvider)\r\n at MongoDB.Driver.MongoCursor`1.GetEnumerator()\r\n at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()\r\n at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)\r\n at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)\r\n at Spark.Search.Mongo.MongoSearcher.CollectKeys(IMongoQuery query)\r\n at Spark.Search.Mongo.MongoSearcher.CollectKeys(String resourceType, IEnumerable`1 criteria, SearchResults results)\r\n at Spark.Search.Mongo.MongoSearcher.Search(String resourceType, SearchParams searchCommand)\r\n at Spark.Mongo.Search.Common.MongoFhirIndex.Search(String resource, SearchParams searchCommand)\r\n at Spark.Service.FhirService.Search(String type, SearchParams searchCommand)\r\n at Spark.Controllers.FhirController.Search(String type)\r\n at lambda_method(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()"
It was working fine this morning.
At least here in California timezone (GMT-7), the History unit test on the FhirClient fails.
I'm writing a Couchbase Store for Spark and was wondering when you foresee adding Dependency Injection? I see a comment in FhirController that suggests it is planned.
If you have an Observation in your database with a quantity value of "140.0" a search with that value will not return any results (with no error)
http://zzzz z.com.au/fhir/Observation?value-quantity=140.0||mm[Hg]
however if you search for 140 (no decimal places) then it works
http://zzzz z.com.au/fhir/Observation?value-quantity=140||mm[Hg]
E.g. POST http://spark.furore.com/fhir/Patient/12.345....
I think the WebApi framework thinks you are trying to reach the "12" resource, with extension "345"
Hi guys!
I am developing FHIR- server using FHIRbase. I suggest you create nuget-package from the assembly "Spark.Engine".
Hi,
Currently as per DSTU1 for Location Resource , a type search parameter is supported which is used to search a code for the type of location. When i query using the following url :
https://localhost/FhirStudy/fhir/Location?type=rneu
The following exception is seen:
"Unknown resource collection rneu". This is because the resource type received by FHIRcontroller is rneu instead of Location.
Have any of you encountered this issue or the fix for same has been done? Please let me know.
in DSTU2 branch at line 81 of Spark.Engine/Auxiliary/XmlSignatureHelper.cs :
if (!certificate.HasPrivateKey) throw new ArgumentException("certificate", "Certificate should have a private key");
Should be:
if (!certificate.HasPrivateKey) throw new ArgumentException("Certificate should have a private key", "certificate");
$ curl get http://localhost:1496/fhir/Encounter/spark1/_history/spark1 Works!
$ curl get http://localhost:1496/fhir/Encounter/spark1 does Not work :(
See https://dl.dropboxusercontent.com/u/7449873/spark-db-issue-3m.zip for a database where this happens
Till Wednesday night, a search like
http://spark.furore.com/fhir/DiagnosticReport?subject:Patient.family=Bor
provided results.
This doesn't seem to be working now, even though when I go to http://spark.furore.com/fhir/DiagnosticReport I see results that have the patient's family name as Bor.
A couple of days ago there was discussion of servers returning partial data (for whatever business reasons) and including the SUBSETTED Tag with them.
[03:40:34] Brian Postlethwaite: Should this also be included when a search result is returned from _summary?
[03:46:59] David Hay: or REDACTED…
[03:47:22] David Hay: and I’d assume yes - for the same arguments as Paul made...
I try to post:
http://localhost:1396/fhir/Patient/?_format=json
I get the error message:
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "error",
"details": "StatusCode: 415, ReasonPhrase: 'Unsupported Media Type', Version: 1.1, Content: System.Net.Http.ObjectContent`1[[System.Web.Http.HttpError, System.Web.Http, Version=5.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]], Headers:\r\n{\r\n Content-Type: application/json; charset=utf-8\r\n}"
}
]
}
A simple JSON Fhir Message I use is:
{
"resourceType": "Patient",
"text": {
"status": "generated",
"div": "<div xmlns="http://www.w3.org/1999/xhtml\">Everywoman, Eve. SSN:\r\n 444222222\r\n \r\n \r\n \r\n "
},
"identifier": [
{
"label": "SSN",
"system": "sid/us-ssn",
"value": "444222222"
}
],
"name": [
{
"use": "official",
"family": [
"Everywoman"
],
"given": [
"Eve"
]
},
{
"family": [
"Kramer"
],
"given": [
"Ewout"
]
},
{
"family": [
"Kramer"
],
"given": [
"Ewout"
]
},
{
"family": [
"Kramer"
],
"given": [
"Ewout"
]
},
{
"family": [
"Kramer"
],
"given": [
"Ewout"
]
},
{
"family": [
"Kramer"
],
"given": [
"Ewout"
]
},
{
"family": [
"Kramer"
],
"given": [
"Ewout"
]
},
{
"family": [
"Kramer"
],
"given": [
"Ewout"
]
}
],
"telecom": [
{
"system": "phone",
"value": "555-555-2003",
"use": "work"
}
],
"gender": {
"coding": [
{
"system": "v3/AdministrativeGender",
"code": "F"
}
]
},
"birthDate": "1976-05-31",
"address": [
{
"use": "home",
"line": [
"3333 Home Street"
]
}
],
"managingOrganization": {
"reference": "Organization/hl7"
},
"active": true
}
For DSTU, Conformance statement has been extended, e.g. to include declaring chained parameters. Update the ConformanceBuilder to provide this new information.
Hi All,
I am trying to use Crucible to determine the compliance to FHIR specifications by executing the predefined FHIR Tests.When i try to run the tests , it is executing indefinitely. Can anyone please help me with this. I am unable to find good documentation on using this tool.
Also can anyone please help me with following information :
Thanks,
Revathy
80: Failed
22: Pass
Are all the unit tests up to date and in working order.
I am planning on refactoring the project to make it easier to plug in different storage and index providers.
Should I make sure the tests are up to date, or are they not being maintained.
In the C# object model there are elements for which the name end on "_" (like AppointmentResponse.ParticipantStatus). If these paths occur in the definition of search parameters, the harvester will not be able to find the appropriate element on the object model. Easy fix would be for the harvester to re-try to find a property suffixed with "_" when a property is not found.
Hi All, Went to download the latest build ,and tried to compile but ran into some small errors. I do have a fix if you need. The issue was in the web.config. I had to change the langversion to 5 from 6. May be just something on my end , but in-case someone had the same issue here is the fix.
Error was in webpage
[No relevant source lines]
in webconfig line below
compilerOptions="/langversion:5
Thanks
Brandon
It seems the dstu2 code only accepts POST requests for the _search format like this: {type}/_search
When changing to Get in the code, it works. According to the specification, it seems GET is acceptable?
For example, I think the following GET should be acceptable?
GET http://localhost:1396/fhir/Observation/_search?subject%3APatient=12345
Fix is probably in FhirController.cs? Currently the above URL gets interpreted as if "_search" is an {id} and gives an error that _search is an unknown id.
When posting a Resource with an internal #anchor in a resource reference (to a contained resource), the resource reference gets converted to a url with just "/"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.