@ovok/core 0.4.55 → 0.4.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,7 +26,7 @@ exports.OVOK_CORE_REQUIREMENTS = {
26
26
  description: "The FHIR surface a server must provide for the @ovok/core client library's own methods to function.",
27
27
  software: {
28
28
  name: "@ovok/core",
29
- version: "0.4.55",
29
+ version: "0.4.56",
30
30
  },
31
31
  fhirVersion: "4.0.1",
32
32
  format: ["json"],
@@ -1,4 +1,4 @@
1
- import type { BundleEntry } from "@medplum/fhirtypes";
1
+ import type { BundleEntry, CodeableConcept } from "@medplum/fhirtypes";
2
2
  /**
3
3
  * What an outbox item holds: a whole reading, a growing series, one piece of a long recording, or a deletion.
4
4
  *
@@ -71,6 +71,8 @@ export type OutboxItem = OutboxItemSummary & {
71
71
  export type OutboxSentItem = Pick<OutboxItemSummary, "id" | "kind" | "group" | "seq" | "recordedAt"> & {
72
72
  /** When the server accepted it, in epoch milliseconds. */
73
73
  sentAt: number;
74
+ /** What the reading is: its main observation's code. A deletion has none. */
75
+ code?: CodeableConcept;
74
76
  };
75
77
  /**
76
78
  * How far a long recording has got.
@@ -29,6 +29,6 @@ export declare class RunnerState {
29
29
  supersede(id: string): void;
30
30
  /** True once if the item was superseded since it was planned. */
31
31
  wasSuperseded(id: string): boolean;
32
- remember({ id, kind, group, seq, recordedAt }: OutboxItem): void;
32
+ remember({ id, kind, group, seq, recordedAt, entries }: OutboxItem): void;
33
33
  recentlySent(): OutboxSentItem[];
34
34
  }
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RunnerState = void 0;
4
+ const entry_observation_1 = require("./entry-observation");
4
5
  const failure_policy_1 = require("./failure-policy");
5
6
  const RECENTLY_SENT_LIMIT = 50;
6
7
  /** What the runner remembers between requests: pauses, connectivity, what is planned or sending, what was sent. */
@@ -49,9 +50,11 @@ class RunnerState {
49
50
  wasSuperseded(id) {
50
51
  return this.superseded.delete(id);
51
52
  }
52
- remember({ id, kind, group, seq, recordedAt }) {
53
+ remember({ id, kind, group, seq, recordedAt, entries }) {
54
+ var _a;
53
55
  const position = { ...(group === undefined ? {} : { group }), ...(seq === undefined ? {} : { seq }) };
54
- this.recent.unshift({ id, kind, recordedAt, sentAt: this.now(), ...position });
56
+ const code = (_a = (0, entry_observation_1.observationOf)(entries[0])) === null || _a === void 0 ? void 0 : _a.code;
57
+ this.recent.unshift({ id, kind, recordedAt, sentAt: this.now(), ...position, ...(code && { code }) });
55
58
  this.recent.length = Math.min(this.recent.length, RECENTLY_SENT_LIMIT);
56
59
  }
57
60
  recentlySent() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ovok/core",
3
- "version": "0.4.55",
3
+ "version": "0.4.56",
4
4
  "private": false,
5
5
  "main": "dist/next/index.js",
6
6
  "types": "dist/next/index.d.ts",