[Mpuls-commits] r4427 - in jmd/trunk: . jmdweb/public/xml

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Dec 27 12:10:40 CET 2010


Author: torsten
Date: 2010-12-27 12:10:39 +0100 (Mon, 27 Dec 2010)
New Revision: 4427

Modified:
   jmd/trunk/ChangeLog
   jmd/trunk/jmdweb/public/xml/eval_cm.xml
   jmd/trunk/jmdweb/public/xml/eval_zielgruppe.xml
Log:
Issue963: Changed calculation of age


Modified: jmd/trunk/ChangeLog
===================================================================
--- jmd/trunk/ChangeLog	2010-12-27 10:54:54 UTC (rev 4426)
+++ jmd/trunk/ChangeLog	2010-12-27 11:10:39 UTC (rev 4427)
@@ -5,6 +5,9 @@
 	"Zielerreichung" into "Integrationsförderplan".
 	* jmdweb/i18n/de/LC_MESSAGES/mpulsweb.po: Fixed translation "Dauer der
 	Phase" -> "Dauer der Begleitung"
+	* jmdweb/public/xml/eval_cm.xml,
+	jmdweb/public/xml/eval_zielgruppe.xml: Issue963: Age calculation is
+	now relative to the "erstgespraech".
 
 2010-12-22  Torsten Irlaender <torsten at intevation.de>
 

Modified: jmd/trunk/jmdweb/public/xml/eval_cm.xml
===================================================================
--- jmd/trunk/jmdweb/public/xml/eval_cm.xml	2010-12-27 10:54:54 UTC (rev 4426)
+++ jmd/trunk/jmdweb/public/xml/eval_cm.xml	2010-12-27 11:10:39 UTC (rev 4427)
@@ -207,6 +207,7 @@
       </ydim>
   </evaluation>
   
+  <!--
   <evaluation>
       <id>11</id>
       <name>Zielerreichungsgrad</name>
@@ -241,6 +242,7 @@
           <join>ziel3_erreicht</join>
       </ydim>
   </evaluation>
+  --> 
   
   <evaluation>
       <id>12</id>

Modified: jmd/trunk/jmdweb/public/xml/eval_zielgruppe.xml
===================================================================
--- jmd/trunk/jmdweb/public/xml/eval_zielgruppe.xml	2010-12-27 10:54:54 UTC (rev 4426)
+++ jmd/trunk/jmdweb/public/xml/eval_zielgruppe.xml	2010-12-27 11:10:39 UTC (rev 4427)
@@ -30,14 +30,14 @@
       <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('%(edate)s'::date, geburtsdatum)) &lt; 12)</where>
+      <where>(date_part('year', age(datum_ea_start, geburtsdatum)) &lt; 12)</where>
     </ydim>
     <ydim>
       <label>12 bis 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('%(edate)s'::date, geburtsdatum)) &gt;= 12 AND date_part('year', age('%(edate)s'::date, geburtsdatum)) &lt;= 14)
+      <where>(date_part('year', age(datum_ea_start, geburtsdatum)) &gt;= 12 AND date_part('year', age(datum_ea_start, geburtsdatum)) &lt;= 14)
       </where>
     </ydim>
     <ydim>
@@ -45,28 +45,28 @@
       <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('%(edate)s'::date, geburtsdatum)) &gt; 14 AND date_part('year', age('%(edate)s'::date, geburtsdatum)) &lt;= 18)</where>
+      <where>(date_part('year', age(datum_ea_start, geburtsdatum)) &gt; 14 AND date_part('year', age(datum_ea_start, geburtsdatum)) &lt;= 18)</where>
     </ydim>
     <ydim>
       <label>18 bis 27 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('%(edate)s'::date, geburtsdatum)) &gt; 18 AND date_part('year', age('%(edate)s'::date, geburtsdatum)) &lt;= 27)</where>
+      <where>(date_part('year', age(datum_ea_start, geburtsdatum)) &gt; 18 AND date_part('year', age(datum_ea_start, geburtsdatum)) &lt;= 27)</where>
     </ydim>
     <ydim>
       <label>älter als 27 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('%(edate)s'::date, geburtsdatum)) &gt; 27 and geburtsdatum != '0001-01-01'::date)</where>
+      <where>(date_part('year', age(datum_ea_start, geburtsdatum)) &gt; 27 and geburtsdatum != '0001-01-01'::date)</where>
     </ydim>
     <ydim>
       <label>Gesamt</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('%(edate)s'::date, geburtsdatum)) &gt;= 12 AND date_part('year', age('%(edate)s'::date, geburtsdatum)) &lt;= 27)</where>
+      <where>(date_part('year', age(datum_ea_start, geburtsdatum)) &gt;= 12 AND date_part('year', age(datum_ea_start, geburtsdatum)) &lt;= 27)</where>
     </ydim>
   </evaluation>
   <evaluation>
@@ -98,7 +98,7 @@
     <basequery>
       <table>master_tbl_eval_total_view</table>
       <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
-      <where>(date_part('year', age('%(edate)s'::date, geburtsdatum)) &lt; 12)</where>
+      <where>(date_part('year', age(datum_ea_start, geburtsdatum)) &lt; 12)</where>
     </basequery>
     <xdim>
       <label>Geschlecht</label>
@@ -120,7 +120,7 @@
     <basequery>
       <table>master_tbl_eval_total_view</table>
       <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
