@awell-health/awell-extensions 2.1.225 → 2.1.227

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.
Files changed (32) hide show
  1. package/dist/extensions/awell/v1/ingestion/catalog.d.ts +70 -0
  2. package/dist/extensions/awell/v1/ingestion/catalog.js +104 -0
  3. package/dist/extensions/awell/v1/ingestion/catalog.js.map +1 -0
  4. package/dist/extensions/awell/v1/ingestion/dataIngestion.d.ts +103 -8
  5. package/dist/extensions/awell/v1/ingestion/dataIngestion.js +132 -14
  6. package/dist/extensions/awell/v1/ingestion/dataIngestion.js.map +1 -1
  7. package/dist/extensions/awell/v1/ingestion/dataIngestionSimple.d.ts +36 -0
  8. package/dist/extensions/awell/v1/ingestion/dataIngestionSimple.js +49 -0
  9. package/dist/extensions/awell/v1/ingestion/dataIngestionSimple.js.map +1 -0
  10. package/dist/extensions/awell/v1/ingestion/index.d.ts +44 -3
  11. package/dist/extensions/awell/v1/ingestion/index.js +4 -2
  12. package/dist/extensions/awell/v1/ingestion/index.js.map +1 -1
  13. package/dist/extensions/awellTasks/api/schema/GetTasks.schema.d.ts +4 -4
  14. package/dist/extensions/bland/actions/sendCall/config/fields.d.ts +3 -3
  15. package/dist/extensions/bland/actions/sendCallWithPathway/config/fields.d.ts +3 -3
  16. package/dist/extensions/bland/lib/sharedActionFields.d.ts +1 -1
  17. package/dist/extensions/bland/lib/sharedActionFields.js +3 -2
  18. package/dist/extensions/bland/lib/sharedActionFields.js.map +1 -1
  19. package/dist/extensions/canvasMedical/v1/validation/address.zod.d.ts +1 -1
  20. package/dist/extensions/canvasMedical/v1/validation/patient.zod.d.ts +2 -2
  21. package/dist/extensions/canvasMedical/v1/validation/task.zod.d.ts +4 -4
  22. package/dist/extensions/elation/validation/patient.zod.d.ts +3 -3
  23. package/dist/extensions/markdown.json +2 -2
  24. package/dist/extensions/medplum/actions/createServiceRequest/config/fields.d.ts +3 -3
  25. package/dist/extensions/medplum/actions/createTask/config/fields.d.ts +4 -4
  26. package/dist/extensions/medplum/fhir/schemas/resources/serviceRequest.schema.d.ts +1 -1
  27. package/dist/extensions/medplum/fhir/schemas/resources/task.schema.d.ts +2 -2
  28. package/dist/extensions/medplum/webhooks/index.d.ts +1 -1
  29. package/dist/src/lib/fhir/schemas/Appointment/Status.schema.d.ts +2 -2
  30. package/dist/src/lib/fhir/schemas/ServiceRequest/Status.schema.d.ts +1 -1
  31. package/dist/src/lib/fhir/schemas/Task/Status.schema.d.ts +2 -2
  32. package/package.json +1 -1
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Where `dataIngestion` writes: Awell's core objects as the data workbench names them, by key alone. Encounter and
3
+ * Condition are the patient's records and are written. Location and Organization are the organization's directory: an
4
+ * ingestion never writes one, it points at a record the organization already holds, by identifier.
5
+ */
6
+ export declare const ENCOUNTER_OBJECT = "encounter";
7
+ export declare const CONDITION_OBJECT = "condition";
8
+ export declare const LOCATION_OBJECT = "location";
9
+ export declare const ORGANIZATION_OBJECT = "organization";
10
+ /**
11
+ * The sender's system of record. Every record it sends is identified under this one system by the sender's own id:
12
+ * the patient, an encounter, a condition, and the Location or Organization an encounter points at. A Location or
13
+ * Organization must carry an identifier under it in the workbench for an encounter's reference to resolve.
14
+ */
15
+ export declare const IDENTIFIER_SYSTEM = "https://acme.com";
16
+ /** A coding as the catalog stores it. */
17
+ export interface CatalogCoding {
18
+ system: string;
19
+ code: string;
20
+ display?: string;
21
+ }
22
+ export declare const ENCOUNTER_CLASSES: {
23
+ readonly inpatient: CatalogCoding;
24
+ readonly emergency: CatalogCoding;
25
+ readonly ambulatory: CatalogCoding;
26
+ readonly observation: CatalogCoding;
27
+ readonly virtual: CatalogCoding;
28
+ readonly home: CatalogCoding;
29
+ };
30
+ /** Encounter status (`encounter_status`). */
31
+ export declare const ENCOUNTER_STATUSES: readonly ["planned", "arrived", "in-progress", "finished", "cancelled"];
32
+ export declare const encounterStatus: (code: string) => CatalogCoding;
33
+ export declare const DISCHARGE_DISPOSITIONS: readonly ["home", "alt-home", "other-hcf", "hosp", "long", "aadvice", "exp", "psy", "rehab", "snf", "oth"];
34
+ export declare const dischargeDisposition: (code: string) => CatalogCoding;
35
+ /** Condition code: ICD-10-CM, with the sender's description as its display. */
36
+ export declare const icd10: (code: string, display?: string) => CatalogCoding;
37
+ /** Condition clinical status (`condition_clinical`). */
38
+ export declare const CLINICAL_STATUSES: readonly ["active", "recurrence", "relapse", "inactive", "remission", "resolved"];
39
+ export declare const clinicalStatus: (code: string) => CatalogCoding;
40
+ /** Condition verification status (`condition_ver_status`). */
41
+ export declare const VERIFICATION_STATUSES: readonly ["unconfirmed", "provisional", "differential", "confirmed", "refuted", "entered-in-error"];
42
+ export declare const verificationStatus: (code: string) => CatalogCoding;
43
+ /** Condition category (`condition_category`): a condition arriving with an encounter is that encounter's diagnosis. */
44
+ export declare const ENCOUNTER_DIAGNOSIS: CatalogCoding;
45
+ export declare const SEVERITIES: {
46
+ readonly mild: CatalogCoding;
47
+ readonly moderate: CatalogCoding;
48
+ readonly severe: CatalogCoding;
49
+ };
50
+ /** The patient profile stores sex as a number: not known 0, male 1, female 2. */
51
+ export declare const SEX_CODES: {
52
+ readonly unknown: 0;
53
+ readonly male: 1;
54
+ readonly female: 2;
55
+ };
56
+ export interface RecordRef {
57
+ $ref: {
58
+ object: string;
59
+ identifier: {
60
+ system: string;
61
+ value: string;
62
+ };
63
+ };
64
+ }
65
+ /** A Location of the organization's directory. */
66
+ export declare const locationRef: (value: string) => RecordRef;
67
+ /** An Organization of the organization's directory. */
68
+ export declare const organizationRef: (value: string) => RecordRef;
69
+ /** One of the patient's Encounters, ingested by an earlier payload. */
70
+ export declare const encounterRef: (value: string) => RecordRef;
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.encounterRef = exports.organizationRef = exports.locationRef = exports.SEX_CODES = exports.SEVERITIES = exports.ENCOUNTER_DIAGNOSIS = exports.verificationStatus = exports.VERIFICATION_STATUSES = exports.clinicalStatus = exports.CLINICAL_STATUSES = exports.icd10 = exports.dischargeDisposition = exports.DISCHARGE_DISPOSITIONS = exports.encounterStatus = exports.ENCOUNTER_STATUSES = exports.ENCOUNTER_CLASSES = exports.IDENTIFIER_SYSTEM = exports.ORGANIZATION_OBJECT = exports.LOCATION_OBJECT = exports.CONDITION_OBJECT = exports.ENCOUNTER_OBJECT = void 0;
4
+ /**
5
+ * Where `dataIngestion` writes: Awell's core objects as the data workbench names them, by key alone. Encounter and
6
+ * Condition are the patient's records and are written. Location and Organization are the organization's directory: an
7
+ * ingestion never writes one, it points at a record the organization already holds, by identifier.
8
+ */
9
+ exports.ENCOUNTER_OBJECT = 'encounter';
10
+ exports.CONDITION_OBJECT = 'condition';
11
+ exports.LOCATION_OBJECT = 'location';
12
+ exports.ORGANIZATION_OBJECT = 'organization';
13
+ /**
14
+ * The sender's system of record. Every record it sends is identified under this one system by the sender's own id:
15
+ * the patient, an encounter, a condition, and the Location or Organization an encounter points at. A Location or
16
+ * Organization must carry an identifier under it in the workbench for an encounter's reference to resolve.
17
+ */
18
+ exports.IDENTIFIER_SYSTEM = 'https://acme.com';
19
+ const coding = (system, code, display) => display === undefined ? { system, code } : { system, code, display };
20
+ /** Encounter class (`encounter_class`), from FHIR's v3 ActCode. */
21
+ const ACT_CODE = 'http://terminology.hl7.org/CodeSystem/v3-ActCode';
22
+ exports.ENCOUNTER_CLASSES = {
23
+ inpatient: coding(ACT_CODE, 'IMP', 'inpatient encounter'),
24
+ emergency: coding(ACT_CODE, 'EMER', 'emergency'),
25
+ ambulatory: coding(ACT_CODE, 'AMB', 'ambulatory'),
26
+ observation: coding(ACT_CODE, 'OBSENC', 'observation encounter'),
27
+ virtual: coding(ACT_CODE, 'VR', 'virtual'),
28
+ home: coding(ACT_CODE, 'HH', 'home health'),
29
+ };
30
+ /** Encounter status (`encounter_status`). */
31
+ exports.ENCOUNTER_STATUSES = [
32
+ 'planned',
33
+ 'arrived',
34
+ 'in-progress',
35
+ 'finished',
36
+ 'cancelled',
37
+ ];
38
+ const encounterStatus = (code) => coding('http://hl7.org/fhir/encounter-status', code);
39
+ exports.encounterStatus = encounterStatus;
40
+ exports.DISCHARGE_DISPOSITIONS = [
41
+ 'home',
42
+ 'alt-home',
43
+ 'other-hcf',
44
+ 'hosp',
45
+ 'long',
46
+ 'aadvice',
47
+ 'exp',
48
+ 'psy',
49
+ 'rehab',
50
+ 'snf',
51
+ 'oth',
52
+ ];
53
+ const dischargeDisposition = (code) => coding('http://terminology.hl7.org/CodeSystem/discharge-disposition', code);
54
+ exports.dischargeDisposition = dischargeDisposition;
55
+ /** Condition code: ICD-10-CM, with the sender's description as its display. */
56
+ const icd10 = (code, display) => coding('http://hl7.org/fhir/sid/icd-10-cm', code, display);
57
+ exports.icd10 = icd10;
58
+ /** Condition clinical status (`condition_clinical`). */
59
+ exports.CLINICAL_STATUSES = [
60
+ 'active',
61
+ 'recurrence',
62
+ 'relapse',
63
+ 'inactive',
64
+ 'remission',
65
+ 'resolved',
66
+ ];
67
+ const clinicalStatus = (code) => coding('http://terminology.hl7.org/CodeSystem/condition-clinical', code);
68
+ exports.clinicalStatus = clinicalStatus;
69
+ /** Condition verification status (`condition_ver_status`). */
70
+ exports.VERIFICATION_STATUSES = [
71
+ 'unconfirmed',
72
+ 'provisional',
73
+ 'differential',
74
+ 'confirmed',
75
+ 'refuted',
76
+ 'entered-in-error',
77
+ ];
78
+ const verificationStatus = (code) => coding('http://terminology.hl7.org/CodeSystem/condition-ver-status', code);
79
+ exports.verificationStatus = verificationStatus;
80
+ /** Condition category (`condition_category`): a condition arriving with an encounter is that encounter's diagnosis. */
81
+ exports.ENCOUNTER_DIAGNOSIS = coding('http://terminology.hl7.org/CodeSystem/condition-category', 'encounter-diagnosis', 'Encounter Diagnosis');
82
+ /** Condition severity, as SNOMED CT codes it. */
83
+ const SNOMED = 'http://snomed.info/sct';
84
+ exports.SEVERITIES = {
85
+ mild: coding(SNOMED, '255604002', 'Mild'),
86
+ moderate: coding(SNOMED, '6736007', 'Moderate'),
87
+ severe: coding(SNOMED, '24484000', 'Severe'),
88
+ };
89
+ /** The patient profile stores sex as a number: not known 0, male 1, female 2. */
90
+ exports.SEX_CODES = { unknown: 0, male: 1, female: 2 };
91
+ /**
92
+ * A reference to a record by the identifier the sender gives it. The runtime looks it up in the patient's records,
93
+ * then the organization's, and stores `<object>/<record id>`; one neither holds is left out and logged.
94
+ */
95
+ const refTo = (object, system) => (value) => ({
96
+ $ref: { object, identifier: { system, value } },
97
+ });
98
+ /** A Location of the organization's directory. */
99
+ exports.locationRef = refTo(exports.LOCATION_OBJECT, exports.IDENTIFIER_SYSTEM);
100
+ /** An Organization of the organization's directory. */
101
+ exports.organizationRef = refTo(exports.ORGANIZATION_OBJECT, exports.IDENTIFIER_SYSTEM);
102
+ /** One of the patient's Encounters, ingested by an earlier payload. */
103
+ exports.encounterRef = refTo(exports.ENCOUNTER_OBJECT, exports.IDENTIFIER_SYSTEM);
104
+ //# sourceMappingURL=catalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../../../../extensions/awell/v1/ingestion/catalog.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACU,QAAA,gBAAgB,GAAG,WAAW,CAAA;AAC9B,QAAA,gBAAgB,GAAG,WAAW,CAAA;AAC9B,QAAA,eAAe,GAAG,UAAU,CAAA;AAC5B,QAAA,mBAAmB,GAAG,cAAc,CAAA;AAEjD;;;;GAIG;AACU,QAAA,iBAAiB,GAAG,kBAAkB,CAAA;AASnD,MAAM,MAAM,GAAG,CACb,MAAc,EACd,IAAY,EACZ,OAAgB,EACD,EAAE,CACjB,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAA;AAEtE,mEAAmE;AACnE,MAAM,QAAQ,GAAG,kDAAkD,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AAC,CAAA;AACpE,uDAAuD;AAC1C,QAAA,eAAe,GAAG,KAAK,CAAC,2BAAmB,EAAE,yBAAiB,CAAC,CAAA;AAC5E,uEAAuE;AAC1D,QAAA,YAAY,GAAG,KAAK,CAAC,wBAAgB,EAAE,yBAAiB,CAAC,CAAA"}
@@ -1,36 +1,131 @@
1
1
  import { z } from 'zod';
