Files
BeWoPlaner/Dakota/DakotaFile.cs

292 lines
14 KiB
C#

using BeWo.Data.Entities;
using BS.Shared.DataContracts;
using Dakota.Models;
using Dakota.Models.Blocke;
using Dakota.Models.Infos;
using Dakota.Models.Nachrichten;
using Dakota.Models.Segmente;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Dakota
{
/// <summary>
/// Nutzdatendatei mit Logik
/// </summary>
internal class DakotaFile : Nachricht
{
internal BlockFile Nutzdatendatei { get; private set; }
// Rene26 Comment
//// UNB
//internal SegmentUNB SegmentUNB => SozioTherapieEinzelnachweis.UNB;
//// Block
//internal
//internal BlockKrankenkarteVerordnung BlockKrankenkarteVerordnung => SozioTherapieEinzelnachweis.BlockKrankenkarteVerordnung;
//// SLGA
//internal SegmentUNH BlockSLGAUNH => BlockKrankenkarteVerordnung.SLGAUNH;
//internal NachrichtSLGA2 BlockSLGANachricht => BlockKrankenkarteVerordnung.SLGANachricht2;
//internal SegmentUNT BlockSLGAUNT => BlockKrankenkarteVerordnung.SLGAUNT;
//// SLLA
//internal SegmentUNH BlockSLLAUNH => BlockKrankenkarteVerordnung.SLLAUNH;
//internal NachrichtSLLA2 BlockSLLANachricht => BlockKrankenkarteVerordnung.SLLANachricht2;
//internal SegmentUNT BlockSLLAUNT => BlockKrankenkarteVerordnung.SLLAUNT;
//// UNZ
//internal SegmentUNZ SegmentUNZ => SozioTherapieEinzelnachweis.UNZ;
internal DakotaFile()
{
Nutzdatendatei = new BlockFile();
}
internal void Apply(InfoFile info)
{
Nutzdatendatei.Apply(info);
}
//internal void AddInvoiceItem(DakotaInvoiceItemInfo invoiceInfo)
//{
// var kostentrager = "123456789";
// var kostentragerblock = GetBlockKostenträger(kostentrager, invoiceInfo);
// var krankenversichten = "987654321";
// var krankenversichtenblock = GetBlockKrankenkarte(kostentragerblock, krankenversichten, invoiceInfo);
// AddInvoiceItemIntoBlock(krankenversichtenblock, invoiceInfo);
//}
//internal void AddInvoiceItemIntoBlock(BlockKrankenkarteVerordnung block, DakotaInvoiceItemInfo invoiceInfo)
//{
//}
//private BlockKostenträger GetBlockKostenträger(string kostentrager, DakotaInvoiceItemInfo invoiceInfo)
//{
// var kostentragerblock = Nutzdatendatei.BlockKostenträger.FirstOrDefault(block => block.IKKostenträger == kostentrager);
// if (kostentragerblock is null)
// {
// kostentragerblock = GenerateBlockKostentrager(invoiceInfo);
// Nutzdatendatei.BlockKostenträger.Add(kostentragerblock);
// }
// return kostentragerblock;
//}
//private BlockKrankenkarteVerordnung GetBlockKrankenkarte(BlockKostenträger blockkt, string kvkarte, DakotaInvoiceItemInfo invoiceInfo)
//{
// var krankenkartenBlock = blockkt.BlockKrankenkarteVerordnung.FirstOrDefault(block => block.IKKrankenkasseKVKarte == kvkarte);
// if (krankenkartenBlock is null)
// {
// krankenkartenBlock = GenerateBlockKrankenkarte(invoiceInfo);
// blockkt.BlockKrankenkarteVerordnung.Add(krankenkartenBlock);
// }
// return krankenkartenBlock;
//}
//private BlockKostenträger GenerateBlockKostentrager(DakotaInvoiceItemInfo invoiceinfo)
//{
// var block = new BlockKostenträger();
// var nachrefnum = ++AnzahlUNHCounter;
// block.SegmentUNH.Nachrichtenreferenznummer.SetValue(nachrefnum);
// block.SegmentUNH.NachrichtenTypKennung.SetValue("SLGA");
// block.SegmentUNH.Nachrichtenverionsnummer.SetValue("18");
// block.SegmentUNH.NachrichtenFreigabeNrDesTypes.SetValue("0");
// block.SegmentUNH.NachrichtenVerwaltendeOrganisation.SetValue("0");
// block.SegmentUNT.Nachrichtenreferenznummer.SetValue(nachrefnum);
// return block;
//}
//private BlockKrankenkarteVerordnung GenerateBlockKrankenkarte()
//{
// var block = new BlockKrankenkarteVerordnung();
// // Abrechnungsfalle
// AddBlockAbrechnungsfall(block, invoiceInfo);
// block.SegmentSLLAUNT.Nachrichtenreferenznummer.SetValue(nachrefnum2);
// return block;
//}
//private BlockAbrechnungsfall AddBlockAbrechnungsfall(BlockKrankenkarteVerordnung blockkvkarte, DakotaInvoiceItemInfo info)
//{
// var block = new BlockAbrechnungsfall();
// blockkvkarte.NachrichtSLLA.Abrechnungsfalle.Add(block);
// return block;
//}
//private void GenerateBlockSLGA(DakotaInfoFile info)
//{
// var nachrefnum = ++AnzahlUNHCounter;
//}
//private void GenerateBlockSLLA(DakotaInfoFile info)
//{
// AnzahlUNHCounter++;
// var nachrefnum = ++AnzahlUNHCounter;
// // Head
// //BlockSLLAUNH.Nachrichtenreferenznummer.SetFilledIntValue(nachrefnum, 5);
// //BlockSLLAUNH.NachrichtenTypKennung.SetValue("SLLA");
// //BlockSLLAUNH.Verionsnummer.SetValue("18");
// //BlockSLLAUNH.FreigabeNrDesTypes.SetValue("0");
// //BlockSLLAUNH.VerwaltendeOrganisation.SetValue("0");
// //// Body
// //// FKT Funktion
// //BlockSLLANachricht.SegmentSLLAFKT.Verarbeitungskennzeichen.SetValue(info.Verarbeitungskennzeichen.Value);
// //BlockSLLANachricht.SegmentSLLAFKT.IKLeistungserbringers.SetValue(info.IKLeistungserbringers);
// //BlockSLLANachricht.SegmentSLLAFKT.IKKostenträgers.SetValue(info.IKKostenträger);
// //BlockSLLANachricht.SegmentSLLAFKT.IKKrankenkasse.SetValue(info.IKKrankenkasse);
// ////BlockSLLANachricht.SegmentSLLAFKT.IKRechnungsstellers.SetValue(string.Empty);
// //// REC
// //BlockSLLANachricht.SegmentSLLAREC.SammelRechnungsnummer.SetValue(info.Rechnungsnummer);
// //BlockSLLANachricht.SegmentSLLAREC.EinzelRechnungsnummer.SetValue("0");
// //BlockSLLANachricht.SegmentSLLAREC.Datum.SetValue(info.Rechnungsdatum.ToString("yyyyMMdd"));
// //BlockSLLANachricht.SegmentSLLAREC.Rechnungsart.SetValue(info.Rechnungsart.Value);
// //// INV
// //// Information Versicherte
// //BlockSLLANachricht.SegmentSLLAINV.VersichertenNummer.SetValue(string.Empty);
// //BlockSLLANachricht.SegmentSLLAINV.Versichertenstatus.SetValue(string.Empty);
// //BlockSLLANachricht.SegmentSLLAINV.Beleginformation.SetValue("0");
// //BlockSLLANachricht.SegmentSLLAINV.Belegnummer.SetValue(string.Empty);
// //BlockSLLANachricht.SegmentSLLAINV.KennzeichenBesondereVersorgungsform.SetValue(string.Empty);
// //// URI
// //// Wird erst bei Korrekturen verwendet
// //// NAD
// //BlockSLLANachricht.SegmentSLLANAD.Nachname.SetValue(string.Empty);
// //BlockSLLANachricht.SegmentSLLANAD.Vorname.SetValue(string.Empty);
// //BlockSLLANachricht.SegmentSLLANAD.Geburtsdatum.SetValue(string.Empty);
// //BlockSLLANachricht.SegmentSLLANAD.StraßeNr.SetValue(string.Empty);
// //BlockSLLANachricht.SegmentSLLANAD.PLZ.SetValue(string.Empty);
// //BlockSLLANachricht.SegmentSLLANAD.Wohnort.SetValue(string.Empty);
// //BlockSLLANachricht.SegmentSLLANAD.Länderkennzeichen.SetValue(string.Empty);
// //// IMG
// //BlockSLLANachricht.SegmentSLLAIMG.Abrechnungsjahr.SetValue(string.Empty);
// //BlockSLLANachricht.SegmentSLLAIMG.Abrechnungsmonat.SetValue(string.Empty);
// //BlockSLLANachricht.SegmentSLLAIMG.Identifikationsmerkmal.SetValue(string.Empty);
// //var test = new List<object>();
// //var abrechnungspositionen = new List<InvoiceItemDC>();
// //foreach (var position in abrechnungspositionen)
// //{
// // var pos = new Abrechnungsposition();
// // // ENF
// // pos.SegmentSLLAENF.Identifikationsnummer.SetValue(string.Empty);
// // pos.SegmentSLLAENF.Abrechnungscode.SetValue("69");
// // pos.SegmentSLLAENF.Tarifkennzeichen.SetValue(string.Empty);
// // pos.SegmentSLLAENF.ArtLeistung.SetValue(string.Empty);
// // pos.SegmentSLLAENF.AnzahlMenge.SetValue(string.Empty);
// // pos.SegmentSLLAENF.EinzelbetragAbrechnungsposition.SetValue(string.Empty);
// // pos.SegmentSLLAENF.DatumLeistungserbringung.SetValue(string.Empty);
// // pos.SegmentSLLAENF.BetragZuzahlung.SetValue(string.Empty);
// // // SUT
// // pos.SegmentSLLASUT.GefahreneKilometer.SetValue(string.Empty);
// // pos.SegmentSLLASUT.Uhrzeit.SetValue(string.Empty);
// // pos.SegmentSLLASUT.UhrzeitBis.SetValue(string.Empty);
// // pos.SegmentSLLASUT.Dauer.SetValue(string.Empty);
// // pos.SegmentSLLASUT.VersorgungszeitraumVon.SetValue(string.Empty);
// // pos.SegmentSLLASUT.VersorgungszeitraumBis.SetValue(string.Empty);
// // // TXT
// // pos.SegmentSLLATXT.Text.SetValue(string.Empty);
// // // MWS
// // //pos.SegmentSLLAMWS.Mehrwertsteuersatz.SetValue(string.Empty);
// // //pos.SegmentSLLAMWS.BetragMehrwertsteuer.SetValue(string.Empty);
// // BlockSLLANachricht.AddPosition(pos);
// //}
// //// ZUV
// ////BlockSLLANachricht.SegmentSLLAZUV.Betriebsstättennummer.SetValue(string.Empty);
// ////BlockSLLANachricht.SegmentSLLAZUV.LebenslangeArztnummer.SetValue(string.Empty);
// ////BlockSLLANachricht.SegmentSLLAZUV.VerordnungsAusstellEinsatzdatum.SetValue(string.Empty);
// ////BlockSLLANachricht.SegmentSLLAZUV.Zuzahlungskennzeichen.SetValue(string.Empty);
// ////BlockSLLANachricht.SegmentSLLAZUV.Unfallkennzeichen.SetValue(string.Empty);
// ////BlockSLLANachricht.SegmentSLLAZUV.KennzeichenBVGSonstiges.SetValue(string.Empty);
// ////BlockSLLANachricht.SegmentSLLAZUV.KennzeichenVerordnungsbesonderheiten.SetValue(string.Empty);
// //// BES
// //BlockSLLANachricht.SegmentSLLABES.GesamtbetragBrutto.SetValue(string.Empty);
// //BlockSLLANachricht.SegmentSLLABES.GesamtbetragGesetzlicheZuzahlung.SetValue(string.Empty);
// //BlockSLLANachricht.SegmentSLLABES.GesamtbetragProzentualeZuzahlung.SetValue(string.Empty);
// //BlockSLLANachricht.SegmentSLLABES.PauschalerZuzahlungsbetrag.SetValue(string.Empty);
// //BlockSLLANachricht.SegmentSLLABES.GesamtbetragEigenanteil.SetValue(string.Empty);
// //// End
// //BlockSLLAUNT.AnzahlEinheiten.SetFilledIntValue(SegmentSLLACounter, 6);
// //BlockSLLAUNT.Nachrichtenreferenznummer.SetFilledIntValue(nachrefnum, 5);
//}
//public void foo(long? invoiceBaseOid)
//{
// //var serviceInvoice = DAOFactory.SearchDAO.GetServiceInvoiceByInvoiceBaseOid(invoiceBaseOid.Value);
// //if (!serviceInvoice.Oid.HasValue)
// // return;
// //if (serviceInvostring.IsNullOrEmpty(serviceInvoiceOid))
// // return;
// //var serviceInvoiceOid = serviceInvoice.Oid.Value;
// //var serviceInvoiceOid2CostbearerId = new Dictionary<long, string>();
// //var dcList = new List<ServiceInvoiceDC>();
// // var oid = long.Parse(oidStr);
// // // Lade ServiceInvoice
// // var invoice = DAOFactory.GenericDAO.LoadByID<ServiceInvoice>(oid);
// // var dc = MapperFactory.ServiceInvoiceDC_ServiceInvoice.MapToNewDC(invoice);
// // // Füge dcListe hinzu
// // dcList.Add(dc);
// // // Falls ServiceInvoice Oid bereits in serviceInvoiceOid2CostbearerOid List (S2C List) ist, überspringe
// // if (serviceInvoiceOid2CostbearerId.ContainsKey(oid))
// // continue;
// // // ServiceInvoice Oid ist noch nicht in S2C List
// // // Frage, ob InvoiceId existiert
// // if (!String.IsNullOrEmpty(invoice.InvoiceBase.InvoiceId))
// // // Falls InvoiceId existiert
// // serviceInvoiceOid2CostbearerId.Add(oid, invoice.InvoiceBase.InvoiceId);
// //}
// //IBeWoReport<ServiceInvoiceRO> allReports = null;
// //foreach (var iDC in dcList)
// //{
// // String reportId = null;
// // if (serviceInvoiceOid2CostbearerId.ContainsKey(iDC.ServiceInvoiceOid.Value))
// // reportId = serviceInvoiceOid2CostbearerId[iDC.ServiceInvoiceOid.Value];
// // IBeWoReport<ServiceInvoiceRO> singleReport = FindReportImp<ServiceInvoiceRO>(reportId);
// // singleReport.SetReportDataSource(ServiceInvoiceRO.Create(iDC));
// // ((XtraReport)singleReport).CreateDocument();
// // if (allReports == null)
// // allReports = singleReport;
// // else
// // ((XtraReport)allReports).Pages.AddRange(((XtraReport)singleReport).Pages);
// //}
// //return allReports as XtraReport;
//}
public override List<Segment> GetSegments()
{
return Nutzdatendatei.GetSegments();
}
}
}