Stream: implementers
Topic: Change DataSource
Con McGourty (Nov 03 2016 at 13:51):
Anyone know where to start in regards changing the DataSource on FHIR Spark Server?
Geoff Low (Nov 03 2016 at 13:53):
I know nothing about the project itself - but https://github.com/furore-fhir/spark/blob/master/src/Spark/Web.Release.config looks interesting
Martijn Harthoorn (Nov 03 2016 at 14:46):
Con, is your goal to point to a different MongoDb server, or to implement a different kind of database (like SQL)?
Con McGourty (Nov 03 2016 at 14:47):
I'm looking to implement an SQL server specifically.
Martijn Harthoorn (Nov 03 2016 at 14:48):
There is a bit of documentation here:
https://github.com/furore-fhir/spark/wiki/Fitting-Spark-in-my-environment
Martijn Harthoorn (Nov 03 2016 at 14:48):
You basically have to implement your own Store.
Martijn Harthoorn (Nov 03 2016 at 14:48):
And if you want to implement your own search index, things get a lot more complicated.
Martijn Harthoorn (Nov 03 2016 at 14:49):
But search is a complicated topic ;)
Martijn Harthoorn (Nov 03 2016 at 14:50):
You can find the MongoFhirStore here:
https://github.com/furore-fhir/spark/blob/dstu2/develop/src/Spark.Mongo/Store/MongoFhirStore.cs
Con McGourty (Nov 03 2016 at 14:55):
is there anywhere I can get test data on my localhost to test out the api calls?
I have sql servers full of data but no MongoDb to work with
Bryn Rhodes (Nov 03 2016 at 17:26):
There's a SimpleStore implementation here: https://github.com/cqframework/cds-on-fhir/tree/master/Src/net/CQF/GuidanceService/Store
Bryn Rhodes (Nov 03 2016 at 17:27):
It's based on an older version of the Spark service, but I believe the Store implementation is still functional.
Bryn Rhodes (Nov 03 2016 at 17:27):
It's just file based, so you can just drop resource files in directories and it will serve them up.
Con McGourty (Nov 03 2016 at 17:28):
Would it be able to implement a SQL DB?
Con McGourty (Nov 03 2016 at 17:28):
Also Thank you
Bryn Rhodes (Nov 03 2016 at 17:28):
What type of SQL DBMS?
Con McGourty (Nov 03 2016 at 17:29):
Microsoft Management Studio DB
Con McGourty (Nov 03 2016 at 17:29):
or either a service feeding form a MS Management Studio
Con McGourty (Nov 03 2016 at 17:30):
I'm completely new to all this
Bryn Rhodes (Nov 03 2016 at 17:30):
So your tables are in an MS SQL Server, and I imagine they're things like Patient and Medication, etc. Right?
Con McGourty (Nov 03 2016 at 17:30):
YesYes
Bryn Rhodes (Nov 03 2016 at 17:31):
Using just the Spark server, you'd have to implement a Store that transformed the content from the tables into FHIR resources.
Bryn Rhodes (Nov 03 2016 at 17:31):
That would be a lot of C# code.
Bryn Rhodes (Nov 03 2016 at 17:32):
There is a tech that could help, but it would also be a fairly heavy lift, including learning the tech involved:
Con McGourty (Nov 03 2016 at 17:33):
What would you recommend me do instead?
Bryn Rhodes (Nov 03 2016 at 17:34):
Let me back up, you're trying to stand up a FHIR server on top of your existing data that could expose your content as FHIR resources?
Con McGourty (Nov 03 2016 at 17:35):
yes
Con McGourty (Nov 03 2016 at 17:36):
I have it set up out of the box with MongoDB, or at least I think I do. There is no data to work with
Bryn Rhodes (Nov 03 2016 at 17:36):
If you just want to set up a Spark test server that you can play with, you could stand one up with MongoDB and then load it with bundles.
Con McGourty (Nov 03 2016 at 17:37):
bundles?
Bryn Rhodes (Nov 03 2016 at 17:38):
A Bundle is a collection of FHIR resources, and a FHIR Server can accept a POST of a bundle at its root that will load all the resources in the Bundle.
Bryn Rhodes (Nov 03 2016 at 17:38):
e.g.: https://github.com/cqframework/payerextract/blob/master/resources/bundle-load-patient-12214.json
Con McGourty (Nov 03 2016 at 17:40):
Right and I post this though the API then?
Bryn Rhodes (Nov 03 2016 at 17:40):
Yes, and the Spark server should just push that into the MongoDB.
Bryn Rhodes (Nov 03 2016 at 17:40):
That directory has a bunch of bundles, they're STU3 (1.6) though.
Con McGourty (Nov 03 2016 at 17:41):
yeah thats loads of data to work with
Con McGourty (Nov 03 2016 at 17:41):
thank you
Con McGourty (Nov 03 2016 at 17:41):
I'll give you the full story, Ive given a task
Con McGourty (Nov 03 2016 at 17:43):
to create a FHIR server that will either call other services or read directly form our MS SQL server DB, Am I going down the right track with this Spark Server If im looking for an easy-ish tranisation to a new DataSource?
Con McGourty (Nov 03 2016 at 17:44):
Or what would you recoomend?
Bryn Rhodes (Nov 03 2016 at 17:45):
Well, yes, but it's a long road, there's a lot involved in that transformation from your local structures to the FHIR resources.
Bryn Rhodes (Nov 03 2016 at 17:45):
Spark can definitely provide the scaffolding, but the transformation logic, and supporting indexed read/write against the SQL Server as your data source is non-trivial.
Bryn Rhodes (Nov 03 2016 at 17:48):
You could start by just doing a simple transform to support say a GET on Patient to get a feel for how much is involved.
Con McGourty (Nov 03 2016 at 17:49):
Okay, no other way of getting around this?
Bryn Rhodes (Nov 03 2016 at 17:49):
Here's an open source data federation tech that we've been extending to support this use case, but it's a work in progress:
Bryn Rhodes (Nov 03 2016 at 17:49):
https://github.com/DBCG/Dataphor/tree/RESTfulCLI
Con McGourty (Nov 03 2016 at 17:56):
What is this software doing, parsing my current data in my MS SQl?
Bryn Rhodes (Nov 03 2016 at 17:58):
Providing access to current data in whatever source system it's in, yes. In your case, MSSQL.
Con McGourty (Nov 03 2016 at 18:01):
Thank you, this is a great starting point
Con McGourty (Nov 03 2016 at 18:02):
Would it be okay to contact you in the future if I run into issues?
Bryn Rhodes (Nov 03 2016 at 18:02):
Yes, please feel free to reach out.
Con McGourty (Nov 03 2016 at 18:03):
Thank you, Ill send you a mail now - bryn@databaseconsultinggroup.com
Last updated: Apr 12 2022 at 19:14 UTC