O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.
FHIR API 
for .Net programmers 
Mirjam Baltus 
FHIR Developer Days 
November 24, 2014 
© 2012 HL7 ® International. License...
Who am I? 
 Name: Mirjam Baltus-Bakker 
 Company: Furore, Amsterdam 
 Background: 
 ICT trainer 
 Furore FHIR team 
...
Using the Reference Implementations 
HL7.FHIR SUPPORT API 
© 2012 HL7 ® International. Licensed under Creative Commons. HL...
Hl7.Fhir 
- Core contents 
- Model – classes generated from the spec 
- Parsers and Serializers 
- REST functionality – Fh...
A FHIR Resource 
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trad...
A FHIR Resource in C# 
public partial class Observation : Hl7.Fhir.Model.Resource 
{ 
// Codes that provides reliability i...
Primitives are not really 
primitive… 
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Sev...
Primitives are not really 
primitive… 
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Sev...
Resource example 
using Hl7.Fhir.Model; 
var pat = new Patient(); 
pat.Name = new List<HumanName>(); 
pat.Name.Add(HumanNa...
Choice elements [x] 
public 
Hl7.Fhir.Model.CodeableConcept 
MaritalStatus { set; get; } 
public Hl7.Fhir.Model.Element 
D...
Hl7.Fhir Core 
 Model – Resources and Datatypes in the API 
 
 Parsers and Serializers 
 REST functionality – FhirClie...
Parsing example 
using Hl7.Fhir.Serialization; 
// Suppose we have a JSON string 
string str = "{"resourceType":"Patient",...
Parsing example 2 
// Create a file-based reader for Xml 
XmlReader xr = XmlReader.Create( 
new StreamReader(@"publishobse...
Serializing example 
// Here’s our Observation again 
var obs = (Observation)FhirParser.ParseResource(xr); 
// Modify some...
Hl7.Fhir Core 
 Model – Resources and Datatypes in the API 
 
 
 Parsers and Serializers 
 REST functionality – FhirC...
REST functionality 
 REST operations done with FhirClient 
using Hl7.Fhir.Rest; 
var client = new FhirClient( 
new Uri("h...
Using the FhirClient 
var patEntry = client.Read<Patient>("Patient/1"); 
var pat = patEntry.Resource; 
var restId = patEnt...
Using the FhirClient 
var pat = new Patient() { /* set up data */ }; 
var patEntry = client.Create(pat); 
var restId = pat...
Bundles in C# 
 Abstraction on top of Atom parser 
 Bundle = feed, BundleEntry = entry. 
Bundle result = new Bundle() { ...
Search 
var criteria = new string[] { "family=Eve" }; 
Bundle result = client.Search<Patient>(criteria); 
while (result !=...
More about search 
 Please attend one of the presentations in the 
next quarter: 
 Search for Server developers 
by Mart...
Validation 
 DotNetAttributeValidation validates: 
 Cardinality of an element 
 Regex patterns of the primitives code, ...
Validation example 
using Hl7.Fhir.Validation; 
var pat = new Patient() { /* set up data */ }; 
// Will throw a Validation...
Hl7.Fhir Core 
 Model – Resources and Datatypes in the API 
 
 
 Parsers and Serializers 
 REST functionality – FhirC...
Questions? 
 http://hl7.org/fhir m.baltus@furore.com 
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & ...
Próximos SlideShares
Carregando em…5
×

de

FHIR API for .Net programmers by Mirjam Baltus Slide 1 FHIR API for .Net programmers by Mirjam Baltus Slide 2 FHIR API for .Net programmers by Mirjam Baltus Slide 3 FHIR API for .Net programmers by Mirjam Baltus Slide 4 FHIR API for .Net programmers by Mirjam Baltus Slide 5 FHIR API for .Net programmers by Mirjam Baltus Slide 6 FHIR API for .Net programmers by Mirjam Baltus Slide 7 FHIR API for .Net programmers by Mirjam Baltus Slide 8 FHIR API for .Net programmers by Mirjam Baltus Slide 9 FHIR API for .Net programmers by Mirjam Baltus Slide 10 FHIR API for .Net programmers by Mirjam Baltus Slide 11 FHIR API for .Net programmers by Mirjam Baltus Slide 12 FHIR API for .Net programmers by Mirjam Baltus Slide 13 FHIR API for .Net programmers by Mirjam Baltus Slide 14 FHIR API for .Net programmers by Mirjam Baltus Slide 15 FHIR API for .Net programmers by Mirjam Baltus Slide 16 FHIR API for .Net programmers by Mirjam Baltus Slide 17 FHIR API for .Net programmers by Mirjam Baltus Slide 18 FHIR API for .Net programmers by Mirjam Baltus Slide 19 FHIR API for .Net programmers by Mirjam Baltus Slide 20 FHIR API for .Net programmers by Mirjam Baltus Slide 21 FHIR API for .Net programmers by Mirjam Baltus Slide 22 FHIR API for .Net programmers by Mirjam Baltus Slide 23 FHIR API for .Net programmers by Mirjam Baltus Slide 24 FHIR API for .Net programmers by Mirjam Baltus Slide 25
Próximos SlideShares
HL7 Fhir for Developers
Avançar
Transfira para ler offline e ver em ecrã inteiro.

7 gostaram

Compartilhar

Baixar para ler offline

FHIR API for .Net programmers by Mirjam Baltus

Baixar para ler offline

FHIR API for .Net programmers by Mirjam Baltus

FHIR API for .Net programmers by Mirjam Baltus

  1. 1. FHIR API for .Net programmers Mirjam Baltus FHIR Developer Days November 24, 2014 © 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
  2. 2. Who am I?  Name: Mirjam Baltus-Bakker  Company: Furore, Amsterdam  Background:  ICT trainer  Furore FHIR team  Contact:  m.baltus@furore.com © 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
  3. 3. Using the Reference Implementations HL7.FHIR SUPPORT API © 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
  4. 4. Hl7.Fhir - Core contents - Model – classes generated from the spec - Parsers and Serializers - REST functionality – FhirClient - Validation - Specification  NuGet “FHIR”, or GitHub “fhir-net-api” © 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
  5. 5. A FHIR Resource © 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
  6. 6. A FHIR Resource in C# public partial class Observation : Hl7.Fhir.Model.Resource { // Codes that provides reliability information about an observation public enum ObservationReliability {Ok, Ongoing, …} // Codes identifying interpretations of observations public enum ObservationInterpretation {N, A, L, H } public partial class ObservationReferenceRangeComponent : Hl7.Fhir.Model.Element { … } public CodeableConcept Name { get; set; } public List<ObservationReferenceRangeComponent> ReferenceRange { get; set;} public List<ResourceReference> Performer { get; set; } } © 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
  7. 7. Primitives are not really primitive… © 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
  8. 8. Primitives are not really primitive… © 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
  9. 9. Resource example using Hl7.Fhir.Model; var pat = new Patient(); pat.Name = new List<HumanName>(); pat.Name.Add(HumanName.ForFamily("Baltus") .WithGiven("Mirjam")); pat.MaritalStatus = new CodeableConcept("http://acme.org/MStat", "M"); pat.BirthDate = "1974-01-20"; © 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
  10. 10. Choice elements [x] public Hl7.Fhir.Model.CodeableConcept MaritalStatus { set; get; } public Hl7.Fhir.Model.Element Deceased { set; get; } pat.Deceased = new FhirBoolean(true); pat.Deceased = new FhirDateTime("2012-01-30"); © 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
  11. 11. Hl7.Fhir Core  Model – Resources and Datatypes in the API   Parsers and Serializers  REST functionality – FhirClient  Validation © 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
  12. 12. Parsing example using Hl7.Fhir.Serialization; // Suppose we have a JSON string string str = "{"resourceType":"Patient","name":" + "[{"family":["Baltus"],"given":["Mirjam"]}]}"; // Parse the Patient from the string var pat = (Patient)FhirParser.ParseResourceFromJson(str); © 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
  13. 13. Parsing example 2 // Create a file-based reader for Xml XmlReader xr = XmlReader.Create( new StreamReader(@"publishobservation-example.xml")); // Parse the Observation from the stream var obs = (Observation)FhirParser.ParseResource(xr); © 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
  14. 14. Serializing example // Here’s our Observation again var obs = (Observation)FhirParser.ParseResource(xr); // Modify some fields of the observation obs.Status = Observation.ObservationStatus.Amended; obs.Value = new Quantity() { Value = 40, Units = "g" }; // Serialize the in-memory observation to Json var jsonText = FhirSerializer.SerializeResourceToJson(obs); © 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
  15. 15. Hl7.Fhir Core  Model – Resources and Datatypes in the API    Parsers and Serializers  REST functionality – FhirClient  Validation © 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
  16. 16. REST functionality  REST operations done with FhirClient using Hl7.Fhir.Rest; var client = new FhirClient( new Uri("http://acme.org/fhir"));  Operations throw a FhirOperationException  Outcome property with OperationOutcome © 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
  17. 17. Using the FhirClient var patEntry = client.Read<Patient>("Patient/1"); var pat = patEntry.Resource; var restId = patEntry.Id; var tags = patEntry.Tags; pat.Name.Add(HumanName.ForFamily("Kramer") .WithGiven("Ewout")); client.Update<Patient>(patEntry); var myId = ResourceIdentity.Build("Patient","31"); © 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
  18. 18. Using the FhirClient var pat = new Patient() { /* set up data */ }; var patEntry = client.Create(pat); var restId = patEntry.Id; var newEntry = client.Refresh(patEntry); client.Delete(patEntry); var location = new Uri("http://acme.org/fhir/Patient/34"); client.Delete(location); © 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
  19. 19. Bundles in C#  Abstraction on top of Atom parser  Bundle = feed, BundleEntry = entry. Bundle result = new Bundle() { Title = "Demo bundle" }; result.Entries.Add(new ResourceEntry<Patient>() { LastUpdated=DateTimeOffset.Now, Resource = new Patient() }); result.Entries.Add(new DeletedEntry() { Id = new Uri("http://..."), When = DateTime.Now }); var bundleXml = FhirSerializer.SerializeBundleToXml(result); © 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
  20. 20. Search var criteria = new string[] { "family=Eve" }; Bundle result = client.Search<Patient>(criteria); while (result != null) { // Do something useful result = client.Continue(results); } © 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
  21. 21. More about search  Please attend one of the presentations in the next quarter:  Search for Server developers by Martijn Harthoorn  Search for Client developers by myself © 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
  22. 22. Validation  DotNetAttributeValidation validates:  Cardinality of an element  Regex patterns of the primitives code, date, dateTime, id, instant, oid, uri, uuid  Allowed types for a choice element (value[x]) pat.Deceased = new FhirString("Died on 2012-01-30");  Does not validate:  Conformance to ValueSet bindings  Profile conformance © 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
  23. 23. Validation example using Hl7.Fhir.Validation; var pat = new Patient() { /* set up data */ }; // Will throw a ValidationException when an error is encountered DotNetAttributeValidation.Validate(pat); // Alternatively, use the TryXXXX pattern var errors = new List<ValidationResult>(); var success = DotNetAttributeValidation.TryValidate(pat, errors); if(!success) { /* handle errors */ } © 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
  24. 24. Hl7.Fhir Core  Model – Resources and Datatypes in the API    Parsers and Serializers  REST functionality – FhirClient    Validation © 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
  25. 25. Questions?  http://hl7.org/fhir m.baltus@furore.com © 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
  • dianashah

    Aug. 3, 2021
  • MariamChaabanChoker

    Sep. 8, 2019
  • amank0611

    Aug. 19, 2019
  • Abdul_Rauf

    Jan. 3, 2018
  • 123mama

    Sep. 7, 2017
  • parulmc

    Jun. 2, 2016
  • vavenda

    Dec. 15, 2014

FHIR API for .Net programmers by Mirjam Baltus

Vistos

Vistos totais

6.952

No Slideshare

0

De incorporações

0

Número de incorporações

373

Ações

Baixados

212

Compartilhados

0

Comentários

0

Curtir

7

×