2
2
  /**
3
- * Experimental. The payload is the record: one POST is one patient. Everything
4
- * but the subject key is optional so a partial payload still ingests what it
5
- * carries. Field names (`Gender` included) match the data workbench as-is.
3
+ * Experimental. The payload is the record: one POST is one patient, and optionally one encounter at a facility and
4
+ * one condition diagnosed in it. Everything but the subject key is optional so a partial payload still ingests what
5
+ * it carries.
6
6
  */
7
7
  export declare const dataIngestionSchema: z.ZodObject<{
8
8
  patient_id: z.ZodString;
9
- facility_name: z.ZodOptional<z.ZodString>;
10
- Gender: z.ZodOptional<z.ZodString>;
11
9
  first_name: z.ZodOptional<z.ZodString>;
12
10
  last_name: z.ZodOptional<z.ZodString>;
13
- birth_date: z.ZodOptional<z.ZodString>;
11
+ birth_date: z.ZodOptional<z.ZodISODate>;
12
+ sex: z.ZodOptional<z.ZodEnum<{
13
+ unknown: "unknown";
14
+ male: "male";
15
+ female: "female";
16
+ }>>;
17
+ email: z.ZodOptional<z.ZodEmail>;
14
18
  address: z.ZodOptional<z.ZodObject<{
15
19
  street: z.ZodOptional<z.ZodString>;
16
20
  city: z.ZodOptional<z.ZodString>;
17
21
  state: z.ZodOptional<z.ZodString>;
18
22
  zip: z.ZodOptional<z.ZodString>;
23
+ country: z.ZodOptional<z.ZodString>;
24
+ }, z.core.$loose>>;
25
+ encounter: z.ZodOptional<z.ZodObject<{
26
+ visit_id: z.ZodString;
27
+ class: z.ZodEnum<{
28
+ emergency: "emergency";
29
+ ambulatory: "ambulatory";
30
+ virtual: "virtual";
31
+ home: "home";
32
+ inpatient: "inpatient";
33
+ observation: "observation";
34
+ }>;
35
+ status: z.ZodOptional<z.ZodEnum<{
36
+ planned: "planned";
37
+ arrived: "arrived";
38
+ "in-progress": "in-progress";
39
+ finished: "finished";
40
+ cancelled: "cancelled";
41
+ }>>;
42
+ admitted_at: z.ZodOptional<z.ZodISODateTime>;
43
+ discharged_at: z.ZodOptional<z.ZodISODateTime>;
44
+ facility_id: z.ZodOptional<z.ZodString>;
45
+ service_provider_id: z.ZodOptional<z.ZodString>;
46
+ discharge_disposition: z.ZodOptional<z.ZodEnum<{
47
+ exp: "exp";
48
+ home: "home";
49
+ "alt-home": "alt-home";
50
+ "other-hcf": "other-hcf";
51
+ hosp: "hosp";
52
+ long: "long";
53
+ aadvice: "aadvice";
54
+ psy: "psy";
55
+ rehab: "rehab";
56
+ snf: "snf";
57
+ oth: "oth";
58
+ }>>;
59
+ }, z.core.$loose>>;
60
+ condition: z.ZodOptional<z.ZodObject<{
61
+ condition_id: z.ZodString;
62
+ visit_id: z.ZodOptional<z.ZodString>;
63
+ icd10_code: z.ZodString;
64
+ description: z.ZodOptional<z.ZodString>;
65
+ clinical_status: z.ZodOptional<z.ZodEnum<{
66
+ active: "active";
67
+ recurrence: "recurrence";
68
+ relapse: "relapse";
69
+ inactive: "inactive";
70
+ remission: "remission";
71
+ resolved: "resolved";
72
+ }>>;
73
+ verification_status: z.ZodOptional<z.ZodEnum<{
74
+ unconfirmed: "unconfirmed";
75
+ provisional: "provisional";
76
+ differential: "differential";
77
+ confirmed: "confirmed";
78
+ refuted: "refuted";
79
+ "entered-in-error": "entered-in-error";
80
+ }>>;
81
+ severity: z.ZodOptional<z.ZodEnum<{
82
+ mild: "mild";
83
+ moderate: "moderate";
84
+ severe: "severe";
85
+ }>>;
86
+ onset_at: z.ZodOptional<z.ZodISODateTime>;
87
+ recorded_at: z.ZodOptional<z.ZodISODateTime>;
88
+ note: z.ZodOptional<z.ZodString>;
19
89
  }, z.core.$loose>>;
20
90
  }, z.core.$loose>;
