[Mpuls-commits] r712 - in waska/trunk/waskaweb/public: . xml

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Nov 27 14:11:26 CET 2009


Author: torsten
Date: 2009-11-27 14:11:23 +0100 (Fri, 27 Nov 2009)
New Revision: 712

Added:
   waska/trunk/waskaweb/public/xml/
   waska/trunk/waskaweb/public/xml/eval_adele.xml
   waska/trunk/waskaweb/public/xml/eval_aktiv.xml
   waska/trunk/waskaweb/public/xml/eval_analyse.xml
   waska/trunk/waskaweb/public/xml/eval_tagebuch.xml
   waska/trunk/waskaweb/public/xml/eval_verlauf.xml
   waska/trunk/waskaweb/public/xml/eval_weitere.xml
   waska/trunk/waskaweb/public/xml/eval_zusammenfassung.xml
   waska/trunk/waskaweb/public/xml/tagging.xml
Log:
Added evaluation configs


Added: waska/trunk/waskaweb/public/xml/eval_adele.xml
===================================================================
--- waska/trunk/waskaweb/public/xml/eval_adele.xml	2009-11-27 13:10:03 UTC (rev 711)
+++ waska/trunk/waskaweb/public/xml/eval_adele.xml	2009-11-27 13:11:23 UTC (rev 712)
@@ -0,0 +1,603 @@
+<evaluationset>
+  <id>1</id>
+  <version>0.9.1</version>
+  <name>Verwendungsnachweis</name>
+  <desc>Die Verwendungsnachweise 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 (adele-auswertbar)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_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_feststellung AND '%(sdate)s'::date &lt;= coalesce(beendigung_5, 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_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>('%(sdate)s'::date &lt;= datum_feststellung 
+				AND '%(edate)s'::date &gt;= datum_feststellung)
+	  </where>
+    </ydim>
+  </evaluation>
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <evaluation>
+    <id>2</id>
+    <name>Austritte gesamt</name>
+    <desc>Zeigt die Anzahl der Austritte aus dem CM innerhalb des Auswertungszeitraums</desc>
+    <requirement>
+      <phase>3,4,5</phase>
+    </requirement>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_feststellung AND '%(sdate)s'::date &lt;= coalesce(beendigung_5, 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_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>('%(edate)s'::date &gt;= coalesce(beendigung_5, now()) 
+				AND '%(sdate)s'::date &lt;= coalesce(beendigung_5, 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 innerhalb des Auswertungszeitraums</desc>
+    <requirement>
+      <phase>3,4,5</phase>
+    </requirement>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_feststellung AND '%(sdate)s'::date &lt;= coalesce(beendigung_5, 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_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>('%(edate)s'::date &gt;= coalesce(beendigung_5, now()) 
+				AND '%(sdate)s'::date &lt;= coalesce(beendigung_5, now())
+      			AND art_beendigung = 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_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_feststellung AND '%(sdate)s'::date &lt;= coalesce(beendigung_5, 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_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>('%(edate)s'::date &gt;= coalesce(beendigung_5, now()) 
+				AND '%(sdate)s'::date &lt;= coalesce(beendigung_5, now())
+      			AND art_beendigung = 1)
+	  </where>
+    </ydim>
+  </evaluation>
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <evaluation>
+    <id>7</id>
+    <name>Alterklasse (15-24 Jahre)</name>
+    <desc>Zeigt die Anzahl der Jugendlichen im Alter von 15-24 Jahren. Das Alter bezieht sich auf das Eintrittsdatum ins Case Management.</desc>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_feststellung AND '%(sdate)s'::date &lt;= coalesce(beendigung_5, 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_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(date_part('year', age(datum_feststellung, geburtsdatum)) &gt;= 15 			AND date_part('year', age(datum_feststellung, 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 Jugendlichen 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_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_feststellung AND '%(sdate)s'::date &lt;= coalesce(beendigung_5, 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_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(date_part('year', age(datum_feststellung, geburtsdatum)) &lt; 15 
+		OR (date_part('year', age(datum_feststellung, geburtsdatum)) &gt;= 25 
+			AND date_part('year', 
+					age(datum_feststellung, geburtsdatum)) &lt;= 54) 
+		OR date_part('year', age(datum_feststellung, geburtsdatum)) &gt; 64)
+	  </where> 
+    </ydim>
+  </evaluation>
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
+  <evaluation>
+    <id>9</id>
+    <name>Alterklasse (55-64 Jahre)</name>
+    <desc>Zeigt die Anzahl der Personen im Alter von 55-64 Jahren. Das Alter bezieht sich auf das Eintrittsdatum ins Case Management.</desc>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_feststellung AND '%(sdate)s'::date &lt;= coalesce(beendigung_5, 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_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(date_part('year', age(datum_feststellung, geburtsdatum)) &gt;= 55 
+		AND date_part('year', age(datum_feststellung, geburtsdatum)) &lt;= 64)
+	  </where> 
+    </ydim>
+  </evaluation>
+-->
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <evaluation>
+    <id>10</id>
+    <name>Erwerbstätig</name>
+    <desc>Zeigt die Anzahl der Menschen mit Erwerbstätigkeit.</desc>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_feststellung AND '%(sdate)s'::date &lt;= coalesce(beendigung_5, 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_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(erwerbstaetigkeit_job = 1)</where> 
+    </ydim>
+  </evaluation>
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <evaluation>
+    <id>11</id>
+    <name>Selbstständig</name>
+    <desc>Zeigt die Anzahl der Menschen mit selbstständiger Tätigkeit.</desc>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_feststellung AND '%(sdate)s'::date &lt;= coalesce(beendigung_5, 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_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(bei_eintritt_ist_der_jugendliche = 6)</where> 
+    </ydim>
+  </evaluation>
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <evaluation>
+    <id>12</id>
+    <name>Arbeitslos</name>
+    <desc>Zeigt die Anzahl der Menschen mit Arbeitslosigkeit.</desc>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_feststellung AND '%(sdate)s'::date &lt;= coalesce(beendigung_5, 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_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(arbeitslosigkeit_1 = 1 
+				and ((bezug_alg2 = 1 and bezug_alg1 != 1)
+				      or (bezug_alg1 = 1 and bezug_alg2 != 1)))</where> 
+    </ydim>
+  </evaluation>
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <evaluation>
+    <id>13</id>
+    <name>Langzeitarbeitslos</name>
+    <desc>Zeigt die Anzahl der Menschen in Langzeitarbeitslosigkeit.</desc>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_feststellung AND '%(sdate)s'::date &lt;= coalesce(beendigung_5, 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_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(arbeitslosigkeit_1 = 1 
+				and ((bezug_alg2 = 1 and bezug_alg1 != 1)
+						 or bezug_alg1 = 1 and bezug_alg2 != 1) 
+				and dauer_nach_letzter_beschaeftigung &gt; 12)</where> 
+    </ydim>
+  </evaluation>
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <evaluation>
+    <id>14</id>
+    <name>SGB II Bezug</name>
+    <desc>Zeigt die Anzahl der Menschen mit SGB II Bezug.</desc>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_feststellung AND '%(sdate)s'::date &lt;= coalesce(beendigung_5, 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_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(arbeitslosigkeit_1 = 1 
+				and bezug_alg2 = 1 and bezug_alg1 != 1)</where> 
+    </ydim>
+  </evaluation>
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <evaluation>
+    <id>15</id>
+    <name>SGB III Bezug</name>
+    <desc>Zeigt die Anzahl der Menschen mit SGB III Bezug.</desc>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_feststellung AND '%(sdate)s'::date &lt;= coalesce(beendigung_5, 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_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(arbeitslosigkeit_1 = 1 
+				and bezug_alg1 = 1 and bezug_alg2 != 1 )</where> 
+    </ydim>
+  </evaluation>
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <evaluation>
+    <id>16</id>
+    <name>Nicht-Erwerbspersonen</name>
+    <desc>Zeigt die Anzahl der Menschen die nicht erwerbstätig sind..</desc>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_feststellung AND '%(sdate)s'::date &lt;= coalesce(beendigung_5, 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_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(erwerbstaetigkeit_job = 0 and arbeitslosigkeit_1 = 0)</where> 
+    </ydim>
+  </evaluation>
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <evaluation>
+    <id>17</id>
+    <name>Nicht-Erwerbspersonen in Ausbildung</name>
+    <desc>Zeigt die Anzahl der Menschen in Ausbildung, die als nicht-erwerbstätig gelten.</desc>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_feststellung AND '%(sdate)s'::date &lt;= coalesce(beendigung_5, 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_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(erwerbstaetigkeit_job = 0 and arbeitslosigkeit_1 = 0 and bei_eintritt_ist_der_jugendliche = 1)</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_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_feststellung AND '%(sdate)s'::date &lt;= coalesce(beendigung_5, 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_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(muttersprache not in (18,-1,-3) 
+				OR staatsangehoerigkeit not in (29, -1,-3) 
+				OR vater not in (1, -1) 
+				OR mutter not in (1, -1))
+	  </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_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_feststellung AND '%(sdate)s'::date &lt;= coalesce(beendigung_5, 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_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(anerkannte_behinderung = 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_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_feststellung AND '%(sdate)s'::date &lt;= coalesce(beendigung_5, 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_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(physische_beeintraechtigungen = 1 or psychische_beeintraechtigungen = 1)</where>
+    </ydim>
+  </evaluation>
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <evaluation>
+    <id>22</id>
+    <name>Ohne Schulabschluss</name>
+    <desc>Zeigt die Anzahl der Menschen ohne Schulabschluss.</desc>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_feststellung AND '%(sdate)s'::date &lt;= coalesce(beendigung_5, 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_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(schulabschluss_1 = 1)</where> 
+    </ydim>
+  </evaluation>
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <evaluation>
+    <id>23</id>
+    <name>ISCED 1, ISCED 2</name>
+    <desc>Zeigt die Anzahl der Menschen in den Kategorien ISCED 1 und ISCED 2 (Nur Hauptschule/Realschule/BGJ/BVJ)</desc>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_feststellung AND '%(sdate)s'::date &lt;= coalesce(beendigung_5, 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_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(schulabschluss_1 in (3,4,5,9,10))</where> 
+    </ydim>
+  </evaluation>
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <evaluation>
+    <id>24</id>
+    <name>ISCED 3</name>
+    <desc>Zeigt die Anzahl der Menschen in der Kategorie ISCED 3 (Hochschulzugangsberechtigt 1. Bildungsweg)</desc>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_feststellung AND '%(sdate)s'::date &lt;= coalesce(beendigung_5, 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_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(schulabschluss_1 = 6)</where> 
+    </ydim>
+  </evaluation>
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <evaluation>
+    <id>25</id>
+    <name>ISCED 4</name>
+    <desc>Zeigt die Anzahl der Menschen in der Kategorie ISCED 4 (Hochschulzugangsberechtigt 2. Bildungsweg)</desc>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_feststellung AND '%(sdate)s'::date &lt;= coalesce(beendigung_5, 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_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(schulabschluss_1 = 8)</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_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(edate)s'::date &gt;= datum_feststellung AND '%(sdate)s'::date &lt;= coalesce(beendigung_5, 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_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+    </ydim>
+  </evaluation>
+</evaluationset>

Added: waska/trunk/waskaweb/public/xml/eval_aktiv.xml
===================================================================
--- waska/trunk/waskaweb/public/xml/eval_aktiv.xml	2009-11-27 13:10:03 UTC (rev 711)
+++ waska/trunk/waskaweb/public/xml/eval_aktiv.xml	2009-11-27 13:11:23 UTC (rev 712)
@@ -0,0 +1,197 @@
+<evaluationset>
+  <id>3</id>
+  <version>0.9</version>
+  <name>Aktive Fälle</name>
+  <desc>Betrachtet, 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. Berücksichtigt werden nur Fälle, die am Stichtag aktiv bearbeitet wurden.</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 (Eingangsanamnese) 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_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>
+	  		('%(sdate)s'::date &lt;= coalesce(datum_feststellung, now()) 
+			AND '%(edate)s'::date &gt;= erstgespraech)
+      </where>
+    </basequery>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <xdim>
+      <label>Migration nach Geschlecht</label>
+      <table>geschlecht_tbl</table>
+      <field>(CASE WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 0) THEN 0 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 1) THEN 1 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -3) THEN -3 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Gesamtzahl Teilnehmer</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(phase = 0 OR (erstgespraech &lt;= '%(edate)s'::date AND coalesce(datum_feststellung, now()) &gt; '%(edate)s'::date))</where>
+    </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,3,4,5</phase>
+    </requirement>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>
+	  		('%(sdate)s'::date &lt;= coalesce(beendigung_5, now()) 
+			AND '%(edate)s'::date &gt;= datum_feststellung)
+      </where>
+    </basequery>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <xdim>
+      <label>Migration nach Geschlecht</label>
+      <table>geschlecht_tbl</table>
+      <field>(CASE WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 0) THEN 0 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 1) THEN 1 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -3) THEN -3 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Gesamtzahl Teilnehmer</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(phase = 2 OR 
+                (datum_feststellung &lt;= '%(edate)s'::date 
+                    AND coalesce(beendigung_5, now()) &gt; '%(edate)s'::date))
+      </where>
+    </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,5</phase>
+    </requirement>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>
+	  		('%(sdate)s'::date &lt;= coalesce(beendigung_nachbetreuung, now()) 
+			AND '%(edate)s'::date &gt;= beendigung_5)
+      </where>
+	  <where>(TRUE)</where>
+    </basequery>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <xdim>
+      <label>Migration nach Geschlecht</label>
+      <table>geschlecht_tbl</table>
+      <field>(CASE WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 0) THEN 0 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 1) THEN 1 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -3) THEN -3 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Gesamtzahl Teilnehmer</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(phase = 5 OR 
+                (beendigung_5 &lt;= '%(edate)s'::date 
+                    AND coalesce(beendigung_nachbetreuung, now()) 
+                                                &gt; '%(edate)s'::date))
+      </where>
+    </ydim>
+  </evaluation>
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <evaluation>
+    <id>4</id>
+    <name>Jugendliche in der Beratung</name>
+    <desc>Zeigt die Gesamtanzahl der Fälle in der Beratung zum Zeitpunkt X. Fälle, die am Stichtag die Beratung beendeten, werden nicht gezählt.</desc>
+    <requirement>
+      <phase>6,7</phase>
+    </requirement>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>
+	  		('%(sdate)s'::date &lt;= coalesce(datum_ende_beratung, now()) 
+			AND '%(edate)s'::date &gt;= datum_feststellung)
+      </where>
+    </basequery>
+    <xdim>
+      <label>Geschlecht</label>
+      <field>geschlecht</field>
+      <table>geschlecht_tbl</table>
+      <join>geschlecht</join>
+    </xdim>
+    <xdim>
+      <label>Migration nach Geschlecht</label>
+      <table>geschlecht_tbl</table>
+      <field>(CASE WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 0) THEN 0 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 1) THEN 1 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -3) THEN -3 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Gesamtzahl Teilnehmer</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(phase = 6 OR 
+                (datum_feststellung &lt;= '%(edate)s'::date 
+                    AND coalesce(datum_ende_beratung, now()) 
+                                                &gt; '%(edate)s'::date))
+      </where>
+    </ydim>
+  </evaluation>
+</evaluationset>

Added: waska/trunk/waskaweb/public/xml/eval_analyse.xml
===================================================================
--- waska/trunk/waskaweb/public/xml/eval_analyse.xml	2009-11-27 13:10:03 UTC (rev 711)
+++ waska/trunk/waskaweb/public/xml/eval_analyse.xml	2009-11-27 13:11:23 UTC (rev 712)
@@ -0,0 +1,72 @@
+<evaluationset>
+  <id>4</id>
+  <version>1.0</version>
+  <name>Fallaktenanalyse</name>
+  <desc>Analyse der Fallakten nach Phasen und Validität</desc>
+  <evaluation>
+    <id>1</id>
+    <name>Gesamtzahl</name>
+    <desc>Zeigt die Gesamtanzahl der Fälle in der Datenbank an.</desc>
+    <basequery>
+      <table>master_tbl_eval_total_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_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+    </ydim>
+  </evaluation>
+  <evaluation>
+    <id>2</id>
+    <name>Phase</name>
+    <desc>Zeigt Verteilung von Phasen über die Geschlechter auf.</desc>
+    <basequery>
+      <table>master_tbl_eval_total_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>Phase</label>
+      <field>phase</field>
+      <table>phase_tbl</table>
+      <join>phase</join>
+    </ydim>
+  </evaluation>
+  <evaluation>
+    <id>3</id>
+    <name>Validität in Phasen</name>
+    <desc>Zeigt Verteilung Validitäten in den verschiedenen Phasen auf.</desc>
+    <basequery>
+      <table>(select DISTINCT p.id, p.phase, p.geschlecht, l.tag_id from nm_tags_cases_view l join master_tbl_eval_total_view p on l.case_id = p.id) zzz</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>(TRUE)</where>
+    </basequery>
+    <xdim>
+      <label>Phase</label>
+      <field>phase</field>
+      <table>( select * from phase_tbl where id in (-1,0,1,2,3,4,5,6,7) )</table>
+      <join>phase</join>
+    </xdim>
+    <ydim>
+      <label>Validität</label>
+      <field>tag_id</field>
+      <table>(select id, label as value from tags_view where id in (1,2,3,4,0))</table>
+      <join>tag_id</join>
+    </ydim>
+  </evaluation>
+</evaluationset>

Added: waska/trunk/waskaweb/public/xml/eval_tagebuch.xml
===================================================================
--- waska/trunk/waskaweb/public/xml/eval_tagebuch.xml	2009-11-27 13:10:03 UTC (rev 711)
+++ waska/trunk/waskaweb/public/xml/eval_tagebuch.xml	2009-11-27 13:11:23 UTC (rev 712)
@@ -0,0 +1,49 @@
+<evaluationset>
+  <id>5</id>
+  <version>0.9</version>
+  <name>Tagebuch Auswertungen</name>
+  <desc>Keine weitere Beschreibung</desc>
+  <requirement>
+    <phase>2,3,4,5</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, p.muttersprache, p.staatsangehoerigkeit, p.vater, p.mutter, l.art, l.dauer from ka_logbuch_tbl_view l join master_tbl_eval_total_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, 9, 10))</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 (5, 6, 7, 8))</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 (-2, -1))</table>
+      <join>art</join>
+    </ydim>
+  </evaluation>
+</evaluationset>

Added: waska/trunk/waskaweb/public/xml/eval_verlauf.xml
===================================================================
--- waska/trunk/waskaweb/public/xml/eval_verlauf.xml	2009-11-27 13:10:03 UTC (rev 711)
+++ waska/trunk/waskaweb/public/xml/eval_verlauf.xml	2009-11-27 13:11:23 UTC (rev 712)
@@ -0,0 +1,226 @@
+<evaluationset mode="trend">
+  <id>2</id>
+  <version>0.9</version>
+  <name>Auswertung über den zeitlichen Verlauf</name>
+  <desc>Zeigt eine zusammenfassende Beschreibung der CM Fälle und der Ein- und Austritte über einen monatlichen Verlauf innerhalb des Auswertungszeitraums</desc>
+  <requirement>
+    <phase>2,3,4,5,6,7</phase>
+    <validity>1</validity>
+    <validity>3</validity>
+  </requirement>
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <evaluation>
+    <id>1</id>
+    <name>Gesamtzahl der Teilnehmer</name>
+    <desc>Zeigt die monatliche Entwicklung der Gesamtanzahl der Fälle innerhalb des Auswertungszeitraums.</desc>
+    <requirement>
+      <phase>2,3,4,5,6,7</phase>
+    </requirement>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>
+		SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s
+	  </template>
+      <where>
+		('%(edate)s'::date &gt;= datum_feststellung 
+				AND ((phase in (2,3,4,5) 
+					  AND '%(sdate)s'::date &lt;= coalesce(beendigung_5, 
+															now()))
+					OR (phase in (6,7) 
+					  AND '%(sdate)s'::date &lt;= coalesce(datum_ende_beratung,
+															 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 ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 0) THEN 0 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 1) THEN 1 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -3) THEN -3 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) 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_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+    </ydim>
+    <ydim>
+      <label>davon Beratungsfälle</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(phase in (6,7))</where>
+    </ydim>
+    <ydim>
+      <label>davon Case Management Fälle</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(phase in (2,3,4,5))</where>
+    </ydim>
+  </evaluation>
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <evaluation>
+    <id>2</id>
+    <name>Gesamtzahl der Neueintritte</name>
+    <desc>Zeigt die monatliche Entwicklung der Gesamtanzahl der Neueintritte innerhalb des Auswertungszeitraums. Der relative Anteil von Wiederaufnahmen und Neueintritten ergibt sich aus den Angaben in der Eingangsdokumentation. Hierbei muss a) die Angabe "Jugendlicher war bereits im CM" und b) eine genehmigte Wiedervorlage bzw. Neuaufnahme dokumentiert sein.</desc>
+    <requirement>
+      <phase>2,3,4,5,6,7</phase>
+    </requirement>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>
+		('%(sdate)s'::date &lt;= datum_feststellung 
+			AND '%(edate)s'::date &gt;= datum_feststellung)</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 ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 0) THEN 0 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 1) THEN 1 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -3) THEN -3 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <table>geschlecht_tbl</table>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Gesamtzahl Neueintritte</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+    </ydim>
+    <ydim>
+      <label>Davon noch allgemeinschulpflichtig</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(schulpflichtig=1)</where>
+    </ydim>
+    <ydim>
+      <label>Davon allgemeinschulpflichtig mit Übergangsprognose</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(schulpflichtig=1 AND FALSE)</where>
+    </ydim>
+  </evaluation>
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <evaluation>
+    <id>3</id>
+    <name>Gesamtzahl der Austritte</name>
+    <desc>Zeigt die montaliche Entwicklung der Gesamtanzahl der Austritte innerhalb des Auswertungszeitraums.</desc>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>
+		(
+		('%(edate)s'::date &gt;= datum_feststellung) AND 
+		(phase in (3,4,5) 
+			  AND '%(sdate)s'::date &lt;= coalesce(beendigung_5, now())
+			  AND '%(edate)s'::date &gt;= coalesce(beendigung_5, now()))
+			OR (phase in (7) 
+			  AND '%(sdate)s'::date &lt;= coalesce(datum_ende_beratung, now())
+			  AND '%(edate)s'::date &gt;= coalesce(datum_ende_beratung, now()))
+		)
+	  </where>
+    </basequery>
+    <requirement>
+      <phase>3,4,5,7</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 ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 0) THEN 0 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 1) THEN 1 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -3) THEN -3 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <table>geschlecht_tbl</table>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Gesamtzahl Austritte</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+    </ydim>
+    <ydim>
+      <label>davon Beratungsfälle</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(phase = 7)</where>
+    </ydim>
+    <ydim>
+      <label>davon Case Management Fälle</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(phase in (3,4,5))</where>
+    </ydim>
+    <ydim>
+      <label>davon CM mit erfolgreiche Beendigung</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(phase in (3,4,5) AND art_beendigung = 0)</where>
+    </ydim>
+    <ydim>
+      <label>davon CM mit sonst. Beendigung</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(phase in (3,4,5) AND art_beendigung = 2)</where>
+    </ydim>
+    <ydim>
+      <label>davon CM mit unbekannter Beendigung</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>
+        (phase in (3,4,5) AND (art_beendigung = -1 OR art_beendigung = -3))
+      </where>
+    </ydim>
+    <ydim>
+      <label>davon CM-Abbrüche</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(phase in (3,4,5) AND art_beendigung = 1)</where>
+    </ydim>
+  </evaluation>
+</evaluationset>

Added: waska/trunk/waskaweb/public/xml/eval_weitere.xml
===================================================================
--- waska/trunk/waskaweb/public/xml/eval_weitere.xml	2009-11-27 13:10:03 UTC (rev 711)
+++ waska/trunk/waskaweb/public/xml/eval_weitere.xml	2009-11-27 13:11:23 UTC (rev 712)
@@ -0,0 +1,652 @@
+<evaluationset>
+  <id>3</id>
+  <version>0.9.3</version>
+  <name>Weitere Kriterien</name>
+  <desc>Weitere Auswertungen der CM Fälle</desc>
+  <requirement>
+    <phase>2,3,4,5</phase>
+    <validity>1</validity>
+    <validity>3</validity>
+  </requirement>
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <evaluation>
+    <id>1</id>
+    <name>Alter</name>
+    <desc>Zeigt die Gesamtanzahl der Fälle aufgeteilt nach den verschiedenen Alterstufen (Alter zum Eintritt in das Case Management).</desc>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(sdate)s'::date &lt;= coalesce(beendigung_5, now()) 
+		AND '%(edate)s'::date &gt;= datum_feststellung)</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 ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 0) THEN 0 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 1) THEN 1 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -3) THEN -3 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <table>geschlecht_tbl</table>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>jünger als 14 Jahre</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(date_part('year', age(datum_feststellung, geburtsdatum)) &lt; 14)</where>
+    </ydim>
+    <ydim>
+      <label>14 Jahre</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(date_part('year', age(datum_feststellung, geburtsdatum)) = 14)</where>
+    </ydim>
+    <ydim>
+      <label>15 - 17 Jahre</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>
+		(date_part('year', age(datum_feststellung, geburtsdatum)) &gt;= 15
+		 AND date_part('year', age(datum_feststellung, geburtsdatum)) &lt;= 17)
+		</where>
+    </ydim>
+    <ydim>
+      <label>18 - 20 Jahre</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>
+		(date_part('year', age(datum_feststellung, geburtsdatum)) &gt;= 18
+		 AND date_part('year', age(datum_feststellung, geburtsdatum)) &lt;= 20)
+		</where>
+    </ydim>
+    <ydim>
+      <label>21 - 24 Jahre</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>
+		(date_part('year', age(datum_feststellung, geburtsdatum)) &gt;= 21
+		 AND date_part('year', age(datum_feststellung, geburtsdatum)) &lt;= 24)
+		</where>
+    </ydim>
+    <ydim>
+      <label>25 - 26 Jahre</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>
+		(date_part('year', age(datum_feststellung, geburtsdatum)) &gt;= 25
+		 AND date_part('year', age(datum_feststellung, geburtsdatum)) &lt;= 26)
+		</where>
+    </ydim>
+    <ydim>
+      <label>älter als 26 Jahre</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(date_part('year', age(datum_feststellung, geburtsdatum)) &gt; 26)</where>
+    </ydim>
+    <ydim>
+      <label>unbekannt</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(geburtsdatum IS NULL)</where>
+    </ydim>
+    <ydim>
+      <label>total</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>
+        (
+        (date_part('year', age(datum_feststellung, geburtsdatum)) &lt; 14)
+        OR (date_part('year', age(datum_feststellung, geburtsdatum)) = 14)
+        OR (date_part('year', age(datum_feststellung, geburtsdatum)) &gt;= 15
+		 AND date_part('year', age(datum_feststellung, geburtsdatum)) &lt;= 17)
+        OR (date_part('year', age(datum_feststellung, geburtsdatum)) &gt;= 18
+		 AND date_part('year', age(datum_feststellung, geburtsdatum)) &lt;= 20)
+        OR (date_part('year', age(datum_feststellung, geburtsdatum)) &gt;= 21
+		 AND date_part('year', age(datum_feststellung, geburtsdatum)) &lt;= 24)
+        OR (date_part('year', age(datum_feststellung, geburtsdatum)) &gt;= 25
+		 AND date_part('year', age(datum_feststellung, geburtsdatum)) &lt;= 26)
+        OR (date_part('year', age(datum_feststellung, geburtsdatum)) &gt; 26)
+        OR (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_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(sdate)s'::date &lt;= coalesce(beendigung_5, now()) 
+		AND '%(edate)s'::date &gt;= datum_feststellung)</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 ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 0) THEN 0 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 1) THEN 1 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -3) THEN -3 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) 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_kompetenzagentur</field>
+      <table>zugang_kompetenzagentur_tbl</table>
+      <join>zugang_kompetenzagentur</join>
+    </ydim>
+  </evaluation>
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <evaluation>
+    <id>3</id>
+    <name>Status des jungen Menschen bei Eintritt</name>
+    <desc>Zeigt die Gesamtanzahl der Fälle aufgeteilt nach den verschiedenen Status bei Eintritt.</desc>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(sdate)s'::date &lt;= coalesce(beendigung_5, now()) 
+		AND '%(edate)s'::date &gt;= datum_feststellung)</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 ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 0) THEN 0 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 1) THEN 1 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -3) THEN -3 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <table>geschlecht_tbl</table>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Status</label>
+      <field>bei_eintritt_ist_der_jugendliche</field>
+      <table>bei_eintritt_ist_der_jugendliche_tbl</table>
+      <join>bei_eintritt_ist_der_jugendliche</join>
+    </ydim>
+  </evaluation>
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+<!--Bisher noch nicht möglich, Datenfeld muss erst noch mit der Erweiterung von
+WASKA implementiert werden.
+  <evaluation>
+    <id>7</id>
+    <name>Status des jungen Menschen bei Austritt</name>
+    <desc>Zeigt die Gesamtanzahl der Fälle aufgeteilt nach den verschiedenen Status bei Austritt.</desc>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(sdate)s'::date &lt;= coalesce(beendigung_5, now()) 
+		AND '%(edate)s'::date &gt;= datum_feststellung)</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 ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 0) THEN 0 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 1) THEN 1 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -3) THEN -3 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <table>geschlecht_tbl</table>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Status</label>
+      <field>bei_eintritt_ist_der_jugendliche</field>
+      <table>bei_eintritt_ist_der_jugendliche_tbl</table>
+      <join>bei_eintritt_ist_der_jugendliche</join>
+    </ydim>
+  </evaluation>
+-->
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <evaluation>
+    <id>6</id>
+    <name>Angaben zur Vermittlung nach dem CM</name>
+    <!-- Status des Jungen Menschen bei Austritt existiert in der Form noch
+         nicht (s.o.). Daher Angabe von:
+         - Nach der Beendigung des CM wurde der Jugendliche vermittelt
+		 - erzielter Übergang
+      -->
+    <desc>Zeigt die Gesamtanzahl der Fälle aufgeteilt nach den verschiedenen Vermittlungen</desc>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(sdate)s'::date &lt;= coalesce(beendigung_5, now()) 
+		AND '%(edate)s'::date &gt;= datum_feststellung)</where>
+    </basequery>
+    <requirements>
+      <phase>2,3,4,5</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 ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 0) THEN 0 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 1) THEN 1 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -3) THEN -3 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <table>geschlecht_tbl</table>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Vermittlung</label>
+      <field>vermittlung</field>
+      <table>vermittlung_tbl</table>
+      <join>vermittlung</join>
+    </ydim>
+  </evaluation>
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <evaluation>
+    <id>7</id>
+    <name>Angaben zu erzielten Übergängen</name>
+    <!-- Status des Jungen Menschen bei Austritt existiert in der Form noch
+         nicht (s.o.). Daher Angabe von:
+         - Nach der Beendigung des CM wurde der Jugendliche vermittelt
+		 - erzielter Übergang
+      -->
+    <desc>Zeigt die Gesamtanzahl der Fälle aufgeteilt nach den verschiedenen Übergängen</desc>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(sdate)s'::date &lt;= coalesce(beendigung_5, now()) 
+		AND '%(edate)s'::date &gt;= datum_feststellung)</where>
+    </basequery>
+    <requirements>
+      <phase>3,4,5</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 ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 0) THEN 0 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 1) THEN 1 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -3) THEN -3 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <table>geschlecht_tbl</table>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Schulart</label>
+      <field>schulart</field>
+      <table>schulart_tbl</table>
+      <join>schulart</join>
+    </ydim>
+    <ydim>
+      <label>Ausbildung</label>
+      <field>ausbildung</field>
+      <table>ausbildung_tbl</table>
+      <join>ausbildung</join>
+    </ydim>
+    <ydim>
+      <label>Umschulung</label>
+      <field>umschulung</field>
+      <table>einverstaendniserklaerung_tbl</table>
+      <join>umschulung</join>
+    </ydim>
+    <ydim>
+      <label>Erwerbstatus</label>
+      <field>erwerbstatus</field>
+      <table>erwerbstatus_tbl</table>
+      <join>erwerbstatus</join>
+    </ydim>
+    <ydim>
+      <label>Beschäftigungsumfang</label>
+      <field>beschaeftigungsumfang</field>
+      <table>beschaeftigungsumfang_tbl</table>
+      <join>beschaeftigungsumfang</join>
+    </ydim>
+    <ydim>
+      <label>Kategorien Nichterwerbsarbeit und Nichtausbildung</label>
+      <field>kategorien_nichterwerbsarbeit_nichtausbildung</field>
+      <table>kategorien_nichterwerbsarbeit_nichtausbildung_tbl</table>
+      <join>kategorien_nichterwerbsarbeit_nichtausbildung</join>
+    </ydim>
+  </evaluation>
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <evaluation>
+    <id>8</id>
+    <name>Rechtskreis bei Eintritt</name>
+    <desc>Zeigt die Gesamtanzahl der Fälle aufgeteilt nach den verschiedenen Rechtskreisen bei Eintritt.</desc>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(sdate)s'::date &lt;= coalesce(beendigung_5, now()) 
+		AND '%(edate)s'::date &gt;= datum_feststellung)</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 ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 0) THEN 0 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 1) THEN 1 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -3) THEN -3 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <table>geschlecht_tbl</table>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Rechtskreis</label>
+      <field>rechtlicher_kontext</field>
+      <table>rechtlicher_kontext_tbl</table>
+      <join>rechtlicher_kontext</join>
+    </ydim>
+  </evaluation>
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <evaluation>
+    <id>9</id>
+    <name>Schnittstelle bei Eintritt</name>
+    <desc>Zeigt die Gesamtanzahl der Fälle aufgeteilt nach den verschiedenen Schnittstellen bei Eintritt.</desc>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(sdate)s'::date &lt;= coalesce(beendigung_5, now()) 
+		AND '%(edate)s'::date &gt;= datum_feststellung)</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 ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 0) THEN 0 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 1) THEN 1 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -3) THEN -3 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <table>geschlecht_tbl</table>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Schnittstelle</label>
+      <field>schnittstelle_zu</field>
+      <table>rechtlicher_kontext_tbl</table>
+      <join>schnittstelle_zu</join>
+    </ydim>
+  </evaluation>
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <evaluation>
+    <id>10</id>
+    <name>Rechtskreis bei Austritt</name>
+    <desc>Zeigt die Gesamtanzahl der Fälle aufgeteilt nach den verschiedenen Rechtskreisen bei Austritt.</desc>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>('%(sdate)s'::date &lt;= coalesce(beendigung_5, now()) 
+		AND '%(edate)s'::date &gt;= datum_feststellung)</where>
+    </basequery>
+    <requirement>
+      <phase>3,4,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 ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 0) THEN 0 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 1) THEN 1 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -3) THEN -3 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <table>geschlecht_tbl</table>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Rechtskreis</label>
+      <field>veraenderungen_rechtskreis</field>
+      <table>veraenderungen_rechtskreis_tbl</table>
+      <join>veraenderungen_rechtskreis</join>
+    </ydim>
+  </evaluation>
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <evaluation>
+    <id>11</id>
+    <name>Höchster erreichter Schulabschluss</name>
+    <desc>Zeigt den höchsten erreichten Schulabschluss der Jugendlichen an.</desc>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>(TRUE)</where>
+    </basequery>
+    <requirement>
+      <phase>2,3,4,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 ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 0) THEN 0 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 1) THEN 1 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -3) THEN -3 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <table>geschlecht_tbl</table>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Schulabschluss</label>
+      <field>schulabschluss_1</field>
+      <table>schulabschluss_1_tbl</table>
+      <join>schulabschluss_1</join>
+    </ydim>
+  </evaluation>
+  <evaluation>
+    <id>12</id>
+    <name>Durchschnittliche Verweildauer in Phase A (Eingangsanamnese)</name>
+    <desc>Zeigt die durchschnittliche Verweildauer (Tage zu 24 Stunden) der Fälle in der Phase A. Die Phase muss abgeschlossen sein.</desc>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>SELECT id, erstgespraech, datum_feststellung, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <aggregate>trunc(sum(extract(epoch from age(m.datum_feststellung, m.erstgespraech))/86400)/count(m.id))</aggregate>
+      <where>(TRUE)</where>
+    </basequery>
+    <requirement>
+      <phase>1,2,3,4,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 ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 0) THEN 0 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 1) THEN 1 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -3) THEN -3 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <table>geschlecht_tbl</table>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Dauer (Tagen)</label>
+      <field>(select DISTINCT 1 from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT 1 as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+    </ydim>
+  </evaluation>
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <evaluation>
+    <id>13</id>
+    <name>Durchschnittliche Verweildauer in Phase B (Case Management)</name>
+    <desc>Zeigt die durchschnittliche Verweildauer (Tage zu 24 Stunden) der Fälle in der Phase B. Die Phase muss abgeschlossen sein.</desc>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>SELECT id, beendigung_5, datum_feststellung, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <aggregate>trunc(sum(extract(epoch from age(m.beendigung_5, m.datum_feststellung))/86400)/count(m.id))</aggregate>
+      <where>(TRUE)</where>
+    </basequery>
+    <requirement>
+      <phase>3,4,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 ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 0) THEN 0 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 1) THEN 1 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -3) THEN -3 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <table>geschlecht_tbl</table>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Dauer (Tagen)</label>
+      <field>(select DISTINCT 1 from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT 1 as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+    </ydim>
+  </evaluation>
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <evaluation>
+    <id>14</id>
+    <name>Durchschnittliche Verweildauer in Phase C (Nachbetreuung)</name>
+    <desc>Zeigt die durchschnittliche Verweildauer (Tage zu 24 Stunden) der Fälle in der Phase C. Die Phase muss abgeschlossen sein.</desc>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>SELECT id, beendigung_5, beendigung_nachbetreuung, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <aggregate>trunc(sum(extract(epoch from age(m.beendigung_nachbetreuung, m.beendigung_5))/86400)/count(m.id))</aggregate>
+      <where>(TRUE)</where>
+    </basequery>
+    <requirement>
+      <phase>4,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 ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 0) THEN 0 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 1) THEN 1 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -3) THEN -3 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <table>geschlecht_tbl</table>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Dauer (Tagen)</label>
+      <field>(select DISTINCT 1 from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT 1 as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+    </ydim>
+  </evaluation>
+</evaluationset>

Added: waska/trunk/waskaweb/public/xml/eval_zusammenfassung.xml
===================================================================
--- waska/trunk/waskaweb/public/xml/eval_zusammenfassung.xml	2009-11-27 13:10:03 UTC (rev 711)
+++ waska/trunk/waskaweb/public/xml/eval_zusammenfassung.xml	2009-11-27 13:11:23 UTC (rev 712)
@@ -0,0 +1,226 @@
+<evaluationset>
+  <id>2</id>
+  <version>0.9</version>
+  <name>Auswertungen der Koordinierungsstelle (Einrichtung Auswertung)</name>
+  <desc>Zusammenfassende Beschreibung der CM Fälle und der Ein- und Austritte</desc>
+  <requirement>
+    <phase>2,3,4,5,6,7</phase>
+    <validity>1</validity>
+    <validity>3</validity>
+  </requirement>
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <evaluation>
+    <id>1</id>
+    <name>Gesamtzahl der Teilnehmer</name>
+    <desc>Zeigt die Gesamtanzahl der Fälle innerhalb des Auswertungszeitraums.</desc>
+    <requirement>
+      <phase>2,3,4,5,6,7</phase>
+    </requirement>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>
+		SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s
+	  </template>
+      <where>
+		('%(edate)s'::date &gt;= datum_feststellung 
+				AND ((phase in (2,3,4,5) 
+					  AND '%(sdate)s'::date &lt;= coalesce(beendigung_5, 
+															now()))
+					OR (phase in (6,7) 
+					  AND '%(sdate)s'::date &lt;= coalesce(datum_ende_beratung,
+															 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 ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 0) THEN 0 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 1) THEN 1 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -3) THEN -3 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) 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_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+    </ydim>
+    <ydim>
+      <label>davon Beratungsfälle</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(phase in (6,7))</where>
+    </ydim>
+    <ydim>
+      <label>davon Case Management Fälle</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(phase in (2,3,4,5))</where>
+    </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 war bereits im CM" und b) eine genehmigte Wiedervorlage bzw. Neuaufnahme dokumentiert sein.</desc>
+    <requirement>
+      <phase>2,3,4,5,6,7</phase>
+    </requirement>
+    <basequery>
+      <table>master_tbl_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>
+		('%(sdate)s'::date &lt;= datum_feststellung 
+			AND '%(edate)s'::date &gt;= datum_feststellung)</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 ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 0) THEN 0 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 1) THEN 1 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -3) THEN -3 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <table>geschlecht_tbl</table>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Gesamtzahl Neueintritte</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+    </ydim>
+    <ydim>
+      <label>Davon noch allgemeinschulpflichtig</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(schulpflichtig=1)</where>
+    </ydim>
+    <ydim>
+      <label>Davon allgemeinschulpflichtig mit Übergangsprognose</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(schulpflichtig=1 AND FALSE)</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_eval_total_view</table>
+      <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
+      <where>
+		(
+		('%(edate)s'::date &gt;= datum_feststellung) AND 
+		(phase in (3,4,5) 
+			  AND '%(sdate)s'::date &lt;= coalesce(beendigung_5, now())
+			  AND '%(edate)s'::date &gt;= coalesce(beendigung_5, now()))
+			OR (phase in (7) 
+			  AND '%(sdate)s'::date &lt;= coalesce(datum_ende_beratung, now())
+			  AND '%(edate)s'::date &gt;= coalesce(datum_ende_beratung, now()))
+		)
+	  </where>
+    </basequery>
+    <requirement>
+      <phase>3,4,5,7</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 ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 0) THEN 0 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = 1) THEN 1 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -3) THEN -3 WHEN ((muttersprache not in (18,-1, -3) or
+      staatsangehoerigkeit not in (29, -1, -3) or vater not in (1, -1) or
+      mutter not in (1, -1)) and geschlecht = -1) THEN -1 ELSE 10 END) as migration</field>
+      <table>geschlecht_tbl</table>
+      <join>migration</join>
+    </xdim>
+    <ydim>
+      <label>Gesamtzahl Austritte</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+    </ydim>
+    <ydim>
+      <label>davon Beratungsfälle</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(phase = 7)</where>
+    </ydim>
+    <ydim>
+      <label>davon Case Management Fälle</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(phase in (3,4,5))</where>
+    </ydim>
+    <ydim>
+      <label>davon CM mit erfolgreiche Beendigung</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(phase in (3,4,5) AND art_beendigung = 0)</where>
+    </ydim>
+    <ydim>
+      <label>davon CM mit sonst. Beendigung</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(phase in (3,4,5) AND art_beendigung = 2)</where>
+    </ydim>
+    <ydim>
+      <label>davon CM mit unbekannter Beendigung</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>
+        (phase in (3,4,5) AND (art_beendigung = -1 OR art_beendigung = -3))
+      </where>
+    </ydim>
+    <ydim>
+      <label>davon CM-Abbrüche</label>
+      <field>(select count(id) from master_tbl_eval_total_view) as anzahl</field>
+      <table>(select DISTINCT count(id) as id, 'Gesamt' as value from master_tbl_eval_total_view)</table>
+      <join>anzahl</join>
+      <where>(phase in (3,4,5) AND art_beendigung = 1)</where>
+    </ydim>
+  </evaluation>
+</evaluationset>

