40
© Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical Trials Peter MacCallum Cancer Centre 1

Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

  • Upload
    others

  • View
    29

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©

Leveraging XML Transformations to Get

Data into SAS, R, CSV, and Other FormatsLinas Silva

Centre for Biostatistics and Clinical Trials

Peter MacCallum Cancer Centre

1

Page 2: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

Goals

Demonstrate XML transformations are a viable way to

export OpenClinica data to any system

Encourage further development

Support for other formats/systems (e.g. SPSS, STATA, MS

SQL)

More seamless integration

2

Page 3: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

Agenda

Background on how the XML transformations were

developed

Describe how OpenClinica data is structured

3 powerful XML transformation commands

4 main transformation steps common to the 3 export

formats

Results for CSV, R and SAS

3

Page 4: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

Background

Peter MacCallum Cancer Centre, Australia’s only public

hospital solely dedicated to cancer treatment, research

and education

Centre for Biostatistics and Clinical Trials

Paper based clinical trials and MS Access

May 2010 - began implementing OpenClinica

XML transformations to MS Access

XML transformations to SAS, R and CSV

4

Page 5: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

Reference - Wikibooks

Bullet text

Bullet text

Bullet text

Bullet text

Bullet text

Bullet text

5

Page 6: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

Reference – Issue Tracker

6

Page 7: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

Transform what?

7

Format to transform

Page 8: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

Sample CDISC ODM XML file

Bullet text

Bullet text

Bullet text

Bullet text

Bullet text

Bullet text

8

Page 9: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

Sample CRF – how many data tables?

9

Page 10: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

Sample CRF – 3 data tables

10

Target lesion

data table

Non target lesion

data table

Response

data table

Page 11: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

CDISC ODM XML

11

StudyEventDef FormRef

FormRef

StudyEventDef FormRef

Study MetaDataVersion FormDef ItemGroupRef

ItemGroupRef

FormDef ItemGroupRef

ODM FormDef ItemGroupRef

ItemGroupDef ItemRef

ItemRef

ItemGroupDef ItemRef

ItemDef

ItemDef

ClinicalData SubjectData StudyEventData FormData ItemGroupData ItemData

ItemData

ItemGroupData ItemData

FormData ItemGroupData ItemData

StudyEventData FormData ItemGroupData ItemData

SubjectData StudyEventData FormData ItemGroupData ItemData

Page 12: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

Study Events (Screen)

12

4 Study Events: Baseline, Cycle 1, Cycle 2 and Off Study

Page 13: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

Study Events and Forms (XML)

13

4 Study

Events

3 Forms

Page 14: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

Study Event Forms (Screen)

14

Cycle 1 Study Event uses

Haematology and Tumour

Response Forms only

Page 15: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

Study Event Forms (XML)

15

Cycle 1 Study Event uses

Haematology and Tumour

Response Forms only

Page 16: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

ItemGroups (Screen)

16

Target lesion

ItemGroup

Non target lesion

ItemGroup

Response

ItemGroup

Page 17: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

ItemGroups (XML)

17

5 ItemGroups

Page 18: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

Form ItemGroups (XML)

18

Tumour Response Form

contains 3 ItemGroups

Page 19: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

ItemGroup items (Screen)

19

Target Lesions ItemGroup

contains 2 items “site/organ”

and “LongestDiameter”

Page 20: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

ItemGroup fields (XML)

20

Target Lesions

ItemGroup

contains 2 items

“site/organ” and

“LongestDiameter”

Page 21: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

Item Data (Screen)

21

Values for “Site/Organ”

and “Longest Diameter”

items

Page 22: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

Item Data XML

22

Values for “Site/Organ”

and “Longest Diameter”

items

Page 23: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

CDISC ODM XML – data tables?

23

StudyEventDef FormRef

FormRef

StudyEventDef FormRef

Study MetaDataVersion FormDef ItemGroupRef

ItemGroupRef

FormDef ItemGroupRef

ODM FormDef ItemGroupRef

ItemGroupDef ItemRef

ItemRef

ItemGroupDef ItemRef

ItemDef

ItemDef

