Files
BeWoPlaner/ReportImp/CaritasLudwigsburgWaiblingenEnz/JahresauswertungMissinglist2022.cs
Christian c4b7703842 cb
2023-02-15 20:13:03 +01:00

1745 lines
78 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using BS.Shared;
using BS.Shared.Core;
using BeWo.Data.Access;
using BeWo.Data.Entities;
using BeWo.Report;
using BeWo.Report.ReportObjects;
using System.Text;
namespace CaritasLudwigsburgWaiblingenEnz
{
public partial class JahresauswertungMissinglist2022 : DevExpress.XtraReports.UI.XtraReport, IBeWoReport<QueryRO>
{
private DevExpress.XtraReports.UI.TopMarginBand topMarginBand1;
private DevExpress.XtraReports.UI.DetailBand detailBand1;
private DevExpress.XtraReports.UI.BottomMarginBand bottomMarginBand1;
public JahresauswertungMissinglist2022()
{
InitializeComponent();
}
public void SetReportDataSource(QueryRO pRO)
{
//var reportDate = DateTime.Parse(pRO.Rows[0].Field1.ToString());
var reportDate = new DateTime(DateTime.Now.Year, 1, 1);
if (pRO.Rows != null)
{
DateTime dt;
if (DateTime.TryParse(pRO.Rows[0].Field1.ToString(), out dt))
{
reportDate = new DateTime(dt.Year, 1, 1);
}
}
lblTitel.Text = String.Format("2. Vom SpDi versorgte Personen {0:yyyy}", reportDate);
#region RowVariables
// 3.1 Insgesamt betreute Personen
int anz311M = 0;
int anz311W = 0;
int anz311D = 0;
int anz312M = 0;
int anz312W = 0;
int anz312D = 0;
int anz313M = 0;
int anz313W = 0;
int anz313D = 0;
// 3.2 Insgesamt betreute Personen
int anz321 = 0;
int anz322 = 0;
int anz323 = 0;
StringBuilder sbOhneDirektOderIndirekt = new StringBuilder();
// 3.3 Dauer der Betreuung im Rahmen der Grundversorgung
int anzBis3Monate1Bis4Kontakte = 0;
StringBuilder anzBis3Monate1Bis4KontakteSb = new StringBuilder();
int anzBis3Monate5Bis10Kontakte = 0;
StringBuilder anzBis3Monate5Bis10KontakteSb = new StringBuilder();
int anzBis3Monate11Bis20Kontakte = 0;
StringBuilder anzBis3Monate11Bis20KontakteSb = new StringBuilder();
int anzBis3Monate21Bis40Kontakte = 0;
StringBuilder anzBis3Monate21Bis40KontakteSb = new StringBuilder();
int anzBis3Monate40PlusKontakte = 0;
StringBuilder anzBis3Monate40PlusKontakteSb = new StringBuilder();
int anz3Bis6Monate1Bis4Kontakte = 0;
StringBuilder anz3Bis6Monate1Bis4KontakteSb = new StringBuilder();
int anz3Bis6Monate5Bis10Kontakte = 0;
StringBuilder anz3Bis6Monate5Bis10KontakteSb = new StringBuilder();
int anz3Bis6Monate11Bis20Kontakte = 0;
StringBuilder anz3Bis6Monate11Bis20KontakteSb = new StringBuilder();
int anz3Bis6Monate21Bis40Kontakte = 0;
StringBuilder anz3Bis6Monate21Bis40KontakteSb = new StringBuilder();
int anz3Bis6Monate40PlusKontakte = 0;
StringBuilder anz3Bis6Monate40PlusKontakteSb = new StringBuilder();
int anz7Bis12Monate1Bis4Kontakte = 0;
StringBuilder anz7Bis12Monate1Bis4KontakteSb = new StringBuilder();
int anz7Bis12Monate5Bis10Kontakte = 0;
StringBuilder anz7Bis12Monate5Bis10KontakteSb = new StringBuilder();
int anz7Bis12Monate11Bis20Kontakte = 0;
StringBuilder anz7Bis12Monate11Bis20KontakteSb = new StringBuilder();
int anz7Bis12Monate21Bis40Kontakte = 0;
StringBuilder anz7Bis12Monate21Bis40KontakteSb = new StringBuilder();
int anz7Bis12Monate40PlusKontakte = 0;
StringBuilder anz7Bis12Monate40PlusKontakteSb = new StringBuilder();
StringBuilder sbOhne33 = new StringBuilder();
//3.4 Neuanfrangen
int anz341M = 0;
int anz341W = 0;
int anz341D = 0;
int anz342M = 0;
int anz342W = 0;
int anz342D = 0;
// 3.5 Zuweisungswege
int anz351 = 0;
int anz352 = 0;
int anz353 = 0;
int anz354 = 0;
int anz355 = 0;
int anz356 = 0;
int anz357 = 0;
int anz358 = 0;
int anz359 = 0;
int anz3510 = 0;
int anz3511 = 0;
int anz3512 = 0;
int anz3513 = 0;
int anz3514 = 0;
int anz3515 = 0;
int anz3516 = 0;
int anz3517 = 0;
int anz3518 = 0;
int anz3519 = 0;
int anz3520 = 0;
int anz3521 = 0;
int anz3522 = 0;
int anz3523 = 0;
StringBuilder zuweisungswegeUnbekanntSb = new StringBuilder();
zuweisungswegeUnbekanntSb.AppendLine("Unbekannt:");
StringBuilder zuweisungswegeSonstigesSb = new StringBuilder();
zuweisungswegeSonstigesSb.AppendLine("Sonstiges:");
// 3.6.1 Information und Anlauf
int anz361 = 0;
// 3.6.2 Weitervermittlung
int anz3621 = 0;
int anz3622 = 0;
int anz3623 = 0;
int anz3624 = 0;
int anz3625 = 0;
int anz3626 = 0;
int anz3627 = 0;
StringBuilder sb362KeineAngaben = new StringBuilder();
sb362KeineAngaben.AppendLine("Keine Angaben:");
// 4.1 Art der Betreuung
int anz411 = 0;
int anz412 = 0;
int anz413 = 0;
int anz414 = 0;
int anz415 = 0;
int anz416 = 0;
int anz417 = 0;
int anz418 = 0;
int anz419 = 0;
StringBuilder sb41KeineAngaben = new StringBuilder();
sb41KeineAngaben.AppendLine("Keine Angaben:");
// 4.2 Kriseninterventionen
int anz42 = 0;
StringBuilder sb42 = new StringBuilder();
// 4.3.1 Ärztliche Versorgung
int anz4311 = 0;
int anz4312 = 0;
int anz4313 = 0;
int anz4314 = 0;
int anz4315 = 0;
int anz4316 = 0;
StringBuilder sb431KeineAngaben = new StringBuilder();
sb431KeineAngaben.AppendLine("Keine Angaben:");
// 4.3.2 Zusammenarbeit mit nicht psych Hilfen anderer
int anz4321 = 0;
int anz4322 = 0;
int anz4323 = 0;
int anz4324 = 0;
StringBuilder sb432KeineAngaben = new StringBuilder();
sb432KeineAngaben.AppendLine("Keine Angaben:");
// 4.3.3 Zusammenarbeit mit weiteren Hilfen
int anz4331 = 0;
int anz4332 = 0;
int anz4333 = 0;
int anz4334 = 0;
int anz4335 = 0;
int anz4336 = 0;
int anz4337 = 0;
int anz4338 = 0;
int anz4339 = 0;
StringBuilder sb433KeineAngaben = new StringBuilder();
sb433KeineAngaben.AppendLine("Keine Angaben:");
// 4.4 Beendigung der Betreuung
int anz441 = 0;
int anz442 = 0;
int anz443 = 0;
int anz444 = 0;
int anz445 = 0;
int anz446 = 0;
int anz447 = 0;
int anz448 = 0;
int anz449 = 0;
// 5.1 Alter
int anz18bis27W = 0;
int anz28bis40W = 0;
int anz41bis50W = 0;
int anz51bis60W = 0;
int anzUeber60W = 0;
int anzAlterUnbekanntW = 0;
int anz18bis27M = 0;
int anz28bis40M = 0;
int anz41bis50M = 0;
int anz51bis60M = 0;
int anzUeber60M = 0;
int anzAlterUnbekanntM = 0;
int anz18bis27D = 0;
int anz28bis40D = 0;
int anz41bis50D = 0;
int anz51bis60D = 0;
int anzUeber60D = 0;
int anzAlterUnbekanntD = 0;
StringBuilder AlterUnbekanntSb = new StringBuilder();
AlterUnbekanntSb.AppendLine("Unbekannt:");
// 5.2 Familienstand
int anzLedig = 0;
int anzVerwitwert = 0;
int anzGeschieden = 0;
int anzVerheiratet = 0;
int anzGetrennt = 0;
int anzPartner = 0;
int anzPartnerMarried = 0;
int anzEntpartnert = 0;
int anzPartnerDead = 0;
int anzFamlienstandUnbekannt = 0;
StringBuilder familienStandUnbekanntSb = new StringBuilder();
familienStandUnbekanntSb.AppendLine("Unbekannt:");
// 5.3 Person hat minderjährige(s) Kind(er)
int anz531 = 0;
int anz532 = 0;
int anz533 = 0;
StringBuilder sb53Unbekannt = new StringBuilder();
sb53Unbekannt.AppendLine("Unbekannt:");
// 5.4 Lebensverhältnisse
int anzAlleinlebend = 0;
int anzLebtMitPartnerin = 0;
int anzAlleinerziehendMitMinderjaehrigenKindern = 0;
int anzMitPartnerLebendMitGgfMinderjaehrigenKindern = 0;
int anzLebtMitEltern = 0;
int anzLebtMitAngehoerigen = 0;
int anzInPrivaterWGLebend = 0;
int anzInBeWoLebend = 0;
int anzOhneFestenWohnsitz = 0;
int anzLebensverhaeltnisUnbekannt = 0;
int anzLebensverhaeltnisSonstiges = 0;
StringBuilder LebensverhaltnisUnbekanntSb = new StringBuilder();
LebensverhaltnisUnbekanntSb.AppendLine("Unbekannt:");
// 5.5 Einkommen
int anzUnterhaltDurchEhepartner = 0;
int anzErwerbsBerufstaetig = 0;
int anzGelegenheitsarbeiten = 0;
int anzUnterhaltDurchFamilie = 0;
int anzErwerbsBerufsunfaehigkeitsrente = 0;
int anzALGI = 0;
int anzALGII = 0;
int anzKrankengeld = 0;
int anzAltersrentePensionWitwenrente = 0;
int anzGrundsicherungNachSGBXII = 0;
int anzEigenesVermoegenErsparnisse = 0;
int anzUebergangsgeld = 0;
int anzWfbM = 0;
int anzEinkommenUnbekannt = 0;
int anzEinkommenSonstiges = 0;
StringBuilder EinkommenUnbekanntSb = new StringBuilder();
EinkommenUnbekanntSb.AppendLine("Unbekannt:");
// 5.6 Diagnosen
Dictionary<string, int> diagnose2Anzahl = new Dictionary<string, int>();
StringBuilder sbDiagnoseUnbekannt = new StringBuilder();
sbDiagnoseUnbekannt.AppendLine("Unbekannt / Ärztliche Diagnose nicht vorhanden:");
// 5.7 Komorbidität
int anz571 = 0;
int anz572 = 0;
int anz573 = 0;
int anz574 = 0;
StringBuilder sb57KeineAngaben = new StringBuilder();
sb57KeineAngaben.AppendLine("Keine Angaben:");
#endregion
int customercount = 0;
var customerList = DAOFactory.GenericDAO.GetAllActiveAndArchived<Customer>(); //.Where(c => c.SupportConcepts.Count > 0 && c.SupportConcepts.Any(sc => sc.StartDate.Value.Year == reportDate.Year));
var varFieldDefs = DAOFactory.GenericDAO.GetAllActive<VarFieldDef>();
var oid2VarfieldDef = varFieldDefs.ToDictionary(varFieldDef => varFieldDef.Oid.Value);
foreach (var customer in customerList.OrderBy(c => c.Person.LastNameFirstName))
{
if (customer.Person.LastName == "Jesch")
{
int test = 0;
}
CostBearer2SupportConcept soPsyDiC2S = null;
foreach (var sc in customer.SupportConcepts)
{
if (sc.IsActive != ActivationTypeId.Deleted)
{
foreach (var cb in sc.CostBearer2SupportConceptList)
{
if (cb.CostBearer.Organisation.Name == "Landesstatistik SpDi")
{
//if (cb.ApprovalPeriodList.Any(a => a.ServiceCategory != null && a.ServiceCategory.Name == "Sozialpsychiatrischer Dienst" && a.StartDate.HasValue && a.StartDate < reportDate.AddYears(1) && a.EndDate.HasValue && a.EndDate >= reportDate))
if (cb.ApprovalPeriodList.Any(a => a.StartDate.HasValue && a.StartDate < reportDate.AddYears(1) && a.EndDate.HasValue && a.EndDate >= reportDate))
{
soPsyDiC2S = cb;
customercount++;
}
}
}
}
}
if (soPsyDiC2S != null)
{
DateTime betreuungBegonnenAm = DateTime.MinValue;
if (customer.AssistanceBegin.HasValue)
{
betreuungBegonnenAm = customer.AssistanceBegin.Value;
}
// bool istErstbetreuung = false;
//if (erstbetreuungsDatum >= reportDate && erstbetreuungsDatum < reportDate.AddYears(1))
//{
// istErstbetreuung = true;
//}
var alleServiceRecords = soPsyDiC2S.ServiceRecords.OrderByDescending(s => s.Start).ToList();
var serviceRecordsImBerichtsjahr = alleServiceRecords.Where(sr => sr.Start >= reportDate && sr.Start < reportDate.AddYears(1));
var serviceRecordsImLetztenJahr = alleServiceRecords.Where(sr => sr.Start >= reportDate.AddYears(-1) && sr.Start < reportDate);
//int anzahlKontakteImBerichtsjahr = serviceRecordsImBerichtsjahr.Count();
int anzahlKontakteLetztesJahr = serviceRecordsImLetztenJahr.Count();
int anzBeratungOderBegleitung = 0;
int anzBeratungVonAngehoerigen = 0;
int anzBeratungVonAnderenBezugspersonen = 0;
int anzInformation = 0;
int anzKrisenintervention = 0;
foreach (var sr in serviceRecordsImBerichtsjahr)
{
if (sr.ServiceDescription.Name.Contains("Angehörigenberatung"))
{
anzBeratungVonAngehoerigen++;
}
else if (sr.ServiceDescription.Name.Contains("Kontakt zu Kooperationspartnern"))
{
anzBeratungVonAnderenBezugspersonen++;
}
else if (sr.ServiceDescription.Name.Contains("Information"))
{
anzInformation++;
}
else if (sr.ServiceDescription.Name.Contains("Krisenintervention"))
{
anzKrisenintervention++;
}
else
{
anzBeratungOderBegleitung++;
}
}
DateTime letzterKontaktInsgesamt = alleServiceRecords.Max(s => s.Start) ?? DateTime.MinValue;
DateTime ersterKontaktInsgesamt = alleServiceRecords.Min(s => s.Start) ?? DateTime.MaxValue;
DateTime letzterKontaktDiesesJahr = serviceRecordsImBerichtsjahr.Max(s => s.Start) ?? DateTime.MinValue;
DateTime ersterKontaktDiesesJahr = serviceRecordsImBerichtsjahr.Min(s => s.Start) ?? DateTime.MaxValue;
bool istNeuanfrage = false;
bool istInGrundversorgung = false;
bool istKurzberatung = false;
if (ersterKontaktInsgesamt >= reportDate || letzterKontaktInsgesamt < reportDate.AddYears(-1)) // Erste Mal in Kontakt oder letzter Kontakt liegt länger als ein Berichtsjahr zurück
{
istNeuanfrage = true;
}
if (istNeuanfrage && anzBeratungOderBegleitung < 5)
{
istKurzberatung = true;
}
if (istNeuanfrage && anzBeratungOderBegleitung >= 5)
{
istInGrundversorgung = true;
}
if (anzahlKontakteLetztesJahr >= 5 && anzBeratungOderBegleitung > 0)
{
istInGrundversorgung = true;
}
if (anzBeratungVonAngehoerigen > 0 || anzBeratungVonAnderenBezugspersonen > 0)
{
istInGrundversorgung = true;
}
#region 3.1
Sex geschlecht = Sex.Divers;
if (customer.Person.Sex.HasValue)
{
geschlecht = customer.Person.Sex.Value;
}
if (istInGrundversorgung || istKurzberatung)
{
var hatMigrationshintergrund = customer.Person.IsMigrant;
bool fluchterfahrung = HatFluchterfahrung(customer, oid2VarfieldDef);
if (geschlecht == Sex.Male)
{
anz311M++;
if (hatMigrationshintergrund)
{
anz312M++;
}
if (fluchterfahrung)
{
anz313M++;
}
}
else if (geschlecht == Sex.Female)
{
anz311W++;
if (hatMigrationshintergrund)
{
anz312W++;
}
if (fluchterfahrung)
{
anz313W++;
}
}
else
{
anz311D++;
if (hatMigrationshintergrund)
{
anz312D++;
}
if (fluchterfahrung)
{
anz313D++;
}
}
}
#endregion
#region 3.2
if (anzBeratungOderBegleitung >= 5)
{
anz321++;
}
else if (anzBeratungVonAngehoerigen > 0)
{
anz322++;
}
else if (anzBeratungVonAnderenBezugspersonen > 0)
{
anz323++;
}
if (anzBeratungOderBegleitung == 0 && anzBeratungVonAngehoerigen == 0 && anzBeratungVonAnderenBezugspersonen == 0)
{
sbOhneDirektOderIndirekt.AppendLine(String.Format("{0}, {1}", customer.Person.LastName, customer.Person.FirstName));
}
#endregion
#region 3.3 Dauer der Betreuung im Rahmen der Grundversorgung
if (istInGrundversorgung)
{
int anzKontakte = anzBeratungOderBegleitung;
var zeitraum = letzterKontaktDiesesJahr - ersterKontaktDiesesJahr;
//if (recordsInSpan.Count == 0)
//{
// sbOhne23.AppendLine(String.Format("{0}, {1}", customer.Person.LastName, customer.Person.FirstName));
//}
// bis 3 Monate
if (zeitraum.Days < 91)
{
if (anzKontakte > 0 && anzKontakte < 5)
{
anzBis3Monate1Bis4Kontakte++;
anzBis3Monate1Bis4KontakteSb.AppendLine(String.Format("{0}, {1}", customer.Person.LastName, customer.Person.FirstName));
}
else if (anzKontakte > 4 && anzKontakte < 11)
{
anzBis3Monate5Bis10Kontakte++;
anzBis3Monate5Bis10KontakteSb.AppendLine(String.Format("{0}, {1}", customer.Person.LastName, customer.Person.FirstName));
}
else if (anzKontakte > 10 && anzKontakte < 21)
{
anzBis3Monate11Bis20Kontakte++;
anzBis3Monate11Bis20KontakteSb.AppendLine(String.Format("{0}, {1}", customer.Person.LastName, customer.Person.FirstName));
}
else if (anzKontakte > 20 && anzKontakte < 41)
{
anzBis3Monate21Bis40Kontakte++;
anzBis3Monate21Bis40KontakteSb.AppendLine(String.Format("{0}, {1}", customer.Person.LastName, customer.Person.FirstName));
}
else if (anzKontakte > 40)
{
anzBis3Monate40PlusKontakte++;
anzBis3Monate40PlusKontakteSb.AppendLine(String.Format("{0}, {1}", customer.Person.LastName, customer.Person.FirstName));
}
}
else if (zeitraum.Days < 181) // 3-6 Monate
{
if (anzKontakte > 0 && anzKontakte < 5)
{
anz3Bis6Monate1Bis4Kontakte++;
anz3Bis6Monate1Bis4KontakteSb.AppendLine(String.Format("{0}, {1}", customer.Person.LastName, customer.Person.FirstName));
}
else if (anzKontakte > 4 && anzKontakte < 11)
{
anz3Bis6Monate5Bis10Kontakte++;
anz3Bis6Monate5Bis10KontakteSb.AppendLine(String.Format("{0}, {1}", customer.Person.LastName, customer.Person.FirstName));
}
else if (anzKontakte > 10 && anzKontakte < 21)
{
anz3Bis6Monate11Bis20Kontakte++;
anz3Bis6Monate11Bis20KontakteSb.AppendLine(String.Format("{0}, {1}", customer.Person.LastName, customer.Person.FirstName));
}
else if (anzKontakte > 20 && anzKontakte < 41)
{
anz3Bis6Monate21Bis40Kontakte++;
anz3Bis6Monate21Bis40KontakteSb.AppendLine(String.Format("{0}, {1}", customer.Person.LastName, customer.Person.FirstName));
}
else if (anzKontakte > 40)
{
anz3Bis6Monate40PlusKontakte++;
anz3Bis6Monate40PlusKontakteSb.AppendLine(String.Format("{0}, {1}", customer.Person.LastName, customer.Person.FirstName));
}
}
else
{
if (anzKontakte > 0 && anzKontakte < 5)
{
anz7Bis12Monate1Bis4Kontakte++;
anz7Bis12Monate1Bis4KontakteSb.AppendLine(String.Format("{0}, {1}", customer.Person.LastName, customer.Person.FirstName));
}
else if (anzKontakte > 4 && anzKontakte < 11)
{
anz7Bis12Monate5Bis10Kontakte++;
anz7Bis12Monate5Bis10KontakteSb.AppendLine(String.Format("{0}, {1}", customer.Person.LastName, customer.Person.FirstName));
}
else if (anzKontakte > 10 && anzKontakte < 21)
{
anz7Bis12Monate11Bis20Kontakte++;
anz7Bis12Monate11Bis20KontakteSb.AppendLine(String.Format("{0}, {1}", customer.Person.LastName, customer.Person.FirstName));
}
else if (anzKontakte > 20 && anzKontakte < 41)
{
anz7Bis12Monate21Bis40Kontakte++;
anz7Bis12Monate21Bis40KontakteSb.AppendLine(String.Format("{0}, {1}", customer.Person.LastName, customer.Person.FirstName));
}
else if (anzKontakte > 40)
{
anz7Bis12Monate40PlusKontakte++;
anz7Bis12Monate40PlusKontakteSb.AppendLine(String.Format("{0}, {1}", customer.Person.LastName, customer.Person.FirstName));
}
}
}
#endregion
#region 3.4
if (istNeuanfrage)
{
if (geschlecht == Sex.Male)
{
anz341M++;
}
else if (geschlecht == Sex.Female)
{
anz341W++;
}
else
{
anz341D++;
}
if (istKurzberatung)
{
if (geschlecht == Sex.Male)
{
anz342M++;
}
else if (geschlecht == Sex.Female)
{
anz342W++;
}
else
{
anz342D++;
}
}
}
#endregion
#region 3.5 Zuweisungswege
if (istNeuanfrage)
{
String zw = "";
foreach (var placement in customer.PlacementList)
{
if (placement.PlacementDate.HasValue && placement.PlacementDate.Value >= reportDate &&
placement.PlacementDate.Value < reportDate.AddYears(1) && placement.Objective != null)
{
zw = placement.Objective.Value;
if (zw != null)
{
zw = zw.Trim();
}
}
}
if (zw.StartsWith("Eigeninitiative"))
{
anz351++;
}
else if (zw.Contains("Klinik für Psychiatrie"))
{
anz352++;
}
else if (zw.Contains("Fornesische Abteilung") || zw.Contains("Forensische Abteilung"))
{
anz353++;
}
else if (zw.StartsWith("Andere Klinik"))
{
anz354++;
}
else if (zw.StartsWith("Psychiatrische Institutsambulanz"))
{
anz355++;
}
else if (zw.StartsWith("Niedergelassen"))
{
anz356++;
}
else if (zw.StartsWith("Psychologische und ärztliche Psychotherapeut"))
{
anz357++;
}
else if (zw.StartsWith("Hausarzt"))
{
anz358++;
}
else if (zw.StartsWith("Selbsthilfe"))
{
anz359++;
}
else if (zw.StartsWith("EUTB"))
{
anz3510++;
}
else if (zw.StartsWith("IBB Stellen"))
{
anz3511++;
}
else if (zw.StartsWith("Einrichtungen der Eingliederungshilfe"))
{
anz3512++;
}
else if (zw.StartsWith("Tagesstätte"))
{
anz3513++;
}
else if (zw.StartsWith("Amt für Öffentliche") || zw.StartsWith("Amt für öffentliche"))
{
anz3514++;
}
else if (zw.StartsWith("Gesundheitsamt") || zw.StartsWith("Gesundheitsä"))
{
anz3515++;
}
else if (zw.StartsWith("Jobcenter"))
{
anz3516++;
}
else if (zw.StartsWith("Sozialamt"))
{
anz3517++;
}
else if (zw.StartsWith("Wohnungslos") || zw.StartsWith("Wohnungsnotfall"))
{
anz3518++;
}
else if (zw.StartsWith("Suchthilfe"))
{
anz3519++;
}
else if (zw.StartsWith("Gesetzlicher Betreuer"))
{
anz3520++;
}
else if (zw.StartsWith("Soziales Umfeld"))
{
anz3521++;
}
else if (zw.StartsWith("weitere Berat") || zw.StartsWith("Weitere Berat"))
{
anz3522++;
}
else if (zw.StartsWith("Sonstiges"))
{
anz3523++;
}
else
{
zuweisungswegeUnbekanntSb.AppendLine(String.Format("{0}, {1}", customer.Person.LastName, customer.Person.FirstName));
}
}
#endregion
#region 3.6.1 Information und Anlauf
if (istNeuanfrage)
{
anz361 += serviceRecordsImBerichtsjahr.Count(s => s.ServiceDescription.Name.Contains("Information und Anlauf"));
}
#endregion
#region 3.6.2 Weitervermittlung
if (istNeuanfrage) // Nur Neuanfragen??
{
if (HatBoolVarfieldDef(customer, 68))
{
anz3621++;
}
else if (HatBoolVarfieldDef(customer, 69))
{
anz3622++;
}
else if (HatBoolVarfieldDef(customer, 70))
{
anz3623++;
}
else if (HatBoolVarfieldDef(customer, 71))
{
anz3624++;
}
else if (HatBoolVarfieldDef(customer, 72))
{
anz3625++;
}
else if (HatBoolVarfieldDef(customer, 73))
{
anz3626++;
}
else if (HatBoolVarfieldDef(customer, 74))
{
anz3627++;
}
}
#endregion
#region 4.1 Art der Betreuung
if (istInGrundversorgung)
{
anz411 += serviceRecordsImBerichtsjahr.Count(s => s.ServiceDescription.Name.Contains("Einzelberatung in der Dienststelle"));
anz412 += serviceRecordsImBerichtsjahr.Count(s => s.ServiceDescription.Name.Contains("Beratung per Telefon"));
anz413 += serviceRecordsImBerichtsjahr.Count(s => s.ServiceDescription.Name.Contains("Beratung per Video"));
anz414 += serviceRecordsImBerichtsjahr.Count(s => s.ServiceDescription.Name.Contains("Beratung per E"));
anz415 += serviceRecordsImBerichtsjahr.Count(s => s.ServiceDescription.Name.Contains("Gruppen"));
anz416 += serviceRecordsImBerichtsjahr.Count(s => s.ServiceDescription.Name.Contains("Begleitung"));
anz417 += serviceRecordsImBerichtsjahr.Count(s => s.ServiceDescription.Name.Contains("Aufsuchende Betreuung"));
anz418 += serviceRecordsImBerichtsjahr.Count(s => s.ServiceDescription.Name.Contains("Kontakt zu Angehörigen"));
anz419 += serviceRecordsImBerichtsjahr.Count(s => s.ServiceDescription.Name.Contains("Kontakt zu Kooperations"));
}
#endregion
#region 4.2 Kriseninterventionen
var count42 = serviceRecordsImBerichtsjahr.Count(s => s.ServiceDescription.Name.Contains("Krisenintervention"));
if (count42 > 0)
{
anz42 += count42;
sb42.AppendLine(String.Format("{0}, {1}", customer.Person.LastName, customer.Person.FirstName));
}
#endregion
#region 4.3.1 Ärztliche Versorgung
if (istInGrundversorgung)
{
if (HatBoolVarfieldDef(customer, 62))
{
anz4311++;
}
else if (HatBoolVarfieldDef(customer, 63))
{
anz4312++;
}
else if (HatBoolVarfieldDef(customer, 64))
{
anz4313++;
}
else if (HatBoolVarfieldDef(customer, 65))
{
anz4314++;
}
else if (HatBoolVarfieldDef(customer, 75))
{
anz4315++;
}
else if (HatBoolVarfieldDef(customer, 76))
{
anz4316++;
}
}
#endregion
#region 4.3.2 Zusammenarbeit mit nicht psychiatrischen Hilfen anderer System
if (istInGrundversorgung)
{
if (HatBoolVarfieldDef(customer, 77))
{
anz4321++;
}
else if (HatBoolVarfieldDef(customer, 78))
{
anz4322++;
}
else if (HatBoolVarfieldDef(customer, 79))
{
anz4323++;
}
else if (HatBoolVarfieldDef(customer, 80))
{
anz4324++;
}
}
#endregion
#region 4.3.3 Zusammenarbeit mit weiteren Hilfen
if (istInGrundversorgung)
{
if (HatBoolVarfieldDef(customer, 81))
{
anz4331++;
}
else if (HatBoolVarfieldDef(customer, 82))
{
anz4332++;
}
else if (HatBoolVarfieldDef(customer, 83))
{
anz4333++;
}
else if (HatBoolVarfieldDef(customer, 84))
{
anz4334++;
}
else if (HatBoolVarfieldDef(customer, 85))
{
anz4335++;
}
else if (HatBoolVarfieldDef(customer, 86))
{
anz4336++;
}
else if (HatBoolVarfieldDef(customer, 87))
{
anz4337++;
}
else if (HatBoolVarfieldDef(customer, 88))
{
anz4338++;
}
else if (HatBoolVarfieldDef(customer, 89))
{
anz4339++;
}
}
#endregion
#region 4.4 Beendigung der Betreuung
if (customer.TerminationDate.HasValue && customer.TerminationDate.Value >= reportDate && customer.TerminationDate.Value < reportDate.AddYears(1) && customer.TerminationReason != null)
{
var reason = customer.TerminationReason.Value.ToLower().Trim();
if (reason.Contains("beendigung") && reason.Contains("ohne weiter") && reason.Contains("fachdienst"))
{
anz441++;
}
else if (reason.Contains("beendigung") && reason.Contains("anderen") && reason.Contains("fachdienst"))
{
anz442++;
}
else if (reason.Contains("beendigung der grundversorgung"))
{
anz443++;
}
else if (reason.Contains("einseitige") && reason.Contains("beendigung durch klient"))
{
anz444++;
}
else if (reason.Contains("einseitige") && reason.Contains("endigung durch dienst"))
{
anz445++;
}
else if (reason.Contains("beendigung") && reason.Contains("ende") && reason.Contains("zuständigkeit"))
{
anz446++;
}
else if (reason.Contains("verstorben") && reason.Contains("ohne suizid"))
{
anz447++;
}
else if (reason.Contains("durch suizid"))
{
anz448++;
}
else
{
anz449++;
}
}
#endregion
#region 5.1 Alter
if (istInGrundversorgung)
{
var geb = customer.Person.DateOfBirth;
if (geb == null)
{
if (geschlecht == Sex.Male)
anzAlterUnbekanntM++;
else if (geschlecht == Sex.Female)
anzAlterUnbekanntW++;
else
anzAlterUnbekanntD++;
AlterUnbekanntSb.AppendLine(String.Format("{0}, {1}", customer.Person.LastName, customer.Person.FirstName));
}
else if (geb.Value < DateTime.Now)
{
var alter = (new DateTime(1, 1, 1) + (DateTime.Now - geb.Value)).Year - 1;
if (geschlecht == Sex.Male)
{
if (alter < 28)
anz18bis27M++;
else if (alter < 41)
anz28bis40M++;
else if (alter < 51)
anz41bis50M++;
else if (alter < 61)
anz51bis60M++;
else if (alter > 60)
anzUeber60M++;
}
else if (geschlecht == Sex.Female)
{
if (alter < 28)
anz18bis27W++;
else if (alter < 41)
anz28bis40W++;
else if (alter < 51)
anz41bis50W++;
else if (alter < 61)
anz51bis60W++;
else if (alter > 60)
anzUeber60W++;
}
else
{
if (alter < 28)
anz18bis27D++;
else if (alter < 41)
anz28bis40D++;
else if (alter < 51)
anz41bis50D++;
else if (alter < 61)
anz51bis60D++;
else if (alter > 60)
anzUeber60D++;
}
}
}
#endregion
#region 5.2 Familienstand
if (istInGrundversorgung)
{
switch (customer.Person.FamilyStatus)
{
case FamilyStatus.Single:
anzLedig++;
break;
case FamilyStatus.Widowed:
anzVerwitwert++;
break;
case FamilyStatus.Divorced:
anzGeschieden++;
break;
case FamilyStatus.Married:
anzVerheiratet++;
break;
case FamilyStatus.PartnerDivorced:
anzGetrennt++;
break;
case FamilyStatus.Partner:
anzPartner++;
break;
case FamilyStatus.PartnerMarried:
anzPartnerMarried++;
break;
case FamilyStatus.Entpartnert:
anzEntpartnert++;
break;
case FamilyStatus.PartnerDead:
anzPartnerDead++;
break;
default:
anzFamlienstandUnbekannt++;
familienStandUnbekanntSb.AppendLine(String.Format("{0}, {1}", customer.Person.LastName, customer.Person.FirstName));
break;
}
}
#endregion
#region 5.3 Betreute Personen mit minderjährigem Kind oder Kindern
if (istInGrundversorgung)
{
var vv53 = customer.VarFieldValueList.FirstOrDefault(v => v.VarFieldDefOid == 61);
if (vv53 != null)
{
var type = Type.GetType(vv53.TypeName);
var label = Utils.XMLDeserializeFromString(vv53.SerializedValue, type).ToString();
switch (label)
{
case "Ja":
anz531++;
break;
case "Kein Kind":
anz532++;
break;
default:
anz533++;
sb53Unbekannt.AppendLine(String.Format("{0}, {1}", customer.Person.LastName, customer.Person.FirstName));
break;
}
}
else
{
anz533++;
sb53Unbekannt.AppendLine(String.Format("{0}, {1}", customer.Person.LastName, customer.Person.FirstName));
}
}
#endregion
#region 5.4 Lebensverhältnisse
if (istInGrundversorgung)
{
var lvvalue = customer.VarFieldValueList.FirstOrDefault(v => v.VarFieldDefOid == 7);
//lebt alleine
//lebt mit Eltern/Kindern/Verwandten
//lebt in priv. Wohngemeinschaft
//lebt mit (Ehe-)Partner/in
//lebt in betreuter Wohnform
//Lebensverhältnisse unbekannt
//lebt alleine;lebt mit PartnerIn;lebt alleinerziehend mit minderjährigen Kind(ern);lebt mit PartnerIn und ggf. minderjährigen Kind(ern);lebt mit Eltern;lebt mit Angehörigen;lebt in priv. Wohngemeinschaft;lebt in betreuter Wohnform;ohne festen Wohnsitz;Lebensverhältnisse unbekannt;Sonstiges
if (lvvalue != null)
{
var type = Type.GetType(lvvalue.TypeName);
var label = Utils.XMLDeserializeFromString(lvvalue.SerializedValue, type).ToString();
switch (label)
{
case "lebt alleine":
anzAlleinlebend++;
break;
case "lebt mit PartnerIn":
anzLebtMitPartnerin++;
break;
case "lebt alleinerziehend mit minderjährigen Kind(ern)":
anzAlleinerziehendMitMinderjaehrigenKindern++;
break;
case "lebt mit PartnerIn und ggf. minderjährigen Kind(ern)":
anzMitPartnerLebendMitGgfMinderjaehrigenKindern++;
break;
case "lebt mit (Ehe-)Partner/in":
anzMitPartnerLebendMitGgfMinderjaehrigenKindern++;
break;
case "lebt mit Eltern":
anzLebtMitEltern++;
break;
case "lebt mit Eltern/Kindern/Verwandten":
anzLebtMitEltern++;
break;
case "lebt mit Angehörigen":
anzLebtMitAngehoerigen++;
break;
case "lebt in priv. Wohngemeinschaft":
anzInPrivaterWGLebend++;
break;
case "lebt in betreuter Wohnform":
anzInBeWoLebend++;
break;
case "ohne festen Wohnsitz":
anzOhneFestenWohnsitz++;
break;
case "Sonstiges":
anzLebensverhaeltnisSonstiges++;
break;
default:
anzLebensverhaeltnisUnbekannt++;
LebensverhaltnisUnbekanntSb.AppendLine(String.Format("{0}, {1}", customer.Person.LastName, customer.Person.FirstName));
break;
}
}
else
{
anzLebensverhaeltnisUnbekannt++;
LebensverhaltnisUnbekanntSb.AppendLine(String.Format("{0}, {1}", customer.Person.LastName, customer.Person.FirstName));
}
}
#endregion
#region 5.5 Einkommen
if (istInGrundversorgung)
{
if (HatBoolVarfieldDef(customer, 42))
{
anzUnterhaltDurchEhepartner++;
}
else if (HatBoolVarfieldDef(customer, 39))
{
anzErwerbsBerufstaetig++;
}
else if (HatBoolVarfieldDef(customer, 40))
{
anzGelegenheitsarbeiten++;
}
else if (HatBoolVarfieldDef(customer, 41))
{
anzUnterhaltDurchFamilie++;
}
else if (HatBoolVarfieldDef(customer, 49))
{
anzErwerbsBerufsunfaehigkeitsrente++;
}
else if (HatBoolVarfieldDef(customer, 43))
{
anzALGI++;
}
else if (HatBoolVarfieldDef(customer, 50))
{
anzALGII++;
}
else if (HatBoolVarfieldDef(customer, 45))
{
anzKrankengeld++;
}
else if (HatBoolVarfieldDef(customer, 46))
{
anzAltersrentePensionWitwenrente++;
}
else if (HatBoolVarfieldDef(customer, 44))
{
anzGrundsicherungNachSGBXII++;
}
else if (HatBoolVarfieldDef(customer, 90))
{
anzEigenesVermoegenErsparnisse++;
}
else if (HatBoolVarfieldDef(customer, 91))
{
anzUebergangsgeld++;
}
else if (HatBoolVarfieldDef(customer, 92))
{
anzWfbM++;
}
else if (HatBoolVarfieldDef(customer, 51))
{
anzEinkommenSonstiges++;
}
else
{
anzEinkommenUnbekannt++;
EinkommenUnbekanntSb.AppendLine(String.Format("{0}, {1}", customer.Person.LastName, customer.Person.FirstName));
}
}
#endregion
#region 5.6 Diagnose
if (istInGrundversorgung)
{
bool hasDiagnose = JahresauswertungHelper.AddDiagnoseZuDict3(customer, diagnose2Anzahl);
if (!hasDiagnose)
{
sbDiagnoseUnbekannt.AppendLine(String.Format("{0}, {1}", customer.Person.LastName, customer.Person.FirstName));
}
}
#endregion
#region 5.7 Komorbität
if (istInGrundversorgung)
{
foreach (var v2o in customer.ValueList)
{
if (v2o.Entry.Type == ValueListEntryType.DisabilityType)
{
if (v2o.Entry.Value.Contains("körperlich"))
{
anz571++;
}
else if (v2o.Entry.Value.Contains("neurologisch"))
{
anz572++;
}
else if (v2o.Entry.Value.Contains("Sucht"))
{
anz573++;
}
else if (v2o.Entry.Value.Contains("Intelligenz"))
{
anz574++;
}
}
}
}
#endregion
}
}
// 3.1
cellGesamtWLabel.Text = string.Format("{0}", anz311W);
cellGesamtMLabel.Text = string.Format("{0}", anz311M);
cellGesamtDLabel.Text = string.Format("{0}", anz311D);
cellGesamtMigrationWLabel.Text = string.Format("{0}", anz312W);
cellGesamtMigrationMLabel.Text = string.Format("{0}", anz312M);
cellGesamtMigrationDLabel.Text = string.Format("{0}", anz312D);
cellGesamtFluchtWLabel.Text = string.Format("{0}", anz313W);
cellGesamtFluchtMLabel.Text = string.Format("{0}", anz313M);
cellGesamtFluchtDLabel.Text = string.Format("{0}", anz313D);
cellGesamtGesamtLabel.Text = string.Format("{0}", anz311W + anz311M + anz311D);
cellGesamtMigrationGesamtLabel.Text = string.Format("{0}", anz312W + anz312M + anz312D);
cellGesamtFluchtGesamtLabel.Text = string.Format("{0}", anz313W + anz313M + anz313D);
//3.2
cellAnzahl321.Text = string.Format("{0}", anz321);
cellAnzahl322.Text = string.Format("{0}", anz322);
cellAnzahl323.Text = string.Format("{0}", anz323);
cellAnzahl32Gesamt.Text = string.Format("{0}", anz321 + anz322 + anz323);
//3.3
anzBis3Monate1Bis4KLabel.Text = string.Format("{0}", anzBis3Monate1Bis4Kontakte);
anzBis3Monate1Bis4KLabel.Text += "\n" + anzBis3Monate1Bis4KontakteSb.ToString();
anzBis3Monate5Bis10KLabel.Text = string.Format("{0}", anzBis3Monate5Bis10Kontakte);
anzBis3Monate5Bis10KLabel.Text += "\n" + anzBis3Monate5Bis10KontakteSb.ToString();
anzBis3Monate11Bis20KLabel.Text = string.Format("{0}", anzBis3Monate11Bis20Kontakte);
anzBis3Monate11Bis20KLabel.Text += "\n" + anzBis3Monate11Bis20KontakteSb.ToString();
anzBis3Monate21Bis40KLabel.Text = string.Format("{0}", anzBis3Monate21Bis40Kontakte);
anzBis3Monate21Bis40KLabel.Text += "\n" + anzBis3Monate21Bis40KontakteSb.ToString();
anzBis3MonateUeber40KLabel.Text = string.Format("{0}", anzBis3Monate40PlusKontakte);
anzBis3MonateUeber40KLabel.Text += "\n" + anzBis3Monate40PlusKontakteSb.ToString();
anzBis3MonateSummeLabel.Text = string.Format("{0}", anzBis3Monate1Bis4Kontakte + anzBis3Monate5Bis10Kontakte + +anzBis3Monate11Bis20Kontakte + anzBis3Monate21Bis40Kontakte + anzBis3Monate40PlusKontakte);
anz3Bis6Monate1Bis4KLabel.Text = string.Format("{0}", anz3Bis6Monate1Bis4Kontakte);
anz3Bis6Monate1Bis4KLabel.Text += "\n" + anz3Bis6Monate1Bis4KontakteSb.ToString();
anz3Bis6Monate5Bis10KLabel.Text = string.Format("{0}", anz3Bis6Monate5Bis10Kontakte);
anz3Bis6Monate5Bis10KLabel.Text += "\n" + anz3Bis6Monate5Bis10KontakteSb.ToString();
anz3Bis6Monate11Bis20KLabel.Text = string.Format("{0}", anz3Bis6Monate11Bis20Kontakte);
anz3Bis6Monate11Bis20KLabel.Text += "\n" + anz3Bis6Monate11Bis20KontakteSb.ToString();
anz3Bis6Monate21Bis40KLabel.Text = string.Format("{0}", anz3Bis6Monate21Bis40Kontakte);
anz3Bis6Monate21Bis40KLabel.Text += "\n" + anz3Bis6Monate21Bis40KontakteSb.ToString();
anz3Bis6MonateUeber40KLabel.Text = string.Format("{0}", anz3Bis6Monate40PlusKontakte);
anz3Bis6MonateUeber40KLabel.Text += "\n" + anz3Bis6Monate40PlusKontakteSb.ToString();
anz3Bis6MonateSummeLabel.Text = string.Format("{0}", anz3Bis6Monate1Bis4Kontakte + anz3Bis6Monate5Bis10Kontakte + +anz3Bis6Monate11Bis20Kontakte + anz3Bis6Monate21Bis40Kontakte + anz3Bis6Monate40PlusKontakte);
anz7Bis12Monate1Bis4KLabel.Text = string.Format("{0}", anz7Bis12Monate1Bis4Kontakte);
anz7Bis12Monate1Bis4KLabel.Text += "\n" + anz7Bis12Monate1Bis4KontakteSb.ToString();
anz7Bis12Monate5Bis10KLabel.Text = string.Format("{0}", anz7Bis12Monate5Bis10Kontakte);
anz7Bis12Monate5Bis10KLabel.Text += "\n" + anz7Bis12Monate5Bis10KontakteSb.ToString();
anz7Bis12Monate11Bis20KLabel.Text = string.Format("{0}", anz7Bis12Monate11Bis20Kontakte);
anz7Bis12Monate11Bis20KLabel.Text += "\n" + anz7Bis12Monate11Bis20KontakteSb.ToString();
anz7Bis12Monate21Bis40KLabel.Text = string.Format("{0}", anz7Bis12Monate21Bis40Kontakte);
anz7Bis12Monate21Bis40KLabel.Text += "\n" + anz7Bis12Monate21Bis40KontakteSb.ToString();
anz7Bis12MonateUeber40KLabel.Text = string.Format("{0}", anz7Bis12Monate40PlusKontakte);
anz7Bis12MonateUeber40KLabel.Text += "\n" + anz7Bis12Monate40PlusKontakteSb.ToString();
anz7Bis12MonateSummeLabel.Text = string.Format("{0}", anz7Bis12Monate1Bis4Kontakte + anz7Bis12Monate5Bis10Kontakte + +anz7Bis12Monate11Bis20Kontakte + anz7Bis12Monate21Bis40Kontakte + anz7Bis12Monate40PlusKontakte);
var summe1Bis4 = anzBis3Monate1Bis4Kontakte + anz3Bis6Monate1Bis4Kontakte + anz7Bis12Monate1Bis4Kontakte;
var summe5Bis10 = anzBis3Monate5Bis10Kontakte + anz3Bis6Monate5Bis10Kontakte + anz7Bis12Monate5Bis10Kontakte;
var summe11Bis20 = anzBis3Monate11Bis20Kontakte + anz3Bis6Monate11Bis20Kontakte + anz7Bis12Monate11Bis20Kontakte;
var summe21Bis40 = anzBis3Monate21Bis40Kontakte + anz3Bis6Monate21Bis40Kontakte + anz7Bis12Monate21Bis40Kontakte;
var summe40Plus = anzBis3Monate40PlusKontakte + anz3Bis6Monate40PlusKontakte + anz7Bis12Monate40PlusKontakte;
anz1Bis4KSummeLabel.Text = string.Format("{0}", summe1Bis4);
anz5Bis10KSummeLabel.Text = string.Format("{0}", summe5Bis10);
anz11Bis20KSummeLabel.Text = string.Format("{0}", summe11Bis20);
anz21Bis40KSummeLabel.Text = string.Format("{0}", summe21Bis40);
anzUeber40KSummeLabel.Text = string.Format("{0}", summe40Plus);
cellAnzahl33Gesamt.Text = string.Format("{0}", summe1Bis4 + summe5Bis10 + summe11Bis20 + summe21Bis40 + summe40Plus);
//anzDauerLaengBetreuungSummeLabel.Text = string.Format("{0}", anzBis3MonateBetreuungSumme + anz3Bis6MonateBetreuungSumme + anz7Bis12MonateBetreuungSumme);
//anzDauerLaengBetreuungSummeAus412Label.Text = string.Format("{0}", anzDirektGesamt);
if (sbOhne33.Length > 0)
{
lblMissing23.Text = "Personen ohne Kontakte: " +
sbOhne33.ToString().Trim();
}
// 3.4
cell341W.Text = string.Format("{0}", anz341W);
cell341M.Text = string.Format("{0}", anz341M);
cell341D.Text = string.Format("{0}", anz341D);
cell341Gesamt.Text = string.Format("{0}", anz341W + anz341M + anz341D);
cell342W.Text = string.Format("{0}", anz342W);
cell342M.Text = string.Format("{0}", anz342M);
cell342D.Text = string.Format("{0}", anz342D);
cell342Gesamt.Text = string.Format("{0}", anz342W + anz342M + anz342D);
// 3.5
anzZuweisung1Label.Text = string.Format("{0}", anz351);
anzZuweisung2Label.Text = string.Format("{0}", anz352);
anzZuweisung3Label.Text = string.Format("{0}", anz353);
anzZuweisung4Label.Text = string.Format("{0}", anz354);
anzZuweisung5Label.Text = string.Format("{0}", anz355);
anzZuweisung6Label.Text = string.Format("{0}", anz356);
anzZuweisung7Label.Text = string.Format("{0}", anz357);
anzZuweisung8Label.Text = string.Format("{0}", anz358);
anzZuweisung9Label.Text = string.Format("{0}", anz359);
anzZuweisung10Label.Text = string.Format("{0}", anz3510);
anzZuweisung12Label.Text = string.Format("{0}", anz3511);
anzZuweisung11Label.Text = string.Format("{0}", anz3512);
anzZuweisung13Label.Text = string.Format("{0}", anz3513);
anzZuweisung14Label.Text = string.Format("{0}", anz3514);
anzZuweisung15Label.Text = string.Format("{0}", anz3515);
anzZuweisung16Label.Text = string.Format("{0}", anz3516);
anzZuweisung17Label.Text = string.Format("{0}", anz3517);
anzZuweisung18Label.Text = string.Format("{0}", anz3518);
anzZuweisung19Label.Text = string.Format("{0}", anz3519);
anzZuweisung20Label.Text = string.Format("{0}", anz3520);
anzZuweisung21Label.Text = string.Format("{0}", anz3521);
anzZuweisung22Label.Text = string.Format("{0}", anz3522);
anzZuweisung23Label.Text = string.Format("{0}", anz3523);
cell35Gesamt.Text = string.Format("{0}", anz351 +
anz352 +
anz353 +
anz354 +
anz355 +
anz356 +
anz357 +
anz358 +
anz359 +
anz3510 +
anz3511 +
anz3512 +
anz3513 +
anz3514 +
anz3515 +
anz3516 +
anz3517 +
anz3518 +
anz3519 +
anz3520 +
anz3521 +
anz3522 +
anz3523);
// 3.6.1
cell361.Text = string.Format("{0}", anz361);
// 3.6.2
cell3621.Text = string.Format("{0}", anz3621);
cell3622.Text = string.Format("{0}", anz3622);
cell3623.Text = string.Format("{0}", anz3623);
cell3624.Text = string.Format("{0}", anz3624);
cell3625.Text = string.Format("{0}", anz3625);
cell3626.Text = string.Format("{0}", anz3626);
cell3627.Text = string.Format("{0}", anz3627);
// 4.1
cell411.Text = string.Format("{0}", anz411);
cell412.Text = string.Format("{0}", anz412);
cell413.Text = string.Format("{0}", anz413);
cell414.Text = string.Format("{0}", anz414);
cell415.Text = string.Format("{0}", anz415);
cell416.Text = string.Format("{0}", anz416);
cell417.Text = string.Format("{0}", anz417);
cell418.Text = string.Format("{0}", anz418);
cell419.Text = string.Format("{0}", anz419);
cell41Gesamt.Text = string.Format("{0}", anz411 +
anz412 +
anz413 +
anz414 +
anz415 +
anz416 +
anz417 +
anz418 +
anz419);
// 4.2
cell42.Text = string.Format("{0}", anz42);
// 4.3.1
cell4311.Text = string.Format("{0}", anz4311);
cell4312.Text = string.Format("{0}", anz4312);
cell4313.Text = string.Format("{0}", anz4313);
cell4314.Text = string.Format("{0}", anz4314);
cell4315.Text = string.Format("{0}", anz4315);
cell4316.Text = string.Format("{0}", anz4316);
cell431Gesamt.Text = string.Format("{0}", anz4311 +
anz4312 +
anz4313 +
anz4314 +
anz4315 +
anz4316);
// 4.3.2
cell4321.Text = string.Format("{0}", anz4321);
cell4322.Text = string.Format("{0}", anz4322);
cell4323.Text = string.Format("{0}", anz4323);
cell4324.Text = string.Format("{0}", anz4324);
// 4.3.3
cell4331.Text = string.Format("{0}", anz4331);
cell4332.Text = string.Format("{0}", anz4332);
cell4333.Text = string.Format("{0}", anz4333);
cell4334.Text = string.Format("{0}", anz4334);
cell4335.Text = string.Format("{0}", anz4335);
cell4336.Text = string.Format("{0}", anz4336);
cell4337.Text = string.Format("{0}", anz4337);
cell4338.Text = string.Format("{0}", anz4338);
cell4339.Text = string.Format("{0}", anz4339);
// 4.4
cell441.Text = string.Format("{0}", anz441);
cell442.Text = string.Format("{0}", anz442);
cell443.Text = string.Format("{0}", anz443);
cell444.Text = string.Format("{0}", anz444);
cell445.Text = string.Format("{0}", anz445);
cell446.Text = string.Format("{0}", anz446);
cell447.Text = string.Format("{0}", anz447);
cell448.Text = string.Format("{0}", anz448);
cell449.Text = string.Format("{0}", anz449);
cell44Gesamt.Text = string.Format("{0}", anz441 +
anz442 +
anz443 +
anz444 +
anz445 +
anz446 +
anz447 +
anz448 +
anz449);
// 5.1
anzAlterAb18MLabel.Text = string.Format("{0}", anz18bis27M);
anzAlterAb18WLabel.Text = string.Format("{0}", anz18bis27W);
anzAlterAb18DLabel.Text = string.Format("{0}", anz18bis27D);
anzAlterAb18SummeLabel.Text = string.Format("{0}", anz18bis27W + anz18bis27M + anz18bis27D);
anzAlterAb28MLabel.Text = string.Format("{0}", anz28bis40M);
anzAlterAb28WLabel.Text = string.Format("{0}", anz28bis40W);
anzAlterAb28DLabel.Text = string.Format("{0}", anz28bis40D);
anzAlterAb28SummeLabel.Text = string.Format("{0}", anz28bis40W + anz28bis40M + anz28bis40D);
anzAlterAb41MLabel.Text = string.Format("{0}", anz41bis50M);
anzAlterAb41WLabel.Text = string.Format("{0}", anz41bis50W);
anzAlterAb41DLabel.Text = string.Format("{0}", anz41bis50D);
anzAlterAb41SummeLabel.Text = string.Format("{0}", anz41bis50W + anz41bis50M + anz41bis50D);
anzAlterAb51MLabel.Text = string.Format("{0}", anz51bis60M);
anzAlterAb51WLabel.Text = string.Format("{0}", anz51bis60W);
anzAlterAb51DLabel.Text = string.Format("{0}", anz51bis60D);
anzAlterAb51SummeLabel.Text = string.Format("{0}", anz51bis60W + anz51bis60M + anz51bis60D);
anzAlterAb60MLabel.Text = string.Format("{0}", anzUeber60M);
anzAlterAb60WLabel.Text = string.Format("{0}", anzUeber60W);
anzAlterAb60DLabel.Text = string.Format("{0}", anzUeber60D);
anzAlterAb60SummeLabel.Text = string.Format("{0}", anzUeber60W + anzUeber60M + anzUeber60D);
anzAlterUnbekanntMLabel.Text = string.Format("{0}", anzAlterUnbekanntM);
anzAlterUnbekanntWLabel.Text = string.Format("{0}", anzAlterUnbekanntW);
anzAlterUnbekanntDLabel.Text = string.Format("{0}", anzAlterUnbekanntD);
anzAlterUnbekanntSummeLabel.Text = string.Format("{0}", anzAlterUnbekanntW + anzAlterUnbekanntM + anzAlterUnbekanntD);
var alterSummeW = anz18bis27W +
anz28bis40W +
anz41bis50W +
anz51bis60W +
anzUeber60W +
anzAlterUnbekanntW;
anzSummeAlterWLabel.Text = string.Format("{0}", alterSummeW);
var alterSummeM = anz18bis27M +
anz28bis40M +
anz41bis50M +
anz51bis60M +
anzUeber60M +
anzAlterUnbekanntM;
anzSummeAlterMLabel.Text = string.Format("{0}", alterSummeM);
var alterSummeD = anz18bis27D +
anz28bis40D +
anz41bis50D +
anz51bis60D +
anzUeber60D +
anzAlterUnbekanntD;
anzSummeAlterDLabel.Text = string.Format("{0}", alterSummeD);
anzAlterSummeLabel.Text = string.Format("{0}", alterSummeW + alterSummeM + alterSummeD);
AlterUnbekanntLabel.Text = AlterUnbekanntSb.ToString().Trim();
// 5.2
anzLedigLabel.Text = string.Format("{0}", anzLedig);
anzVerwitwetLabel.Text = string.Format("{0}", anzVerwitwert);
anzGeschiedenLabel.Text = string.Format("{0}", anzGeschieden);
anzVerheiratetLabel.Text = string.Format("{0}", anzVerheiratet);
anzGetrenntLabel.Text = string.Format("{0}", anzGetrennt);
//anzPartnerschaftLabel.Text = string.Format("{0}", anzPartner);
//anzVerpartnertLabel.Text = string.Format("{0}", anzPartnerMarried);
//anzEntpartnertLabel.Text = string.Format("{0}", anzEntpartnert);
//anzPartnerhinterbliebenLabel.Text = string.Format("{0}", anzPartnerDead);
anzFamilienstatusUnbekanntLabel.Text = string.Format("{0}", anzPartner + anzPartnerMarried + anzEntpartnert + anzPartnerDead + anzFamlienstandUnbekannt);
anzFamilienstandSummeLabel.Text = string.Format("{0}", anzLedig + anzVerheiratet + anzGeschieden + anzVerwitwert + anzGetrennt +
+ anzPartner + anzPartnerMarried + anzEntpartnert + anzPartnerDead + anzFamlienstandUnbekannt);
familienstandUnbekanntLabel.Text = familienStandUnbekanntSb.ToString().Trim();
// 5.3
cell531.Text = string.Format("{0}", anz531);
cell532.Text = string.Format("{0}", anz532);
cell533.Text = string.Format("{0}", anz533);
cell53Gesamt.Text = string.Format("{0}", anz531 + anz532 + anz533);
// 5.4
cell541.Text = string.Format("{0}", anzAlleinlebend);
cell542.Text = string.Format("{0}", anzLebtMitPartnerin);
cell543.Text = string.Format("{0}", anzAlleinerziehendMitMinderjaehrigenKindern);
cell544.Text = string.Format("{0}", anzMitPartnerLebendMitGgfMinderjaehrigenKindern);
cell545.Text = string.Format("{0}", anzLebtMitEltern);
cell546.Text = string.Format("{0}", anzLebtMitAngehoerigen);
cell547.Text = string.Format("{0}", anzInPrivaterWGLebend);
cell548.Text = string.Format("{0}", anzInBeWoLebend);
cell549.Text = string.Format("{0}", anzOhneFestenWohnsitz);
cell5410.Text = string.Format("{0}", anzLebensverhaeltnisUnbekannt);
cell5411.Text = string.Format("{0}", anzLebensverhaeltnisSonstiges);
cell54Gesamt.Text = string.Format("{0}", anzAlleinlebend +
anzLebtMitPartnerin +
anzAlleinerziehendMitMinderjaehrigenKindern +
anzMitPartnerLebendMitGgfMinderjaehrigenKindern +
anzLebtMitEltern +
anzLebtMitAngehoerigen +
anzInPrivaterWGLebend +
anzInBeWoLebend +
anzOhneFestenWohnsitz +
anzLebensverhaeltnisUnbekannt +
anzLebensverhaeltnisSonstiges);
lblLebensverhaeltnisUnbekannt.Text = LebensverhaltnisUnbekanntSb.ToString().Trim();
// 5.5
cell551.Text = string.Format("{0}", anzUnterhaltDurchEhepartner);
cell552.Text = string.Format("{0}", anzErwerbsBerufstaetig);
cell553.Text = string.Format("{0}", anzGelegenheitsarbeiten);
cell554.Text = string.Format("{0}", anzUnterhaltDurchFamilie);
cell555.Text = string.Format("{0}", anzErwerbsBerufsunfaehigkeitsrente);
cell556.Text = string.Format("{0}", anzALGI);
cell557.Text = string.Format("{0}", anzALGII);
cell558.Text = string.Format("{0}", anzKrankengeld);
cell559.Text = string.Format("{0}", anzAltersrentePensionWitwenrente);
cell5510.Text = string.Format("{0}", anzGrundsicherungNachSGBXII);
cell5511.Text = string.Format("{0}", anzEigenesVermoegenErsparnisse);
cell5512.Text = string.Format("{0}", anzUebergangsgeld);
cell5513.Text = string.Format("{0}", anzWfbM);
cell5514.Text = string.Format("{0}", anzEinkommenUnbekannt);
cell5515.Text = string.Format("{0}", anzEinkommenSonstiges);
cell55Gesamt.Text = string.Format("{0}", anzUnterhaltDurchEhepartner +
anzErwerbsBerufstaetig +
anzGelegenheitsarbeiten +
anzUnterhaltDurchFamilie +
anzErwerbsBerufsunfaehigkeitsrente +
anzALGI +
anzALGII +
anzKrankengeld +
anzAltersrentePensionWitwenrente +
anzGrundsicherungNachSGBXII +
anzEigenesVermoegenErsparnisse +
anzUebergangsgeld +
anzWfbM +
anzEinkommenUnbekannt +
anzEinkommenSonstiges);
EinkommenUnbekanntLabel.Text = EinkommenUnbekanntSb.ToString().Trim();
// 5.6
JahresauswertungHelper.CreateDiagnoseTable3(tableDiagnosen, diagnose2Anzahl, sbDiagnoseUnbekannt.ToString());
// 5.7
cell571.Text = string.Format("{0}", anz571);
cell572.Text = string.Format("{0}", anz572);
cell573.Text = string.Format("{0}", anz573);
cell574.Text = string.Format("{0}", anz574);
}
private bool HatFluchterfahrung(Customer customer, Dictionary<long, VarFieldDef> oid2VarfieldDef)
{
return HatBoolVarfieldDef(customer, 67);
}
private bool HatBoolVarfieldDef(Customer customer, long defOid)
{
var vv = customer.VarFieldValueList.FirstOrDefault(v => v.VarFieldDefOid == defOid);
if (vv != null)
{
var type = Type.GetType(vv.TypeName);
var label = Utils.XMLDeserializeFromString(vv.SerializedValue, type).ToString();
if (!String.IsNullOrEmpty(label) && label.ToLower() == "true")
{
return true;
}
}
return false;
}
private static bool IstSchaltjahr(int jahr)
{
return jahr%4 == 0 && jahr%100 != 0 || jahr%4 == 0 && jahr%400 == 0;
}
}
}