Added: waska/trunk/waskaweb/public/xml/tagging.xml
===================================================================
--- waska/trunk/waskaweb/public/xml/tagging.xml	2009-11-27 13:10:03 UTC (rev 711)
+++ waska/trunk/waskaweb/public/xml/tagging.xml	2009-11-27 13:11:23 UTC (rev 712)
@@ -0,0 +1,100 @@
+<checks>
+  <check tagid="0">
+    <name>Alle</name>
+    <desc>Jede Fallakte hat einen Tag</desc>
+    <addtag>
+      <sql>SELECT id from master_tbl_view</sql>
+    </addtag>
+    <deltag>
+      <sql>SELECT id from master_tbl_view</sql>
+    </deltag>
+  </check>
+  <check tagid="1">
+    <name>Konsistent</name>
+    <desc>Eine Fallakte ist konsistent, wenn alle Angaben bis zu jeweiligen
+    Phase widerspruchsfrei sind.</desc>
+    <addtag>
+      <sql>SELECT id from master_tbl_view WHERE phase != -1 
+	AND (coalesce(erstgespraech,'0001-01-01'::date) &lt;= now() 
+		AND coalesce(datum_feststellung,'0001-01-01'::date) &lt;= now() 
+		AND coalesce(beendigung_5,'0001-01-01'::date) &lt;= now() 
+		AND coalesce(beendigung_nachbetreuung,'0001-01-01'::date) &lt;= now() 
+		AND coalesce(datum_ende_beratung,'0001-01-01'::date) &lt;= now())</sql>
+    </addtag>
+    <deltag>
+      <sql>SELECT id from master_tbl_view</sql>
+    </deltag>
+  </check>
+  <check tagid="2">
+    <name>Vollständig</name>
+    <desc>Eine Akte ist vollständig, wenn alle Pflichtfeldangaben bis zur aktuellen Phase ungleich "keine Angabe" sind. Die Fallakte muss zudem in sich konsistent sein.</desc>
+    <addtag>
+      <sql>SELECT DISTINCT m.id from master_tbl_view m JOIN nm_tags_cases_view t ON t.case_id = m.id WHERE (TRUE) AND t.tag_id = 1; 
+      </sql>
+    </addtag>
+    <deltag>
+      <sql>SELECT id from master_tbl_view</sql>
+    </deltag>
+  </check>
+  <check tagid="3">
+    <name>Auswertbar</name>
+    <desc>Eine Akte ist auswertbar, wenn das Start- bzw. Enddatum einer der
+    aktuellen Phase gesetzt ist. Die Fallakte muss zudem in sich konsistent sein.</desc>
+    <addtag>
+      <sql>SELECT DISTINCT m.id FROM master_tbl_view m 
+								JOIN nm_tags_cases_view t ON t.case_id = m.id 
+				WHERE 
+      				((phase = 0 AND erstgespraech is not NULL 
+						AND erstgespraech != '0001-01-01'::date 
+						AND (datum_feststellung is NULL)) 
+					OR
+      				(phase = 1 AND (erstgespraech is not NULL 
+						AND erstgespraech != '0001-01-01'::date 
+						AND datum_feststellung is not NULL 
+						AND datum_feststellung != '0001-01-01'::date)) 
+					OR
+      				(phase = 2 AND (datum_feststellung is not NULL 
+						AND datum_feststellung != '0001-01-01'::date) 
+						AND (beendigung_5 is NULL)) 
+					OR
+      				(phase = 3 AND (datum_feststellung is not NULL 
+						AND datum_feststellung != '0001-01-01'::date 
+						AND beendigung_5 is not NULL 
+						AND beendigung_5 != '0001-01-01'::date)) 
+					OR
+      				(phase = 4 AND (beendigung_5 is not NULL 
+						AND beendigung_5 != '0001-01-01'::date 
+						AND (beendigung_nachbetreuung is NULL))) 
+					OR
+      				(phase = 5 AND (beendigung_5 is not NULL 
+						AND beendigung_5 != '0001-01-01'::date 
+						AND beendigung_nachbetreuung is not NULL 
+						AND beendigung_nachbetreuung != '0001-01-01'::date))
+					OR
+      				(phase = 6 AND (datum_feststellung is not NULL 
+						AND datum_feststellung != '0001-01-01'::date) 
+						AND (datum_ende_beratung is NULL)) 
+					OR
+      				(phase = 7 AND (datum_feststellung is not NULL 
+						AND datum_feststellung != '0001-01-01'::date 
+						AND datum_ende_beratung is not NULL 
+						AND datum_ende_beratung != '0001-01-01'::date)) 
+					) 
+					AND t.tag_id = 1; 
+      </sql>
+    </addtag>
+    <deltag>
+      <sql>SELECT id from master_tbl_view</sql>
+    </deltag>
+  </check>
+  <check tagid="4">
+    <name>Adele auswertbar</name>
+    <desc>Eine Akte ist für Adele auswertbar, wenn die Geschlechtsangabe nicht unbekannt ist. Die Fallakte muss zudem grundsätzlich auswertbar sein.</desc>
+    <addtag>
+      <sql>SELECT DISTINCT m.id from master_tbl_view m JOIN nm_tags_cases_view t ON m.id = t.case_id WHERE geschlecht not in (-1, -3) AND PHASE in (2, 3, 4, 5) AND t.tag_id = 3</sql>
+    </addtag>
+    <deltag>
+      <sql>SELECT id from master_tbl_view</sql>
+    </deltag>
+  </check>
+</checks>



More information about the Mpuls-commits mailing list