From 2177e69d4c12c1c4914a353f34208b8a308ea6a0 Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Mon, 9 Jan 2023 15:51:00 +0100 Subject: [PATCH] kleine Korrekturen --- bsmd.dbh/RequestUtil.cs | 13 +++++++++---- bsmd.dbh/ResponseUtil.cs | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/bsmd.dbh/RequestUtil.cs b/bsmd.dbh/RequestUtil.cs index 31939378..15460aa7 100644 --- a/bsmd.dbh/RequestUtil.cs +++ b/bsmd.dbh/RequestUtil.cs @@ -28,12 +28,16 @@ namespace bsmd.dbh root.Version = RootVersion.Item71; root.SourceDocumentVersion = "7.1"; root.Timestamp = DateTime.Now; + string filenameComponent; + if(core.InitialHIS == Message.NSWProvider.DBH_MAERSK) { + filenameComponent = "BSMDMAERSK"; root.Sender = Properties.Settings.Default.SenderMaersk; } else { + filenameComponent = "BSMD"; root.Sender = Properties.Settings.Default.Sender; } root.SenderReference = message.Id.Value.ToString("N"); @@ -229,7 +233,7 @@ namespace bsmd.dbh rootNOA_NOD.Items = choices.ToArray(); rootNOA_NOD.ItemsElementName = choiceList.ToArray(); - rootNOA_NOD.ReportingParty = rp; + // rootNOA_NOD.ReportingParty = rp; root.Items = new object[1]; root.Items[0] = rootNOA_NOD; break; @@ -1659,9 +1663,9 @@ namespace bsmd.dbh rwr.TreatmentFacilityProvider[j] = was_rcpt.TreatmentFacilityProvider[j].TreatmentFacilityProviderName; } if (was_rcpt.WasteDeliveryDateFrom.HasValue) - rwr.WasteDeliveryDateFrom = was_rcpt.WasteDeliveryDateFrom.Value; + rwr.WasteDeliveryDateFrom = was_rcpt.WasteDeliveryDateFrom.Value.ToUTCSerializableDateTime(); if (was_rcpt.WasteDeliveryDateTo.HasValue) - rwr.WasteDeliveryDateTo = was_rcpt.WasteDeliveryDateTo.Value; + rwr.WasteDeliveryDateTo = was_rcpt.WasteDeliveryDateTo.Value.ToUTCSerializableDateTime(); rwr.WasteReceived = new RootWAS_RCPTWasteDeliveryReceiptWasteReceived[was_rcpt.WasteReceived.Count]; for (int j = 0; j < was_rcpt.WasteReceived.Count; j++) { @@ -1671,6 +1675,7 @@ namespace bsmd.dbh rwr.WasteReceived[j].WasteType.WasteCode = was_rcpt.WasteReceived[j].WasteCode; rwr.WasteReceived[j].WasteType.WasteDescription = was_rcpt.WasteReceived[j].WasteDescription; } + rootWAS_RCPT.WasteDeliveryReceipt[i] = rwr; } // rootWAS_RCPT.ReportingParty = rp; root.Items = new object[1]; @@ -1688,7 +1693,7 @@ namespace bsmd.dbh // serialize output structure to file - string filename = string.Format("NSW.DBH.BSMD.{0}.xml", message.FileSequenceNumber); + string filename = string.Format("NSW.DBH.{0}.{1}.xml", filenameComponent, message.FileSequenceNumber); _log.InfoFormat("{0}: saving {1} to output directory", message.MessageNotificationClassDisplay, filename); string filePath = Path.Combine(Path.GetTempPath(), filename); diff --git a/bsmd.dbh/ResponseUtil.cs b/bsmd.dbh/ResponseUtil.cs index 504a1121..5d9905e5 100644 --- a/bsmd.dbh/ResponseUtil.cs +++ b/bsmd.dbh/ResponseUtil.cs @@ -37,7 +37,7 @@ namespace bsmd.dbh // Achtung! Die laufende Nummer der rücklaufenden Datei ist _nicht_ dieselbe und kann zur Identifikation der Meldeklasse // nicht verwendet werden - string fileSeqString = m.Groups[1].Value; + string fileSeqString = m.Groups[2].Value; if(!Int32.TryParse(fileSeqString, out int fileSeqNum)) {