Skip to content

Commit bda1520

Browse files
committed
Update PipeParse Hl7 version check to use string.CompareOrdinal instead of using System.Version the former is more forgiving if a version contains non numerical characters
1 parent d6d9685 commit bda1520

File tree

6 files changed

+14
-10
lines changed

6 files changed

+14
-10
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ All notable changes to this project will be documented in this file.
77

88
## Previous Releases
99
###
10+
11+
## [3.0.3] - 2021-08-09
12+
This change updates the `PipeParser` Version check when obtaining encoding characters from a message object in order to encode it to HL7; `string.CompareOrdinal` is now used instead of `System.Version` which is more forgiving when a version contains non numerical characters.
13+
1014
## [3.0.2] - 2021-08-09
1115
This change gives nhapi [strong-named assemblies](https://docs.microsoft.com/en-us/dotnet/standard/assembly/strong-named), there are no codes changes.
1216
### Bug Fixes

build/nHapi.v3.nuspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
33
<metadata>
44
<id>nhapi</id>
5-
<version>3.0.2</version>
5+
<version>3.0.3</version>
66
<authors>Chad Chenoweth,Duane Edwards,Jake Aitchison</authors>
77
<license type="expression">MPL-2.0</license>
88
<projectUrl>https://github.com/nHapiNET/nHapi</projectUrl>
@@ -13,7 +13,7 @@
1313
NHapi allows Microsoft .NET developers to easily use an HL7 2.x object model. This object model allows for parsing and encoding HL7 2.x data to/from Pipe Delimited or XML formats. A very handy program for use in the health care industry.
1414

1515
This project is NOT affiliated with the HL7 organization. This software just conforms to the HL7 2.x specifications.</description>
16-
<releaseNotes>https://github.com/nHapiNET/nHapi/releases/tag/v3.0.2</releaseNotes>
16+
<releaseNotes>https://github.com/nHapiNET/nHapi/releases/tag/v3.0.3</releaseNotes>
1717
<tags>HL7 parsing healthcare HAPI xml</tags>
1818
<readme>docs\README.md</readme>
1919
<dependencies>

src/NHapi.Base/NHapi.Base.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
<TargetFrameworks>net35;netstandard2.0</TargetFrameworks>
55
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
66
<PackageId>nhapi.base</PackageId>
7-
<PackageVersion>3.0.2</PackageVersion>
7+
<PackageVersion>3.0.3</PackageVersion>
88
<Authors>Chad Chenoweth;Duane Edwards;Jake Aitchison</Authors>
99
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1010
<PackageProjectUrl>https://github.com/nHapiNET/nHapi</PackageProjectUrl>
1111
<RepositoryUrl>https://github.com/nHapiNET/nHapi.git</RepositoryUrl>
1212
<RepositoryType>git</RepositoryType>
1313
<Description>The core components for parsing/encoding HL7 messages. Contains the base classes and interfaces for datatypes, segments, and messages.</Description>
1414
<PackageTags>HL7;parsing;healthcare;HAPI;xml</PackageTags>
15-
<PackageReleaseNotes>https://github.com/nHapiNET/nHapi/releases/tag/v3.0.2</PackageReleaseNotes>
15+
<PackageReleaseNotes>https://github.com/nHapiNET/nHapi/releases/tag/v3.0.3</PackageReleaseNotes>
1616
<PackageReadmeFile>docs\README.md</PackageReadmeFile>
1717
<AssemblyOriginatorKeyFile>..\..\NHapi.snk</AssemblyOriginatorKeyFile>
1818
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>

src/NHapi.Base/Parser/PipeParser.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -819,10 +819,9 @@ private EncodingCharacters GetValidEncodingCharacters(char fieldSep, ISegment ms
819819
Terser.Set(msh, 2, 0, 1, 1, encCharString);
820820
}
821821

822-
var version27 = new Version("2.7");
823-
var messageVersion = new Version(msh.Message.Version);
822+
var version27 = "2.7";
824823

825-
if (version27 > messageVersion && encCharString.Length != 4)
824+
if (string.CompareOrdinal(version27, msh.Message.Version) > 0 && encCharString.Length != 4)
826825
{
827826
throw new HL7Exception(
828827
$"Encoding characters (MSH-2) value '{encCharString}' invalid -- must be 4 characters", ErrorCode.DATA_TYPE_ERROR);

src/SharedAssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@
2323
//
2424
// You can specify all the values or you can default the Revision and Build Numbers
2525
// by using the '*' as shown below:
26-
[assembly: AssemblyVersion("3.0.0.0")]
27-
[assembly: AssemblyFileVersion("3.0.0.0")]
26+
[assembly: AssemblyVersion("3.0.3.0")]
27+
[assembly: AssemblyFileVersion("3.0.3.0")]

tests/NHapi.NUnit/NHapi.NUnit.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@
7373
<Copy SourceFiles="App.config" DestinationFiles="$(OutDir)\testhost.dll.config" />
7474
<Copy SourceFiles="App.config" DestinationFiles="$(OutDir)\testhost.x86.dll.config" />
7575
<!-- Rider -->
76-
<Copy SourceFiles="App.config" DestinationFiles="$(OutDir)\ReSharperTestRunner64.dll.config"/>
76+
<Copy SourceFiles="App.config" DestinationFiles="$(OutDir)\ReSharperTestRunner.dll.config" />
77+
<Copy SourceFiles="App.config" DestinationFiles="$(OutDir)\ReSharperTestRunner64.dll.config" />
7778
</Target>
7879

7980
</Project>

0 commit comments

Comments
 (0)