Get started
The Java SDK requires Java 17 or later.
- Stable unknown
- Release candidate since 0.1.0-rc.1
- Development since 0.1.0-dev+62f59ce
The Java SDK requires Java 17 or later.
Install
Add the SDK from Maven Central to your Gradle project:
repositories {
mavenCentral()
}
dependencies {
implementation("com.ovok:ovok-sdk:0.1.0")
}Or to your Maven project:
<dependency>
<groupId>com.ovok</groupId>
<artifactId>ovok-sdk</artifactId>
<version>0.1.0</version>
</dependency>Release candidates are on Maven Central as 0.1.0-rc.<n>. Development builds are 0.1.0-SNAPSHOT in the Central Portal snapshot repository:
repositories {
mavenCentral()
maven("https://central.sonatype.com/repository/maven-snapshots/")
}
dependencies {
implementation("com.ovok:ovok-sdk:0.1.0-SNAPSHOT")
}The SDK brings in tools.jackson.core:jackson-databind (Jackson 3) as an API dependency.
Configure a client
import com.ovok.sdk.Ovok;
import com.ovok.sdk.OvokConfig;
Ovok ovok = new Ovok(OvokConfig.builder()
.baseUrl("https://api.sandbox.ovok.com")
.tenantCode("your-tenant")
.build());baseUrl and tenantCode are required. See client configuration for the other options.
Sign in
import com.ovok.sdk.LoginCredentials;
import com.ovok.sdk.LoginResult;
import com.ovok.sdk.ProfileType;
LoginResult result = ovok.auth().login(new LoginCredentials(
ProfileType.PRACTITIONER, "person@example.com", password));
if (result.status().equals("mfa-required")) {
result = ovok.auth().verifyMfa(result.challenge(), mfaCode);
}The client keeps the session and refreshes its access token before it expires. A backend service can use client credentials instead; see machine clients.
Read a FHIR resource
import tools.jackson.databind.JsonNode;
JsonNode patient = ovok.fhir().read("Patient", "patient-id");SDK methods declare IOException and InterruptedException. A response that is not a success throws an OvokApiException subtype; see errors.
Last updated on