.NET
This page describes .NET library that provide access to fhirbase. This library uses following nuget packages:
https://www.nuget.org/packages/Hl7.Fhir.STU3/ - this is an official .NET API for HL7 FHIR used to model representation;
https://www.nuget.org/packages/Newtonsoft.Json/ - this is a popular high-performance JSON framework for .NET. It is used to convert resources from json string to classes and back;
https://www.nuget.org/packages/Npgsql/ - this is a .NET Access to PostgreSQL. It is used to connect to fhirbase.
Installation
Clone this project somewhere:
Then add reference to library to your project (for example):
That's all!
Usage
Create Connector
to fhirbase and use it's methods to resource access like this:
API Reference
Connector Class
Namespace: FhirbaseConnector
Constructors
Parameters:
host
- network address of the Postgresql server where resides fhirbase;port
- port of the Postgresql server;user
- Postgresql user that have access to the fhirbase;password
- user password;db
- database name of the fhirbase.
Methods:
Create new resource in the fhirbase.
Parameters:
resource
- resource that will be created in the fhirbase.
Returns:
Returns updated resource.
Base
is the type from theHl7.Fhir.STU3
.
Update resource in the fhirbase.
Parameters:
resource
- resource that will be updated in the fhirbase.
Returns:
Returns updated resource.
Base
is the type from theHl7.Fhir.STU3
.
Delete resource from fhirbase.
Parameters:
resource
- resource that will be deleted from the fhirbase.
Returns:
Returns deleted resource.
Resource
is the type from theHl7.Fhir.STU3
.
Read resources from fhirbase.
Parameters:
limit
- if limit is -1 then all resources will be returned else only specified amount.
Returns:
Returns list of the resources.
Base
is the type from theHl7.Fhir.STU3
Executes arbitrary sql and returns list of resources.
Parameters:
sql
- arbitrary sql string.
Returns:
Returns list of the resources.
Base
is the type from theHl7.Fhir.STU3
Demo
Install and init fhirbase. Then execute following commands (notice that you need dotnet 2.1):
Last updated