[Mpuls-commits] r608 - in wasko/branches/1.0: . waskaweb/public waskaweb/public/styles waskaweb/public/xml waskaweb/templates waskaweb/templates/casemanagement waskaweb/templates/evaluation

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Sep 23 17:06:45 CEST 2009


Author: torsten
Date: 2009-09-23 17:06:44 +0200 (Wed, 23 Sep 2009)
New Revision: 608

Added:
   wasko/branches/1.0/waskaweb/public/xml/
   wasko/branches/1.0/waskaweb/public/xml/eval_adele.xml
   wasko/branches/1.0/waskaweb/public/xml/eval_aktiv.xml
   wasko/branches/1.0/waskaweb/public/xml/eval_analyse.xml
   wasko/branches/1.0/waskaweb/public/xml/eval_tagebuch.xml
   wasko/branches/1.0/waskaweb/public/xml/eval_verlauf.xml
   wasko/branches/1.0/waskaweb/public/xml/eval_weitere.xml
   wasko/branches/1.0/waskaweb/public/xml/eval_zusammenfassung.xml
   wasko/branches/1.0/waskaweb/templates/evaluation/
   wasko/branches/1.0/waskaweb/templates/evaluation/evaluate.mako
   wasko/branches/1.0/waskaweb/templates/evaluation/result.mako
Removed:
   wasko/branches/1.0/waskaweb/templates/casemanagement/evaluation.mako
   wasko/branches/1.0/waskaweb/templates/casemanagement/evaluation/
Modified:
   wasko/branches/1.0/ChangeLog.txt
   wasko/branches/1.0/waskaweb/public/styles/all.css
Log:
Added evaluation configs. created new templates, deleted old templates


Modified: wasko/branches/1.0/ChangeLog.txt
===================================================================
--- wasko/branches/1.0/ChangeLog.txt	2009-09-23 12:44:29 UTC (rev 607)
+++ wasko/branches/1.0/ChangeLog.txt	2009-09-23 15:06:44 UTC (rev 608)
@@ -8,6 +8,33 @@
 	  waskaweb/lib/validators.py: Replaced old evaluate controller with
 	  new one. 
 
+	* waskaweb/public/xml/eval_adele.xml,
+	  waskaweb/public/xml/eval_analyse.xml,
+	  waskaweb/public/xml/eval_aktiv.xml,
+	  waskaweb/public/xml/eval_tagebuch.xml,
+	  waskaweb/public/xml/eval_verlauf.xml,
+	  waskaweb/public/xml/eval_weitere.xml, 
+	  waskaweb/public/xml/eval_zusammenfassung.xml: Added evaluations files.
+
+	* waskaweb/public/styles/all.css,
+	  waskaweb/templates/evaluation,
+	  waskaweb/templates/evaluation/result.mako,
+	  waskaweb/templates/evaluation/evaluate.mako: Added new templates for
+	  evaluation
+
+	* waskaweb/templates/casemanagement/evaluation.mako,
+	  waskaweb/templates/casemanagement/evaluation,
+	  waskaweb/templates/casemanagement/evaluation/evaluation_avg_effort.mako,
+	  waskaweb/templates/casemanagement/evaluation/evaluation_effort.mako,
+	  waskaweb/templates/casemanagement/evaluation/evaluation_esfstammblatt.mako,
+	  waskaweb/templates/casemanagement/evaluation/evaluation_adele.mako,
+	  waskaweb/templates/casemanagement/evaluation/evaluation_result_0.mako,
+	  waskaweb/templates/casemanagement/evaluation/evaluation_result_1.mako,
+	  waskaweb/templates/casemanagement/evaluation/evaluation_navigation.mako,
+	  waskaweb/templates/casemanagement/evaluation/evaluation_result_2.mako,
+	  waskaweb/templates/casemanagement/evaluation/evaluation_result_3.mako:
+	  Deleted old evaluation templates
+
 2009-09-22	Torsten Irlaender	<torsten.irlaender at intevation.de> 
 
 	Read jason-based configuration-files. List evaluations based on

Modified: wasko/branches/1.0/waskaweb/public/styles/all.css
===================================================================
--- wasko/branches/1.0/waskaweb/public/styles/all.css	2009-09-23 12:44:29 UTC (rev 607)
+++ wasko/branches/1.0/waskaweb/public/styles/all.css	2009-09-23 15:06:44 UTC (rev 608)
@@ -15,6 +15,20 @@
 	border:none;
 }
 
+.container { 
+	padding: 0.25em;
+}
+
+.widget {
+	border: 1pt solid;
+	margin: 1pt 0 1pt 0;
+	border-color: #ccc;
+	-webkit-border-radius: 5px;
+	-moz-border-radius:5px;
+}
+
+
+
 /*------------------*/
 /* 1. Table Formats */
 /*------------------*/
@@ -53,9 +67,22 @@
 table td.label {
 	vertical-align: top; 
 	font-weight: bold; 
+	width: 8em;
+	border-right: 1pt solid;
+	padding-right: 0.25em;
+	text-align: right;
+
 }
 
