API Access
Typical product integrations occur via an HL7 or FHIR interface. Dr. Know has tools and trained staff to assist with these types of integrations. Learn more here.
For trusted partnership scenarios or if your project requires a deeper integration, you can request direct access to the Dr. Know platform via our API and SDK.
Our team will review your request and you should receive a response within 48 hours.
Getting Started
Upon approval, you will be provided with an App ID, which is required when making API and SDK calls. Additionally, you will gain access to the Dr. Know API documentation portal.
Software Development Kit (SDK)
The Dr. Know API is extensive. As such, using our SDK can make development much easier and is strongly recommended. The SDK is made available to all approved developers.
Currently, Dr. Know offers an SDK based on the .NET Standard. Future SDKs are planned to support additional platforms (i.e. JavaScript).
There are only two files included with the SDK, which are required to exist alongside your executable when deployed:
SDK Initialization
You must initialize the SDK during your project's startup before any other code executes:
At initialization time, you must specify the appropriate threading mode for your project, which instructs the SDK how it should manage its in-memory state. This setting is critical because the SDK heavily utilizes the async/await pattern and different project types behave differently with this pattern. For example, UI-based projects typically return from an await on the same thread, while non-UI-based projects typically return from an await on a different thread.
Use the table below to determine the appropriate threading mode for your project.
Threading Mode | Description |
---|---|
Singleton | Use with UI-based project types (e.g. WinUI, UWP, WinForms). |
AsyncLocal | Use within an async/await call chain (e.g. Azure Functions). |
ThreadLocal | Use for manually-managed, multi-threaded scenarios. |
Connecting Users
Next, you must connect a valid Dr. Know user to establish a session. This is equivalent to a user logging in to the Dr. Know product. Internally, the SDK will cache a session token for this user's session. All subsequent SDK calls will be scoped to this user's session, until the session ends or another call to Connect() is made with a different username.
Once connected, you can use the various SDK types to perform the desired actions. All SDK types have convenient names and are self-documented via IntelliSense.
Error Handling
For scenarios when an item may or may not exist (e.g. finding a patient), a null reference is returned when the item does not exist. Null-checking is recommended for this scenario.
For scenarios when an error occurs during a function call that is expected to succeed, a descriptive exception will be thrown. Inspecting the error code and message will provide further details. Normal try-catch blocks are recommended for this scenario.
Usage Patterns
The API and SDK support two common usage patterns:
Pattern | Description |
---|---|
CRUD | Used for Create, Read, Update, and Delete operations. |
Functions | Used for calling static functions. |
Below are examples demonstrating each pattern's usage.