21
91
  export declare const dataIngestion: import("@awell-health/extensions-core").IngestionEndpoint<{
22
92
  [x: string]: unknown;
23
93
  patient_id: string;
24
- facility_name?: string | undefined;
25
- Gender?: string | undefined;
26
94
  first_name?: string | undefined;
27
95
  last_name?: string | undefined;
28
96
  birth_date?: string | undefined;
97
+ sex?: "unknown" | "male" | "female" | undefined;
98
+ email?: string | undefined;
29
99
  address?: {
30
100
  [x: string]: unknown;
31
101
  street?: string | undefined;
32
102
  city?: string | undefined;
33
103
  state?: string | undefined;
34
104
  zip?: string | undefined;
105
+ country?: string | undefined;
106
+ } | undefined;
107
+ encounter?: {
108
+ [x: string]: unknown;
109
+ visit_id: string;
110
+ class: "emergency" | "ambulatory" | "virtual" | "home" | "inpatient" | "observation";
111
+ status?: "planned" | "arrived" | "in-progress" | "finished" | "cancelled" | undefined;
112
+ admitted_at?: string | undefined;
113
+ discharged_at?: string | undefined;
114
+ facility_id?: string | undefined;
115
+ service_provider_id?: string | undefined;
116
+ discharge_disposition?: "exp" | "home" | "alt-home" | "other-hcf" | "hosp" | "long" | "aadvice" | "psy" | "rehab" | "snf" | "oth" | undefined;
117
+ } | undefined;
118
+ condition?: {
119
+ [x: string]: unknown;
120
+ condition_id: string;
121
+ icd10_code: string;
122
+ visit_id?: string | undefined;
123
+ description?: string | undefined;
124
+ clinical_status?: "active" | "recurrence" | "relapse" | "inactive" | "remission" | "resolved" | undefined;
125
+ verification_status?: "unconfirmed" | "provisional" | "differential" | "confirmed" | "refuted" | "entered-in-error" | undefined;
126
+ severity?: "mild" | "moderate" | "severe" | undefined;
127
+ onset_at?: string | undefined;
128
+ recorded_at?: string | undefined;
129
+ note?: string | undefined;
35
130
  } | undefined;
36
131
  }, unknown, import("@awell-health/extensions-core").Settings>;
@@ -4,46 +4,164 @@ exports.dataIngestion = exports.dataIngestionSchema = void 0;
4
4
  const extensions_core_1 = require("@awell-health/extensions-core");
5
5
  const lodash_1 = require("lodash");
6
6
  const zod_1 = require("zod");
7
+ const catalog_1 = require("./catalog");
7
8
  const trimmedString = zod_1.z.string().trim();
9
+ const id = trimmedString.min(1);
10
+ const timestamp = zod_1.z.iso.datetime({ offset: true });
11
+ const keysOf = (object) => Object.keys(object);
12
+ const encounterSchema = zod_1.z.looseObject({
13
+ visit_id: id,
14
+ class: zod_1.z.enum(keysOf(catalog_1.ENCOUNTER_CLASSES)),
15
+ /** Derived from `discharged_at` when omitted: finished once discharged, in progress until then. */
16
+ status: zod_1.z.enum(catalog_1.ENCOUNTER_STATUSES).optional(),
17
+ admitted_at: timestamp.optional(),
18
+ discharged_at: timestamp.optional(),
19
+ /** The id of a Location the organization already holds in the workbench. */
20
+ facility_id: id.optional(),
21
+ /** The id of an Organization the organization already holds in the workbench. */
22
+ service_provider_id: id.optional(),
23
+ discharge_disposition: zod_1.z.enum(catalog_1.DISCHARGE_DISPOSITIONS).optional(),
24
+ });
25
+ const conditionSchema = zod_1.z.looseObject({
26
+ condition_id: id,
27
+ /**
28
+ * The visit the condition was diagnosed in. Omit it to link the payload's own `encounter`; name another visit to
29
+ * link one an earlier payload ingested.
30
+ */
31
+ visit_id: id.optional(),
32
+ icd10_code: id,
33
+ description: trimmedString.optional(),
34
+ clinical_status: zod_1.z.enum(catalog_1.CLINICAL_STATUSES).optional(),
35
+ verification_status: zod_1.z.enum(catalog_1.VERIFICATION_STATUSES).optional(),
36
+ severity: zod_1.z.enum(keysOf(catalog_1.SEVERITIES)).optional(),
37
+ onset_at: timestamp.optional(),
38
+ recorded_at: timestamp.optional(),
39
+ note: trimmedString.optional(),
40
+ });
8
41
  /**
9
- * Experimental. The payload is the record: one POST is one patient. Everything
10
- * but the subject key is optional so a partial payload still ingests what it
11
- * carries. Field names (`Gender` included) match the data workbench as-is.
42
+ * Experimental. The payload is the record: one POST is one patient, and optionally one encounter at a facility and
43
+ * one condition diagnosed in it. Everything but the subject key is optional so a partial payload still ingests what
44
+ * it carries.
12
45
  */
13
46
  exports.dataIngestionSchema = zod_1.z.looseObject({
14
- patient_id: trimmedString.min(1),
15
- facility_name: trimmedString.optional(),
16
- Gender: trimmedString.optional(),
47
+ /** The patient's id in the sender's system of record, `https://acme.com`. */
48
+ patient_id: id,
17
49
  first_name: trimmedString.optional(),
18
50
  last_name: trimmedString.optional(),
19
- birth_date: trimmedString.optional(),
51
+ birth_date: zod_1.z.iso.date().optional(),
52
+ sex: zod_1.z.enum(keysOf(catalog_1.SEX_CODES)).optional(),
53
+ email: zod_1.z.email().optional(),
20
54
  address: zod_1.z
21
55
  .looseObject({
22
56
  street: trimmedString.optional(),
23
57
  city: trimmedString.optional(),
24
58
  state: trimmedString.optional(),
25
59
  zip: trimmedString.optional(),
60
+ country: trimmedString.optional(),
26
61
  })
27
62
  .optional(),
63
+ encounter: encounterSchema.optional(),
64
+ condition: conditionSchema.optional(),
65
+ });
66
+ /** Drops what a payload does not carry, so a save never clears a field an earlier payload set. */
67
+ const known = (data) => (0, lodash_1.omitBy)(data, lodash_1.isUndefined);
68
+ const statusOf = (encounter) => {
69
+ var _a;
70
+ return (_a = encounter.status) !== null && _a !== void 0 ? _a : ((0, lodash_1.isUndefined)(encounter.discharged_at) ? 'in-progress' : 'finished');
71
+ };
72
+ /** The Encounter, upserted on the visit id, at the Location the facility id names. */
73
+ const encounterData = (encounter, status) => known({
74
+ identifier: {
75
+ system: catalog_1.IDENTIFIER_SYSTEM,
76
+ value: encounter.visit_id,
77
+ },
78
+ class: catalog_1.ENCOUNTER_CLASSES[encounter.class],
79
+ status: (0, catalog_1.encounterStatus)(status),
80
+ period_start: encounter.admitted_at,
81
+ period_end: encounter.discharged_at,
82
+ location: (0, lodash_1.isUndefined)(encounter.facility_id)
83
+ ? undefined
84
+ : [(0, catalog_1.locationRef)(encounter.facility_id)],
85
+ service_provider: (0, lodash_1.isUndefined)(encounter.service_provider_id)
86
+ ? undefined
87
+ : (0, catalog_1.organizationRef)(encounter.service_provider_id),
88
+ discharge_disposition: (0, lodash_1.isUndefined)(encounter.discharge_disposition)
89
+ ? undefined
90
+ : (0, catalog_1.dischargeDisposition)(encounter.discharge_disposition),
91
+ });
92
+ /**
93
+ * The encounter a condition was diagnosed in: this payload's, by the id its save answered, or an earlier payload's,
94
+ * by its visit id. Nothing when the condition names no visit and the payload carries no encounter.
95
+ */
96
+ const encounterOfCondition = (condition, encounter) => {
97
+ if ((0, lodash_1.isUndefined)(condition.visit_id))
98
+ return encounter === null || encounter === void 0 ? void 0 : encounter.id;
99
+ return condition.visit_id === (encounter === null || encounter === void 0 ? void 0 : encounter.visitId)
100
+ ? encounter.id
101
+ : (0, catalog_1.encounterRef)(condition.visit_id);
102
+ };
103
+ /** The Condition, upserted on its id, pointing at the encounter it was diagnosed in when there is one. */
104
+ const conditionData = (condition, encounterId) => known({
105
+ identifier: {
106
+ system: catalog_1.IDENTIFIER_SYSTEM,
107
+ value: condition.condition_id,
108
+ },
109
+ code: (0, catalog_1.icd10)(condition.icd10_code, condition.description),
110
+ clinical_status: (0, lodash_1.isUndefined)(condition.clinical_status)
111
+ ? undefined
112
+ : (0, catalog_1.clinicalStatus)(condition.clinical_status),
113
+ verification_status: (0, lodash_1.isUndefined)(condition.verification_status)
114
+ ? undefined
115
+ : (0, catalog_1.verificationStatus)(condition.verification_status),
116
+ category: (0, lodash_1.isUndefined)(encounterId) ? undefined : [catalog_1.ENCOUNTER_DIAGNOSIS],
117
+ severity: (0, lodash_1.isUndefined)(condition.severity)
118
+ ? undefined
119
+ : catalog_1.SEVERITIES[condition.severity],
120
+ encounter: encounterId,
121
+ onset_at: condition.onset_at,
122
+ recorded_at: condition.recorded_at,
123
+ note: condition.note,
28
124
  });