-td {overflow: hidden;}
+tr.hl, td.hl, th.hl {
+	background-color: #D5D5D5;
+}
+
+td {
+	overflow: hidden;
+	vertical-align: top; 
+}
+
 tr {width:50em}
 
 .table_checkbox {
@@ -140,71 +167,21 @@
 /*----------------------*/
 /* 2. Evaluation Formats*/
 /*----------------------*/
-
-table.evaluation {
-	margin: 0.3em 0.5em 0.3em 0.5em;
+.evaluation .widget {
+	margin-top: 1.5em;
 }
 
-table.evaluation td.label, th.label {
-	font-weight: normal;
-	text-align: left;
+.evaluation table, .evaluation td, .evaluation th {
+	border: 1pt solid;
+	border-collapse: collapse;
+	empty-cells: hide;
 }
 
-table.evaluation td.num, th.num {
-	text-align: right;
+.evaluation th, .evaluation td.num {
+	text-align: center;
+	vertical-align: middle;
 }
 
-td.eval_group_finished {
-	width: 1em;
-	background-image: url('/images/eval_finished_bg.png');
-	background-repeat: repeat
-}
-td.eval_group_incm {
-	width: 1em;
-	background-image: url('/images/eval_incm_bg.png');
-	background-repeat: repeat
-}
-td.eval_group_all {
-	width: 1em;
-	background-image: url('/images/eval_all_bg.png');
-	background-repeat: repeat
-}
-
-div.evaluation {
-	padding: 0.5em 0.5em 1.5em 0.5em;
-}
-
-div.eval_note {
-	margin: 0.3em 0.5em 0.3em 0.5em;
-}
-
-div.evaluation h1, div.evaluation h2, div.evaluationa h3 {
-        margin: 0.1em 0;
-	padding: 0;
-	font-size:1.1em;
-}
-	
-div.evaluation h4 {
-        margin: 1.1em 0 0em 0;
-	padding-left: 0.75em;
-	font-size:1em;
-}
-
-div.odd-row{
-	border: 0.5pt;
-	border-style: solid none solid none;
-}
-
-div.odd-row a, div.even-row a{
-	padding-left:0.75em;
-	padding-right:0.6em;
-}
-
-div.odd-row h3 a, div.even-row h3 a {
-	padding-left:0.2em;
-}	
-
-
 /*---------------------*/
 /*3. Formular Elements */
 /*---------------------*/

Added: wasko/branches/1.0/waskaweb/public/xml/eval_adele.xml
===================================================================
--- wasko/branches/1.0/waskaweb/public/xml/eval_adele.xml	2009-09-23 12:44:29 UTC (rev 607)
+++ wasko/branches/1.0/waskaweb/public/xml/eval_adele.xml	2009-09-23 15:06:44 UTC (rev 608)
@@ -0,0 +1,295 @@
+<evaluationset>
+  <id>1</id>
+  <version>0.9</version>
+  <name>Zwischenberichtsauswertungen</name>
+  <desc>Die Zwischenberichtsauswertungen dienen der ESF-Berichterstattung. Sie werden grundsätzlich nur über CM Fälle ausgeführt (Phase ist min. laufendes CM). Weiter muss der Fall die notwendige Validität aufweisen.</desc>
+  <requirement>
+    <phase>2,3,4,5</phase>
+    <validity>1</validity>
+    <validity>3</validity>
+    <validity>4</validity>
+  </requirement>
+  <evaluation>
+    <id>1</id>
+    <name>Eintritte gesamt</name>
+    <desc>Zeigt die Anzahl der Eintritte in das CM innerhalb des Auswertungszeitraums</desc>
+    <basequery>
+      <table>master_tbl_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_cm_start AND '%(sdate)s'::date &lt;= coalesce(datum_cm_ende, now()))</where>
+    </basequery>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <ydim>
+      <label>Gesamtzahl Teilnehmer</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+      <where>('%(sdate)s'::date &lt;= datum_cm_start 
+				AND '%(edate)s'::date &gt;= datum_cm_start)
+	  </where>
+    </ydim>
+  </evaluation>
+  <evaluation>
+    <id>2</id>
+    <name>Austritte gesamt</name>
+    <desc>Zeigt die Anzahl der Austritte aus dem CM innherhalb des Auswertungszeitraums</desc>
+    <requirement>
+      <phase>3,4,5</phase>
+    </requirement>
+    <basequery>
+      <table>master_tbl_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_cm_start AND '%(sdate)s'::date &lt;= coalesce(datum_cm_ende, now()))</where>
+    </basequery>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <ydim>
+      <label>Gesamtzahl Teilnehmer</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+      <where>('%(edate)s'::date &gt;= coalesce(datum_cm_ende, now()) 
+				AND '%(sdate)s'::date &lt;= coalesce(datum_cm_ende, now()))
+	  </where>
+    </ydim>
+  </evaluation>
+  <evaluation>
+    <id>3</id>
+    <name>Vorzeitig ausgetreten</name>
+    <desc>Zeigt die Anzahl der vorzeitigen Austritte (Art der Beendigung ist "sonstige Beendigung") aus dem CM innherhalb des Auswertungszeitraums</desc>
+    <requirement>
+      <phase>3,4,5</phase>
+    </requirement>
+    <basequery>
+      <table>master_tbl_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_cm_start AND '%(sdate)s'::date &lt;= coalesce(datum_cm_ende, now()))</where>
+    </basequery>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <ydim>
+      <label>Gesamtzahl Teilnehmer</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+      <where>('%(edate)s'::date &gt;= coalesce(datum_cm_ende, now()) 
+				AND '%(sdate)s'::date &lt;= coalesce(datum_cm_ende, now())
+      			AND cm_end_art = 2)
+	  </where>
+    </ydim>
+  </evaluation>
+  <evaluation>
+    <id>4</id>
+    <name>Abbrecher/innen</name>
+    <desc>Zeigt die Anzahl der Abbrüche (Art der Beendigung ist "Abbruch") des CM innerhalb des Auswertungszeitraums</desc>
+    <requirement>
+      <phase>3</phase>
+    </requirement>
+    <basequery>
+      <table>master_tbl_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_cm_start AND '%(sdate)s'::date &lt;= coalesce(datum_cm_ende, now()))</where>
+    </basequery>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <ydim>
+      <label>Gesamtzahl Teilnehmer</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+      <where>('%(edate)s'::date &gt;= coalesce(datum_cm_ende, now()) 
+				AND '%(sdate)s'::date &lt;= coalesce(datum_cm_ende, now())
+      			AND cm_end_art = 3)
+	  </where>
+    </ydim>
+  </evaluation>
+  <evaluation>
+    <id>7</id>
+    <name>Alterklasse (15-24 Jahre)</name>
+    <desc>Zeigt die Anzahl der Jugendlichem im Alter von 15-24 Jahren. Das Alter bezieht sich auf das Eintrittsdatum ins Case Management.</desc>
+    <basequery>
+      <table>master_tbl_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_cm_start AND '%(sdate)s'::date &lt;= coalesce(datum_cm_ende, now()))</where>
+    </basequery>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <ydim>
+      <label>Gesamtzahl Teilnehmer</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+      <where>(date_part('year', age(datum_cm_start, geburtsdatum)) &gt;= 15 			AND date_part('year', age(datum_cm_start, geburtsdatum)) &lt;= 24)
+      </where> 
+    </ydim>
+  </evaluation>
+  <evaluation>
+    <id>8</id>
+    <name>Alterklasse (jünger 15, 25-54,  älter 64 Jahre)</name>
+    <desc>Zeigt die Anzahl der Jugendlichem im Alter von jünger als 15, 25-54, älter 64 Jahren. Das Alter bezieht sich auf das Eintrittsdatum ins Case Management.</desc>
+    <basequery>
+      <table>master_tbl_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_cm_start AND '%(sdate)s'::date &lt;= coalesce(datum_cm_ende, now()))</where>
+    </basequery>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <ydim>
+      <label>Gesamtzahl Teilnehmer</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+      <where>(date_part('year', age(datum_cm_start, geburtsdatum)) &lt; 15 
+		OR (date_part('year', age(datum_cm_start, geburtsdatum)) &gt;= 25 
+			AND date_part('year', 
+					age(datum_cm_start, geburtsdatum)) &lt;= 54) 
+		OR date_part('year', age(datum_cm_start, geburtsdatum)) &gt; 64)
+	  </where> 
+    </ydim>
+  </evaluation>
+  <evaluation>
+    <id>9</id>
+    <name>Alterklasse (55-64 Jahre)</name>
+    <desc>Zeigt die Anzahl der Jugendlichem im Alter von 55-64 Jahren. Das Alter bezieht sich auf das Eintrittsdatum ins Case Management.</desc>
+    <basequery>
+      <table>master_tbl_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_cm_start AND '%(sdate)s'::date &lt;= coalesce(datum_cm_ende, now()))</where>
+    </basequery>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <ydim>
+      <label>Gesamtzahl Teilnehmer</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+      <where>(date_part('year', age(datum_cm_start, geburtsdatum)) &gt;= 55 
+		AND date_part('year', age(datum_cm_start, geburtsdatum)) &lt;= 64)
+	  </where> 
+    </ydim>
+  </evaluation>
+  <evaluation>
+    <id>19</id>
+    <name>Menschen mit Migrationshintergrund</name>
+    <desc>Zeigt die Anzahl der Menschen mit Migrationshintergund. Ein Migrationshintergrund besteht, wenn a) die Muttersprache nicht deutsch ist, oder b) die Staatsangehörigkeit nicht deutsch ist, oder c) die Mutter oder der Vater des jungen Menschen nicht in Deutschland geboren sind.</desc>
+    <basequery>
+      <table>master_tbl_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_cm_start AND '%(sdate)s'::date &lt;= coalesce(datum_cm_ende, now()))</where>
+    </basequery>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <ydim>
+      <label>Gesamtzahl Teilnehmer</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+      <where>(nat_muspra not in (18,-1,-3) 
+				OR nat_staat not in (1,-1,-3) 
+				OR vater_land not in (29, -1, -3) 
+				OR mutter_land not in (29,-1, -3))
+	  </where> 
+    </ydim>
+  </evaluation>
+  <evaluation>
+    <id>20</id>
+    <name>Menschen mit Behinderung</name>
+    <desc>Zeigt die Anzahl der Menschen mit Behinderung. Ein Behinderung besteht, wenn in den Angaben zur Entwicklung des jungen Menschen eine anerkannte Behinderung dokumentiert wurde.</desc>
+    <basequery>
+      <table>master_tbl_view</table>
+      <template>SELECT t.id, r.entw_beh, %(xfield)s, %(yfield)s from %(from)s t JOIN rg_kompetenz_tbl r ON t.id = r.master_id  WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_cm_start AND '%(sdate)s'::date &lt;= coalesce(datum_cm_ende, now()))</where>
+    </basequery>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <ydim>
+      <label>Gesamtzahl Teilnehmer</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+      <where>(r.entw_beh = 1)</where>
+    </ydim>
+  </evaluation>
+  <evaluation>
+    <id>21</id>
+    <name>Menschen mit sonstiger Benachteiligung</name>
+    <desc>Zeigt die Anzahl der Menschen mit sonstiger Benachteiligung. Ein Benachteiligung besteht, wenn in den Angaben zur Entwicklung des jungen Menschen eine a) physische, oder b) psychische Krankheit dokumentiert wurde (geringes Problem oder größer).</desc>
+    <basequery>
+      <table>master_tbl_view</table>
+      <template>SELECT t.id, r.entw_h, r.entw_i, %(xfield)s, %(yfield)s from %(from)s t JOIN rg_kompetenz_tbl r ON t.id = r.master_id  WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_cm_start AND '%(sdate)s'::date &lt;= coalesce(datum_cm_ende, now()))</where>
+    </basequery>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <ydim>
+      <label>Gesamtzahl Teilnehmer</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+      <where>(r.entw_h > 1 or r.entw_i > 1)</where>
+    </ydim>
+  </evaluation>
+  <evaluation>
+    <id>28</id>
+    <name>Gesamtzahl CM-Kunden</name>
+    <desc>Zeigt die Gesamtzahl der Jugendlichen an die sich während des Auswertungszeitraum im CM befunden haben.</desc>
+    <basequery>
+      <table>master_tbl_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_cm_start AND '%(sdate)s'::date &lt;= coalesce(datum_cm_ende, now()))</where>
+    </basequery>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <ydim>
+      <label>Gesamtzahl Teilnehmer</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+    </ydim>
+  </evaluation>
+</evaluationset>

