@awell-health/awell-extensions 2.1.182 → 2.1.183
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.
- package/dist/extensions/markdown.json +1 -1
- package/dist/extensions/medplum/actions/searchPatient/config/fields.d.ts +7 -0
- package/dist/extensions/medplum/actions/searchPatient/config/fields.js +7 -0
- package/dist/extensions/medplum/actions/searchPatient/config/fields.js.map +1 -1
- package/dist/extensions/medplum/actions/searchPatient/searchPatient.js +17 -0
- package/dist/extensions/medplum/actions/searchPatient/searchPatient.js.map +1 -1
- package/package.json +1 -1
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
},
|
|
154
154
|
"medplum": {
|
|
155
155
|
"readme": "---\ntitle: Medplum\ndescription: Medplum is the open source healthcare developer platform that helps you build, test, and deliver any healthcare product or service.\n---\n\n# Medplum\n\nMedplum is the open source healthcare developer platform that helps you build, test, and deliver any healthcare product or service.\n\n## Extension settings\n\nThe following settings are required to configure the Medplum extension:\n\n- **Client ID**: Used to authenticate with Medplum's API (required)\n- **Client Secret**: Used to authenticate with Medplum's API (required)\n- **Base URL**: Optional custom base URL for your Medplum server (e.g., `https://api.medplum.com/`). Leave empty to use the default Medplum server.\n",
|
|
156
|
-
"changelog": "# Medplum changelog\n"
|
|
156
|
+
"changelog": "# Medplum changelog\n\n## Unreleased\n\n- Added `Fail if patient not found?` (`failIfNotFound`) field to the `searchPatient` action. When enabled, a search that returns no patient fails the action with a `SERVER_ERROR` instead of completing with an empty patient. Defaults to `false`, so existing care flows are unchanged.\n- Opted `searchPatient` in to automated retries (`supports_automated_retries`). Combined with `failIfNotFound`, this lets a care flow recover from the race where the search runs before the patient exists in Medplum.\n"
|
|
157
157
|
},
|
|
158
158
|
"messagebird": {
|
|
159
159
|
"readme": "---\ntitle: MessageBird\ndescription: MessageBird is a cloud-based SMS marketing platform designed to help businesses engage with customers across a variety of channels including WhatsApp, voice, live chat and more.\n---\n# MessageBird\n\nMessageBird is a cloud-based SMS marketing platform designed to help businesses engage with customers across a variety of channels including WhatsApp, voice, live chat and more.\n\n## Extension settings\n\nIn order to set up this extension, you will need to provide a MessageBird [API key](https://developers.messagebird.com/quickstarts/voice-calling/test-credits-api-keys/#get-your-api-keys) and [report URL](https://support.messagebird.com/hc/en-us/articles/360001854898-Receiving-Delivery-Reports-DLRs-#:~:text=To%20configure%20the%20status%20report,need%20to%20be%20sent%20to.) (only required if you want to use WhatsApp messaging).\n\n## Custom Actions\n\n### Send SMS\n\nMessageBird's Programmable SMS API enables you to programmatically send SMS messages from within a care flow.\n\n[Read the official documentation](https://developers.messagebird.com/api/sms-messaging/#send-outbound-sms)\n\n### Send voice (text-to-speech) message\n\nMessageBird's Voice Messaging API enables you to transform text messages into voice messages to any country.\n\n[Read the official documentation](https://developers.messagebird.com/api/voice-messaging/#send-a-voice-message)\n\n### Send WhatsApp message\n\nSend a message to a recipient via WhatsApp. If an active conversation already exists for the recipient, the conversation will be resumed. In case there's no active conversation a new one is created.\n\n[Learn how to get started with MessageBird and WhatsApp](https://messagebird.com/omnichannel/whatsapp)",
|
|
@@ -15,8 +15,15 @@ export declare const fields: {
|
|
|
15
15
|
type: FieldType.STRING;
|
|
16
16
|
required: true;
|
|
17
17
|
};
|
|
18
|
+
failIfNotFound: {
|
|
19
|
+
id: string;
|
|
20
|
+
label: string;
|
|
21
|
+
description: string;
|
|
22
|
+
type: FieldType.BOOLEAN;
|
|
23
|
+
};
|
|
18
24
|
};
|
|
19
25
|
export declare const FieldsValidationSchema: z.ZodObject<{
|
|
20
26
|
parameter: z.ZodString;
|
|
21
27
|
value: z.ZodString;
|
|
28
|
+
failIfNotFound: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
22
29
|
}, z.core.$strip>;
|
|
@@ -18,6 +18,12 @@ exports.fields = {
|
|
|
18
18
|
type: extensions_core_1.FieldType.STRING,
|
|
19
19
|
required: true,
|
|
20
20
|
},
|
|
21
|
+
failIfNotFound: {
|
|
22
|
+
id: 'failIfNotFound',
|
|
23
|
+
label: 'Fail if patient not found?',
|
|
24
|
+
description: 'If true, the action fails when the search returns no patient, which allows it to be retried. Use this when the patient may not exist in Medplum yet. If false (default), the action completes with an empty patient.',
|
|
25
|
+
type: extensions_core_1.FieldType.BOOLEAN,
|
|
26
|
+
},
|
|
21
27
|
};
|
|
22
28
|
exports.FieldsValidationSchema = zod_1.z.object({
|
|
23
29
|
parameter: zod_1.z.string().nonempty({
|
|
@@ -26,5 +32,6 @@ exports.FieldsValidationSchema = zod_1.z.object({
|
|
|
26
32
|
value: zod_1.z.string().nonempty({
|
|
27
33
|
error: 'Missing "Search Value"',
|
|
28
34
|
}),
|
|
35
|
+
failIfNotFound: zod_1.z.boolean().optional().default(false),
|
|
29
36
|
});
|
|
30
37
|
//# sourceMappingURL=fields.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../extensions/medplum/actions/searchPatient/config/fields.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AACrE,6BAAqC;AAExB,QAAA,MAAM,GAAG;IACpB,SAAS,EAAE;QACT,EAAE,EAAE,WAAW;QACf,KAAK,EAAE,kBAAkB;QACzB,WAAW,EACT,iEAAiE;QACnE,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;IACD,KAAK,EAAE;QACL,EAAE,EAAE,OAAO;QACX,KAAK,EAAE,cAAc;QACrB,WAAW,EAAE,oDAAoD;QACjE,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC;QAC7B,KAAK,EAAE,4BAA4B;KACpC,CAAC;IACF,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC;QACzB,KAAK,EAAE,wBAAwB;KAChC,CAAC;
|
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../extensions/medplum/actions/searchPatient/config/fields.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AACrE,6BAAqC;AAExB,QAAA,MAAM,GAAG;IACpB,SAAS,EAAE;QACT,EAAE,EAAE,WAAW;QACf,KAAK,EAAE,kBAAkB;QACzB,WAAW,EACT,iEAAiE;QACnE,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;IACD,KAAK,EAAE;QACL,EAAE,EAAE,OAAO;QACX,KAAK,EAAE,cAAc;QACrB,WAAW,EAAE,oDAAoD;QACjE,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;IACD,cAAc,EAAE;QACd,EAAE,EAAE,gBAAgB;QACpB,KAAK,EAAE,4BAA4B;QACnC,WAAW,EACT,sNAAsN;QACxN,IAAI,EAAE,2BAAS,CAAC,OAAO;KACxB;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC;QAC7B,KAAK,EAAE,4BAA4B;KACpC,CAAC;IACF,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC;QACzB,KAAK,EAAE,wBAAwB;KAChC,CAAC;IACF,cAAc,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;CACP,CAAC,CAAA"}
|
|
@@ -11,6 +11,7 @@ exports.searchPatient = {
|
|
|
11
11
|
description: 'Search for patients in Medplum using parameters',
|
|
12
12
|
fields: config_1.fields,
|
|
13
13
|
previewable: true,
|
|
14
|
+
supports_automated_retries: true,
|
|
14
15
|
dataPoints: config_1.dataPoints,
|
|
15
16
|
onEvent: async ({ payload, onComplete, onError, helpers }) => {
|
|
16
17
|
var _a, _b, _c;
|
|
@@ -24,6 +25,22 @@ exports.searchPatient = {
|
|
|
24
25
|
searchParams[input.parameter] = input.value;
|
|
25
26
|
const bundle = await medplumSdk.search('Patient', searchParams);
|
|
26
27
|
const patient = (_c = (_b = (_a = bundle.entry) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.resource) !== null && _c !== void 0 ? _c : null;
|
|
28
|
+
if (patient === null && input.failIfNotFound) {
|
|
29
|
+
const message = `No patient found in Medplum for "${input.parameter}" = "${input.value}"`;
|
|
30
|
+
await onError({
|
|
31
|
+
events: [
|
|
32
|
+
{
|
|
33
|
+
date: new Date().toISOString(),
|
|
34
|
+
text: { en: message },
|
|
35
|
+
error: {
|
|
36
|
+
category: 'SERVER_ERROR',
|
|
37
|
+
message,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
});
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
27
44
|
await onComplete({
|
|
28
45
|
data_points: {
|
|
29
46
|
patientData: JSON.stringify(patient),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchPatient.js","sourceRoot":"","sources":["../../../../../extensions/medplum/actions/searchPatient/searchPatient.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AAErE,qCAAqE;AACrE,uCAAwD;AAE3C,QAAA,aAAa,GAItB;IACF,GAAG,EAAE,eAAe;IACpB,QAAQ,EAAE,0BAAQ,CAAC,gBAAgB;IACnC,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,iDAAiD;IAC9D,MAAM,EAAN,eAAM;IACN,WAAW,EAAE,IAAI;IACjB,UAAU,EAAV,mBAAU;IACV,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,EAAiB,EAAE;;QAC1E,OAAO,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,EAAE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