29
125
  exports.dataIngestion = (0, extensions_core_1.defineEndpoint)({
30
126
  key: 'dataIngestion',
31
127
  title: 'Data ingestion (experimental)',
32
- description: 'Experimental endpoint. POST a patient payload to write demographics to the data store and publish a care flow start event. Identifies the patient by `patient_id`.',
128
+ description: 'Experimental endpoint. POST a patient payload, optionally with an `encounter` at a facility and a `condition` diagnosed in it. Writes the demographics, the Encounter (pointing at the Location the facility id names) and the Condition (pointing at the Encounter) to the data store, and publishes events for care flows. Identifies the patient by `patient_id` under `https://acme.com`.',
33
129
  source: 'webhook',
34
130
  schema: exports.dataIngestionSchema,
35
- identifier: { resolveValue: (record) => record.patient_id },
131
+ identifier: {
132
+ system: catalog_1.IDENTIFIER_SYSTEM,
133
+ resolveValue: (record) => record.patient_id,
134
+ },
36
135
  run: async ({ record, store, events }) => {
37
- store.save('patient', (0, lodash_1.omitBy)({
38
- facility_name: record.facility_name,
39
- Gender: record.Gender,
136
+ const demographics = known({
40
137
  first_name: record.first_name,
41
138
  last_name: record.last_name,
42
139
  birth_date: record.birth_date,
43
- address: record.address,
44
- }, lodash_1.isUndefined));
140
+ sex: (0, lodash_1.isUndefined)(record.sex) ? undefined : catalog_1.SEX_CODES[record.sex],
141
+ email: record.email,
142
+ address: (0, lodash_1.isUndefined)(record.address) ? undefined : known(record.address),
143
+ });
144
+ if (Object.keys(demographics).length > 0)
145
+ store.save('patient', demographics);
146
+ // The encounter is saved first so the condition can name it: a save may only reference one written before it.
147
+ const status = (0, lodash_1.isUndefined)(record.encounter)
148
+ ? undefined
149
+ : statusOf(record.encounter);
150
+ const encounter = (0, lodash_1.isUndefined)(record.encounter) || (0, lodash_1.isUndefined)(status)
151
+ ? undefined
152
+ : {
153
+ visitId: record.encounter.visit_id,
154
+ id: store.save(catalog_1.ENCOUNTER_OBJECT, encounterData(record.encounter, status)).id,
155
+ };
156
+ if (!(0, lodash_1.isUndefined)(record.condition)) {
157
+ store.save(catalog_1.CONDITION_OBJECT, conditionData(record.condition, encounterOfCondition(record.condition, encounter)));
158
+ }
45
159
  events.publish({ key: 'careflow.start' });
46
160
  events.publish({ key: 'ingestion.testing' });
161
+ if (status === 'finished')
162
+ events.publish({ key: 'patient.discharged' });
163
+ if (status === 'arrived' || status === 'in-progress')
164
+ events.publish({ key: 'patient.admitted' });
47
165
  },
48
166
  });
49
167
  //# sourceMappingURL=dataIngestion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dataIngestion.js","sourceRoot":"","sources":["../../../../../extensions/awell/v1/ingestion/dataIngest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a;YAClD,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,kBAAkB,EAAE,CAAC,CAAA;IAC/C,CAAC;CACF,CAAC,CAAA"}
@@ -0,0 +1,36 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Experimental. The payload is the record: one POST is one patient. Everything
4
+ * but the subject key is optional so a partial payload still ingests what it
5
+ * carries. Field names (`Gender` included) match the data workbench as-is.
6
+ */
7
+ export declare const dataIngestionSimpleSchema: z.ZodObject<{
8
+ patient_id: z.ZodString;
9
+ facility_name: z.ZodOptional<z.ZodString>;
10
+ Gender: z.ZodOptional<z.ZodString>;
11
+ first_name: z.ZodOptional<z.ZodString>;
12
+ last_name: z.ZodOptional<z.ZodString>;
13
+ birth_date: z.ZodOptional<z.ZodString>;
14
+ address: z.ZodOptional<z.ZodObject<{
15
+ street: z.ZodOptional<z.ZodString>;
16
+ city: z.ZodOptional<z.ZodString>;
17
+ state: z.ZodOptional<z.ZodString>;
18
+ zip: z.ZodOptional<z.ZodString>;
19
+ }, z.core.$loose>>;
20
+ }, z.core.$loose>;
21
+ export declare const dataIngestionSimple: import("@awell-health/extensions-core").IngestionEndpoint<{
22
+ [x: string]: unknown;
23
+ patient_id: string;
24
+ facility_name?: string | undefined;
25
+ Gender?: string | undefined;
26
+ first_name?: string | undefined;
27
+ last_name?: string | undefined;
28
+ birth_date?: string | undefined;
29
+ address?: {
30
+ [x: string]: unknown;
31
+ street?: string | undefined;
32
+ city?: string | undefined;
33
+ state?: string | undefined;
34
+ zip?: string | undefined;
35
+ } | undefined;
36
+ }, unknown, import("@awell-health/extensions-core").Settings>;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dataIngestionSimple = exports.dataIngestionSimpleSchema = void 0;
4
+ const extensions_core_1 = require("@awell-health/extensions-core");
5
+ const lodash_1 = require("lodash");
6
+ const zod_1 = require("zod");
7
+ const trimmedString = zod_1.z.string().trim();
8
+ /**
9
+ * Experimental. The payload is the record: one POST is one patient. Everything
10
+ * but the subject key is optional so a partial payload still ingests what it
11
+ * carries. Field names (`Gender` included) match the data workbench as-is.
12
+ */
13
+ exports.dataIngestionSimpleSchema = zod_1.z.looseObject({
14
+ patient_id: trimmedString.min(1),
15
+ facility_name: trimmedString.optional(),
16
+ Gender: trimmedString.optional(),
17
+ first_name: trimmedString.optional(),
18
+ last_name: trimmedString.optional(),
19
+ birth_date: trimmedString.optional(),
20
+ address: zod_1.z
21
+ .looseObject({
22
+ street: trimmedString.optional(),
23
+ city: trimmedString.optional(),
24
+ state: trimmedString.optional(),
25
+ zip: trimmedString.optional(),
26
+ })
27
+ .optional(),
28
+ });
29
+ exports.dataIngestionSimple = (0, extensions_core_1.defineEndpoint)({
30
+ key: 'dataIngestionSimple',
31
+ title: 'Data ingestion, simple (experimental)',
32
+ description: 'Experimental endpoint. POST a patient payload to write demographics to the data store and publish a care flow start event. Identifies the patient by `patient_id`.',
33
+ source: 'webhook',
34
+ schema: exports.dataIngestionSimpleSchema,
35
+ identifier: { resolveValue: (record) => record.patient_id },
36
+ run: async ({ record, store, events }) => {
37
+ store.save('patient', (0, lodash_1.omitBy)({
38
+ facility_name: record.facility_name,
39
+ Gender: record.Gender,
40
+ first_name: record.first_name,
41
+ last_name: record.last_name,
42
+ birth_date: record.birth_date,
43
+ address: record.address,
44
+ }, lodash_1.isUndefined));
45
+ events.publish({ key: 'careflow.start' });
46
+ events.publish({ key: 'ingestion.testing' });
47
+ },
48
+ });
49
+ //# sourceMappingURL=dataIngestionSimple.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataIngestionSimple.js","sourceRoot":"","sources":["../../../../../extensions/awell/v1/ingestion/dataIngestionSimple.ts"],"names":[],"mappings":";;;AAAA,mEAA8D;AAC9D,mCAA4C;AAC5C,6BAAuB;AAEvB,MAAM,aAAa,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAA;AAEvC;;;;GAIG;AACU,QAAA,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AAA;QAED,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,gBAAgB,EAAE,CAAC,CAAA;QACzC,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,mBAAmB,EAAE,CAAC,CAAA;IAC9C,CAAC;CACF,CAAC,CAAA"}
@@ -1,6 +1,47 @@
1
1
  import { dataIngestion } from './dataIngestion';
2
- export { dataIngestion };
3
- export declare const ingestion: import("@awell-health/extensions-core").IngestionEndpoint<{
2
+ import { dataIngestionSimple } from './dataIngestionSimple';
3
+ export { dataIngestion, dataIngestionSimple };
4
+ export declare const ingestion: (import("@awell-health/extensions-core").IngestionEndpoint<{
5
+ [x: string]: unknown;
6
+ patient_id: string;
7
+ first_name?: string | undefined;
8
+ last_name?: string | undefined;
9
+ birth_date?: string | undefined;
10
+ sex?: "unknown" | "male" | "female" | undefined;
11
+ email?: string | undefined;
12
+ address?: {
13
+ [x: string]: unknown;
14
+ street?: string | undefined;
15
+ city?: string | undefined;
16
+ state?: string | undefined;
17
+ zip?: string | undefined;
18
+ country?: string | undefined;
19
+ } | undefined;
20
+ encounter?: {
21
+ [x: string]: unknown;
22
+ visit_id: string;
23
+ class: "emergency" | "ambulatory" | "virtual" | "home" | "inpatient" | "observation";
24
+ status?: "planned" | "arrived" | "in-progress" | "finished" | "cancelled" | undefined;
25
+ admitted_at?: string | undefined;
26
+ discharged_at?: string | undefined;
27
+ facility_id?: string | undefined;
28
+ service_provider_id?: string | undefined;
29
+ discharge_disposition?: "exp" | "home" | "alt-home" | "other-hcf" | "hosp" | "long" | "aadvice" | "psy" | "rehab" | "snf" | "oth" | undefined;
30
+ } | undefined;
31
+ condition?: {
32
+ [x: string]: unknown;
33
+ condition_id: string;
34
+ icd10_code: string;
35
+ visit_id?: string | undefined;
36
+ description?: string | undefined;
37
+ clinical_status?: "active" | "recurrence" | "relapse" | "inactive" | "remission" | "resolved" | undefined;
38
+ verification_status?: "unconfirmed" | "provisional" | "differential" | "confirmed" | "refuted" | "entered-in-error" | undefined;
39
+ severity?: "mild" | "moderate" | "severe" | undefined;
40
+ onset_at?: string | undefined;
41
+ recorded_at?: string | undefined;
42
+ note?: string | undefined;
43
+ } | undefined;
44
+ }, unknown, import("@awell-health/extensions-core").Settings> | import("@awell-health/extensions-core").IngestionEndpoint<{
4
45
  [x: string]: unknown;
5
46
  patient_id: string;
6
47
  facility_name?: string | undefined;
@@ -15,4 +56,4 @@ export declare const ingestion: import("@awell-health/extensions-core").Ingestio
15
56
  state?: string | undefined;
16
57
  zip?: string | undefined;
17
58
  } | undefined;
18
- }, unknown, import("@awell-health/extensions-core").Settings>[];
59
+ }, unknown, import("@awell-health/extensions-core").Settings>)[];
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ingestion = exports.dataIngestion = void 0;
3
+ exports.ingestion = exports.dataIngestionSimple = exports.dataIngestion = void 0;
4
4
  const dataIngestion_1 = require("./dataIngestion");
