Views
BI Views are logical representations of data obtained from underlying queries. Where queries represent particular facts within a data source, views represent answers to particular questions. For example, you may have a query definition for "Patients", however a view for "Patients By Gender By Age".
Views allow you to:
  1. 1.
    Aggregate data from queries using a common database independent syntax
  2. 2.
    Pivot data from queries using defined buckets / columns
  3. 3.
    Further filter queries based on a sub-set of data

View Definition Files

View definition files are defined using the BiViewDeifnition root.
1
<?xml version="1.0"?>
2
<BiViewDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="by-type-date" id="org.santedb.bi.core.view.session.type" xmlns="http://santedb.org/bi">
3
<meta status="active">
4
<authors>
5
<add>SanteSuite Contributors</add>
6
</authors>
7
</meta>
8
<query ref="#org.santedb.bi.core.query.session" />
9
<aggregations>
10
<add>
11
<providers>
12
<invariant>psql</invariant>
13
</providers>
14
<grouping>
15
<column name="crt_utc">cast(crt_utc as DATE)</column>
16
<column name="ses_typ">ses_typ</column>
17
</grouping>
18
<select>
19
<column name="ses_typ" fn="value">ses_typ</column>
20
<column name="ses_date" fn="value">cast(crt_utc as DATE)</column>
21
<column name="n_sessions" fn="count-distinct">ses_id</column>
22
</select>
23
</add>
24
</aggregations>
25
<pivot key="ses_date" columnDef="ses_typ" value="n_sessions" fn="sum" />
26
</BiViewDefinition>
Copied!
Last modified 2yr ago
Copy link