The IomtFhirClient Swift library simplifies sending IoMT (Internet of Medical Things) data to an IoMT FHIR Connector for Azure endpoint.
Перейти к файлу
namalu e98ee39128
Merge pull request #1 from microsoft/personal/namalu/installation-documentation
Added Swift Package Manager installation instructions
2019-11-19 23:03:57 -08:00
IomtFhirClient.xcodeproj Initial commit 2019-11-12 17:28:05 -08:00
IomtFhirClient.xcworkspace Initial commit 2019-11-12 17:28:05 -08:00
Pipelines Initial commit 2019-11-12 17:28:05 -08:00
Sources Initial commit 2019-11-12 17:28:05 -08:00
Tests Initial commit 2019-11-12 17:28:05 -08:00
.gitignore Initial commit 2019-11-12 17:28:05 -08:00
CODE_OF_CONDUCT.md Initial commit 2019-11-12 17:28:05 -08:00
CONTRIBUTING.md Initial commit 2019-11-12 17:28:05 -08:00
GeoPol.xml Initial commit 2019-11-12 17:28:05 -08:00
LICENSE Initial commit 2019-11-12 17:28:05 -08:00
Package.swift Initial commit 2019-11-12 17:28:05 -08:00
README.md Added Swift Package Manager installation instructions 2019-11-18 17:19:10 -08:00
SECURITY.md Initial commit 2019-11-12 17:28:05 -08:00

README.md

IomtFhirClient Swift Library

Build Status

The IomtFhirClient Swift library simplifies sending IoMT (Internet of Medical Things) data to an IoMT FHIR Connector for Azure endpoint for persistance in a FHIR® server.

Installation

IomtFhirClient uses Swift Package Manager to manage dependencies. It is recommended that you use Xcode 11 or newer to add IomtFhirClient to your project.

  1. Using Xcode 11 go to File > Swift Packages > Add Package Dependency
  2. Paste the project URL: https://github.com/microsoft/iomt-fhir-client
  3. Click on next and select the project target

Basic Usage

Instantiate an IomtFhirClient

An IomtFhirClient can be instantiated using a connection string.

let iomtFhirClient = try IomtFhirClient.CreateFromConnectionString(connectionString: "YOUR_CONNECTION_STRING")

Create EventData

In the example below, a simple json payload is used to create an EventData object.

let json = "{\"eventPayload\":\"payload data\"}"

let payload = json.data(using: .utf8)

let eventData = EventData(data: payload)

Send the data to the Azure Event Hub

The IomtFhirClient has methods for sending single EventHub objects or collections.

do {
    try iomtFhirClient.send(eventData: eventData) { (success, error) in
        if (success && error == nil) {
            // The event was send successfully
        } else {
            // Handle any errors
        }
    }
} catch {
    // Handle any errors
}

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

There are many other ways to contribute to the IomtFhirClient Project.

See Contributing to IomtFhirClient for more information.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

FHIR® is the registered trademark of HL7 and is used with the permission of HL7. Use of the FHIR trademark does not constitute endorsement of this product by HL7.