MY ATTEMPT TO RID THE CLINICAL WORLD OF EXCEL MIKE MOLTER DIRECTOR OF STATISTICAL PROGRAMMING AND TECHNOLOGY WRIGHT AVE OCTOBER 27, 2016
Agenda Introduction to Study Designer Development tools Database Interface Brief demo (if time) Future of Study Designer
Technologies in Use: Neo4j Cypher HTML, Javascript, CSS Python Jinja2 Google App Engine
Technologies NOT in Use: SAS Excel
What is Study Designer? Study Designer is a web-based tool used for entering metadata (i.e. programming specs and define.xml) for a study Signature features Database of CDISC data models, implementation guides, and study metadata Web interface that guides the user through the development of metadata by way of a study design sequence
Database
Database Keys Properties (variables or fields) Observatio ns (records) NAME DATE TEST RESUL UNIT Sam 10/27 /16 TEMP T 99.5 F Sam 10/27 HEIGH 73 in /16 T Sam 10/27 WEIGH 220 lb /16 T Sam 10/27 SYSBP 118 mmhg /16 Sam 10/27 /16 DIABP 75 mmhg Tony 10/24 /16 Tony 10/24 /16 Tony 10/24 /16 Tony 10/24 /16 TEMP 99.1 F HEIGH 70 IN T SYSBP 122 mmhg DIABP 73 mmhg T a b l e
Traditional rectangular SQL database
Neo4j Graph Database node Properties Name : Sam Date : 10/27/16 Test : TEMP Result : 99.5 Unit : F :VS Observati on (node) node label
:LB :VS :LB :VS :VS :VS :VS :LB :LB :VS :LB :LB :VS :VS :LB :VS :LB
FirstName : Tom LastName: Hanks Born: 1956 [:ACTEDIN] : ACTOR [:ACTEDIN] [:DIRECTED] Neo4j Graph Database
Cypher the query language of Neo4j MATCH (tom:person {name: "Tom Hanks"})- [:ACTED_IN]-> (tomhanksmovies:movie) RETURN tom, tomhanksmovies alternatively, RETURN tom.born, tomhanksmovies.tagline see demo
CDISC standards in Neo4j <ItemGroupDef Name= AE other attributes> <ItemRef ItemOID= IT.STUDYID Order= 1 Mandatory= Yes /> <ItemRef ItemOID= IT.AESEV Order= 15 Mandatory= Yes /> One ItemRef for each variable in the dataset </ItemGroupDef> <ItemDef Name= STUDYID OID= IT.STUDYID STUDYID attributes> </ItemDef> <ItemDef Name= STUDYID OID= IT.AESEV AESEV attributes> <CodeListRef CodeListOID= CT.SEV > </ItemDef> <CodeList OID= CT.SEV <EnumeratedItem CodedValue= MILD > More EnumeratedItem elements </CodeList>
Name : AE Class : Events Purpose: Tabulation CDISC standards in Neo4j : ItemGroupDef Order: 15 Mandatory: Yes : ContainsItem
CDISC standards in Neo4j
CDISC standards in Neo4j
CDISC standards in Neo4j InstantiatesModel
Using Python to interact with Neo4j from py2neo import Graph graph = Graph() defaults to localhost:7474 results = graph.cypher.execute( match (:IG)-[]-> (igd:itemgroupdef) return igd.name,igd.class,igd.purpose ) results (a Python object called a RecordList) name class purpose CM Interventions Tabulation VS Findings Tabulation AE Events Tabulation
Google App Engine A cloud computing platform for developing and hosting web applications in Googlemanaged data centers When downloaded and installed, a local development server is created and listens on port 8080. Comes with a Python package that allows application developers to associate web form URLs with code to be executed capture and process web form input from users
app = webapp2.wsgiapplication([ ( URL1,URL1_code_class), ( URL2,URL2_code_class), ( /,FrontPage) ], debug=true) class FrontPage: def get(self): <pre-processing code> <code to render web form> see demo
class FrontPage: def get(self): allstudies = <Cypher query to return all current studies in the database> <code to render web form> self.render(webform.html, studylist=allstudies)
Jinja 2 Templating language used for generating dynamic HTML HTML generated by what is found in the database Think of the SAS macro language Supports reference of parameters passed in from application ({{x}}) conditional logic ({% if condition %}) iterative logic ({% for x in list-
HTML for dropdowns <select name= mydropdown > <option>choose an Option</option> <option>choice1</option> <option>choice2</option> <option>choice3</option> </select> self.render(webform.html,studylist=allstudies) <select name= mydropdown > <option>choose a study</option> {% for x in studylist %} <option>{{x[0]}}</option> {% endfor %} </select>
Capturing web form choices in Python HTML World <select name= mydropdown > <option>choose a study</option> {% for x in studylist %} <option>{{x[0]}}</option> {% endfor %} </select> Back in Python Land chosenstudy=self.get.request( mydropdown ) self.get.request returns the user choice from the dropdow
Brief summary of the User input/code Execution Cycle USER: Enters application URL into web browser PYTHON: 1. Execute code based on URL (e.g. adding to database, querying database) 2. Render a web form, passing parameters to build dynamic HTML PYTHON: 1. Execute code based on URL (e.g. querying database) 2. Render a web form, passing parameters to build dynamic HTML USER: 1. Populates form fields 2. Clicks Submit button
In Summary In order to replace Excel, we need a database to house standards a user interface collects information from users interacts with the database To connect the dots Python code to touch the database Python code to pass parameters to dynamic HTML (Jinja2 templates) Python code to capture user choices Google App Engine to pair Python code with URLs and provide methods for capturing user choices
The Current and Future State of Study Designer Custom domains Controlled Terminology+extensions define.xml spec.xml standards development Trial Design Visit Schedules Version control Dependency tracking protocol.xml extraction???