5
5
  Object.defineProperty(exports, "dataIngestion", { enumerable: true, get: function () { return dataIngestion_1.dataIngestion; } });
6
- exports.ingestion = [dataIngestion_1.dataIngestion];
6
+ const dataIngestionSimple_1 = require("./dataIngestionSimple");
7
+ Object.defineProperty(exports, "dataIngestionSimple", { enumerable: true, get: function () { return dataIngestionSimple_1.dataIngestionSimple; } });
8
+ exports.ingestion = [dataIngestion_1.dataIngestion, dataIngestionSimple_1.dataIngestionSimple];
7
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/awell/v1/ingestion/index.ts"],"names":[],"mappings":";;;AAAA,mDAA+C;AAEtC,8FAFA,6BAAa,OAEA;AACT,QAAA,SAAS,GAAG,CAAC,6BAAa,CAAC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/awell/v1/ingestion/index.ts"],"names":[],"mappings":";;;AAAA,mDAA+C;AAGtC,8FAHA,6BAAa,OAGA;AAFtB,+DAA2D;AAEnC,oGAFf,yCAAmB,OAEe;AAC9B,QAAA,SAAS,GAAG,CAAC,6BAAa,EAAE,yCAAmB,CAAC,CAAA"}
@@ -2,8 +2,8 @@ import { z } from 'zod';
2
2
  export declare const TaskStatusSchema: z.ZodEnum<{
3
3
  completed: "completed";
4
4
  pending: "pending";
5
- in_progress: "in_progress";
6
5
  cancelled: "cancelled";
6
+ in_progress: "in_progress";
7
7
  stuck: "stuck";
8
8
  }>;
