Skip to content
Jake Aitchison edited this page Jan 20, 2023 · 2 revisions

Getting Started

All Versions of nHapi

The easiest way to get started using nHapi is to use the NuGet package 'nhapi'.

This package contains nhapi.base (the core of nHapi's parsing and encoding functionality) plus all the object models for HL7 2.1, 2.2, 2.3, 2.3.1, 2.4, 2.5, 2.5.1, 2.6, 2.7, 2.7.1, 2.8 and 2.8.1 specifications, in a single convenient NuGet package.

Follow one of the below methods to add a nHapi reference to your project.

Package Manager Console

Using the package manager console within visual studio, simply run the following command:

PM > Install-Package nhapi

.NET CLI

From your console of choice assuming you have dotnet core installed.

> dotnet add package nhapi

PackageReference

Or add a package reference to your csproj

<PackageReference Include="nhapi" Version="3.0.0" />

nHapi Version 3.0.0+

Starting with nHapi version 3.0.0 it is now possible to install just the parts if nHapi you actually need; For example you may only need the object models for HL7 2.4 specifications plus nhapi.base.

In this case you would just install the NuGet package nhapi.model.v24 and it will automatically install nhapi.base since all of the object model NuGet packages depends on nhapi.base.

The benefit of this approach to referencing nHapi in your project is a significant reduction in the size of your application due to not requiring all of the nhapi dlls (2 vs 13 in this example).