fhir search for server devs (martijn)

58
© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office. SEARCH for server developers Martijn Harthoorn FHIR DevDays 2015 November 19, 2015

Upload: devdays

Post on 14-Apr-2017

376 views

Category:

Healthcare


2 download

TRANSCRIPT

Page 1: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

SEARCH for

server developersMartijn Harthoorn

FHIR DevDays 2015November 19, 2015

Page 2: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

2

Name: Martijn Harthoorn Company: Furore Background:

Programmer in C# (mainly)

Project manager Furore FHIR team Programmer of

Spark Search Engine SIMPLIFIER.NET search engine

Who am I?

Page 3: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

3

Dealing with what’s behind the question mark.

Search

Page 4: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

4

"FHIR client should be easy.

FHIR server needs to solve the complex issues."

Search has some…

FHIR paradigm

Page 5: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

5

Use casesfor a FHIR server

Page 6: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

6

UC1: The registrar

patient forgot hospital card (with id)

"what is your name and birthdate?"

Page 7: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

7

UC2: The doctor

“give me all data on patient x”

Page 8: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

8

UC3: The researcher

“give me all data on a specific allergy that conforms to a set of conditions”

Page 9: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

9

UC4: The manager

“how many patients did we treat last month?”

Page 10: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

10

UC5: The lab

“Give me the list of tests to process”

Page 11: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

11

UC6: The nurse

“Alert me on any patient with a measurement in the danger zone.”

Page 12: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

12

UC Summary

 - the registrar - the doctor - the researcher  - the manager - the lab worker - the nurse

Page 13: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

13

Do what?

Do what?

Search Query

"Give me your top results." "Give me exactly what I ask"

Page 14: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

14

Build upon REST

Do what?

Search Query

URL/[resource]?<parameters>

Page 15: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

15

Where do we stand?

Page 16: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

16

Types

Page 17: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

17

FHIR Data types

Page 18: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

18

Search parameters types

number

date

string

token

reference

quantity

uri

composite

Page 19: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

19

Mapping of number

number integer

Parameter data type Content data type

~/Procedure?date=>2010-01-01&date=<2011-12-31

Page 20: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

20

Mapping of date

dateDate

Parameter data type Content data type

Period

~/Procedure?date=>2010-01-01&date=<2011-12-31

DateTime

Instant

Page 21: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

21

Mapping of string

stringString

Parameter data type Content data type

HumanName

~/Patient?name=eve

Page 22: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

22

Mapping of token

tokenCoding

Parameter data type Content data type

Codeable concept

~/Patient?name=eve

Identifier

(Code)

Page 23: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

23

Mapping of quantity

quantity Quantity

Parameter data type Content data type

~/Patient?name=eve

Page 24: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

24

Logical operators

Page 25: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

25

Logical operators

a=x & c=y & e=z 

a=x & a=y

a=b,d

a-b=c$d

AND

OR / IN

(nested) AND

Page 26: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

26

Building an expression tree

URL?a=A&a=A2&c=C1,C2&d-e-=D&E

AND

EQ a=A2

OR

c=C1

c=C2

AND

d=D e=E

a A

ELEM

Page 27: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

27

Comparison operators

Page 28: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

28

Logical operators

eqnegtltgele.....

value=le100

Page 29: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

29

Levels of parameters

Page 30: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

30

Global parameters:

_id_lastupdated_tag_profile_list, ...

Levels of parameters

Page 31: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

31

Predefined parameters:

Patient.addressPatient.familyPatient.emailOrganization.nameOrganization.partof...

Levels of parameters

Page 32: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

32

Profiled parameters:

Patient.mycustomfield...

Levels of parameters

Page 33: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

33

A small historyHOW WE IMPLEMENTED SPARK reference implementation

Page 34: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

34

History

Version 1. Patient only Per parameter

No meta data No index

Limited

every change is rework

Slow!!!

Page 35: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

35

History

Version 2. All resources Self generated meta data

Indexing in Lucene Client side joins

Fast

Lot of work

Page 36: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

36

History

Version 3.

All resources Model meta data Indexing in Mongo

Even faster!

changes in the standard are now applied automatically

Page 37: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

37

Indexing

Page 38: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

38

Indexing

Page 39: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

39

Indexing

Page 40: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

40

Indexing

REST Service

Storage

Index&

Search

DB

Page 41: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

41

How to index?

Page 42: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

42

How to index?

<family value=“Chalmers”>

chalmers

Patient?name=chal

chal*match

PUT SEARCH

Page 43: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

43

How to index?

<valueQuantity=“10g”>

0.1

value-quantity=>0.1||kg

0.05>

http://unitsofmeasure.org http://unitsofmeasure.org

kg = kg

=

PUT SEARCH

Page 44: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

44

Logic and filtering

Page 45: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

45

_include_revinclude

Page 46: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

46

Chained parameters

Page 47: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

47

Paging

Page 48: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

48

Canonical search

Page 49: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

49

Canonical search

UCUM

http://unitsofmeasure.org/

Page 50: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

50

Fuzzy search

Page 51: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

51

Fuzzy search

1. STARTS WITH

Page 52: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

52

Fuzzy search

2. LIKE

Page 53: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

53

Fuzzy search

3. SOUNDEX

Page 54: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

54

Fuzzy search

4. Damerau-Lehvenstein

Page 55: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

55

Fuzzy search

5. More advanced searching

Page 56: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

56

Full text search

Page 57: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

57

Debugging

To test a client – you must have a tested serverTo test a server – you must have a tested client

“One fool can ask more questions than seven wise men can answer”

Page 58: Fhir search for server devs (martijn)

© 2014 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.

58

Debugging

“One fool can ask more questions than seven wise men can answer”

Sprinkler(testtool) Spark MongoDB

Visual Studio Visual Studio MongoVue

Fiddler