A Quasi Relational Query Language for Persistent Standardized EHRs: Using NoSQL Databases

Preview:

Citation preview

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

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

University of Aizu

1

Quasi-Relational Query LanguageQuasi-Relational Query Languagefor Persistent Standardized EHRs:for Persistent Standardized EHRs:

Using No-SQL DatabasesUsing No-SQL Databases

05/01/23 DNIS 2013

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

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

05/01/23 2DNIS 2013

Introduction Introduction

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

05/01/23 3DNIS 2013

Single-patient Encounter

Introduction (2)Introduction (2)

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

405/01/23 DNIS 2013

OpenEHR ArchetypeOpenEHR Archetype

Maximal Definition : may be further revised

Currently: 352 archetype definitions

Concept: Blood Pressure (Example)

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

Universal Schema: Archetypal SerializationUniversal Schema: Archetypal Serialization

definitionOBSERVATION[at0000] matches { -- Blood Pressure

data matches {HISTORY[at0001] matches { -- history

events cardinality matches {1..*; unordered} matches {EVENT[at0006] occurrences matches {0..*} matches { -- any eventdata matches {ITEM_TREE[at0003] matches {-- blood pressure

items cardinality matches {0..*; unordered} matches {ELEMENT[at0004] occurrences matches {0..1} matches {-- Systolicvalue matches {C_DV_QUANTITY <

property = <[openehr::125]>list = <["1"] = <Units = <"mm[Hg]">magnitude = <|0.0..<1000.0|>precision = <|0|>>>

>}

}

05/01/23 DNIS 2013 5

Archetype Definition Language (ADL) XML variant, Complex structure Uses → Standard terminology codes (LOINC, SNOMED-CT, ICD)

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

QueryQuery Options: AQLOptions: 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]WHEREobs/data[at0001]/events[at0006]/data[at0003]/items[at0004]/value/magnitude>=140ANDobs/data[at0001]/events[at0006]/data[at0003]/items[at0005]/value/magnitude>=90

05/01/23 DNIS 2013 6

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

Data Management ModelData Management Model CODASYL Data Model v/s OpenEHR Data Management Model

05/01/23 7DNIS 2013

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

Former Database Solutions

Test prototype (Key-value store) → Physical Layer

Cloud-based Database

05/01/23 8

Archetypal EHRs: Database OptionsArchetypal EHRs: Database Options

DNIS 2013

XML DB

Relational DB

Object DB

Object-Relational DB

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

Conceptual View & New Query LanguageConceptual View & New Query Language

05/01/23 DNIS 2013 9

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

ProblemsProblems

1005/01/23

Universal Schema → Interoperable across distributed healthcare systems

Research focus:Scalable persistence mechanism

New Query Language →

DNIS 2013

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

Context of StudyContext of Study

05/01/23 DNIS 2013 11

Healthcare worker

Input: Patient id

Target: Patient’s EHR

Need: Precise Information

Modern View

Traditional View

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

1205/01/23

Standardized EHRs Database System

DNIS 2013

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

05/01/23 DNIS 2013 13

The ProposalThe Proposal

1. Archetypal Definition → Flattened Forms

2. QBE-style I/P & O/P→ Archetypal Definition

Possible to Query

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

1405/01/23

The Architecture

DNIS 2013

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

Standardized EHRs Database Architecture (1)Standardized EHRs Database Architecture (1)

1505/01/23

Main Components

DNIS 2013

Local Archetype

Repository

Cloud-based

PersistenceUser-Interface

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

Experimental PrototypeExperimental Prototype

05/01/23 16DNIS 2013

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

05/01/23 17

Standardized EHRs Database Architecture(3)Standardized EHRs Database Architecture(3)

DNIS 2013

NoSQL-based Persistence

JSON document

Archetype

Cloud-based

Persistence

• Unique id• Patient id• Version id

ADL

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

1805/01/23

Quasi-Relational Query Language

Archetypal QBE (AQBE)Data InsertQuery UI

DNIS 2013

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

Query Language OptionsQuery Language Options

1. Continue with AQL → ADL Store

2. AQBE → Relational Store (PostgreSQL)

3. AQBE → JSON Store (Cloud-DB)

05/01/23 DNIS 2013 19

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

2005/01/23

Quasi-Relational Query Language: AQBE

DNIS 2013

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

The AQBE – Data InsertThe AQBE – Data Insert

2105/01/23 DNIS 2013

An ExampleStore a patient’s blood pressure observation details

Insert the following details:1. Patient Name: John_Barak2. Composed By: Dr. Madaan3. Systolic BP: 954. Diastolic BP: 150

AQBE-Data Insert UI

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

Query-RequirementsQuery-Requirements

05/01/23 DNIS 2013 22

S. No. Query Requirement1 Population-based Queries

2 Single-patient Queries

3 Epidemiological Queries

4 Single-concept Queries

5 Multi-concept Queries

6 Temporal Queries

6(a) Lifelong Queries

6(b) Instantaneous Queries

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

Demo:Demo: The AQBE –Query Language (3)The AQBE –Query Language (3)

2305/01/23

Q3: [Single- patient, single-concept]

-Get a patient’s medication list

- Select → Medication list concept- Add → patient name- Find data

AQBE-Query UI

DNIS 2013

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

Demo:Demo: The AQBE –Query Language (1)The AQBE –Query Language (1)

2405/01/23

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

DNIS 2013

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

Demo:Demo: The AQBE –Query Language (2)The AQBE –Query Language (2)

2505/01/23

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

DNIS 2013

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

Sample Set of Queries (1)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]

05/01/23 DNIS 2013 26

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

8. Return all blood pressure (BP) elements having a position in which BP was record. [single-(concept/patient), exists]

9. Get the blood pressure (BP)values where the position is not standing. [single-(concept/patient), negation]

10. Find all the patients who have the same admitting doctor as 'A001'. [single-concept, multi-patient,restrict & project]

11. Find all the patients who have diabetes but no record of hypertension diagnosis.[XML definition not found]

12. Get the number of patients admitted on 9 October, 2012.[single-concept, multi-patient, aggregate] <partial execution>

13. Get the number of all the patients with diabetes. .[XML definition not found]14. Retrieve all patients who have not been discharged.[single-concept, multi-patient,

nested]15. Get all patients who are suffering from the same problem as a specific patient

(e.g., diagnosis is ‘Diabetes’). [single-concept, multi-patient, nested]

05/01/23 DNIS 2013 27

Sample Set of Queries (2)Sample Set of Queries (2)

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

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]).

05/01/23 DNIS 2013 28

Sample Set of Queries (3)Sample Set of Queries (3)

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

22. 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]).

23. 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]).

