developing a fhir server using c# and mongodb, xml and json ewout kramer, furore...
TRANSCRIPT
![Page 1: Developing a FHIR Server Using C# and MongoDb, Xml and Json Ewout Kramer, Furore (e.kramer@furore.com)](https://reader030.vdocuments.net/reader030/viewer/2022020101/5514d690550346b0338b5374/html5/thumbnails/1.jpg)
Developing a FHIR Server
Using C# and MongoDb, Xml and Json
Ewout Kramer,
Furore ([email protected])
![Page 2: Developing a FHIR Server Using C# and MongoDb, Xml and Json Ewout Kramer, Furore (e.kramer@furore.com)](https://reader030.vdocuments.net/reader030/viewer/2022020101/5514d690550346b0338b5374/html5/thumbnails/2.jpg)
Architectural context
CDR
FHIR REST
Comm.Service
v3
v2
PHR
FHIR
VNA
FHIR
ETL
HIS LIMS PACS
FHIR Msg
Comm.Service
DB
![Page 3: Developing a FHIR Server Using C# and MongoDb, Xml and Json Ewout Kramer, Furore (e.kramer@furore.com)](https://reader030.vdocuments.net/reader030/viewer/2022020101/5514d690550346b0338b5374/html5/thumbnails/3.jpg)
Solution scenarios
StorageStorage
ProcessingProcessing
FHIR Resource
FHIR REST
JSON/XML
POCO/POJO
DBMS
ORM
FHIR Parser
JSON/XML
POCO/POJO
NoSql(Xml/Json)
FHIR Parser
JSON/XML
JSON/XML
NoSql(Json/Xml)
FHIR Validator
JSON/XML
XML
NoSql(Json)
FHIR Validator
![Page 4: Developing a FHIR Server Using C# and MongoDb, Xml and Json Ewout Kramer, Furore (e.kramer@furore.com)](https://reader030.vdocuments.net/reader030/viewer/2022020101/5514d690550346b0338b5374/html5/thumbnails/4.jpg)
Json and Xml Roundtrip?
<XXX xmlns=“urn:foo”> <B a=“c” /> <C>One</C> <C>Two</C> <D>One</D> <div>Not <b>so</b></div></XXX>
{ “B”: { “@a” : “c” }, “C”: [ “One”, “Two” ], “D” : “One”, “div” : { “#text” : “Not ”,
“b” : “so”}
}
![Page 5: Developing a FHIR Server Using C# and MongoDb, Xml and Json Ewout Kramer, Furore (e.kramer@furore.com)](https://reader030.vdocuments.net/reader030/viewer/2022020101/5514d690550346b0338b5374/html5/thumbnails/5.jpg)
FHIR Xml and JSon guidelines
<Person xmlns="http://www.hl7.org/fhir"> <identifiers> <identifier> <type> <code>MR</code> <system>urn:hl7-org:sid/v2-0203</system> </type> <identifier> <system>oid:1.2.36.146.595.217.0.1</system> <id>12345</id> </identifier> <assigner> <text>Acme Healthcare</text> </assigner> <period> <low>2001-05-06</low> </period> </identifier> </identifiers> <text> <status>generated</status> <xhtml xmlns="http://www.w3.org/1999/xhtml"> <table> <tbody> <tr>
"Person" : { "identifiers" : [ { "identifier" : { "type" : { "code" : "MR",
"system" : "urn:hl7-org:sid/v2-0203“ }
} } ], "text" : { "status" : "generated", "xhtml" : "<table><tbody><tr><td>Name</td>
<td>Peter James <b>Chalmers</b> </table></tbody></table>"
} }
![Page 6: Developing a FHIR Server Using C# and MongoDb, Xml and Json Ewout Kramer, Furore (e.kramer@furore.com)](https://reader030.vdocuments.net/reader030/viewer/2022020101/5514d690550346b0338b5374/html5/thumbnails/6.jpg)
Two ways of storing in MongoDb
var database = server.GetDatabase("test");
var collection = database.GetCollection<Entity>("entities");
var entity = new Entity { Name = "Tom" }; collection.Insert(entity); var id = entity.Id;
BsonDocument nested = new BsonDocument {
{ "name", "John Doe" }, { "address", new BsonDocument
{ { "street", "123 Main St." }, { "city", "Centerville" }, { "zip", 12345 }
}}
};collection.Insert(nested);
![Page 7: Developing a FHIR Server Using C# and MongoDb, Xml and Json Ewout Kramer, Furore (e.kramer@furore.com)](https://reader030.vdocuments.net/reader030/viewer/2022020101/5514d690550346b0338b5374/html5/thumbnails/7.jpg)
What a detour….
Json -> XML -> Json -> Bson
![Page 8: Developing a FHIR Server Using C# and MongoDb, Xml and Json Ewout Kramer, Furore (e.kramer@furore.com)](https://reader030.vdocuments.net/reader030/viewer/2022020101/5514d690550346b0338b5374/html5/thumbnails/8.jpg)
![Page 9: Developing a FHIR Server Using C# and MongoDb, Xml and Json Ewout Kramer, Furore (e.kramer@furore.com)](https://reader030.vdocuments.net/reader030/viewer/2022020101/5514d690550346b0338b5374/html5/thumbnails/9.jpg)
ResourceRecord-RecordId, Version -State-CreationDate, Author
ResourceRecord-RecordId, Version -State-CreationDate, Author
ResourceRecord-RecordId, Version -State-CreationDate, Author
Storing a resource as a record
ResourceInstance-AsJson(), ToJson(), …-GetElement(), ReplaceElement()-ResourceId, Location, Type
FHIR ResourceData (XML)
![Page 10: Developing a FHIR Server Using C# and MongoDb, Xml and Json Ewout Kramer, Furore (e.kramer@furore.com)](https://reader030.vdocuments.net/reader030/viewer/2022020101/5514d690550346b0338b5374/html5/thumbnails/10.jpg)
![Page 11: Developing a FHIR Server Using C# and MongoDb, Xml and Json Ewout Kramer, Furore (e.kramer@furore.com)](https://reader030.vdocuments.net/reader030/viewer/2022020101/5514d690550346b0338b5374/html5/thumbnails/11.jpg)
How do I do transactions/locking?MongoDB does not use traditional locking or complex transactions with rollback, as it is designed to be lightweight and fast and predictable in its performance. It can be thought of as analogous to the MySQL MyISAM autocommit model. By keeping transaction support extremely simple, performance is enhanced, especially in a system that may run across many servers.
![Page 12: Developing a FHIR Server Using C# and MongoDb, Xml and Json Ewout Kramer, Furore (e.kramer@furore.com)](https://reader030.vdocuments.net/reader030/viewer/2022020101/5514d690550346b0338b5374/html5/thumbnails/12.jpg)
Brewer’s CAP theorem
Consistency, Availability and Partition tolerance
Pick any two…
C
A P
![Page 13: Developing a FHIR Server Using C# and MongoDb, Xml and Json Ewout Kramer, Furore (e.kramer@furore.com)](https://reader030.vdocuments.net/reader030/viewer/2022020101/5514d690550346b0338b5374/html5/thumbnails/13.jpg)
![Page 14: Developing a FHIR Server Using C# and MongoDb, Xml and Json Ewout Kramer, Furore (e.kramer@furore.com)](https://reader030.vdocuments.net/reader030/viewer/2022020101/5514d690550346b0338b5374/html5/thumbnails/14.jpg)
![Page 15: Developing a FHIR Server Using C# and MongoDb, Xml and Json Ewout Kramer, Furore (e.kramer@furore.com)](https://reader030.vdocuments.net/reader030/viewer/2022020101/5514d690550346b0338b5374/html5/thumbnails/15.jpg)
![Page 16: Developing a FHIR Server Using C# and MongoDb, Xml and Json Ewout Kramer, Furore (e.kramer@furore.com)](https://reader030.vdocuments.net/reader030/viewer/2022020101/5514d690550346b0338b5374/html5/thumbnails/16.jpg)
http://fhir.apphb.com/fhir/help
![Page 17: Developing a FHIR Server Using C# and MongoDb, Xml and Json Ewout Kramer, Furore (e.kramer@furore.com)](https://reader030.vdocuments.net/reader030/viewer/2022020101/5514d690550346b0338b5374/html5/thumbnails/17.jpg)
26th Annual Plenary & Working Group MeetingSep 9, 2012 to Sep 14, 2012 - Baltimore, MD
(Dutchies take note: September 12th general elections!)
SATURDAY SEPTEMBER 8th
FIRST FHIR CONNECTATHON