Docs / API reference / fhir module

checkin-client API / fhir

fhir

Type Aliases

CheckinBundle

type CheckinBundle = {
  bundle: Record<string, unknown>;
  entries: CheckinBundleEntry[];
};

Defined in: src/fhir/index.ts:43

Properties

bundle
bundle: Record<string, unknown>;

Defined in: src/fhir/index.ts:46

The transaction Bundle equivalent of the plan.

entries
entries: CheckinBundleEntry[];

Defined in: src/fhir/index.ts:44


CheckinBundleContext

type CheckinBundleContext = {
  appointment?: string;
  patient?: string;
};

Defined in: src/fhir/index.ts:31

Properties

appointment?
optional appointment?: string;

Defined in: src/fhir/index.ts:33

patient?
optional patient?: string;

Defined in: src/fhir/index.ts:32


CheckinBundleEntry

type CheckinBundleEntry = {
  artifactId?: string;
  fullUrl: string;
  resource: Record<string, unknown>;
};

Defined in: src/fhir/index.ts:36

Properties

artifactId?
optional artifactId?: string;

Defined in: src/fhir/index.ts:40

Artifact id this entry came from; the Provenance entry has none.

fullUrl
fullUrl: string;

Defined in: src/fhir/index.ts:37

resource
resource: Record<string, unknown>;

Defined in: src/fhir/index.ts:38


FetchLike

type FetchLike = (input, init?) => Promise<Response>;

Defined in: src/fhir/index.ts:29

Minimal fetch signature so tests and hosts can inject their own.

Parameters

Parameter Type
input string | URL | Request
init? RequestInit

Returns

Promise<Response>


PostMode

type PostMode = "transaction" | "individual";

Defined in: src/fhir/index.ts:26


PostResult

type PostResult = {
  bundle: unknown;
  mode: PostMode;
  result: unknown;
};

Defined in: src/fhir/index.ts:204

Properties

bundle
bundle: unknown;

Defined in: src/fhir/index.ts:206

mode
mode: PostMode;

Defined in: src/fhir/index.ts:205

result
result: unknown;

Defined in: src/fhir/index.ts:207

Variables

CHECKIN_APPOINTMENT_SYSTEM

const CHECKIN_APPOINTMENT_SYSTEM: "https://smart-health-checkin.github.io/appointment-context" = "https://smart-health-checkin.github.io/appointment-context";

Defined in: src/fhir/index.ts:51


CHECKIN_REQUEST_ID_SYSTEM

const CHECKIN_REQUEST_ID_SYSTEM: "https://smart-health-checkin.github.io/checkin-request-id" = "https://smart-health-checkin.github.io/checkin-request-id";

Defined in: src/fhir/index.ts:49

Functions

buildCheckinBundle()

function buildCheckinBundle(input): CheckinBundle;

Defined in: src/fhir/index.ts:58

Map a check-in response to a FHIR transaction Bundle. Pure — no network. Inspect or edit the result before sending it anywhere.

Parameters

Parameter Type
input { context?: CheckinBundleContext; now?: () => Date; provenance?: boolean; request: SmartCheckinRequest; response: SmartCheckinResponse; }
input.context? CheckinBundleContext
input.now? () => Date
input.provenance? boolean
input.request SmartCheckinRequest
input.response SmartCheckinResponse

Returns

CheckinBundle


postCheckinBundle()

function postCheckinBundle(plan, options): Promise<PostResult>;

Defined in: src/fhir/index.ts:215

Post a bundle to a FHIR server. A convenience for demos and simple apps — production deployments usually have their own client and auth, in which case use buildCheckinBundle alone and send it yourself.

Parameters

Parameter Type
plan CheckinBundle
options { fetchImpl?: FetchLike; fhirBase: string; mode?: PostMode; }
options.fetchImpl? FetchLike
options.fhirBase string
options.mode? PostMode

Returns

Promise<PostResult>