-      <where>(date_part('year', age('%(edate)s'::date, geburtsdatum)) &gt;= 12 AND date_part('year', age('%(edate)s'::date, geburtsdatum)) &lt;= 14)</where>
+      <where>(date_part('year', age(datum_ea_start, geburtsdatum)) &gt;= 12 AND date_part('year', age(datum_ea_start, geburtsdatum)) &lt;= 14)</where>
     </basequery>
     <xdim>
       <label>Geschlecht</label>
@@ -142,7 +142,7 @@
     <basequery>
       <table>master_tbl_eval_total_view</table>
       <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
-      <where>(date_part('year', age('%(edate)s'::date, geburtsdatum)) &gt; 14 AND date_part('year', age('%(edate)s'::date, geburtsdatum)) &lt;= 18)</where>
+      <where>(date_part('year', age(datum_ea_start, geburtsdatum)) &gt; 14 AND date_part('year', age(datum_ea_start, geburtsdatum)) &lt;= 18)</where>
     </basequery>
     <xdim>
       <label>Geschlecht</label>
@@ -164,7 +164,7 @@
     <basequery>
       <table>master_tbl_eval_total_view</table>
       <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
-      <where>(date_part('year', age('%(edate)s'::date, geburtsdatum)) &gt; 18 AND date_part('year', age('%(edate)s'::date, geburtsdatum)) &lt;= 27)</where>
+      <where>(date_part('year', age(datum_ea_start, geburtsdatum)) &gt; 18 AND date_part('year', age(datum_ea_start, geburtsdatum)) &lt;= 27)</where>
     </basequery>
     <xdim>
       <label>Geschlecht</label>
@@ -186,7 +186,7 @@
     <basequery>
       <table>master_tbl_eval_total_view</table>
       <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
-      <where>(date_part('year', age('%(edate)s'::date, geburtsdatum)) &gt; 27 and geburtsdatum != '0001-01-01'::date)</where>
+      <where>(date_part('year', age(datum_ea_start, geburtsdatum)) &gt; 27 and geburtsdatum != '0001-01-01'::date)</where>
     </basequery>
     <xdim>
       <label>Geschlecht</label>
@@ -206,7 +206,7 @@
   <evaluation>
       <id>5</id>
       <name>Dauer des Aufenthaltes</name>
-      <desc>Dauer des Aufenthaltes</desc>
+      <desc>Dauer des Aufenthaltes relativ zum Datum des Erstgesprächs</desc>
       <basequery>
           <table>master_tbl_eval_total_view</table>
           <template>SELECT id, %(xfield)s, %(yfield)s from %(from)s WHERE %(where)s</template>
@@ -230,31 +230,31 @@
           <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('%(edate)s'::date, einreisedatum)) &gt;= 1
-              AND date_part('year', age('%(edate)s'::date, einreisedatum)) &lt; 3 and geburtsland != 29)</where>
+          <where>(date_part('year', age(datum_ea_start, einreisedatum)) &gt;= 1
+              AND date_part('year', age(datum_ea_start, einreisedatum)) &lt; 3 and geburtsland != 29)</where>
       </ydim>
       <ydim>
           <label>Zuzug zwischen 3 und 6 Jahren</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('%(edate)s'::date, einreisedatum)) &gt;= 3
-              AND date_part('year', age('%(edate)s'::date, einreisedatum)) &lt; 6 and geburtsland != 29)</where>
+          <where>(date_part('year', age(datum_ea_start, einreisedatum)) &gt;= 3
+              AND date_part('year', age(datum_ea_start, einreisedatum)) &lt; 6 and geburtsland != 29)</where>
       </ydim>
       <ydim>
           <label>Zuzug zwischen 6 und 10 Jahren</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('%(edate)s'::date, einreisedatum)) &gt;= 6
-              AND date_part('year', age('%(edate)s'::date, einreisedatum)) &lt; 10 and geburtsland != 29)</where>
+          <where>(date_part('year', age(datum_ea_start, einreisedatum)) &gt;= 6
+              AND date_part('year', age(datum_ea_start, einreisedatum)) &lt; 10 and geburtsland != 29)</where>
       </ydim>
       <ydim>
           <label>Zuzug vor mehr als 10 Jahren</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('%(edate)s'::date, einreisedatum)) &gt;= 10 and einreisedatum != '0001-01-01'::date and geburtsland != 29)</where>
+          <where>(date_part('year', age(datum_ea_start, einreisedatum)) &gt;= 10 and einreisedatum != '0001-01-01'::date and geburtsland != 29)</where>
       </ydim>
       <ydim>
           <label>Seit der Geburt in Deutschland</label>
@@ -580,14 +580,14 @@
       <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;= datum_cm_start AND '%(sdate)s'::date &lt;= coalesce(datum_cm_ende, now()))</where>
+      <where>('%(edate)s'::date &gt;= datum_cm_start AND '%(sdate)s'::date &lt;= coalesce(datum_cm_ende, now()) and phase in (2,3))</where>
     </ydim>
     <ydim>
       <label>Beratung</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;= datum_ber_start AND '%(sdate)s'::date &lt;= coalesce(datum_ber_ende, now()))</where>
+      <where>('%(edate)s'::date &gt;= datum_ber_start AND '%(sdate)s'::date &lt;= coalesce(datum_ber_ende, now()) and phase in (4,5))</where>
     </ydim>
   </evaluation>
 </evaluationset>



More information about the Mpuls-commits mailing list