HL7-parser
1.0.0
dotnet add package HL7-parser --version 1.0.0
NuGet\Install-Package HL7-parser -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="HL7-parser" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="HL7-parser" Version="1.0.0" />
<PackageReference Include="HL7-parser" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add HL7-parser --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: HL7-parser, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=HL7-parser&version=1.0.0
#tool nuget:?package=HL7-parser&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
HL7-parser
HL7 V2
hl7v2 parser example
var msg = @"MSH|^~\&|ADT|ADI|ADT-1|ADI-1|20050215||ADT^A01|MSGADT003|T|2.4" + "\r" +
"EVN|A01|20031016000000" + "\r" +
"PID|1|111222333|H123123^^^^MR^ADT~111-222-333^^^^SS^ADT||John^Smith|GARSEN^^Melissa|19380818|M||2028-9|241 AVE^^Lake City^WA^98125^^^^100|100|(425)111-2222|(425)111-2222||S|CHR|1234567|111-222-333" + "\r" +
"NK1|2|GARSEN^Melissa" + "\r" +
"PV1|1|E|||||D123^Jeff^Carron|||MED||||7|||D123^Jeff^Taylor|E|3454|R^20050215|||||||||||||||||||EM|||||20050215" + "\r" +
"IN1|1|I123|ICOMP1|INS COMP 1|PO BOX 1^^Lake City^WA^98125||||||||||1|John^Smith|01|19380818" + "\r" +
"IN2|1||RETIRED" + "\r" +
"IN1|2|I456|ICOMP2|INS COMP 1|PO BOX 2^^Lake City^WA^98125||||||||||8|John^Smith|01|19380818" + "\r" +
"IN2|2||RETIRED" + "\r";
var hl7v2 = new Message(msg);
var isParsed = hl7v2.ParseMessage();
List<Segment> segList = hl7v2.Segments();
//获取PID里面的姓名
var patName = hl7v2.getValue("PID.5");
patName = hl7v2.DefaultSegment("PID").Fields(5).Value;
patName = hl7v2.Segments("PID")[0].Fields(5).Value;
//判断是否为组件
var isComponentized = hl7v2.IsComponentized("PID.5");
HL7 V3
hl7v3 parser example : use HL7v3Mapper
decimal count = 1000;
string v3xml = File.ReadAllText("v3/v3xmlfile/OrganizationInfoRegister.xml");
Stopwatch stopWatch = Stopwatch.StartNew();
HL7v3Mapper deptMapper = new HL7v3Mapper()
.Add(nameof(DeptDto.DeptCode), DeptDto.DeptCode_Xpath)
.Add(nameof(DeptDto.DeptName), DeptDto.DeptName_Xpath)
.Add(nameof(DeptDto.DeptType), DeptDto.DeptType_Xpath, isRequired: false)
.Add(nameof(DeptDto.ParentDeptCode), DeptDto.ParentDeptCode_Xpath, isRequired: false, destType: MapType.TString
, p =>
{
var output = DeptDto.HandlerData(p);
return output;
});
for (var i = 0; i < count; i++)
{
HL7v3Parser v3Parser = new HL7v3Parser();
string reqId = v3Parser.InitXmlDocument(v3xml);
DeptDto deptDto = new DeptDto();
v3Parser.DoMapper(deptDto, deptMapper);
}
var totalElapsed = stopWatch.ElapsedMilliseconds;
Console.WriteLine($"HL7v3Mapper total elapsed:{totalElapsed}ms");
Console.WriteLine($"HL7v3Mapper once elapsed:{totalElapsed / count}ms");
hl7v3 parser example : use HL7v3Attribute
decimal count = 1000;
string v3xml = File.ReadAllText("v3/v3xmlfile/OrganizationInfoRegister.xml");
var stopWatch2 = Stopwatch.StartNew();
for (var i = 0; i < count; i++)
{
HL7v3Parser v3Parser2 = new HL7v3Parser();
string reqId2 = v3Parser2.InitXmlDocument(v3xml);
DeptDto deptDto2 = new DeptDto();
v3Parser2.DoMapper(deptDto2);
}
var totalElapsed2 = stopWatch2.ElapsedMilliseconds;
Console.WriteLine($"HL7v3Attribute total elapsed:{totalElapsed2}ms");
Console.WriteLine($"HL7v3Attribute once elapsed:{totalElapsed2 / count}ms");
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 189 | 9/15/2023 |