Speaker: Brenda Deverell Cortez, Software Developer, Koneksa Health
Speaker: Tom Hosford, VP Engineering, Koneksa Health
Level: 100 (Beginner)
Track: Developer
Koneksa Health has built an application from the ground up to capture real world patient data in clinical trials. Patients with respiratory disease who formerly could only visit a hospital to measure key data points are now able to capture data with a small device from their own home. This example driven presentation will focus on how a full stack javascript development approach, with Mongo and Node, has been used to build the Koneksa Compare application, with emphasis on the technical challenges encountered and how these have been overcome by the application developers.
What You Will Learn:
- Data modeling and join strategies leveraging Mongoose and NodeJS
- Performance techniques for building a fast and efficient user experience
- Fault tolerance strategies for building a rock-solid, reliable application
The Zero-ETL Approach: Enhancing Data Agility and Insight
Enabling Clinical Research in the Real World
1. Enabling Clinical Research in the Real
World
with Sensors, Node.js & MongoDB
June 2017
Tom Hosford & Brenda Deverell
2. Background: Who We Are
2
● Enabling remote data capture from patients
● Clients: pharmaceutical, biotech and academic institutions
● Currently supporting clinical trials across multiple live
studies in 2 continents
● Across multiple disease areas: pulmonary, neurological,
cardiovascular, oncology
4. 4
Software & Tools
Enterprise 3.24
Ops Manager
Replica sets
DATABASE
S
OPS
OS
Web Server
App Framework
Client Framework
WEB
ACCES
S
Device APIs
5. 5
Platform Architecture
N
N N
G
P
S S
identity database
P
S S
application database
custome
r app
identity
service
admin
app
N
application
gateway
P
S S
MongoDB ops
manager
O
api server
Device APIs
Other APIEmail
Text
MongoDB ops
agent
P = primary
S =
secondary
N = Node Js
G = Nginx
7. Endpoint/Disease:
FEV-1/Asthma
7
● Spirometry: test used to assess strength of lungs
○ diagnosis tool for asthma, COPD and other conditions
○ Key measurement: Forced expiratory volume (FEV-1)
○ FEV-1: measures of how much air a person can expel from their
lungs in one second.
http://www.mayoclinic.org/tests-procedures/spirometry/basics/definition/prc-20012673
clinic
mobile
spirometer
vs
17. Querying Participant’s Measurements
with Mongoose
17
● Mongoose’s populate method - joins at the application
layer
● Assumption: schema has been previously defined to join
on the field of interest, e.g. userId
● Example 1: finding all measurements for a user
19. Querying Participant’s Respiratory
Measurements with $graphLookup
19
● MongoDB 3.4’s $graphLookup function performs left join
natively
Example 3: finding all respiratory measurements for a user
24. Safely Updating A Counter Field:
measurementCount
24
● Intuitive method of update
App
DB
fetch data update count
write data
25. Safely Updating Counter Field
Problem: Could lose writes under concurrency
App
DB
write1 write2
● Final count should be 3 but is now 2
1 1
1 1 2 2
2 2
26. Safely Updating Count With Atomic
App
DB
2 3
find and write1
find and write2
● $inc will find and update in one query - eliminating round
trip
27. Error Monitoring With Mongoose
27
● Default Strategy: Manually log errors
● Repetitive and prone to mistakes
28. Error Monitoring With Mongoose
28
● Better Strategy: Leverage middleware to
auto log errors
29. Error Monitoring With Mongoose
X
● Layer on CloudWatch alerts
● Watches log file for new error entries
● Separate Alarms for JS vs Node Errors