Added: wasko/branches/1.0/waskaweb/public/xml/eval_aktiv.xml
===================================================================
--- wasko/branches/1.0/waskaweb/public/xml/eval_aktiv.xml	2009-09-23 12:44:29 UTC (rev 607)
+++ wasko/branches/1.0/waskaweb/public/xml/eval_aktiv.xml	2009-09-23 15:06:44 UTC (rev 608)
@@ -0,0 +1,128 @@
+<evaluationset>
+  <id>3</id>
+  <version>0.9</version>
+  <name>Aktive Fälle</name>
+  <desc>Betrachte, wieviele Fälle zu einem Zeitpunkt X in den verschiedenen Phasen waren. Als Zeitpunkt/Stichtag wird das Enddatum des angegebenen Auswertungszeitraums verwendet. Bei einer Phasenänderung am Stichtag wird der Fall nicht für die beendete Phase gezählt.</desc>
+  <requirement>
+    <phase>0</phase>
+    <validity>1</validity>
+    <validity>3</validity>
+  </requirement>
+  <evaluation>
+    <id>1</id>
+    <name>Jugendliche in der Eingangsanamnese</name>
+    <desc>Zeigt die Gesamtanzahl der Fälle in der Phase A (Eingangsdokumentation) zum Zeitpunkt X. Fälle, die am Stichtag die Phase A beendeten, werden nicht gezählt.</desc>
+    <requirement>
+      <phase>0</phase>
+    </requirement>
+    <basequery>
+      <table>master_tbl_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>(erstgespraech &lt;= '%(edate)s'::date AND coalesce(datum_cm_start, now()) &gt; '%(edate)s'::date)</where>
+    </basequery>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <xdim>
+      <label>Migration nach Geschlecht</label>
+      <field>(CASE WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 0) THEN 0 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 1) THEN 1 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -3) THEN -3 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <table>geschlecht_tbl</table>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Gesamtzahl Teilnehmer</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+    </ydim>
+  </evaluation>
+  <evaluation>
+    <id>2</id>
+    <name>Jugendliche im Case Management</name>
+    <desc>Zeigt die Gesamtanzahl der Fälle in der Phase B (Case Management) zum Zeitpunkt X. Fälle, die am Stichtag die Phase B beendeten, werden nicht gezählt.</desc>
+    <requirement>
+      <phase>2</phase>
+    </requirement>
+    <basequery>
+      <table>master_tbl_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>(datum_cm_start &lt;= '%(edate)s'::date AND coalesce(datum_cm_ende, now()) &gt; '%(edate)s'::date)</where>
+    </basequery>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <xdim>
+      <label>Migration nach Geschlecht</label>
+      <field>(CASE WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 0) THEN 0 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 1) THEN 1 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -3) THEN -3 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <table>geschlecht_tbl</table>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Gesamtzahl Teilnehmer</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+    </ydim>
+  </evaluation>
+  <evaluation>
+    <id>3</id>
+    <name>Jugendliche in der Nachbetreuung</name>
+    <desc>Zeigt die Gesamtanzahl der Fälle in der Phase C (Nachbetreuung) zum Zeitpunkt X. Fälle, die am Stichtag die Phase C beendeten, werden nicht gezählt.</desc>
+    <requirement>
+      <phase>4</phase>
+    </requirement>
+    <basequery>
+      <table>master_tbl_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>(nbetr_start &lt;= '%(edate)s'::date AND coalesce(nbetr_ende, now()) &gt; '%(edate)s'::date)</where>
+    </basequery>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <xdim>
+      <label>Migration nach Geschlecht</label>
+      <field>(CASE WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 0) THEN 0 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 1) THEN 1 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -3) THEN -3 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <table>geschlecht_tbl</table>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Gesamtzahl Teilnehmer</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+    </ydim>
+  </evaluation>
+</evaluationset>

