Stream: dotnet
Topic: FHIR Server with .Net
Vishal Parekh (Jan 17 2017 at 12:03):
Hi,
I am a .net developer, trying to build an API to allow third parties to get clinical data as per FHIR standard. I download and implement SPARK Server (https://github.com/furore-fhir/spark). It works as expected with mongo database. But I have to implement the same with SQL Server, as that, we are using as a database in our existing EMR application.
I am new with asp.net, so does not understand how to integrate SQL Server in place of mongo.
Any help will be appreciated.
Michel Rutten (Jan 17 2017 at 16:40):
Hi @Vishal Parekh the open source Spark FHIR server only supports MongoDB. If you want to integrate SQL Server storage into Spark, then you are on your own.
Vishal Parekh (Jan 18 2017 at 05:58):
Thanks for prompt reply.
Our whole system is developed in Dotnet with SQL Server as backend. And now we want to create FHIR Server for our EMR application. I am confused right now how to implement FHIR server so it will be a great help if you can suggest me how to implement the same.
Yunwei Wang (Jan 18 2017 at 13:02):
@Vishal Parekh You need to write your own store (for SQL server) to replace MongoStore in the Spark Server.
Ewout Kramer (Jan 18 2017 at 19:23):
Right....
Christiaan Knaap (Jan 23 2017 at 08:52):
Hello @Vishal Parekh ,
In addition to the previous answers: We're also working on a next generation of Spark that is designed to allow this: attach it to an existing (relational) database. You can contact me if you think that might be of help to you. I spoke about it briefly at the FHIR Developer Days, see https://vimeo.com/channels/hl7fhir/192101227 (from 18:43 onwards).
Muhammad Abubakar Ikram (Apr 07 2017 at 06:31):
using fhir net api how to check for a an element of a resource that it is IsSummary=true or not?
Michel Rutten (Apr 07 2017 at 13:30):
Hi @Muhammad Abubakar this information is specified by the StructureDefinition of the associated resource type. So you can resolve this structure (from specification.zip) and then look at the associated ElementDefinition.isSummary property.
Muhammad Abubakar Ikram (Apr 07 2017 at 14:01):
@Michel Rutten Can you please refer me to any guide or help me how to resolve specific structureDefinition from specification.zip I am very new to it. I even don't know how to get specification.zip
Brian Postlethwaite (Apr 07 2017 at 22:06):
Or from the object model, jut look for the attribute on your property of interest
[FhirElement("status", InSummary=true, Order=140)]
[Cardinality(Min=1,Max=1)]
public Code<Hl7.Fhir.Model.PublicationStatus> StatusElement { ....
You can see the summary is on the FhirElementAttribute.
So it really depends on what context you're at.
Just curious why you want to use the IsSummary attribute.
Brian Postlethwaite (Apr 07 2017 at 22:10):
If you're looking to implement the _summary parameter in your server, easier to just use the fhirclient serializers to do it for you. (That's what my sqlonfhir server does)
Hl7.Fhir.Serialization.FhirSerializer.SerializeResourceToXml(resource, Rest.SummaryType.Text);
(and there are json versions of this also, and ones that work on streams rather than strings)
Brian Postlethwaite (Apr 07 2017 at 22:11):
If you're implementing a server, I heavily recommend getting and understanding the source in the fhirclient that you'll be using for your models, as there is so much in there that is heavily useful.
Muhammad Abubakar Ikram (Apr 09 2017 at 16:28):
I am developing a server and I want to implement IsSummary search parameter on CapabilityStatement as docs said it is recommended.
Muhammad Abubakar Ikram (Apr 09 2017 at 16:29):
You mean source code of fhirclient? In fhir-net-api?
Brian Postlethwaite (Apr 10 2017 at 00:46):
Yes that is the code that I would recommend anyone implementing a server be very familiar with.
However I'm not sure what you're implementing, can you pass a refernce to the spec that you're referring to?
http://hl7.org/fhir/capabilitystatement.html#search (this is where the search parameters for CapabilityStatement are defined)
Brian Postlethwaite (Apr 10 2017 at 00:47):
If you're referring to http://hl7.org/fhir/search.html#summary then the FHIR serializer covers that for you (as shown in my example above).
Muhammad Abubakar Ikram (Apr 10 2017 at 06:04):
@Brian Postlethwaite I am talking about this section http://hl7.org/fhir/http.html#capabilities where docs say "Capability statements can become quite large; servers are encouraged to support the _summary and _elements parameters on the capabilities interaction" and also this http://hl7.org/fhir/search.html#summary
docs said _summary a parameter I thought this is a search parameter would you please tell what we will call this? as _summary is not in the search parameter.
I simply want to implement this http://hl7.org/fhir/search.html#summary-true IsSummary=true, after that, I'll implement other possibilities with _summary like text, data, count, false. So, for implementing IsSummary=true I want to return the resource elements of a CapabilityStatement resource that are marked as summary=true. Now, can you please guide me which way should I go?
by the way, you are using term fhirclient, you are referring to fhir rest client in the fhir-net-api? or you are referring to the whole fhir-net-api?
Brian Postlethwaite (Apr 10 2017 at 06:23):
This _summary parameter is also usable on get http://hl7.org/fhir/http.html#read and the CapabilityStatement as you've noted.
_elements will need some work, don't know anyone who's implemented that with the .net stack as yet.
For the _summary stuff, just use the fhirclient's serializer as I noted and it will do things for you. yes the fhir-net-api
Muhammad Abubakar Ikram (Apr 10 2017 at 06:26):
Let me figure it out, If I'll encounter any problem I'll bother you again. Thank you :)
Muhammad Abubakar Ikram (Apr 10 2017 at 06:38):
I got it @Brian Postlethwaite how to implement summary parameter using serializers thank you so much :)
Muhammad Abubakar Ikram (Apr 10 2017 at 06:44):
@Brian Postlethwaite with the CapabilityStatement, _summary parameter should also use with metadata endpoint? or with only read endpoint?
Brian Postlethwaite (Apr 10 2017 at 09:42):
My server implements _summary basically on all interactions (except updates)
Brian Postlethwaite (Apr 10 2017 at 09:43):
Please remember when you do restrict using the _summary=true (or others that remove stuff) that you add in the meta tag for subsetting.
Muhammad Abubakar Ikram (Apr 10 2017 at 10:27):
@Brian Postlethwaite are you talking about this "Servers are not obliged to return just a summary as requested. There are only a limited number of summary forms defined for resources in order to allow servers to store the summarized form(s) in advance. Servers SHOULD mark the resources with the tag SUBSETTED to ensure that the incomplete resource is not acidentally used to overwrite a complete resource." from http://hl7.org/fhir/search.html#summary
If you are talking about this part of the spec that I have shared then seriously I don't know what you are going to convey me. I didn't found anything in docs about SUBSETTED. Is it related to $subset operation?
Brian Postlethwaite (Apr 10 2017 at 11:23):
That is the text that I'm referring to.
If you are writing the server to process the _summary=true, then you should add a Tag to the Meta on your resources before you serialize with the _summary filter (that way you get the correct output)
e.g. http://sqlonfhir-stu3.azurewebsites.net/fhir/metadata?_summary=true
Muhammad Abubakar Ikram (Apr 12 2017 at 06:35):
If I implement OAuth2.0 on my FHIR server then FhirClient component that is part of the fhir-net-api, how will be configurable?
Yunwei Wang (Apr 12 2017 at 19:52):
You need to add Authorization header to your request. Here is a simple example from my server code:
Yunwei Wang (Apr 12 2017 at 19:53):
var client = new FhirClient(serverUrl) { PreferredFormat = ResourceFormat.Json }; client.OnBeforeRequest += (sender, e) => { e.RawRequest.Headers.Add("Authorization", "Bearer " + token); };
Brian Postlethwaite (Apr 12 2017 at 21:35):
If you're working with a UWP client, I have written the code to use the windows native UIs and handle the re-authentication as needed with SMART. Might push it to GitHub if there is interest in UWP for it.
Haven't included it in a prosuct yet, just as a proof of concept to include in some utilities.
Muhammad Abubakar Ikram (Apr 13 2017 at 08:59):
Alright Thank you :)
shivnath shelake (Dec 04 2017 at 10:59):
Hi..
My requirements is we need open source fhir server with outh2 authentication...
As we have .net application we are integrating Fhir.STU3 NuGet package in our application for resources create/update on FHIR server.
So by HSPC sandbox how I can achieve same.
I created sandbox so through .Net FHIR API how I can create/update fhir resource to HSPC sandbox server from my .Net application with security
Help is greatly appreciated...
Ewout Kramer (Dec 04 2017 at 14:48):
Hi Shivnath, you'll need the OnBeforeRequest even on the FhirClient to set your security headers!
Yunwei Wang (Dec 07 2017 at 17:20):
Here is an example: https://chat.fhir.org/#narrow/stream/dotnet/subject/adding.20headers/near/86832
shivnath shelake (Dec 21 2017 at 06:23):
Hi,
I am looking for Subscription resource in that looking for Rest-hook option..
Also I created Subscription resource on FHIR server with specified criteria after that I created the resource with subscription criteria details but not received any notification is there any configuration required to do on FHIR server for notification part.
We have C# application so How I can configure endpoint at my side what step should require for registration...
please help on this
Last updated: Apr 12 2022 at 19:14 UTC