24. 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]).

05/01/23 DNIS 2013 29

Sample Set of Queries (4)Sample Set of Queries (4)

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

AQBE Query Language (2)AQBE Query Language (2)

3005/01/23 DNIS 2013

S. No. Query Requirement AQBE Query Language Capability1 Population-based Queries Yes

2 Single-patient Queries Yes

3 Epidemiological Queries Challenge

4 Single-concept Queries Yes

5 Multi-concept Queries Challenge

6 Temporal Queries Yes

6(a) Lifelong Queries Challenge

6(b) Instantaneous Queries Yes

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

AQBE Query Language (3)AQBE Query Language (3) Query Function Support

3105/01/23

Query TypeAQL [5](Ocean

Informatics)AQBE [30](Relational

DB)AQBE

(NoSQL DB)

Simple Query(Select)

Filtered Query(Where Clause)

Sorted Query(Order By) (Except Distinct Grouping, Summary and Analysis(Group By, Having, grouping/ aggregation/ analytical functions)

  To be explored To be explored

Joins and Intersection(Outer/Inner/ Natural/Range/Equi/Self) To be explored

Sub-query (In/Not In/Nested/ Parallel/Multi(row/column)/single row) To be explored To be explored

Hierarchical Query To be explored To be explored To be explored Composite Query(Union, Union All, Intersect, Minus)

Top-N Query To be explored To be explored To be explored

DNIS 2013

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

05/01/23 32

Persistence Method ComparisonPersistence Method ComparisonFeature PostgreSQL

(Relational DB) [35]DB XML(Berkeley)

(XML DB) [28]MongoDB

Document-Oriented (No-SQL DB)

Scalability• Single large relation

• Versioning is expensive

• Limited scalability

• Nested structure → archetypes and templates

Each concept stored →JSON document (unique id and version id)

Performance Relational queries slow [1]Limited query response – Each node traversed

• Light application

• Fast query-response

Queryability SQL like AQL (limited capability)

Epidemiological queries → Low performance

Proposed AQBE language potential → powerful querying

Indexing• Automatic

• Composite/secondary indexing

• Database pre-defined

• May not be suitable

• Automatic

• Composite/secondary indexing

DNIS 2013

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

3305/01/23

Further Challenges

DNIS 2013

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

3405/01/23

1. Temporal Complexity 1. Temporal Complexity

DNIS 2013

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

Current TaskCurrent Task

Upgrade existing Query Language

Implement → More algebraic operations

Similar to SQL with simplified User-interface

05/01/23 DNIS 2013 35

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

Summary and Conclusions 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

3605/01/23 DNIS 2013

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

References (1)References (1)

3705/01/23

1. Jacobs, A.: Pathologies of Big Data. Communications of ACM 52(8) (August 2009)2. ADL for archetypes downloaded, http://www.openehr.org/svn/knowledge/archetypes/dev/html/3. index_en.html4. Any+time date picker downloaded form, http://www.ama3.com/anytime/5. AQL query builder available at, http://www.oceaninformatics.com/6. Solutions/openehr-solutions/ocean-products/Clinical-Modelling/Ocean-Query-Builder.html7. Archetype Query Language, http://www.openehr.org/wiki/display/spec/~Archetype+Query+Language+Description8. Beale, T., Heard, S., Kalra, D., Llyod, D.: The OpenEHR Reference Model: EHR Information Model, The OpenEHR release

1.0.2., OpenEHR Foundation (2008)9. Beale, T.: The OpenEHR Archetype Model-Archetype Object Model, The OpenEHR release 1.0.2., OpenEHR Foundation

(2008)10. Casbah plugin available at, https://github.com/mongodb/casbah11. CEN 13606 standard, http://www.en13606.org/the-ceniso-en13606-standard12. Clinical Knowledge Manager, http://www.openehr.org/knowledge/13. Eclipse 4.2.0, http://www.eclipse.org/14. Redmond, E., Wilson, J.R.: Book: Seven Databases in Seven Weeks (May 2012)15. HTML 5, http://www.w3schools.com/html/html5_intro.asp16. http://wako3.u-aizu.ac.jp:8080/aqbe/17. ISO 13606-1: Health informatics - Electronic health record communication- Part 1: RM., 1st edn. (2008)

DNIS 2013

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

18. JavaScript, http://www.w3schools.com/js/default.asp19. jQuery downloaded from, http://jquery.com/20. jQuery UI available at, http://jqueryui.com/21. Lift JSON available at, https://github.com/lift/lift/tree/master/framework/lift-base/lift-json/22. MongoDB available at, http://www.mongodb.org/23. Zloof, M.M.: Query-By-Example: The invocation and definition of tables and forms (1975)24. Opereffa Project available at, http://www.openehr.org/wiki/display/projects/Opereffa+Project25. Play framework available at, http://www.playframework.org/26. PostgreSQL database downloadable from, http://www.postgresql.org/27. Scala Plugin available at, http://www.scala-lang.org/28. 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, Linköping, Sweden, October 2–3 (2012)

29. Sachdeva, S., Madaan, A., Chu, W.: Information interchange services for electronic health record databases. IJCSE 7(1), 38–51 (2012)

30. Sachdeva, S., Yaginuma, D., Chu, W., Bhalla, S.: AQBE - QBE Style Queries for Archetyped Data. IEICE Transactions 95-D(3), 861–871 (2012)

05/01/23 DNIS 2013 38

References (2)References (2)

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

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=208adbca-

fc26-4ada-bf02-7efe5a9e5661&trk=group_most_recent_rich-0-b-ttl&goback=%2Egmr_14427635. http://www.openehr.org/wiki/display/projects/Opereffa+Project36. 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 99–109

05/01/23 DNIS 2013 39

References (3)References (3)

to Advance Knowledge for Humanityto Advance Knowledge for Humanity

QuestionsQuestions

4005/01/23 DNIS 2013

Recommended