README.md 3.39 KB
Newer Older
R.W.Majeed's avatar
R.W.Majeed committed
1 2 3 4 5 6 7 8 9 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
Common API for the AKTIN data warehouse
---------------------------------------

Generate XSD files:
```
"$JAVA_HOME"/bin/schemagen -d target -cp target/classes org.aktin.exchange.Query
```

Query exchange
--------------
```
<request>
	<id>unique request id</id>
	<date-reference>2016-04-11</date-reference>
	<published>
	<query>
		<id>unique query id</id>
		<description>
		
		</description>
		<principal>
			<name></name>
			<organisation></organisation>
			<location></location>
			<email></email>
			<phone></phone>
			<url></url>
		</principal>

		<schedule type="single|repeating|benchmark">
			<duration>-P1Y</duration>
			<interval>P1Y</interval>
		</schedule>

		<concepts>
R.W.Majeed's avatar
R.W.Majeed committed
36 37
			<concept id="CEDIS30:ABC1" type="raw"/>
			<concept id="geschlecht" type="aggregate">
R.W.Majeed's avatar
R.W.Majeed committed
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
				<count group-by="fact.value">
			</concept>
			<concept id="XXX1" type="aggregate">
				<!-- by arrival time -->
				<count group-by="substr(8,10,fact.start)">
				<max/>
				<min/>
			</concept>
		</concepts>
		<definition xsi:type="sql">
			
		</definition>
	</query>
	<signature from="broker" algorithm="SHA256withRSA">...</signature>
	<signature from="me" algorithm="SHA256withRSA">...</signature>
	<broker>
		<last-modified>max timestamp der nachfolgenden</last-modified>
		<!-- timestamp the query was published by the broker -->
		<published>2015-12-01T18:30:14</published>
		<!-- later, the query can be either canceled or closed -->
		<closed>2015-12-02T18:30:00</closed>
		<canceled>2015-12-02T18:30:14</canceled>
	</broker>
</query>

	<request-status ref="123">
		<last-modified>max timestampt der nachfolgenden</last-modified>
		<received>XXXtimestamp</received>
		<confirmation method="single|double|automatic">xxx</confirmation>
		<!-- confirmation or rejection -->
rwm's avatar
rwm committed
68 69 70 71
		<rejected></rejected><!-- manually rejected -->
		<!-- may also automatically reject requests:
		 reject all because of vacation,
		 reject specific recurring query -->
72
		<reject-reason>La la la</reject-reason>
R.W.Majeed's avatar
R.W.Majeed committed
73 74 75
		<comment></comment>
		<last-execution>
			<completed>XXXtimestamp</completed>
rwm's avatar
rwm committed
76
		<failed></failed><!-- may fail due to technical reasons -->
R.W.Majeed's avatar
R.W.Majeed committed
77 78 79 80 81 82 83
			
		</last-execution>
		<last-contact>
		<result-submitted>XXX timestamp</result-submitted>
	</request-status>


R.W.Majeed's avatar
R.W.Majeed committed
84 85 86 87 88 89 90 91 92 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 139
<query-result request-ref="1">
	<timestamp>2015-12-02T18:30:14</timestamp>
	<execution-time>P10S</execution-time>
	<result xsi:type="aggragated-result">
		<value id="cedis-count">321</value>
		<breakdown id="gender">
			<value id="male">110</value>
			<value id="female">112</value>
		</breakdown>
	</result>
<!-- or -->
	<result xsi:type="export-result">
		<table id="patients">
			<headers>
				<header>id</header>
				<header>birthdate</header>
			</headers>
			<tr>
				<td>1</td>
				<td>2010-01-01</td>
			</tr>
		</table>
		<table id="visits">
			<headers>
				<header>patient-ref</header>
				<header>id</header>
				<header>start</header>
			</headers>
			<tr>
				<td>1</td>
				<td>1</td>
				<td>2016-05-08T09:32:00</td>
			</tr>
		</table>
		<table id="diagnoses">
			<headers>
				<header>patient-ref</header>
				<header>visit-ref</header>
				<header>start</header>
				<header>code</header>
			</headers>
			<tr>
				<td>1</td>
				<td>1</td>
				<td>2016-05-08T09:32:00</td>
				<td>R46.1</td>
			</tr>
			<tr>
				<td>1</td>
				<td>1</td>
				<td>2016-05-08T09:32:00</td>
				<td>W46.05</td>
			</tr>
		</table>
	</result>

R.W.Majeed's avatar
R.W.Majeed committed
140
</query-result>
rwm's avatar
rwm committed
141 142 143 144 145

<nodeStatus>
	<module artifact="dwh-api" version="0.1-SNAPSHOT"/>
	
</nodeStatus>
R.W.Majeed's avatar
R.W.Majeed committed
146
```