Skip to content

Commit

Permalink
loosened hl7 validation
Browse files Browse the repository at this point in the history
Signed-off-by: Neil South <[email protected]>
  • Loading branch information
neildsouth committed Jan 9, 2024
1 parent 43854e3 commit 6b47b7f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/InformaticsGateway/Services/HealthLevel7/MllpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ private bool CreateMessage(int startIndex, int endIndex, ref string data, out Me
var text = data.Substring(messageStartIndex, endIndex - messageStartIndex);
_logger.Hl7GenerateMessage(text.Length, text);
message = new Message(text);
message.ParseMessage();
message.ParseMessage(false);
data = data.Length > endIndex ? data.Substring(messageEndIndex) : string.Empty;
return true;
}
Expand Down
4 changes: 2 additions & 2 deletions src/InformaticsGateway/Services/HealthLevel7/MllpExtract.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ private Message RepopulateMessage(Hl7ApplicationConfigEntity config, ExternalApp
{
var newMess = message.HL7Message.Replace(oldvalue, details.PatientId);
message = new Message(newMess);
message.ParseMessage();
message.ParseMessage(false);
}
}
else if (tag == DicomTag.StudyInstanceUID)
Expand All @@ -162,7 +162,7 @@ private Message RepopulateMessage(Hl7ApplicationConfigEntity config, ExternalApp
{
var newMess = message.HL7Message.Replace(oldvalue, details.StudyInstanceUid);
message = new Message(newMess);
message.ParseMessage();
message.ParseMessage(false);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ private async Task EnsureAck(NetworkStream networkStream)
foreach (var message in _rawHl7Messages)
{
var hl7Message = new Message(message);
hl7Message.ParseMessage();
hl7Message.ParseMessage(false);

Check warning on line 343 in src/InformaticsGateway/Services/HealthLevel7/MllpService.cs

View check run for this annotation

Codecov / codecov/patch

src/InformaticsGateway/Services/HealthLevel7/MllpService.cs#L343

Added line #L343 was not covered by tests
if (hl7Message.MessageStructure == "ACK")
{
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public async Task GivenAnInputHL7DataPlugInEngine_WhenExecutePlugInsIsCalledWith
"called");

var message = new HL7.Dotnetcore.Message(SampleMessage);
message.ParseMessage();
message.ParseMessage(false);

await Assert.ThrowsAsync<PlugInInitializationException>(async () => await pluginEngine.ExecutePlugInsAsync(message, dicomInfo, config));
}
Expand Down Expand Up @@ -152,7 +152,7 @@ public async Task GivenAnInputHL7DataPlugInEngine_WhenExecutePlugInsIsCalled_Exp
"called");

var message = new HL7.Dotnetcore.Message(SampleMessage);
message.ParseMessage();
message.ParseMessage(false);

var (Hl7Message, resultDicomInfo) = await pluginEngine.ExecutePlugInsAsync(message, dicomInfo, config);

Expand Down

0 comments on commit 6b47b7f

Please sign in to comment.