Você está na página 1de 51

to Advance Knowledge for Humanity

Quasi-Relational Query Language


for Persistent Standardized EHRs:
Using No-SQL Databases

Aastha Madaan, W. Chu, Y. Daigo, S. Bhalla


University of Aizu
3/25/2013

DNIS 2013

to Advance Knowledge for Humanity

Introduction
EHRs Big data
Lifetime data temporal nature
Epidemic Query Needs (research on population) Big Data

Need Scalable and standardized ICT infrastructure


Data-standards EHRs HL7, CEN 13606, OpenEHR
Aim Knowledge-level interoperability

3/25/2013

DNIS 2013

to Advance Knowledge for Humanity

Introduction (2)

Single-patient
Encounter

3/25/2013

DNIS 2013

to Advance Knowledge for Humanity

OpenEHR Archetype
Concept: Blood Pressure (Example)

Maximal Definition : may be further revised


Currently: 352 archetype definitions
3/25/2013

DNIS 2013

to Advance Knowledge for Humanity

Universal Schema: Archetypal Serialization


Archetype Definition Language (ADL)
XML variant, Complex structure
Uses Standard terminology codes (LOINC, SNOMED-CT, ICD)
definition
OBSERVATION[at0000] matches {
-- Blood Pressure
data matches {
HISTORY[at0001] matches { -- history
events cardinality matches {1..*; unordered} matches {
EVENT[at0006] occurrences matches {0..*} matches {
-- any event
data matches {
ITEM_TREE[at0003] matches { -- blood pressure
items cardinality matches {0..*; unordered} matches {
ELEMENT[at0004] occurrences matches {0..1} matches {-- Systolic
value matches {
C_DV_QUANTITY <
property = <[openehr::125]>
list = <
["1"] = <
Units = <"mm[Hg]">
magnitude = <|0.0..<1000.0|>
precision = <|0|>
>
>
>
}
}

3/25/2013

DNIS 2013

to Advance Knowledge for Humanity

Query Options: AQL


AQL Archetype Query Language
Independent System environment, storage model
Developer level SQL +XQuery
An Example Find all the patients with high blood pressure values (Systolic
>= 140 AND Diastolic >= 90).
AQL Equivalent:
SELECT obs/data[at0001]/events[at0006]/data[at0003]/items[at0004]/value/magnitude,
obs/data[at0001]/events[at0006]/data[at0003]/items[at0005]/value/magnitude
FROM EHR [ehr_id/value=$ehrUid]
CONTAINS COMPOSITION c[openEHR-EHR-COMPOSITION.encounter.v1]
CONTAINS OBSERVATION obs[openEHR-EHR-OBSERVATION.blood_pressure.v1]
WHERE
obs/data[at0001]/events[at0006]/data[at0003]/items[at0004]/value/magnitude>=140
ANDobs/data[at0001]/events[at0006]/data[at0003]/items[at0005]/value/magnitude>=90
3/25/2013

DNIS 2013

to Advance Knowledge for Humanity

Data Management Model


CODASYL Data Model v/s OpenEHR Data Management Model

3/25/2013

DNIS 2013

to Advance Knowledge for Humanity

Archetypal EHRs: Database Options


Former Database Solutions
XML DB
Object DB
Relational DB

Object-Relational DB

Test prototype (Key-value store) Physical Layer


Cloud-based Database

3/25/2013

DNIS 2013

to Advance Knowledge for Humanity

Conceptual View & New Query Language

3/25/2013

DNIS 2013

to Advance Knowledge for Humanity

Problems
Universal Schema Interoperable across
distributed healthcare systems

Research focus:
Scalable persistence mechanism
New Query Language

3/25/2013

DNIS 2013

10

to Advance Knowledge for Humanity

Context of Study
Traditional View
Input: Patient id
Target: Patients EHR
Need: Precise Information

Healthcare
worker
Modern View
3/25/2013

DNIS 2013

11

to Advance Knowledge for Humanity

Standardized EHRs Database System

3/25/2013

DNIS 2013

12

to Advance Knowledge for Humanity

The Proposal

1. Archetypal Definition Flattened Forms


2. QBE-style I/P & O/P Archetypal Definition
Possible to Query
3/25/2013

DNIS 2013

13

to Advance Knowledge for Humanity

The Architecture

3/25/2013

DNIS 2013

14

to Advance Knowledge for Humanity

Standardized EHRs Database Architecture (1)


Main Components

Local Archetype
Repository

Cloud-based

User-Interface

3/25/2013

DNIS 2013

Persistence

15

to Advance Knowledge for Humanity

Experimental Prototype

3/25/2013

DNIS 2013

16

to Advance Knowledge for Humanity

Standardized EHRs Database Architecture(3)


NoSQL-based Persistence

ADL
Archetype
JSON document

Cloud-based
Persistence

3/25/2013

Unique id
Patient id
Version id

DNIS 2013

17

to Advance Knowledge for Humanity

Quasi-Relational Query Language


Archetypal QBE (AQBE)
Data Insert
Query UI

3/25/2013

DNIS 2013

18

to Advance Knowledge for Humanity

Query Language Options


1. Continue with AQL ADL Store
2. AQBE Relational Store (PostgreSQL)
3. AQBE JSON Store (Cloud-DB)

3/25/2013

DNIS 2013

19

to Advance Knowledge for Humanity

Quasi-Relational Query Language: AQBE

3/25/2013

DNIS 2013

20

to Advance Knowledge for Humanity

The AQBE Data Insert


An Example
Store a patients blood pressure observation details
Insert the following details:
1. Patient Name: John_Barak
2. Composed By: Dr. Madaan
3. Systolic BP: 95
4. Diastolic BP: 150

AQBE-Data Insert UI

3/25/2013

DNIS 2013

21

to Advance Knowledge for Humanity

3/25/2013

DNIS 2013

22

to Advance Knowledge for Humanity

3/25/2013

DNIS 2013

23

to Advance Knowledge for Humanity

3/25/2013

DNIS 2013

24

to Advance Knowledge for Humanity

3/25/2013

DNIS 2013

25

to Advance Knowledge for Humanity

3/25/2013

DNIS 2013

26

to Advance Knowledge for Humanity

3/25/2013

DNIS 2013

27

to Advance Knowledge for Humanity

Query-Requirements

3/25/2013

S. No.

Query Requirement

Population-based Queries

Single-patient Queries

Epidemiological Queries

Single-concept Queries

Multi-concept Queries

Temporal Queries

6(a)

Lifelong Queries

6(b)

Instantaneous Queries
DNIS 2013

28

to Advance Knowledge for Humanity

Demo: The AQBE Query Language (3)


Q3: [Single- patient, single-concept]
-Get a patients medication list
- Select Medication list concept
- Add patient name
- Find data

AQBE-Query UI

3/25/2013

DNIS 2013

29

to Advance Knowledge for Humanity

Demo: The AQBE Query Language (1)


Q1: [Single-concept, multiple EHRs]
-Get all the patients recorded with abnormal (high) BP values
during patient care
-

Select Blood pressure concept


Add Systolic > 140
Add Diastolic > 90
Find data

AQBE-Query UI

3/25/2013

DNIS 2013

30

to Advance Knowledge for Humanity

3/25/2013

DNIS 2013

31

to Advance Knowledge for Humanity

3/25/2013

DNIS 2013

32

to Advance Knowledge for Humanity

3/25/2013

DNIS 2013

33

to Advance Knowledge for Humanity

3/25/2013

DNIS 2013

34

to Advance Knowledge for Humanity

3/25/2013

DNIS 2013

35

to Advance Knowledge for Humanity

Demo: The AQBE Query Language (2)


Q2: [Single-concept , multiple patients]
-Find all the records with very high BMI value (>30) for patients
between the period of November 25, 2012 to January 21, 2013,
showing the sudden increase in obesity.
-

Select BMI concept


Add context value >= November 25, 2012
Add context value <= January 21, 2013
Enter BMI value > 30
Find Data

AQBE-Query UI
3/25/2013

DNIS 2013

36

to Advance Knowledge for Humanity

Sample Set of Queries (1)


Current set of Queries
1.Get a patient's current medication list. [single-(concept/patient), projection]
2.Find high blood pressure values (systolic >= 140 or diastolic >= 90 ) within a
specified EHR.[single-(concept/patient), restrict & project]
3.Find high blood pressure values (systolic >= 140 and diastolic >= 90 ) within a
specified EHR. [single-(concept/patient), restrict & project]
4.Find blood pressure values where systolic/diastolic value >0.2 within a specified EHR.
[single-(concept/patient), divide]
5.Get BMI values > 30 kg/m2 for a specific patient. [single-(concept/patient), restrict &
project]
6.Get all HbA1c observations that have been done in the last 12 months for a specific
patient. [single-(concept/patient), restrict & project]
7.Find all blood pressure (BP) values for a specific patient, showing their systolic and
diastolic blood pressure values; also change the tag-name of systolic BP as 'Sys' and
Diastolic BP as 'Dias'. [single-(concept/patient), rename]
3/25/2013

DNIS 2013

37

to Advance Knowledge for Humanity

Sample Set of Queries (2)


8.

9.
10.

11.
12.

13.
14.
15.

Return all blood pressure (BP) elements having a position in which BP was record.
[single-(concept/patient), exists]
Get the blood pressure (BP)values where the position is not standing. [single(concept/patient), negation]
Find all the patients who have the same admitting doctor as 'A001'. [singleconcept, multi-patient,restrict & project]
Find all the patients who have diabetes but no record of hypertension
diagnosis.[XML definition not found]
Get the number of patients admitted on 9 October, 2012.[single-concept, multipatient, aggregate] <partial execution>
Get the number of all the patients with diabetes. .[XML definition not found]
Retrieve all patients who have not been discharged.[single-concept, multi-patient,
nested]
Get all patients who are suffering from the same problem as a specific patient (e.g.,
diagnosis is Diabetes). [single-concept, multi-patient, nested]

3/25/2013

DNIS 2013

38

to Advance Knowledge for Humanity

Sample Set of Queries (3)


Test Query Set Recent Literature Survey
16.The children of women which had medication XYZ during their first pregnancy
[complex query-multiple patients/concepts] (src: [11]).
17.Find the number of patients who were given medications during hospital course that
have caused an allergy in 1 or more patients[complex query- multiple patients/concepts,
aggregate, epidemiological] (src: [11]).
18.How many patients have had past medical history of anemia. patients[complex
query- multiple patients/concepts, aggregate, epidemiological] (src: [11]).
19.How many patients developed alopecia as a side effect of chemotherapy in the target
population[complex query- multiple patients/concepts, aggregate, epidemiological] (src:
[11]).
20.How many cases of small cell lung cancer are noted among smoking females in the
target population. [complex query- multiple patients/concepts, aggregate,
epidemiological] (src: [11]).

3/25/2013

DNIS 2013

39

to Advance Knowledge for Humanity

Sample Set of Queries (4)


22.

23.

24.

To retrieve results containing 3 concepts (Fever, sore throat, and cough


with 1 concept having 2 sub-keys with numerical value (Temp > 38.2 deg and
duration > 1 day) [complex query- multiple patients/concepts](src: [36]).
To retrieve results containing 5 concepts (fever, sore throat, cough, no
vomiting and sputum);2 concepts having 1 sub-key with numerical value
(fever temp > 38.2 deg and duration > 1day) and 1 concept having 1 sub-key with
textual value (i.e. sputum of yellow color). [complex query- multiple
patients/concepts](src: [36]).
To retrieve results containing 3 clinical concepts (cough, no sore-throat, and
had no sterol injection) with 1 concept having 1 sub-key with textual value (i.e.
non sterol injection at the left side). [complex query- multiple
patients/concepts](src: [36]).

3/25/2013

DNIS 2013

40

to Advance Knowledge for Humanity

AQBE Query Language (2)


S. No.

Query Requirement

AQBE Query Language Capability

Population-based Queries

Yes

Single-patient Queries

Yes

Epidemiological Queries

Single-concept Queries

Yes

Multi-concept Queries

Challenge

Temporal Queries

Yes

6(a)

Lifelong Queries

Challenge

6(b)

Instantaneous Queries

3/25/2013

Challenge

Yes
DNIS 2013

41

to Advance Knowledge for Humanity

AQBE Query Language (3)


Query Function Support
Query Type
Simple Query(Select)

AQL [5]
(Ocean
Informatics)

AQBE [30]
(Relational
DB)

AQBE
(NoSQL DB)

(Except Distinct

To be explored

To be explored

To be explored

To be explored

To be explored

Filtered Query(Where Clause)


Sorted Query(Order By)
Grouping, Summary and Analysis(Group By,
Having, grouping/ aggregation/ analytical
functions)
Joins and Intersection(Outer/Inner/
Natural/Range/Equi/Self)
Sub-query (In/Not In/Nested/
Parallel/Multi(row/column)/single row)

Hierarchical Query
Composite Query(Union, Union All,
Intersect, Minus)

To be explored

Top-N Query

To be explored

To be explored

To be explored

3/25/2013

DNIS 2013

To be explored To be explored

42

to Advance Knowledge for Humanity

Persistence Method Comparison


PostgreSQL
(Relational DB) [35]

Feature

Scalability

Single large relation

Versioning is expensive

Performance Relational queries slow [1]

like AQL (limited


Queryability SQL
capability)

Indexing

3/25/2013

MongoDB
Document-Oriented
(No-SQL DB)

DB XML(Berkeley)
(XML DB) [28]

Limited scalability

Nested structure
archetypes and
templates

Each concept stored JSON


document (unique id and
version id)

Limited query response

Light application

Each node traversed

Fast query-response

Epidemiological queries
Low performance

Proposed AQBE language


potential powerful querying

Automatic

Database pre-defined

Automatic

Composite/secondary
indexing

May not be suitable

Composite/secondary
indexing

DNIS 2013

43

to Advance Knowledge for Humanity

Further Challenges

3/25/2013

DNIS 2013

44

to Advance Knowledge for Humanity

1. Temporal Complexity

3/25/2013

DNIS 2013

45

to Advance Knowledge for Humanity

Current Task
Upgrade existing Query Language
Implement More algebraic operations
Similar to SQL with simplified User-interface

3/25/2013

DNIS 2013

46

to Advance Knowledge for Humanity

Summary and Conclusions


New Quasi-Relational Query Language

A. Possibility Cloud-based, scalable persistence for archetypal EHRs


B. Ease of query healthcare users
C. Facilitate Complex Queries for developers
D. Reduce Dependency on commercial query tools
E. Facilitate Creation of new SEHR database
Capable to exchange data with MS Health Vault and Google Health

3/25/2013

DNIS 2013

47

to Advance Knowledge for Humanity

References (1)
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.

Jacobs, A.: Pathologies of Big Data. Communications of ACM 52(8) (August 2009)
ADL for archetypes downloaded, http://www.openehr.org/svn/knowledge/archetypes/dev/html/
index_en.html
Any+time date picker downloaded form, http://www.ama3.com/anytime/
AQL query builder available at, http://www.oceaninformatics.com/
Solutions/openehr-solutions/ocean-products/Clinical-Modelling/Ocean-Query-Builder.html
Archetype Query Language, http://www.openehr.org/wiki/display/spec/~Archetype+Query+Language+Description
Beale, T., Heard, S., Kalra, D., Llyod, D.: The OpenEHR Reference Model: EHR Information Model, The
OpenEHR release 1.0.2., OpenEHR Foundation (2008)
Beale, T.: The OpenEHR Archetype Model-Archetype Object Model, The OpenEHR release 1.0.2., OpenEHR
Foundation (2008)
Casbah plugin available at, https://github.com/mongodb/casbah
CEN 13606 standard, http://www.en13606.org/the-ceniso-en13606-standard
Clinical Knowledge Manager, http://www.openehr.org/knowledge/
Eclipse 4.2.0, http://www.eclipse.org/
Redmond, E., Wilson, J.R.: Book: Seven Databases in Seven Weeks (May 2012)
HTML 5, http://www.w3schools.com/html/html5_intro.asp
http://wako3.u-aizu.ac.jp:8080/aqbe/
ISO 13606-1: Health informatics - Electronic health record communication- Part 1: RM., 1st edn. (2008)

3/25/2013

DNIS 2013

48

to Advance Knowledge for Humanity

References (2)
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.

JavaScript, http://www.w3schools.com/js/default.asp
jQuery downloaded from, http://jquery.com/
jQuery UI available at, http://jqueryui.com/
Lift JSON available at, https://github.com/lift/lift/tree/master/framework/lift-base/lift-json/
MongoDB available at, http://www.mongodb.org/
Zloof, M.M.: Query-By-Example: The invocation and definition of tables and forms (1975)
Opereffa Project available at, http://www.openehr.org/wiki/display/projects/Opereffa+Project
Play framework available at, http://www.playframework.org/
PostgreSQL database downloadable from, http://www.postgresql.org/
Scala Plugin available at, http://www.scala-lang.org/
Freire, S.M., Sundvall, E., Karlsson, D., Lambrix, P.: Performance of XML Databases for Epidemiological Queries
in Archetype-Based EHRs. In: Scandinavian Conference on Health Informatics 2012, Linkping, Sweden, October
23 (2012)
29. Sachdeva, S., Madaan, A., Chu, W.: Information interchange services for electronic health record databases. IJCSE
7(1), 3851 (2012)
30. Sachdeva, S., Yaginuma, D., Chu, W., Bhalla, S.: AQBE - QBE Style Queries for Archetyped Data. IEICE
Transactions 95-D(3), 861871 (2012)

3/25/2013

DNIS 2013

49

to Advance Knowledge for Humanity

References (3)
31. Sachdeva, S., Bhalla, S.: Semantic interoperability in standardized electronic health record databases. J. Data
and Information Quality 3(1), 1 (2012)
32. Beale, T.: OpenEHR: Node + Path Persistence (2008)
33. Twitter bootstrap framework downloaded from, http://twitter.github.com/bootstrap/
34. http://www.linkedin.com/groups/Choice-OpenEHR-persistence-layer-144276.S.208531138?qid=208adbcafc26-4ada-bf02-7efe5a9e5661&trk=group_most_recent_rich-0-b-ttl&goback=%2Egmr_144276
35. http://www.openehr.org/wiki/display/projects/Opereffa+Project
36. Ken Ka-Yin Lee, Wai-Choi Tang, Kup-Sze Choi, Alternatives to relational database: Comparison of NoSQL
and XML approaches for clinical data storage, Computer Methods and Programs in Biomedicine, Volume
110, Issue 1, April 2013, Pages 99109

3/25/2013

DNIS 2013

50

to Advance Knowledge for Humanity

Questions

3/25/2013

DNIS 2013

51

Você também pode gostar