Added: wasko/branches/1.0/waskaweb/public/xml/eval_analyse.xml
===================================================================
--- wasko/branches/1.0/waskaweb/public/xml/eval_analyse.xml	2009-09-23 12:44:29 UTC (rev 607)
+++ wasko/branches/1.0/waskaweb/public/xml/eval_analyse.xml	2009-09-23 15:06:44 UTC (rev 608)
@@ -0,0 +1,28 @@
+<evaluationset>
+  <id>4</id>
+  <version>1.0</version>
+  <name>Analyse</name>
+  <desc>Keine weitere Beschreibung</desc>
+  <evaluation>
+    <id>1</id>
+    <name>Gesamtzahl</name>
+    <desc>Zeigt die Gesamtanzahl der Fälle in der Datenbank an.</desc>
+    <basequery>
+      <table>master_tbl_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>(TRUE)</where>
+    </basequery>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <ydim>
+      <label>Gesamtzahl Teilnehmer</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+    </ydim>
+  </evaluation>
+</evaluationset>

Added: wasko/branches/1.0/waskaweb/public/xml/eval_tagebuch.xml
===================================================================
--- wasko/branches/1.0/waskaweb/public/xml/eval_tagebuch.xml	2009-09-23 12:44:29 UTC (rev 607)
+++ wasko/branches/1.0/waskaweb/public/xml/eval_tagebuch.xml	2009-09-23 15:06:44 UTC (rev 608)
@@ -0,0 +1,55 @@
+<evaluationset>
+  <id>5</id>
+  <version>0.9</version>
+  <name>Tagebuch Auswertungen</name>
+  <desc>Keine weitere Beschreibung</desc>
+  <requirement>
+    <phase>2</phase>
+    <validity>1</validity>
+    <validity>3</validity>
+  </requirement>
+  <evaluation>
+    <id>1</id>
+    <name>Falltagebuch</name>
+    <desc>Zeigt den aktuell dokumentierten Aufwand in Minuten im Falltagebuch kategoriesiert nach den Verschiedenen Aufwandsarten.</desc>
+    <requirement>
+      <phase>2</phase>
+    </requirement>
+    <basequery>
+      <table>(select p.id, p.geschlecht, l.art, l.dauer from ka_logbuch_tbl l join master_tbl_view p on l.master_id = p.id) zzz</table>
+      <template>SELECT id, EXTRACT(epoch FROM dauer) as dauer, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>TRUE</where>
+      <aggregate>sum(m.dauer)/60</aggregate>
+    </basequery>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <ydim>
+      <label>Unmittelbare Arbeit mit dem Jugendlichen</label>
+      <field>art</field>
+      <table>(select id, beschreibung as value from ka_logbuch_art_tbl where id in (1, 2, 3, 4, 5))</table>
+      <join>art</join>
+    </ydim>
+    <ydim>
+      <label>Arbeit mit Eltern / Personensorgeberechtigten</label>
+      <field>art</field>
+      <table>(select id, beschreibung as value from ka_logbuch_art_tbl where id in (6, 7, 8))</table>
+      <join>art</join>
+    </ydim>
+    <ydim>
+      <label>Arbeit mit Dritten</label>
+      <field>art</field>
+      <table>(select id, beschreibung as value from ka_logbuch_art_tbl where id in (9,10,18,11,12,13,14))</table>
+      <join>art</join>
+    </ydim>
+    <ydim>
+      <label>Sonstiges</label>
+      <field>art</field>
+      <table>(select id, beschreibung as value from ka_logbuch_art_tbl where id in (15,16,17,-2,-1))</table>
+      <join>art</join>
+    </ydim>
+  </evaluation>
+</evaluationset>

