Schlüssel übersichtlich, Segmente neu sortiert PDFs eingeführt, Beispiel Ansicht eingeführt,
292 lines
14 KiB
C#
292 lines
14 KiB
C#
using BS.Shared.DataContracts;
|
|
using Dakota.Models;
|
|
using Dakota.Models.Datei;
|
|
using Dakota.Models.Nachricht;
|
|
using Dakota.Models.Segmente;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Dakota
|
|
{
|
|
/// <summary>
|
|
/// Interne Logik
|
|
/// </summary>
|
|
public class DakotaFile : IRowable
|
|
{
|
|
internal SozioTherapieEinzelnachweis SozioTherapieEinzelnachweis { get; set; }
|
|
internal DateTime Created { get; private set; }
|
|
|
|
internal int NachrichtenCounter { get; set; }
|
|
internal int AnzahlUNHCounter { get; set; }
|
|
internal int SegmentSLGACounter { get; set; }
|
|
internal int SegmentSLLACounter { get; set; }
|
|
|
|
// UNB
|
|
internal SegmentUNB SegmentUNB => SozioTherapieEinzelnachweis.UNB;
|
|
// Block
|
|
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;
|
|
|
|
public DakotaFile()
|
|
{
|
|
SozioTherapieEinzelnachweis = new SozioTherapieEinzelnachweis();
|
|
Created = DateTime.Now;
|
|
|
|
NachrichtenCounter = 1;
|
|
AnzahlUNHCounter = 0;
|
|
SegmentSLGACounter = 0;
|
|
SegmentSLLACounter = 0;
|
|
}
|
|
|
|
public void Generate(DakotaFileInfo info)
|
|
{
|
|
GenerateUNB(info);
|
|
GenerateBlockSLGA(info);
|
|
GenerateBlockSLLA(info);
|
|
GenerateUNZ(info);
|
|
}
|
|
|
|
public void GenerateUNB(DakotaFileInfo info)
|
|
{
|
|
SegmentUNB.SyntaxKennung.SetValue("UNOC");
|
|
SegmentUNB.SyntaxVersionsnummer.SetValue("3");
|
|
SegmentUNB.Absenderdatei.SetValue(info.Absenderbezeichnung);
|
|
SegmentUNB.Empfangdatei.SetValue(info.Empfangerbezeichnung);
|
|
SegmentUNB.Datum.SetValue(Created.ToString("yyyyMMdd"));
|
|
SegmentUNB.Uhrzeit.SetValue(Created.ToString("HHmm"));
|
|
SegmentUNB.Datenaustauschreferenz.SetFilledIntValue(info.Datenaustauschreferenz, 5);
|
|
SegmentUNB.Leistungsbereich.SetValue("O");
|
|
SegmentUNB.Anwengundsreferenz.SetValue(info.Anwendungsreferenz);
|
|
SegmentUNB.Testindikator.SetValue(info.Testindikator.Value);
|
|
}
|
|
|
|
public void GenerateBlockSLGA(DakotaFileInfo info)
|
|
{
|
|
//UNH, UNT, FKT, REC, GES00, GES, NAM
|
|
SegmentSLGACounter += 7;
|
|
|
|
var nachrefnum = ++AnzahlUNHCounter;
|
|
|
|
// Head
|
|
BlockSLGAUNH.Nachrichtenreferenznummer.SetFilledIntValue(nachrefnum, 5);
|
|
BlockSLGAUNH.NachrichtenTypKennung.SetValue("SLGA");
|
|
BlockSLGAUNH.Verionsnummer.SetValue("18");
|
|
BlockSLGAUNH.FreigabeNrDesTypes.SetValue("0");
|
|
BlockSLGAUNH.VerwaltendeOrganisation.SetValue("0");
|
|
|
|
// Body
|
|
// FKT
|
|
BlockSLGANachricht.SegmentFKT.Verarbeitungskennzeichen.SetValue(info.Verarbeitungskennzeichen.Value);
|
|
BlockSLGANachricht.SegmentFKT.IKLeistungserbringers.SetValue(info.IKLeistungserbringers);
|
|
BlockSLGANachricht.SegmentFKT.IKKostenträger.SetValue(info.IKKostenträger);
|
|
BlockSLGANachricht.SegmentFKT.IKKrankenkasse.SetValue(info.IKKrankenkasse);
|
|
BlockSLGANachricht.SegmentFKT.IKAbsender.SetValue(info.Absenderbezeichnung);
|
|
// REC
|
|
BlockSLGANachricht.SegmentREC.SammelRechnungsnummer.SetValue(info.Rechnungsnummer);
|
|
BlockSLGANachricht.SegmentREC.EinzelRechnungsnummer.SetValue("0");
|
|
BlockSLGANachricht.SegmentREC.Datum.SetValue(info.Rechnungsdatum.ToString("yyyyMMdd"));
|
|
BlockSLGANachricht.SegmentREC.Rechnungsart.SetValue(info.Rechnungsart.Value);
|
|
// UST - wird nicht gebraucht
|
|
//BlockSLGANachricht.SegmentUST.Steuernummer.SetValue(string.Empty);
|
|
//BlockSLGANachricht.SegmentUST.Kennung.SetValue(string.Empty);
|
|
// SKO - wird nicht gebraucht
|
|
//BlockSLGANachricht.SegmentSKO.SkontoProzent.SetValue(string.Empty);
|
|
//BlockSLGANachricht.SegmentSKO.Zahlungsziel.SetValue(string.Empty);
|
|
// GES00
|
|
BlockSLGANachricht.SegmentGES00.Status.SetValue("00");
|
|
BlockSLGANachricht.SegmentGES00.Gesamtrechnungsbetrag.SetDecimalValue(info.Gesamtrechnungsbetrag) ;
|
|
BlockSLGANachricht.SegmentGES00.Gesamtbruttobetrag.SetDecimalValue(info.Gesamtbruttobetrag);
|
|
BlockSLGANachricht.SegmentGES00.GesamtbetragZuzahlung.SetDecimalValue(info.GesamtbetragZuzahlung);
|
|
// GES
|
|
BlockSLGANachricht.SegmentGES.Status.SetValue(info.Summenstatus.Value);
|
|
BlockSLGANachricht.SegmentGES.Gesamtrechnungsbetrag.SetDecimalValue(info.Gesamtrechnungsbetrag);
|
|
BlockSLGANachricht.SegmentGES.Gesamtbruttobetrag.SetDecimalValue(info.Gesamtbruttobetrag);
|
|
BlockSLGANachricht.SegmentGES.GesamtbetragZuzahlung.SetDecimalValue(info.GesamtbetragZuzahlung);
|
|
// NAM
|
|
BlockSLGANachricht.SegmentNAM.Name1.SetValue(info.Name1);
|
|
BlockSLGANachricht.SegmentNAM.Name2.SetValue(info.Name2);
|
|
BlockSLGANachricht.SegmentNAM.Name3.SetValue(info.Name3);
|
|
BlockSLGANachricht.SegmentNAM.Name4.SetValue(info.Name4);
|
|
|
|
// End
|
|
BlockSLGAUNT.AnzahlEinheiten.SetFilledIntValue(SegmentSLGACounter, 6);
|
|
BlockSLGAUNT.Nachrichtenreferenznummer.SetFilledIntValue(nachrefnum, 5);
|
|
}
|
|
|
|
public void GenerateBlockSLLA(DakotaFileInfo info)
|
|
{
|
|
SegmentSLLACounter++;
|
|
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 GenerateUNZ(DakotaFileInfo info)
|
|
{
|
|
SegmentUNZ.AnzahlNachrichten.SetFilledIntValue(AnzahlUNHCounter, 6);
|
|
SegmentUNZ.Datenaustauschreferenz.SetFilledIntValue(info.Datenaustauschreferenz, 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 string GetRows()
|
|
{
|
|
return SozioTherapieEinzelnachweis.GetRows();
|
|
}
|
|
}
|
|
}
|