test-3-datasource.xml 4.33 KB
Newer Older
1
2
3
4
5
6
7
8
<?xml version="1.0" encoding="UTF-8"?>
<datasource version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
	<meta>
		<id>test-3</id>
		<etl-strategy>replace-source</etl-strategy>
	</meta>
	
	<patient-table>
9
		<source xsi:type="csv-file">
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
			<url>test-3-patients-empty.txt</url>
			<separator>\t</separator>
		</source>
		<idat>
			<patient-id column="patid"/>
			<given-name column="vorname"/>
			<surname column="nachname"/>
			<birthdate format="d.M.u" na="" column="geburtsdatum"/>
			<deathdate format="d.M.u" na="" column="verstorben"/>
			<gender column="geschlecht" na="">
				<map> <!-- maps a column -->
					<case value="W" set-value="female"/>
					<case value="M" set-value="male"/>
					<case value="X" set-value="indeterminate"/>
					<otherwise set-value="" log-warning="Unexpected gender value"/>
				</map>
			</gender>
			<ignore xsi:type="string" column="ignoriert1"/>
			<ignore xsi:type="string" column="patfakt1"/>
		</idat>
		<!-- for MDAT in patient table, use the same patient-table also as
		a visit table (visit date needed). the patient id can be re-used
		as visit id, or a constant visit ID can be used. -->
	</patient-table>
	<!-- optional -->
	<visit-table>
36
		<source xsi:type="csv-file">
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
			<url>test-3-visits-empty.txt</url>
			<type>text/csv</type>
			<separator>\t</separator>
		</source>
		<idat>
			<patient-id column="patid"/>
			<visit-id column="fallnr"/>
			<start column="start" format="d.M.u[ H[:m[:s]]]" na="" truncate-to="year"/>
			<end column="end" format="d.M.u[ H[:m[:s]]]" na=""/>
		</idat>
		<mdat>
			<!-- in/out code -->
			<concept id="weight">
				<value column="gewicht" xsi:type="string"/>
				<!-- TODO: verify that na values are no allowed for concept start timestamps -->
				<start column="start" format="d.M.u[ H[:m[:s]]]" na=""/>
			</concept>
		</mdat>
	</visit-table>
	<wide-table>
57
		<source xsi:type="csv-file">
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
			<url>test-1-widetable.txt</url>
			<separator>\t</separator>
		</source>
		<idat>
			<patient-id column="patid"/>
			<visit-id column="fallnr"/>
		</idat>
		<mdat>
			<concept id="natrium">
				<value column="na" xsi:type="decimal"/>
				<start column="zeitpunkt" format="d.M.u[ H[:m[:s]]]"/>
				<unit constant-value="mmol/l" />
				<modifier id="other">
					<value xsi:type="string" na="" constant-value=""/>
				</modifier>
			</concept>
			<concept id="kalium">
				<value column="k" xsi:type="decimal"/>
				<start column="zeitpunkt" format="d.M.u[ H[:m[:s]]]"/>
			</concept>
			<concept id="enum1">
				<value column="en" na="" xsi:type="string">
					<map>
						<case value="1" set-value="" set-concept="enum1_1"/>
						<case value="2" set-value="" set-concept="enum1_2"/>
						<otherwise action="drop-fact" />
					</map>
				</value>
				<start column="zeitpunkt" format="d.M.u[ H[:m[:s]]]"/>
			</concept>
		</mdat>

	</wide-table>
	<eav-table>
92
		<source xsi:type="csv-file">
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
			<url>test-1-eavtable.txt</url>
			<separator>\t</separator>
		</source>
		<idat>
			<patient-id column="patid"/>
			<visit-id column="event"/>
			<ignore column="locat" xsi:type="string"/>
			<ignore column="user" xsi:type="string"/>
		</idat>
		<mdat>
			<concept column="param"/>
			<start column="start_ts" format="u-M-d"/>
			<end column="end" format="u-M-d" na="@"/>
			<!-- location -->

			<!-- if group is non-na, all following eav rows with the same group value
			are considered facts in a single group. A group must contain a primary
			concept and any number of modifiers. All rows within the group must have
			the same patient,encounter and start timestamp. -->
			<!-- <group column="group" na="@" /> -->

			<type column="type"/>
			<value column="value" na="@"/>
			<unit column="unit" na="@"/>
		</mdat>
		<!-- virtual value columns -->
		<virtual>
			<!-- for eav facts, the map always applies to the fact value -->
			<value column="f_eav_m" xsi:type="string">
				<map set-concept="f_eav_m_m" />
			</value>
			<value column="f_eav_x" na="" xsi:type="string">
				<map set-value="">
					<case value="1" set-concept="f_eav_x_1"/>
					<!-- action inplace is default -->
					<case value="0" set-concept="f_eav_x_0"/>
					<!-- action drop will not produce any fact -->
					<otherwise log-warning="Unexpected value" action="drop-fact" />
					<!-- action generate will produce a new concept with the given values -->
				</map>
			</value>
			<!-- ... more value elements -->
		</virtual>
	</eav-table>

</datasource>