Added: wasko/branches/1.0/waskaweb/public/xml/eval_verlauf.xml
===================================================================
--- wasko/branches/1.0/waskaweb/public/xml/eval_verlauf.xml	2009-09-23 12:44:29 UTC (rev 607)
+++ wasko/branches/1.0/waskaweb/public/xml/eval_verlauf.xml	2009-09-23 15:06:44 UTC (rev 608)
@@ -0,0 +1,163 @@
+<evaluationset mode="trend">
+  <id>2</id>
+  <version>0.9</version>
+  <name>Zusammenfassende Auswertungen</name>
+  <desc>Keine weitere Beschreibung</desc>
+  <requirement>
+    <phase>2</phase>
+    <validity>1</validity>
+    <validity>3</validity>
+  </requirement>
+  <evaluation>
+    <id>1</id>
+    <name>Gesamtzahl der Teilnehmer</name>
+    <desc>Zeigt die Gesamtanzahl der CM-Fälle innerhalb des Auswertungszeitraums.</desc>
+    <requirement>
+      <phase>2</phase>
+    </requirement>
+    <basequery>
+      <table>master_tbl_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_cm_start AND '%(sdate)s'::date &lt;= coalesce(datum_cm_ende, now()))</where>
+    </basequery>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <xdim>
+      <label>Migration nach Geschlecht</label>
+      <field>(CASE WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 0) THEN 0 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 1) THEN 1 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -3) THEN -3 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <table>geschlecht_tbl</table>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Gesamtzahl Teilnehmer</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+    </ydim>
+  </evaluation>
+  <evaluation>
+    <id>2</id>
+    <name>Gesamtzahl der Neueintritte</name>
+    <desc>Zeigt die Gesamtanzahl der Neueintritte innerhalb des Auswertungszeitraums. Der relative Anteil von Wiederaufnahmen und Neueintritten ergibt sich aus den Angaben in der Eingansdokumentation. Hierbei muss a) die Angabe "Jugendlicher ware bereits im CM" und b) eine genehmigte Wiedervorlage bzw. Neuaufnahme dokumentiert sein.</desc>
+    <requirement>
+      <phase>2</phase>
+    </requirement>
+    <basequery>
+      <table>master_tbl_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(sdate)s'::date &lt;= datum_cm_start AND '%(edate)s'::date &gt;= datum_cm_start)</where>
+    </basequery>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <xdim>
+      <label>Migration nach Geschlecht</label>
+      <field>(CASE WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 0) THEN 0 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 1) THEN 1 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -3) THEN -3 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <table>geschlecht_tbl</table>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Gesamtzahl Teilnehmer</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+    </ydim>
+    <ydim>
+      <label>Davon Wiederaufnahmen</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+      <where>(cm2c=1 AND cm_wiederauf_genehm_1 = 1 OR cm_wiederauf_genehm_2 = 1)</where>
+    </ydim>
+    <ydim>
+      <label>Davon Neuaufnahmen</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+      <where>(cm2c=1 AND cm_neuauf_genehm = 1)</where>
+    </ydim>
+  </evaluation>
+  <evaluation>
+    <id>3</id>
+    <name>Gesamtzahl der Austritte</name>
+    <desc>Zeigt die Gesamtanzahl der Austritte innerhalb des Auswertungszeitraums.</desc>
+    <basequery>
+      <table>master_tbl_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= coalesce(datum_cm_ende, now()) AND '%(sdate)s'::date &lt;= coalesce(datum_cm_ende, now()))</where>
+    </basequery>
+    <requirement>
+      <phase>3</phase>
+    </requirement>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <xdim>
+      <label>Migration nach Geschlecht</label>
+      <field>(CASE WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 0) THEN 0 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 1) THEN 1 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -3) THEN -3 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <table>geschlecht_tbl</table>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Gesamtzahl Teilnehmer</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+    </ydim>
+    <ydim>
+      <label>davon erfolgreiche Beendigung</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+      <where>cm_end_art = 1</where>
+    </ydim>
+    <ydim>
+      <label>davon mit sonst. Beendigung</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+      <where>cm_end_art = 2</where>
+    </ydim>
+    <ydim>
+      <label>davon Abbrüche</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+      <where>cm_end_art = 3</where>
+    </ydim>
+  </evaluation>
+</evaluationset>