ClinicalData SubjectData StudyEventData FormData ItemGroupData ItemData

ItemData

ItemGroupData ItemData

FormData ItemGroupData ItemData

StudyEventData FormData ItemGroupData ItemData

SubjectData StudyEventData FormData ItemGroupData ItemData

Page 24: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

CDISC ODM XML – data tables

24

StudyEventDef FormRef

FormRef

StudyEventDef FormRef

Study MetaDataVersion FormDef ItemGroupRef

ItemGroupRef

FormDef ItemGroupRef

ODM FormDef ItemGroupRef

ItemGroupDef ItemRef

ItemRef

ItemGroupDef ItemRef

ItemDef

ItemDef

ClinicalData SubjectData StudyEventData FormData ItemGroupData ItemData

ItemData

ItemGroupData ItemData

FormData ItemGroupData ItemData

StudyEventData FormData ItemGroupData ItemData

SubjectData StudyEventData FormData ItemGroupData ItemData

Tables Table columns

Records Data Values

Page 25: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

3 Transformation commands

VALUE OF

<xsl:value-of select=……>

Statement: <xsl:value-of

select=“/odm:ODM/odm:Study/odm:MetaDataVersion/odm:Stu

dyEventDef/@Name">

Data: Baseline, Cycle 1, Cycle 2, Off Study

Result: Baseline (first item found is selected)

25

Page 26: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

3 Transformation commands

FOR EACH

<xsl:for-each select=……>

Statement: <xsl:for-each

select=“/odm:ODM/odm:Study/odm:MetaDataVersion/odm:Stu

dyEventDef">

Data: Baseline, Cycle 1, Cycle 2, Off Study

Result: Baseline, Cycle 1, Cycle 2, Off Study

26

Page 27: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

3 Transformation commands

FILTER

<xsl:….. select=…[element=specific value]…>

Statement: <xsl:for-each

select=“/odm:ODM/odm:Study/odm:MetaDataVersion/odm:StudyEven

tDef[@name=“Cycle 1”]/odm:FormRef">

Data:

Baseline:Haematology, Cycle 1:Haematology,

Cycle 1:Tumour Response, Cycle 2:Haematology,

Cycle 2:Tumour Response, Off Study:Off Study

Result:

Cycle 1:Haematology, Cycle 1:Tumour Response

27

Page 28: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

4 Transformation Steps

For each ItemGroup definition

For each record for the current ItemGroup

For each column for the current ItemGroup

Find the data value for the current record and column

28

Page 29: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

4 Transformation steps

29

StudyEventDef FormRef

FormRef

StudyEventDef FormRef

Study MetaDataVersion FormDef ItemGroupRef

ItemGroupRef

FormDef ItemGroupRef

ODM FormDef ItemGroupRef

ItemGroupDef ItemRef

ItemRef

ItemGroupDef ItemRef

ItemDef

ItemDef

ClinicalData SubjectData StudyEventData FormData ItemGroupData ItemData

ItemData

ItemGroupData ItemData

FormData ItemGroupData ItemData

StudyEventData FormData ItemGroupData ItemData

SubjectData StudyEventData FormData ItemGroupData ItemData

Tables Table

columns

Records Data Values

1. For each

ItemGroup

3. For each

column

2. For each

Record

4. Get the

value

Page 30: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

CSV transformation

30

Page 31: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

R Transformation

31

Page 32: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

SAS (map) Transformation

32

Page 33: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

SAS (data) Transformation

33

Page 34: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

CSV Results

34

Page 35: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

R Results

35

Page 36: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

SAS (map) results

36

Page 37: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

SAS (data) results

37

Page 38: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

SAS results

38

Page 39: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

Code Lists (SAS)

39

Page 40: Leveraging XML Transformations to Get Data into …...Leveraging XML Transformations to Get Data into SAS, R, CSV, and Other Formats Linas Silva Centre for Biostatistics and Clinical

©#OC14Boston

Goals - Review

Demonstrate XML transformations are a viable way to

export OpenClinica data to any system

Encourage further development in the following

Support for other formats/systems (e.g. SPSS, STATA, MS

SQL)

More seamless integration

40