PatientBillingResource

Patients' health insurance, plans, billing accounts and invoices, as FHIR Coverage, Account and Invoice, under /v1/patient-billing; the project's PATIENT_BILLING_ENABLED setting must be on.

  • Stable unknown
  • Release candidate not available
  • Development since 0.2.0-dev.33+8af64df
public final class PatientBillingResource

Patients' health insurance, plans, billing accounts and invoices, as FHIR Coverage, Account and Invoice, under /v1/patient-billing; the project's PATIENT_BILLING_ENABLED setting must be on. Get it from Ovok.patientBilling().

Methods

insurers

public PatientBillingResource.Insurers insurers()

Returns the health insurer directory.

Returns: the insurer routes

coverages

public PatientBillingResource.Coverages coverages()

Returns patients' health insurances.

Returns: the coverage routes

plans

public PatientBillingResource.Plans plans()

Returns the plan each patient pays for.

Returns: the plan routes

accounts

public PatientBillingResource.Accounts accounts()

Returns patients' billing accounts.

Returns: the account routes

invoices

public PatientBillingResource.Invoices invoices()

Returns patients' invoices.

Returns: the invoice routes

PatientBillingResource.Insurers

public static final class Insurers

Ovok's directory of health insurers.

Insurers.list

public List<JsonNode> list(
        Map<String, ?> params,
        RequestOptions options) throws IOException, InterruptedException

Lists the insurers that match, by kind and name (GET /v1/patient-billing/insurers).

Parameters:

  • params: optional country, kind (statutory or private) and query
  • options: per-request options, such as the timeout

Returns: the insurers

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response

PatientBillingResource.Coverages

public static final class Coverages

Patients' health insurances.

Coverages.list

public List<JsonNode> list(
        String patientId,
        RequestOptions options) throws IOException, InterruptedException

Lists a patient's active coverages, in the order they apply (GET /v1/patient-billing/patients/{patientId}/coverages).

Parameters:

  • patientId: the patient id
  • options: per-request options, such as the timeout

Returns: the coverages

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response

Coverages.create

public JsonNode create(
        String patientId,
        Object coverage,
        RequestOptions options) throws IOException, InterruptedException

Adds a coverage; the insurer must be in the directory and the member number must be valid (POST /v1/patient-billing/patients/{patientId}/coverages).

Parameters:

  • patientId: the patient id
  • coverage: the coverage to add
  • options: per-request options, such as the timeout

Returns: the coverage

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response
  • OvokConflictException: if another statutory coverage runs in that period
  • OvokValidationException: if the member number, insurer, period or country is invalid

Coverages.update

public JsonNode update(
        String coverageId,
        Object changes,
        RequestOptions options) throws IOException, InterruptedException

Changes a coverage (PATCH /v1/patient-billing/coverages/{coverageId}).

Parameters:

  • coverageId: the coverage id
  • changes: the fields to change
  • options: per-request options, such as the timeout

Returns: the coverage

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response
  • OvokConflictException: if another statutory coverage runs in that period
public JsonNode update(
        String coverageId,
        Object changes,
        String ifVersion,
        RequestOptions options) throws IOException, InterruptedException

Changes a coverage only if it is still at the version you read (PATCH /v1/patient-billing/coverages/{coverageId} with If-Match).

Parameters:

  • coverageId: the coverage id
  • changes: the fields to change
  • ifVersion: the version you read
  • options: per-request options, such as the timeout

Returns: the coverage

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response
  • OvokConflictException: if the coverage changed since ifVersion, or another statutory coverage runs in that period

Coverages.remove

public void remove(
        String coverageId,
        RequestOptions options) throws IOException, InterruptedException

Removes a coverage: deletes it, or cancels it when a billing account names it (DELETE /v1/patient-billing/coverages/{coverageId}).

Parameters:

  • coverageId: the coverage id
  • options: per-request options, such as the timeout

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response

PatientBillingResource.Plans

public static final class Plans

The plan each patient pays for; setting it is for project admins and admin client applications.

Plans.retrieve

public JsonNode retrieve(
        String patientId,
        RequestOptions options) throws IOException, InterruptedException

Reads a patient's plan, running or ended (GET /v1/patient-billing/patients/{patientId}/plan).

Parameters:

  • patientId: the patient id
  • options: per-request options, such as the timeout

Returns: the plan

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response
  • OvokNotFoundException: if the patient has no plan

Plans.set

public JsonNode set(
        String patientId,
        Object plan,
        RequestOptions options) throws IOException, InterruptedException

Sets a patient's plan, or ends it with {"plan": null} (PUT /v1/patient-billing/patients/{patientId}/plan).

Parameters:

  • patientId: the patient id
  • plan: the plan to set, or {"plan": null} to end it
  • options: per-request options, such as the timeout

Returns: the plan as set or ended, or null when there was no plan to end

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response

PatientBillingResource.Accounts

public static final class Accounts

Patients' billing accounts.

Accounts.list

public List<JsonNode> list(
        String patientId,
        RequestOptions options) throws IOException, InterruptedException

Lists a patient's billing accounts (GET /v1/patient-billing/patients/{patientId}/accounts).

Parameters:

  • patientId: the patient id
  • options: per-request options, such as the timeout

Returns: the accounts

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response

Accounts.retrieve

public JsonNode retrieve(
        String accountId,
        RequestOptions options) throws IOException, InterruptedException

Reads one billing account (GET /v1/patient-billing/accounts/{accountId}).

Parameters:

  • accountId: the account id
  • options: per-request options, such as the timeout

Returns: the account

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response

PatientBillingResource.Invoices

public static final class Invoices

Patients' invoices; recording them is for project admins and admin client applications.

Invoices.list

public Page<JsonNode> list(
        String patientId,
        Map<String, ?> params,
        RequestOptions options) throws IOException, InterruptedException

Lists a patient's invoices, latest first (GET /v1/patient-billing/patients/{patientId}/invoices).

Parameters:

  • patientId: the patient id
  • params: optional filters and limit
  • options: per-request options, such as the timeout

Returns: the first page; iterating it loads the next pages

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response

Invoices.retrieve

public JsonNode retrieve(
        String invoiceId,
        RequestOptions options) throws IOException, InterruptedException

Reads one invoice (GET /v1/patient-billing/invoices/{invoiceId}).

Parameters:

  • invoiceId: the invoice id
  • options: per-request options, such as the timeout

Returns: the invoice

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response

Invoices.record

public JsonNode record(
        String patientId,
        Object invoice,
        RequestOptions options) throws IOException, InterruptedException

Records an invoice, or updates the one recorded with the same identifier, so a retry is safe (POST /v1/patient-billing/patients/{patientId}/invoices).

Parameters:

  • patientId: the patient id
  • invoice: the invoice to record
  • options: per-request options, such as the timeout

Returns: the invoice

Throws:

  • IOException: if the request cannot be sent or the response cannot be read
  • InterruptedException: if the thread is interrupted while waiting for the response

Last updated on

On this page