Added: wasko/branches/1.0/waskaweb/public/xml/eval_weitere.xml
===================================================================
--- wasko/branches/1.0/waskaweb/public/xml/eval_weitere.xml	2009-09-23 12:44:29 UTC (rev 607)
+++ wasko/branches/1.0/waskaweb/public/xml/eval_weitere.xml	2009-09-23 15:06:44 UTC (rev 608)
@@ -0,0 +1,466 @@
+<evaluationset>
+  <id>3</id>
+  <version>0.9</version>
+  <name>Weitere Kategorien</name>
+  <desc>Keine weitere Beschreibung</desc>
+  <requirement>
+    <phase>2</phase>
+    <validity>1</validity>
+    <validity>3</validity>
+  </requirement>
+  <evaluation>
+    <id>1</id>
+    <name>Eintrittsalter</name>
+    <desc>Zeigt die Gesamtanzahl der Fälle aufgeteilt nach den verschiedenen Alterstufen (Alter zum Ende Eintritt in das Case Management).</desc>
+    <basequery>
+      <table>master_tbl_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(sdate)s'::date &lt;= coalesce(datum_cm_ende, now()) 
+		AND '%(edate)s'::date &gt;= datum_cm_start)</where>
+    </basequery>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <xdim>
+      <label>Migration nach Geschlecht</label>
+      <field>(CASE WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 0) THEN 0 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 1) THEN 1 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -3) THEN -3 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <table>geschlecht_tbl</table>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>jünger als 12 Jahre</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+      <where>(date_part('year', age(datum_cm_start, geburtsdatum)) &lt; 12)</where>
+    </ydim>
+    <ydim>
+      <label>12 Jahre</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+      <where>(date_part('year', age(datum_cm_start, geburtsdatum)) = 12)</where>
+    </ydim>
+    <ydim>
+      <label>13 Jahre</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+      <where>(date_part('year', age(datum_cm_start, geburtsdatum)) = 13)</where>
+    </ydim>
+    <ydim>
+      <label>14 Jahre</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+      <where>(date_part('year', age(datum_cm_start, geburtsdatum)) = 14)</where>
+    </ydim>
+    <ydim>
+      <label>15 Jahre</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+      <where>(date_part('year', age(datum_cm_start, geburtsdatum)) = 15)</where>
+    </ydim>
+    <ydim>
+      <label>16 Jahre</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+      <where>(date_part('year', age(datum_cm_start, geburtsdatum)) = 16)</where>
+    </ydim>
+    <ydim>
+      <label>älter als 16 Jahre</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+      <where>(date_part('year', age(datum_cm_start, geburtsdatum)) &gt; 16)</where>
+    </ydim>
+    <ydim>
+      <label>unbekannt</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+      <where>(geburtsdatum IS NULL)</where>
+    </ydim>
+  </evaluation>
+  <evaluation>
+    <id>2</id>
+    <name>Zugang</name>
+    <desc>Zeigt die Gesamtanzahl der Fälle aufgeteilt nach den verschiedenen Zugangswegen</desc>
+    <basequery>
+      <table>master_tbl_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(sdate)s'::date &lt;= coalesce(datum_cm_ende, now()) 
+		AND '%(edate)s'::date &gt;= datum_cm_start)</where>
+    </basequery>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <xdim>
+      <label>Migration nach Geschlecht</label>
+      <field>(CASE WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 0) THEN 0 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 1) THEN 1 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -3) THEN -3 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <table>geschlecht_tbl</table>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Zugang</label>
+      <field>zugang</field>
+      <table>zugang_tbl</table>
+      <join>zugang</join>
+    </ydim>
+  </evaluation>
+  <evaluation>
+    <id>3</id>
+    <name>Schulform bei Aufnahme</name>
+    <desc>Zeigt die Gesamtanzahl der Fälle aufgeteilt nach den verschiedenen Schulformen</desc>
+    <basequery>
+      <table>master_tbl_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(sdate)s'::date &lt;= coalesce(datum_cm_ende, now()) 
+		AND '%(edate)s'::date &gt;= datum_cm_start)</where>
+    </basequery>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <xdim>
+      <label>Migration nach Geschlecht</label>
+      <field>(CASE WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 0) THEN 0 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 1) THEN 1 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -3) THEN -3 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <table>geschlecht_tbl</table>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Schulform</label>
+      <field>schulform</field>
+      <table>schulform_tbl</table>
+      <join>schulform</join>
+    </ydim>
+  </evaluation>
+  <evaluation>
+    <id>4</id>
+    <name>Aktive Schulverweigerungshaltung</name>
+    <desc>Zeigt die Gesamtanzahl der Fälle aufgeteilt nach den verschiedenen Graden der Verweigerungshaltung</desc>
+    <basequery>
+      <table>master_tbl_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(sdate)s'::date &lt;= coalesce(datum_cm_ende, now()) 
+		AND '%(edate)s'::date &gt;= datum_cm_start)</where>
+    </basequery>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <xdim>
+      <label>Migration nach Geschlecht</label>
+      <field>(CASE WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 0) THEN 0 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 1) THEN 1 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -3) THEN -3 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <table>geschlecht_tbl</table>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Aktive Verweigerung</label>
+      <field>sv_aktiv</field>
+      <table>sv_aktiv_tbl</table>
+      <join>sv_aktiv</join>
+    </ydim>
+  </evaluation>
+  <evaluation>
+    <id>5</id>
+    <name>Passive Schulverweigerungshaltung</name>
+    <desc>Zeigt die Gesamtanzahl der Fälle aufgeteilt nach den verschiedenen Graden der Verweigerungshaltung</desc>
+    <basequery>
+      <table>master_tbl_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(sdate)s'::date &lt;= coalesce(datum_cm_ende, now()) 
+		AND '%(edate)s'::date &gt;= datum_cm_start)</where>
+    </basequery>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <xdim>
+      <label>Migration nach Geschlecht</label>
+      <field>(CASE WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 0) THEN 0 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 1) THEN 1 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -3) THEN -3 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <table>geschlecht_tbl</table>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Passive Verweigerung</label>
+      <field>sv_passiv</field>
+      <table>sv_aktiv_tbl</table>
+      <join>sv_passiv</join>
+    </ydim>
+  </evaluation>
+  <evaluation>
+    <id>6</id>
+    <name>Verlängerungen, Wiederaufnahmen, Neuaufnahmen</name>
+    <desc>Zeigt die Anzahl der Fälle aufgeteilt nach Verlängerungen, Wieder- bzw. Neuaufnahmen.</desc>
+    <basequery>
+      <table>master_tbl_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(sdate)s'::date &lt;= coalesce(datum_cm_ende, now()) 
+		AND '%(edate)s'::date &gt;= datum_cm_start)</where>
+    </basequery>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <xdim>
+      <label>Migration nach Geschlecht</label>
+      <field>(CASE WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 0) THEN 0 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 1) THEN 1 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -3) THEN -3 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <table>geschlecht_tbl</table>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Eine Verlängerung</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+      <where>(cm_datum_verlaengerung_1 is not NULL)</where>
+    </ydim>
+    <ydim>
+      <label>Zwei Verlängerungen</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+      <where>(cm_datum_verlaengerung_2 is not NULL)</where>
+    </ydim>
+    <ydim>
+      <label>Wiederaufnahmen</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+      <where>(cm2c=1 AND cm_wiederauf_genehm_1 = 1 OR cm_wiederauf_genehm_2 = 1)</where>
+    </ydim>
+    <ydim>
+      <label>Neuaufnahmen</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+      <where>(cm2c=1 AND cm_neuauf_genehm = 1)</where>
+    </ydim>
+
+  </evaluation>
+  <evaluation>
+    <id>8</id>
+    <name>Übergang in Schulform</name>
+    <desc>Zeigt die Gesamtanzahl der Fälle aufgeteilt nach den verschiedenen Übergängen</desc>
+    <basequery>
+      <table>master_tbl_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(sdate)s'::date &lt;= coalesce(datum_cm_ende, now()) 
+		AND '%(edate)s'::date &gt;= datum_cm_start)</where>
+    </basequery>
+    <requirements>
+      <phase>3</phase>
+    </requirements>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <xdim>
+      <label>Migration nach Geschlecht</label>
+      <field>(CASE WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 0) THEN 0 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 1) THEN 1 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -3) THEN -3 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <table>geschlecht_tbl</table>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Übergang Schulform</label>
+      <field>cm_end_schul</field>
+      <table>cm_end_schul_tbl</table>
+      <join>cm_end_schul</join>
+    </ydim>
+  </evaluation>
+  <evaluation>
+    <id>9</id>
+    <name>Durchschnittliche Verweildauer in Phase A (Eingangsdokumentation)</name>
+    <desc>Zeigt die durchschnittliche Verweildauer der Fälle in der Phase A. Die Phase muss abgeschlossen sein.</desc>
+    <basequery>
+      <table>master_tbl_view</table>
+      <template>SELECT id, erstgespraech, datum_cm_start, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <aggregate>trunc(sum(extract(epoch from age(m.datum_cm_start, m.erstgespraech))/604800))</aggregate>
+      <where>(TRUE)</where>
+    </basequery>
+    <requirement>
+      <phase>1</phase>
+    </requirement>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <xdim>
+      <label>Migration nach Geschlecht</label>
+      <field>(CASE WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 0) THEN 0 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 1) THEN 1 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -3) THEN -3 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <table>geschlecht_tbl</table>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Dauer (Wochen)</label>
+      <field>(select DISTINCT 1 from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT 1 as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+    </ydim>
+  </evaluation>
+  <evaluation>
+    <id>10</id>
+    <name>Durchschnittliche Verweildauer in Phase B (Case Management)</name>
+    <desc>Zeigt die durchschnittliche Verweildauer der Fälle in der Phase B. Die Phase muss abgeschlossen sein.</desc>
+    <basequery>
+      <table>master_tbl_view</table>
+      <template>SELECT id, datum_cm_ende, datum_cm_start, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <aggregate>trunc(sum(extract(epoch from age(m.datum_cm_ende, m.datum_cm_start))/604800))</aggregate>
+      <where>(TRUE)</where>
+    </basequery>
+    <requirement>
+      <phase>3</phase>
+    </requirement>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <xdim>
+      <label>Migration nach Geschlecht</label>
+      <field>(CASE WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 0) THEN 0 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 1) THEN 1 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -3) THEN -3 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <table>geschlecht_tbl</table>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Dauer (Wochen)</label>
+      <field>(select DISTINCT 1 from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT 1 as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+    </ydim>
+  </evaluation>
+  <evaluation>
+    <id>11</id>
+    <name>Durchschnittliche Verweildauer in Phase C (Nachbetreuung)</name>
+    <desc>Zeigt die durchschnittliche Verweildauer der Fälle in der Phase C. Die Phase muss abgeschlossen sein.</desc>
+    <basequery>
+      <table>master_tbl_view</table>
+      <template>SELECT id, nbetr_start, nbetr_ende, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <aggregate>trunc(sum(extract(epoch from age(m.nbetr_ende, m.nbetr_start))/604800))</aggregate>
+      <where>(TRUE)</where>
+    </basequery>
+    <requirement>
+      <phase>5</phase>
+    </requirement>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <xdim>
+      <label>Migration nach Geschlecht</label>
+      <field>(CASE WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 0) THEN 0 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 1) THEN 1 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -3) THEN -3 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <table>geschlecht_tbl</table>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Dauer (Wochen)</label>
+      <field>(select DISTINCT 1 from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT 1 as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+    </ydim>
+  </evaluation>
+</evaluationset>

Added: wasko/branches/1.0/waskaweb/public/xml/eval_zusammenfassung.xml
===================================================================
--- wasko/branches/1.0/waskaweb/public/xml/eval_zusammenfassung.xml	2009-09-23 12:44:29 UTC (rev 607)
+++ wasko/branches/1.0/waskaweb/public/xml/eval_zusammenfassung.xml	2009-09-23 15:06:44 UTC (rev 608)
@@ -0,0 +1,163 @@
+<evaluationset>
+  <id>2</id>
+  <version>0.9</version>
+  <name>Zusammenfassende Auswertungen</name>
+  <desc>Keine weitere Beschreibung</desc>
+  <requirement>
+    <phase>2</phase>
+    <validity>1</validity>
+    <validity>3</validity>
+  </requirement>
+  <evaluation>
+    <id>1</id>
+    <name>Gesamtzahl der Teilnehmer</name>
+    <desc>Zeigt die Gesamtanzahl der CM-Fälle innerhalb des Auswertungszeitraums.</desc>
+    <requirement>
+      <phase>2</phase>
+    </requirement>
+    <basequery>
+      <table>master_tbl_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_cm_start AND '%(sdate)s'::date &lt;= coalesce(datum_cm_ende, now()))</where>
+    </basequery>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <xdim>
+      <label>Migration nach Geschlecht</label>
+      <field>(CASE WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 0) THEN 0 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 1) THEN 1 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -3) THEN -3 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <table>geschlecht_tbl</table>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Gesamtzahl Teilnehmer</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+    </ydim>
+  </evaluation>
+  <evaluation>
+    <id>2</id>
+    <name>Gesamtzahl der Neueintritte</name>
+    <desc>Zeigt die Gesamtanzahl der Neueintritte innerhalb des Auswertungszeitraums. Der relative Anteil von Wiederaufnahmen und Neueintritten ergibt sich aus den Angaben in der Eingansdokumentation. Hierbei muss a) die Angabe "Jugendlicher ware bereits im CM" und b) eine genehmigte Wiedervorlage bzw. Neuaufnahme dokumentiert sein.</desc>
+    <requirement>
+      <phase>2</phase>
+    </requirement>
+    <basequery>
+      <table>master_tbl_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(sdate)s'::date &lt;= datum_cm_start AND '%(edate)s'::date &gt;= datum_cm_start)</where>
+    </basequery>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <xdim>
+      <label>Migration nach Geschlecht</label>
+      <field>(CASE WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 0) THEN 0 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 1) THEN 1 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -3) THEN -3 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <table>geschlecht_tbl</table>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Gesamtzahl Teilnehmer</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+    </ydim>
+    <ydim>
+      <label>Davon Wiederaufnahmen</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+      <where>(cm2c=1 AND cm_wiederauf_genehm_1 = 1 OR cm_wiederauf_genehm_2 = 1)</where>
+    </ydim>
+    <ydim>
+      <label>Davon Neuaufnahmen</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+      <where>(cm2c=1 AND cm_neuauf_genehm = 1)</where>
+    </ydim>
+  </evaluation>
+  <evaluation>
+    <id>3</id>
+    <name>Gesamtzahl der Austritte</name>
+    <desc>Zeigt die Gesamtanzahl der Austritte innerhalb des Auswertungszeitraums.</desc>
+    <basequery>
+      <table>master_tbl_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= coalesce(datum_cm_ende, now()) AND '%(sdate)s'::date &lt;= coalesce(datum_cm_ende, now()))</where>
+    </basequery>
+    <requirement>
+      <phase>3</phase>
+    </requirement>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <xdim>
+      <label>Migration nach Geschlecht</label>
+      <field>(CASE WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 0) THEN 0 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = 1) THEN 1 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -3) THEN -3 WHEN ((nat_muspra not in (18,-1, -3) or
+      nat_staat not in (1,-1,-3) or vater_land not in (29, -1, -3) or
+      mutter_land not in (29,-1, -3)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <table>geschlecht_tbl</table>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Gesamtzahl Teilnehmer</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+    </ydim>
+    <ydim>
+      <label>davon erfolgreiche Beendigung</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+      <where>cm_end_art = 1</where>
+    </ydim>
+    <ydim>
+      <label>davon mit sonst. Beendigung</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+      <where>cm_end_art = 2</where>
+    </ydim>
+    <ydim>
+      <label>davon Abbrüche</label>
+      <field>(select count(id) from master_tbl_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_view)</table>
+      <join>anzahl</join>
+      <where>cm_end_art = 3</where>
+    </ydim>
+  </evaluation>
+</evaluationset>

Deleted: wasko/branches/1.0/waskaweb/templates/casemanagement/evaluation.mako
===================================================================
--- wasko/branches/1.0/waskaweb/templates/casemanagement/evaluation.mako	2009-09-23 12:44:29 UTC (rev 607)
+++ wasko/branches/1.0/waskaweb/templates/casemanagement/evaluation.mako	2009-09-23 15:06:44 UTC (rev 608)
@@ -1,8 +0,0 @@
-<%inherit file="../main.mako" />
-<%def name="buildNavipath()">
-		${parent.buildNavipath()}
-	<li><a href="/case">${_('cm_np_root')}</a></li>
-	<li><a href="/case/evaluate/">${_('cm_np_evaluate')}</a></li>
-</%def>
-<h1>${_('cm_header_evaluate')}</h1>
-<p><a href="/evaluate/evaluate">${_('cm_actions_link_evaluate')}</a></p>

Added: wasko/branches/1.0/waskaweb/templates/evaluation/evaluate.mako
===================================================================
--- wasko/branches/1.0/waskaweb/templates/evaluation/evaluate.mako	2009-09-23 12:44:29 UTC (rev 607)
+++ wasko/branches/1.0/waskaweb/templates/evaluation/evaluate.mako	2009-09-23 15:06:44 UTC (rev 608)
@@ -0,0 +1,85 @@
+## -*- coding: utf-8 -*-
+<%inherit file="/main.mako"/>
+<%!  import waskaweb.lib.filters as F %>
+<div>
+  ##<div class="widget modusfield actions">
+  ##  <ul>
+  ##    <li><a href="/administration/resetPassword/${c.user.id}">${_('Reset password')}</a></li>
+  ##    <li><a href="/administration/listUsers">${_('Back to userlist')}</a></li>
+  ##  </ul>
+  ##</div>
+  <div class="header">
+    <h1>${_('Evaluation configuration')}</h1>
+  </div>
+</div>
+<div>
+<form action="/evaluate/evaluateAction" method="POST">
+<input type="hidden" name="id">
+<input type="hidden" name="start_date_field">
+<input type="hidden" name="end_date_field">
+<input type="hidden" name="phase">
+<input type="hidden" name="sql">
+<h2>${_('Setup evaluation')}</h2>
+<table>
+  <tr>
+    <td class="label">${_('Name')}</td>
+    <td>${c.evalconfig.get_setname()}</td>
+  </tr>
+  <tr>
+    <td class="label">${_('Description')}</td>
+    <td>${c.evalconfig.get_setdesc()}</td>
+  </tr>
+  <tr>
+    <td class="label">${_('Phase')}</td>
+    <td>${c.evaloptions.get('phase', '-2')}</td>
+  </tr>
+  <tr>
+    <td class="label">${_('Interval')}</td>
+    <td>${_('Start datefield: "%s" | End datefield: "%s"') % (c.evaloptions.get('start_date_field'), c.evaloptions.get('end_date_field'))}</td>
+  </tr>
+  <tr>
+    <td class="label">${_('Start date')}</td>
+    <td><input type="text" name="start_date" class="datefield"><form:error name="start_date" format=""></td>
+  </tr>
+  <tr>
+    <td class="label">${_('End date')}</td>
+    <td><input type="text" name="end_date" class="datefield"><form:error name="end_date" format=""></td>
+  </tr>
+  % if session.has_key('evaluation.options'):
+  <tr>
+    <td class="label">${_('Filter')}</td>
+    <td>
+      Yes (<a href="/evaluate/resetFilter/${c.evalconfig.get_setid()}">Reset</a>)<br>
+      ${session['evaluation.options'].get('sql')}
+    </td>
+  </tr>
+  % endif
+</table>
+<h2>${_('Available evaluations')}</h2>
+<p>${_('Please select one or more evaluations')}</p>
+<table style="table-layout:auto">
+  <tr>
+    <th colspan="2">${_('Evaluations')}</th>
+  </tr>
+  % for num, id in enumerate(c.evalconfig.get_evaluations()):
+  <tr>
+    <td class="${num%2 and 'hl' or ''}">
+      <input type="checkbox" name="typelist" value="${id}" id="${id}">
+    </td>
+    <td class="${num%2 and 'hl' or ''}">
+      <h3><label for="${id}">${c.evalconfig.get_name(id)}</label></h3>
+      <p><label for="${id}">${c.evalconfig.get_desc(id)}</label></p>
+    </td>
+  </tr>
+  % endfor
+</table>
+<table>
+  <tr>
+    <td colspan="3"><input type="checkbox" name="show_percent" id="show_percent"> <label for="show_percent">${_('Show percent')}</label></td> 
+  </tr>
+  <tr>
+    <td colspan="3"><input type="submit" name="setup_evaluation" value="${_('evaluate')}"></td> 
+  </tr>
+</table>
+</form>
+</div>

Added: wasko/branches/1.0/waskaweb/templates/evaluation/result.mako
===================================================================
--- wasko/branches/1.0/waskaweb/templates/evaluation/result.mako	2009-09-23 12:44:29 UTC (rev 607)
+++ wasko/branches/1.0/waskaweb/templates/evaluation/result.mako	2009-09-23 15:06:44 UTC (rev 608)
@@ -0,0 +1,13 @@
+## -*- coding: utf-8 -*-
+<%inherit file="/main.mako"/>
+<div id="content_header_small">
+<div id="modusfield">
+  <div class="actions">
+    <ul>
+      <li><a href="/evaluate/exportXML/evaluation_export.xml" target="_blank">${_('Export XML')}</a></li>
+      <li><a href="/evaluate/exportCSV/evaluation_export.csv" target="_blank">${_('Export CSV')}</a></li>
+    </ul>
+  </div>
+</div>
+</div>
+${c.result}



More information about the Mpuls-commits mailing list