9
9
  /**
@@ -13,8 +13,8 @@ export declare const GetTasksInputSchema: z.ZodObject<{
13
13
  status: z.ZodOptional<z.ZodEnum<{
14
14
  completed: "completed";
15
15
  pending: "pending";
16
- in_progress: "in_progress";
17
16
  cancelled: "cancelled";
17
+ in_progress: "in_progress";
18
18
  stuck: "stuck";
19
19
  }>>;
20
20
  patient_id: z.ZodOptional<z.ZodString>;
@@ -45,8 +45,8 @@ export declare const TaskSchema: z.ZodObject<{
45
45
  status: z.ZodEnum<{
46
46
  completed: "completed";
47
47
  pending: "pending";
48
- in_progress: "in_progress";
49
48
  cancelled: "cancelled";
49
+ in_progress: "in_progress";
50
50
  stuck: "stuck";
51
51
  }>;
52
52
  task_type: z.ZodString;
@@ -76,8 +76,8 @@ export declare const GetTasksResponseSchema: z.ZodObject<{
76
76
  status: z.ZodEnum<{
77
77
  completed: "completed";
78
78
  pending: "pending";
79
- in_progress: "in_progress";
80
79
  cancelled: "cancelled";
80
+ in_progress: "in_progress";
81
81
  stuck: "stuck";
82
82
  }>;
83
83
  task_type: z.ZodString;
@@ -352,9 +352,9 @@ export declare const FieldsValidationSchema: z.ZodObject<{
352
352
  turbo: "turbo";
353
353
  }>>;
354
354
  temperature: z.ZodOptional<z.ZodNumber>;
355
- dynamic_data: z.ZodOptional<z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<Record<string, string>[], string | undefined>>>;
355
+ dynamic_data: z.ZodOptional<z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<Record<string, string>[] | undefined, string | undefined>>>;
356
356
  keywords: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string[], string>>>;
357
- pronunciation_guide: z.ZodOptional<z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<Record<string, string>[], string | undefined>>>;
357
+ pronunciation_guide: z.ZodOptional<z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<Record<string, string>[] | undefined, string | undefined>>>;
358
358
  language: z.ZodOptional<z.ZodString>;
359
359
  local_dialing: z.ZodOptional<z.ZodPipe<z.ZodEnum<{
360
360
  true: "true";
@@ -375,7 +375,7 @@ export declare const FieldsValidationSchema: z.ZodObject<{
375
375
  false: "false";
376
376
  }>, z.ZodTransform<boolean, "true" | "false">>>;
377
377
  timezone: z.ZodOptional<z.ZodString>;
378
- tools: z.ZodOptional<z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<Record<string, string>[], string | undefined>>>;
378
+ tools: z.ZodOptional<z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<Record<string, string>[] | undefined, string | undefined>>>;
379
379
  voicemail_message: z.ZodOptional<z.ZodString>;
380
380
  voicemail_action: z.ZodPreprocess<z.ZodOptional<z.ZodEnum<{
381
381
  hangup: "hangup";
@@ -360,9 +360,9 @@ export declare const FieldsValidationSchema: z.ZodObject<{
360
360
  turbo: "turbo";
361
361
  }>>;
362
362
  temperature: z.ZodOptional<z.ZodNumber>;
363
- dynamic_data: z.ZodOptional<z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<Record<string, string>[], string | undefined>>>;
363
+ dynamic_data: z.ZodOptional<z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<Record<string, string>[] | undefined, string | undefined>>>;
364
364
  keywords: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string[], string>>>;
365
- pronunciation_guide: z.ZodOptional<z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<Record<string, string>[], string | undefined>>>;
365
+ pronunciation_guide: z.ZodOptional<z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<Record<string, string>[] | undefined, string | undefined>>>;
366
366
  language: z.ZodOptional<z.ZodString>;
367
367
  local_dialing: z.ZodOptional<z.ZodPipe<z.ZodEnum<{
368
368
  true: "true";
@@ -383,7 +383,7 @@ export declare const FieldsValidationSchema: z.ZodObject<{
383
383
  false: "false";
384
384
  }>, z.ZodTransform<boolean, "true" | "false">>>;
385
385
  timezone: z.ZodOptional<z.ZodString>;
386
- tools: z.ZodOptional<z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<Record<string, string>[], string | undefined>>>;
386
+ tools: z.ZodOptional<z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<Record<string, string>[] | undefined, string | undefined>>>;
387
387
  voicemail_message: z.ZodOptional<z.ZodString>;
388
388
  voicemail_action: z.ZodPreprocess<z.ZodOptional<z.ZodEnum<{
389
389
  hangup: "hangup";
@@ -17,4 +17,4 @@ export declare const VoicemailActionFieldSchema: z.ZodPreprocess<z.ZodOptional<z
17
17
  ignore: "ignore";
18
18
  }>>, unknown>;
19
19
  export declare const JsonObjectSchema: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<Record<string, unknown>, string | undefined>>;
20
- export declare const JsonArraySchema: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<Record<string, string>[], string | undefined>>;
20
+ export declare const JsonArraySchema: z.ZodPipe<z.ZodOptional<z.ZodString>, z.ZodTransform<Record<string, string>[] | undefined, string | undefined>>;
@@ -47,13 +47,14 @@ exports.JsonObjectSchema = zod_1.z
47
47
  exports.JsonArraySchema = zod_1.z
48
48
  .string()
49
49
  .optional()
50
+ // A cleared field means "not set": Bland rejects an empty array such as `tools: []`
50
51
  .transform((str, ctx) => {
51
52
  if ((0, lodash_1.isNil)(str) || (0, lodash_1.isEmpty)(str))
52
- return [];
53
+ return undefined;
53
54
  try {
54
55
  const parsedJson = JSON.parse(str);
55
56
  if ((0, lodash_1.isEmpty)(parsedJson)) {
56
- return [];
57
+ return undefined;
57
58
  }
58
59
  if (!Array.isArray(parsedJson)) {
59
60
  ctx.addIssue({
@@ -1 +1 @@
1
- {"version":3,"file":"sharedActionFields.js","sourceRoot":"","sources":["../../../../extensions/bland/lib/sharedActionFields.ts"],"names":[],"mappings":";;;AAAA,mCAAuC;AACvC,6BAAuB;AACvB,+CAA2D;AAE9C,QAAA,sBAAsB,GAAG;IACpC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE;IAC/B,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE;CAChC,CAAA;AAEY,QAAA,4BAA4B,GAAG,OAAC;KAC1C,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACvB,SAAS,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,KAAK,MAAM,CAAC,CAAA;AAExB,QAAA,8BAA8B,GAAG;IAC5C,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE;IACrC,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,eAAe,EAAE;IAClD,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;CACrC,CAAA;AAED,uGAAuG;AAC1F,QAAA,0BAA0B,GAAG,OAAC;KACxC,UAAU,CAAC,CAAC,GAAG,EAAE,EAAE;IAClB,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,GAAG,CAAA;IACvC,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,EAAE,CAAA;IAC1B,IAAI,OAAO,KAAK,EAAE,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,SAAS,CAAA;IACxD,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;AAC1C,CAAC,EAAE,6BAAqB,CAAC,QAAQ,EAAE,CAAC,CAAA;AAEzB,QAAA,gBA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CAAC,EAAE,CAAC;QACX,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,kCAAkC;SAC5C,CAAC,CAAA;QACF,OAAO,OAAC,CAAC,KAAK,CAAA;IAChB,CAAC;AACH,CAAC,CAAC,CAAA"}
@@ -1,9 +1,9 @@
1
1
  import { z } from 'zod';
2
2
  export declare const addressSchema: z.ZodObject<{
3
3
  use: z.ZodEnum<{
4
+ home: "home";
4
5
  temp: "temp";
5
6
  old: "old";
6
- home: "home";
7
7
  work: "work";
8
8
  }>;
9
9
  type: z.ZodEnum<{
@@ -127,9 +127,9 @@ export declare const patientSchema: z.ZodObject<{
127
127
  }, z.core.$strip>>>;
128
128
  address: z.ZodOptional<z.ZodArray<z.ZodObject<{
129
129
  use: z.ZodEnum<{
130
+ home: "home";
130
131
  temp: "temp";
131
132
  old: "old";
132
- home: "home";
133
133
  work: "work";
134
134
  }>;
135
135
  type: z.ZodEnum<{
@@ -277,9 +277,9 @@ export declare const patientWithIdSchema: z.ZodObject<{
277
277
  }, z.core.$strip>>>;
278
278
  address: z.ZodOptional<z.ZodArray<z.ZodObject<{
279
279
  use: z.ZodEnum<{
280
+ home: "home";
280
281
  temp: "temp";
281
282
  old: "old";
282
- home: "home";
283
283
  work: "work";
284
284
  }>;
285
285
  type: z.ZodEnum<{
@@ -10,17 +10,17 @@ export declare const taskSchema: z.ZodObject<{
10
10
  }, z.core.$strip>>>;
11
11
  status: z.ZodEnum<{
12
12
  completed: "completed";
13
+ "in-progress": "in-progress";
13
14
  cancelled: "cancelled";
15
+ "entered-in-error": "entered-in-error";
14
16
  accepted: "accepted";
15
17
  rejected: "rejected";
16
18
  draft: "draft";
17
19
  requested: "requested";
18
20
  received: "received";
19
21
  ready: "ready";
20
- "in-progress": "in-progress";
21
22
  "on-hold": "on-hold";
22
23
  failed: "failed";
23
- "entered-in-error": "entered-in-error";
24
24
  }>;
25
25
  requester: z.ZodObject<{
26
26
  reference: z.ZodString;
@@ -63,17 +63,17 @@ export declare const taskWithIdSchema: z.ZodObject<{
63
63
  }, z.core.$strip>>>;
64
64
  status: z.ZodEnum<{
65
65
  completed: "completed";
66
+ "in-progress": "in-progress";
66
67
  cancelled: "cancelled";
68
+ "entered-in-error": "entered-in-error";
67
69
  accepted: "accepted";
68
70
  rejected: "rejected";
69
71
  draft: "draft";
70
72
  requested: "requested";
71
73
  received: "received";
72
74
  ready: "ready";
73
- "in-progress": "in-progress";
74
75
  "on-hold": "on-hold";
75
76
  failed: "failed";
76
- "entered-in-error": "entered-in-error";
77
77
  }>;
78
78
  requester: z.ZodObject<{
79
79
  reference: z.ZodString;
@@ -158,8 +158,8 @@ export declare const patientStatusSchema: z.ZodObject<{
158
158
  notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
159
159
  status: z.ZodEnum<{
160
160
  active: "active";
161
- deceased: "deceased";
162
161
  inactive: "inactive";
162
+ deceased: "deceased";
163
163
  prospect: "prospect";
164
164
  }>;
165
165
  }, z.core.$strip>;
@@ -379,8 +379,8 @@ export declare const patientSchema: z.ZodObject<{
379
379
  notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
380
380
  status: z.ZodEnum<{
381
381
  active: "active";
382
- deceased: "deceased";
383
382
  inactive: "inactive";
383
+ deceased: "deceased";
384
384
  prospect: "prospect";
385
385
  }>;
386
386
  }, z.core.$strict>>>;
@@ -635,8 +635,8 @@ export declare const updatePatientSchema: z.ZodObject<{
635
635
  notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
636
636
  status: z.ZodEnum<{
637
637
  active: "active";
638
- deceased: "deceased";
639
638
  inactive: "inactive";
639
+ deceased: "deceased";
640
640
  prospect: "prospect";
641
641
  }>;
642
642
  }, z.core.$strict>>>;
@@ -13,7 +13,7 @@
13
13
  },
14
14
  "awell": {
15
15
  "readme": "---\ntitle: Awell Workflow\ndescription: Enrich your care flows with powerful Awell actions.\n---\n\n# Awell API extension\n\n## Extension settings\n\nYou will need to provide the [API URL](https://developers.awellhealth.com/awell-orchestration/api-reference/overview/endpoints) and an [API key](https://developers.awellhealth.com/awell-orchestration/api-reference/overview/authorization).\n\n## Custom Actions\n\n### Start care flow\n\nStarts a new care flow for the patient enrolled in your current care flow.\n\n**Passing baseline info:**\nPlease read the documentation on [our developer hub](https://developers.awellhealth.com/awell-orchestration/api-reference/mutations/start-pathway) to learn more about how to pass baseline info.\n\n**Example of how to configure a value for the baseline info action field:**\n\n```json\n[\n {\n \"data_point_definition_id\": \"age\",\n \"value\": \"29\"\n },\n {\n \"data_point_definition_id\": \"dob\",\n \"value\": \"1993-11-30\"\n }\n]\n```\n\n### Stop care flow\n\nStops the care flow the patient is currently enrolled in. A reason is why you are stopping the care flow is mandatory.\n\n### Pause care flow\n\nPauses one or more care flows. A paused care flow can be resumed later with the \"Unpause care flow\" action or the `unpauseCareFlow` API mutation, without starting over.\n\nWhat pausing does:\n\n- Nothing in the paused care flow progresses: no new steps, messages, forms, actions or tracks are activated. Tracks added while paused (ad hoc tracks, triggers) only activate on resume.\n- Timers keep counting from their original start and are not extended by the pause. A timer that runs out during the pause does not activate the next step until the care flow is resumed, at which point it fires immediately.\n- A paused care flow cannot run its own actions, so the resume signal has to come from outside: the API, or another care flow that runs \"Unpause care flow\".\n\n**Action fields:**\n\n- careFlowIds: a comma-separated string of care flow IDs to pause. When left empty, the care flow this action runs in is paused.\n- reason: an optional reason that is stored with the care flow.\n\n### Unpause care flow\n\nResumes one or more paused care flows.\n\n**Action fields:**\n\n- careFlowIds: a comma-separated string of paused care flow IDs to resume. This field is required because a paused care flow cannot run actions, so the care flow to resume is always a different one than the care flow this action runs in.\n\n### Update patient\n\nAllows updating patient data for the patient currently enrolled in the care flow.\n\n### Is patient already enrolled in care flow\n\nChecks whether the patient is already enrolled in a care flow definition. The care flow the patient is currently enrolled in does not count and is excluded from the results.\n\n**Action fields:**\n\n- pathwayStatus: a comma-separated string of care flow statuses that will be used when looking for care flows the patient is already enrolled in. By default, we only look at active care flows. Options: \"active\", \"completed\", \"missing_baseline_info\", \"paused\", \"starting\", and \"stopped\".\n- careFlowDefinitionIds: a comma-separated string of care flow definition ids that will be used when looking for care flows the patient is already enrolled in. By default, we only search for care flows that match the current care flow definition id (i.e. is the patient already included in the current care flow?).\n\n**Data points:**\n\n- result: a boolean indicating whether the patient is already enrolled in another care flow that matches your criteria (status & care flow definition id)\n- nbrOfResults: the number of care flows found for the patient that match the criteria.\n- careFlowIds: a comma-separated string of care flow ids that matched your search criteria. It will be empty when the result is `false` because then there are no other care flow ids that match your criteria.\n\n### Search patients by patient code\n\nNote that this action is deprecated and we recommend using [identifiers](https://developers.awellhealth.com/awell-orchestration/docs/misc/patient-identifiers) instead.\n\nSearch whether, apart from the patient currently enrolled in the care flow, another patient with the same `patient_code` already exists.\n\n**Data points:**\n\n1. patientAlreadyExists: a boolean which will be true if minimum one patient with the patient code already exists.\n2. numberOfPatientsFound: the number of patients found with the same patient code.\n3. awellPatientIds: a comma-separated string of all Awell patient ids (except the current patient) that have the same patient code as the patient currently enrolled in the care flow. Will return an empty string when there are no other patients with the same patient code.\n\n### Get patient by identifier\n\nThis action lets you check if a patient with a specific identifier already exists in Awell. It's particularly useful when a patient's identity is initially anonymous during the start of the care flow, but later becomes identifiable through the identifiers collected during the care flow. This check ensures whether a patient with that identifier is already present or not.\n\n### Add identifier to patient\n\nThis action allows you to add a unique identifier to the current patient's profile. If the patient already has an identifier with the same system but a different value, this action will update the existing identifier with the new value provided.\n\nFirst, it checks if this identifier (system and value) is already associated with another patient. If it's safe to proceed, it will add or update the identifier as needed. However, if another patient already has this identifier, the action will stop and notify you, preventing duplicates. To avoid conflicts, we recommend first running the \"Get patient by identifier\" action to check for any existing matches.\n\n### Get data point value\n\nThis action allows you to read the most recent data point value of a given data point definition id from a care flow different from the current one. The action returns multiple data points, each with a different value type. Pick the one you need from the returned data points based on the value type of the data point you want to read the value from.\n\n**Example:**\nIf the data point you want to read the value from is of type `number`, then you should use the `valueNumber` data point.\n\n### Get Hosted Pages Link\n\nFetches the static Hosted Pages link for a stakeholder in a care flow. Unlike \"Start Hosted Pages Session\", this does not start a session - it returns the persistent link that can be shared with (or re-used by) the stakeholder, e.g. to send it in a reminder message.\n\n**Action fields:**\n\n- careFlowId (required): the instance ID of the care flow to fetch the link for.\n- stakeholder (optional): the name of the stakeholder to fetch the link for. Defaults to the patient when left empty. There must be activity for the stakeholder in the care flow, otherwise no link exists yet and the action will error.\n\n**Data points:**\n\n- linkUrl: the static Hosted Pages link for the stakeholder.\n\n## Webhooks\n\nWebhooks in the Awell extension offer ways to trigger a care flow based on the end of another care flow, or from any event that happens in your system (via the pathwayStart webhook).\n",
16
- "changelog": "# Awell changelog\n\n## Unreleased\n\n- New actions \"Pause care flow\" and \"Unpause care flow\": pause one or more care flows (defaults to the current care flow) and resume them later via the `pauseCareFlow` and `unpauseCareFlow` orchestration mutations.\n- \"Is patient already enrolled in care flow\" now accepts \"paused\" in the pathway status field, so a support care flow can find a paused care flow and resume it.\n- New action \"Get Hosted Pages Link\": fetches the static Hosted Pages link for a stakeholder in a care flow. The stakeholder field is optional and defaults to the patient when left empty.\n\n## April 2024\n\nTwo new action were added: \"Get patient by identifier\" and \"Add identifier to patient\".\n\n## October 26, 2023\n\nGeneric webhook to start a care flow added\n\n## April 19, 2023\n\nStop care flow action added.\nSearch patients by patient code action was added.\n\"Is patient enrolled in care flow\" action added.\n"
16
+ "changelog": "# Awell changelog\n\n## Unreleased\n\n- Experimental \"Data ingestion\" endpoint now writes an Encounter (pointing at a workbench Location and Organization by identifier) and a Condition linked to it, under Awell's catalog keys. `Gender` and `facility_name` are replaced by `sex` and `encounter.facility_id`. The original patient-only endpoint stays available as \"Data ingestion, simple\" (`dataIngestionSimple`).\n\n- New actions \"Pause care flow\" and \"Unpause care flow\": pause one or more care flows (defaults to the current care flow) and resume them later via the `pauseCareFlow` and `unpauseCareFlow` orchestration mutations.\n- \"Is patient already enrolled in care flow\" now accepts \"paused\" in the pathway status field, so a support care flow can find a paused care flow and resume it.\n- New action \"Get Hosted Pages Link\": fetches the static Hosted Pages link for a stakeholder in a care flow. The stakeholder field is optional and defaults to the patient when left empty.\n\n## April 2024\n\nTwo new action were added: \"Get patient by identifier\" and \"Add identifier to patient\".\n\n## October 26, 2023\n\nGeneric webhook to start a care flow added\n\n## April 19, 2023\n\nStop care flow action added.\nSearch patients by patient code action was added.\n\"Is patient enrolled in care flow\" action added.\n"
17
17
  },
18
18
  "awellTasks": {
19
19
  "readme": "---\ntitle: Awell Tasks\ndescription: Awell Tasks is an extension that allows communication with the Task Service module.\n---\n\n# Awell Tasks\n\nAwell Tasks is an extension that allows communication with the Task Service module.\n",
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "bland": {
23
23
  "readme": "---\ntitle: Bland.ai\ndescription: To do\n---\n\n# Bland.ai\n\nWith Bland.ai you can build, test, and deploy AI phone calling agents. \n\n## Extension settings\n\nTo set up this extension, you will need to provide an API key for Bland.\n\nOptionally, add the **Webhook signing secret** to have Awell verify that webhooks really come from Bland. Create it in the Bland dev portal under Account Settings, Keys tab, \"Replace Secret\" (it is shown only once). Bland then signs each webhook with an HMAC-SHA256 of the body using the secret and sends the hex digest in the `X-Webhook-Signature` header. Awell recomputes it and rejects a webhook with no signature or a wrong one with a `401`. When the setting is empty, webhooks are not verified.\n\nThe signature proves who sent a webhook, not when: Bland's documentation describes no timestamp, so a captured request could be sent again. See [Bland's webhook signing guide](https://docs.bland.ai/tutorials/webhook-signing).\n\n## Actions\n\n### Send call (with Pathway)\n\nInitiates an AI phone call using a simple prompt or a conversational pathway agent built on the Bland platform. This action is asynchronous—it triggers a call request in Bland, which queues the call. Note that the action only confirms that Bland has received the request; it does not wait for the call to complete or handle any callbacks from Bland.\n\nAwell lets you specify both the data you want to send to Bland and the structured data you’d like to receive in return. This is achieved by defining the request data for outgoing information and an analysis schema for the structured data you’ll get back.\n\n#### Request data\n\nAny JSON you put in here will be visible to the AI agent during the call - and can also be referenced with Prompt Variables.\n\nFor example, let’s say in the action you want to programmatically set the name of the person you’re calling. You could set request data to:\n\n```json\n{\n \"name\": \"John Doe\",\n}\n```\n\n[Also see Bland documentation.](https://docs.bland.ai/api-v1/post/calls)\n\n#### Analysis schema\n\nDefine a JSON schema for how you want to get information about the call - information like email addresses, names, appointment times or any other type of custom data.\n\nFor example, if you wanted to retrieve this information from the call:\n\n```json\n{\n \"email_address\": \"email\",\n \"first_name\": \"string\",\n \"last_name\": \"string\",\n \"wants_to_book_appointment\": \"boolean\",\n \"appointment_time\": \"YYYY-MM-DD HH:MM:SS\"\n}\n```\n\nWhen retrieving the call details, Bland will return data about the call in the following format:\n\n```json\n{\n \"analysis\": {\n \"email_address\": \"johndoe@gmail.com\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"wants_to_book_appointment\": true,\n \"appointment_time\": \"2024-01-01 12:00:00\"\n }\n}\n```\n\n[Also see Bland documentation.](https://docs.bland.ai/api-v1/post/calls)\n\n### Get call details\n\nRetrieve the details of a call based on the provider call ID.",
24
- "changelog": "# CHANGELOG\n\n## Unreleased\n\n- When Bland rejects a request, the error on the activity now includes the HTTP status and Bland's response body (for example `{\"status\":\"error\",\"message\":\"Invalid parameters\",\"errors\":[...]}`) instead of only `Request failed with status code 400`. This applies to every Bland action.\n\n- Changed **Voicemail action** on `sendCall` and `sendCallWithPathway` from a JSON input to a dropdown (Hang up, Leave message, Ignore). Values saved while it was a JSON input still work: `{}` or empty is treated as not set, and a quoted value like `\"ignore\"` is accepted.\n\n- Added the optional **Webhook signing secret** setting. When set, the `callCompleted` and `completedBlandText` webhooks verify Bland's `X-Webhook-Signature` header (an HMAC-SHA256 of the body, hex-encoded) and reject a request with no signature or a wrong one with a `401`. When empty, nothing changes: webhooks are not verified, as before.\n- Added `sendSms` action: send an SMS immediately via Bland `POST /v1/sms/send`. The agent message is optional; when omitted, the pathway configured on the agent number generates the message.\n- Added `createSmsConversation` action: seed an SMS conversation positioned at pathway state via Bland `POST /v1/sms/create` without sending a message.\n- Added optional timeout fields to `sendSms` (`time_out`, `timeout_message`, `warning_time`, `warning_message`): per-conversation overrides for Bland's silence-timeout flow.\n- Added `completedBlandText` webhook: triggered when a Bland SMS conversation ends. Maps conversation data (status, reason, transcript, pathway variables) to data points and resolves the patient via the `awell_patient_id` echoed back in metadata.\n"
24
+ "changelog": "# CHANGELOG\n\n## Unreleased\n\n- Fixed **Tools**, **Dynamic data** and **Pronunciation guide** on `sendCall` and `sendCallWithPathway` sending an empty array to Bland when the field was cleared (`\"\"`, `[]` or `{}`). Bland rejects `tools: []` with a `400`. An empty value is now treated as not set and left out of the request.\n\n- When Bland rejects a request, the error on the activity now includes the HTTP status and Bland's response body (for example `{\"status\":\"error\",\"message\":\"Invalid parameters\",\"errors\":[...]}`) instead of only `Request failed with status code 400`. This applies to every Bland action.\n\n- Changed **Voicemail action** on `sendCall` and `sendCallWithPathway` from a JSON input to a dropdown (Hang up, Leave message, Ignore). Values saved while it was a JSON input still work: `{}` or empty is treated as not set, and a quoted value like `\"ignore\"` is accepted.\n\n- Added the optional **Webhook signing secret** setting. When set, the `callCompleted` and `completedBlandText` webhooks verify Bland's `X-Webhook-Signature` header (an HMAC-SHA256 of the body, hex-encoded) and reject a request with no signature or a wrong one with a `401`. When empty, nothing changes: webhooks are not verified, as before.\n- Added `sendSms` action: send an SMS immediately via Bland `POST /v1/sms/send`. The agent message is optional; when omitted, the pathway configured on the agent number generates the message.\n- Added `createSmsConversation` action: seed an SMS conversation positioned at pathway state via Bland `POST /v1/sms/create` without sending a message.\n- Added optional timeout fields to `sendSms` (`time_out`, `timeout_message`, `warning_time`, `warning_message`): per-conversation overrides for Bland's silence-timeout flow.\n- Added `completedBlandText` webhook: triggered when a Bland SMS conversation ends. Maps conversation data (status, reason, transcript, pathway variables) to data points and resolves the patient via the `awell_patient_id` echoed back in metadata.\n"
25
25
  },
26
26
  "braze": {
27
27
  "readme": "---\ntitle: Braze\ndescription: Braze is a customer engagement platform that helps you communicate with your patients.\n---\n\n# Braze\n\nBraze is a comprehensive customer engagement platform that specializes in helping businesses connect with their users through personalized messaging channels.\n\n## Extension settings\n\nAn api key and the REST Endpoint URL are needed to be provided in order for the extension to authenticate with Braze's API. \n\nAn app ID can also be specified via the extension settings or the action field. Actions requiring an app ID to be provided will throw an error if no app ID is provided via the extension settings or the action field. If both are provided, the app ID from the action field will be used.\n\nList of URLs can be found [here](https://www.braze.com/docs/api/basics/#endpoints) - make sure it's the REST Endpoint URL. Documentation on API keys can be found [here](https://www.braze.com/docs/api/basics/#about-rest-api-keys).\n\n## Supported Actins\n\n### Send SMS\n\nSend an immediate SMS message to a specified user\n\nRequired permissions: `messages.send`\n\n### Schedule SMS\n\nSchedule an SMS message to be sent at a specific time\n\nRequired permissions: `messages.schedule.create`\n\n### Send Email\n\nSend an immediate email to a specified user\n\nRequired permissions: `messages.send`\n\n### Schedule Email\n\nSchedule an email to be sent at a specific time\n\nRequired permissions: `messages.schedule.create`\n\n### Send Email Using Template\n\nSend an email using a pre-defined Braze template\n\nRequired permissions: `messages.send`\n\n### Send campaign\n\nSend a campaign message.\n\nRequired permissions: `campaigns.trigger.send`\n",
@@ -16,8 +16,8 @@ export declare const fields: {
16
16
  required: true;
17
17
  options: {
18
18
  dropdownOptions: {
19
- label: "unknown" | "active" | "completed" | "draft" | "on-hold" | "entered-in-error" | "revoked";
20
- value: "unknown" | "active" | "completed" | "draft" | "on-hold" | "entered-in-error" | "revoked";
19
+ label: "unknown" | "active" | "completed" | "entered-in-error" | "draft" | "on-hold" | "revoked";
20
+ value: "unknown" | "active" | "completed" | "entered-in-error" | "draft" | "on-hold" | "revoked";
21
21
  }[];
22
22
  };
23
23
  };
@@ -54,9 +54,9 @@ export declare const FieldsValidationSchema: ZodObject<{
54
54
  unknown: "unknown";
55
55
  active: "active";
56
56
  completed: "completed";
57
+ "entered-in-error": "entered-in-error";
57
58
  draft: "draft";
58
59
  "on-hold": "on-hold";
59
- "entered-in-error": "entered-in-error";
60
60
  revoked: "revoked";
61
61
  }>;
62
62
  intent: import("zod").ZodEnum<{
@@ -30,8 +30,8 @@ export declare const fields: {
30
30
  required: true;
31
31
  options: {
32
32
  dropdownOptions: {
33
- label: "completed" | "cancelled" | "accepted" | "rejected" | "draft" | "requested" | "received" | "ready" | "in-progress" | "on-hold" | "failed" | "entered-in-error";
34
- value: "completed" | "cancelled" | "accepted" | "rejected" | "draft" | "requested" | "received" | "ready" | "in-progress" | "on-hold" | "failed" | "entered-in-error";
33
+ label: "completed" | "in-progress" | "cancelled" | "entered-in-error" | "accepted" | "rejected" | "draft" | "requested" | "received" | "ready" | "on-hold" | "failed";
34
+ value: "completed" | "in-progress" | "cancelled" | "entered-in-error" | "accepted" | "rejected" | "draft" | "requested" | "received" | "ready" | "on-hold" | "failed";
35
35
  }[];
36
36
  };
37
37
  };
@@ -82,17 +82,17 @@ export declare const FieldsValidationSchema: ZodObject<{
82
82
  description: import("zod").ZodOptional<import("zod").ZodString>;
83
83
  status: import("zod").ZodEnum<{
84
84
  completed: "completed";
85
+ "in-progress": "in-progress";
85
86
  cancelled: "cancelled";
87
+ "entered-in-error": "entered-in-error";
86
88
  accepted: "accepted";
87
89
  rejected: "rejected";
88
90
  draft: "draft";
89
91
  requested: "requested";
90
92
  received: "received";
91
93
  ready: "ready";
92
- "in-progress": "in-progress";
93
94
  "on-hold": "on-hold";
94
95
  failed: "failed";
95
- "entered-in-error": "entered-in-error";
96
96
  }>;
97
97
  intent: import("zod").ZodEnum<{
98
98
  unknown: "unknown";
@@ -5,9 +5,9 @@ export declare const CreateServiceRequestSchema: z.ZodObject<{
5
5
  unknown: "unknown";
6
6
  active: "active";
7
7
  completed: "completed";
8
+ "entered-in-error": "entered-in-error";
8
9
  draft: "draft";
9
10
  "on-hold": "on-hold";
10
- "entered-in-error": "entered-in-error";
11
11
  revoked: "revoked";
12
12
  }>;
13
13
  intent: z.ZodEnum<{
@@ -5,17 +5,17 @@ export declare const CreateTaskSchema: z.ZodObject<{
5
5
  description: z.ZodOptional<z.ZodString>;
6
6
  status: z.ZodEnum<{
7
7
  completed: "completed";
8
+ "in-progress": "in-progress";
8
9
  cancelled: "cancelled";
10
+ "entered-in-error": "entered-in-error";
9
11
  accepted: "accepted";
10
12
  rejected: "rejected";
11
13
  draft: "draft";
12
14
  requested: "requested";
13
15
  received: "received";
14
16
  ready: "ready";
15
- "in-progress": "in-progress";
16
17
  "on-hold": "on-hold";
17
18
  failed: "failed";
18
- "entered-in-error": "entered-in-error";
19
19
  }>;
20
20
  intent: z.ZodEnum<{
21
21
  unknown: "unknown";
@@ -1,4 +1,4 @@
1
- export declare const webhooks: (import("@awell-health/extensions-core").Webhook<"patientId", import("@medplum/fhirtypes").Patient, Record<string, import("@awell-health/extensions-core").Setting>> | import("@awell-health/extensions-core").Webhook<"observationId" | "observation", import("@medplum/fhirtypes").Observation, {
1
+ export declare const webhooks: (import("@awell-health/extensions-core").Webhook<"patientId", import("@medplum/fhirtypes").Patient, Record<string, import("@awell-health/extensions-core").Setting>> | import("@awell-health/extensions-core").Webhook<"observation" | "observationId", import("@medplum/fhirtypes").Observation, {
2
2
  clientId: {
3
3
  key: string;
4
4
  label: string;
@@ -1,11 +1,11 @@
1
1
  import { z } from 'zod';
2
2
  export declare const StatusSchema: z.ZodEnum<{
3
3
  pending: "pending";
4
+ arrived: "arrived";
4
5
  cancelled: "cancelled";
5
- proposed: "proposed";
6
6
  "entered-in-error": "entered-in-error";
7
+ proposed: "proposed";
7
8
  booked: "booked";
8
- arrived: "arrived";
9
9
  fulfilled: "fulfilled";
10
10
  noshow: "noshow";
11
11
  "checked-in": "checked-in";
@@ -3,8 +3,8 @@ export declare const ServiceRequestStatusSchema: z.ZodEnum<{
3
3
  unknown: "unknown";
4
4
  active: "active";
5
5
  completed: "completed";
6
+ "entered-in-error": "entered-in-error";
6
7
  draft: "draft";
7
8
  "on-hold": "on-hold";
8
- "entered-in-error": "entered-in-error";
9
9
  revoked: "revoked";
10
10
  }>;
@@ -1,15 +1,15 @@
1
1
  import { z } from 'zod';
2
2
  export declare const TaskStatusSchema: z.ZodEnum<{
3
3
  completed: "completed";
4
+ "in-progress": "in-progress";
4
5
  cancelled: "cancelled";
6
+ "entered-in-error": "entered-in-error";
5
7
  accepted: "accepted";
6
8
  rejected: "rejected";
7
9
  draft: "draft";
8
10
  requested: "requested";
9
11
  received: "received";
10
12
  ready: "ready";
11
- "in-progress": "in-progress";
12
13
  "on-hold": "on-hold";
13
14
  failed: "failed";
14
- "entered-in-error": "entered-in-error";
15
15
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awell-health/awell-extensions",
3
- "version": "2.1.225",
3
+ "version": "2.1.227",
4
4
  "packageManager": "yarn@4.5.3",
5
5
  "main": "dist/src/index.js",
6
6
  "repository": {