@awell-health/awell-extensions 1.0.131 → 1.0.133

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.
@@ -7,6 +7,7 @@ export interface CalendlyWebhookPayload {
7
7
  created_at: string;
8
8
  payload: {
9
9
  scheduled_event: {
10
+ text_reminder_number: string;
10
11
  start_time: string;
11
12
  end_time: string;
12
13
  uri: string;
@@ -16,6 +17,7 @@ export interface CalendlyWebhookPayload {
16
17
  user_email: string;
17
18
  }>;
18
19
  location: any;
20
+ name: string;
19
21
  };
20
22
  email: string;
21
23
  first_name: string;
@@ -39,11 +39,11 @@ declare const dataPoints: {
39
39
  };
40
40
  startTime: {
41
41
  key: string;
42
- valueType: "string";
42
+ valueType: "date";
43
43
  };
44
44
  endTime: {
45
45
  key: string;
46
- valueType: "string";
46
+ valueType: "date";
47
47
  };
48
48
  cancelUrl: {
49
49
  key: string;
@@ -57,6 +57,14 @@ declare const dataPoints: {
57
57
  key: string;
58
58
  valueType: "string";
59
59
  };
60
+ eventName: {
61
+ key: string;
62
+ valueType: "string";
63
+ };
64
+ inviteePhoneNumber: {
65
+ key: string;
66
+ valueType: "string";
67
+ };
60
68
  };
61
69
  export declare const eventCreated: Webhook<keyof typeof dataPoints, CalendlyWebhookPayload>;
62
70
  export type EventCreated = typeof eventCreated;
@@ -41,11 +41,11 @@ const dataPoints = {
41
41
  },
42
42
  startTime: {
43
43
  key: 'startTime',
44
- valueType: 'string',
44
+ valueType: 'date',
45
45
  },
46
46
  endTime: {
47
47
  key: 'endTime',
48
- valueType: 'string',
48
+ valueType: 'date',
49
49
  },
50
50
  cancelUrl: {
51
51
  key: 'cancelUrl',
@@ -59,11 +59,20 @@ const dataPoints = {
59
59
  key: 'videoCallUrl',
60
60
  valueType: 'string',
61
61
  },
62
+ eventName: {
63
+ key: 'eventName',
64
+ valueType: 'string',
65
+ },
66
+ inviteePhoneNumber: {
67
+ key: 'inviteePhoneNumber',
68
+ valueType: 'string',
69
+ }
62
70
  };
63
71
  exports.eventCreated = {
64
72
  key: 'eventCreated',
65
73
  dataPoints,
66
74
  onWebhookReceived: async ({ payload }, onSuccess, onError) => {
75
+ var _a, _b;
67
76
  const { payload: { email, first_name, last_name, name, scheduled_event, status, timezone, cancel_url, reschedule_url, rescheduled, }, } = payload;
68
77
  // https://api.calendly.com/scheduled_events/GBGBDCAADAEDCRZ2 => GBGBDCAADAEDCRZ2
69
78
  const scheduledEventId = scheduled_event.uri.split('/').pop();
@@ -71,9 +80,6 @@ exports.eventCreated = {
71
80
  const hostEmail = scheduled_event.event_memberships.length > 0
72
81
  ? scheduled_event.event_memberships[0].user_email
73
82
  : '';
74
- const videoCallUrl = scheduled_event.location.type === 'zoom'
75
- ? scheduled_event.location.join_url
76
- : '';
77
83
  if (!(0, lodash_1.isNil)(scheduledEventId) &&
78
84
  !(0, lodash_1.isNil)(scheduledEventTypeId) &&
79
85
  !rescheduled) {
@@ -92,7 +98,9 @@ exports.eventCreated = {
92
98
  cancelUrl: cancel_url,
93
99
  rescheduleUrl: reschedule_url,
94
100
  hostEmail,
95
- videoCallUrl,
101
+ videoCallUrl: (_a = scheduled_event.location.join_url) !== null && _a !== void 0 ? _a : "",
102
+ inviteePhoneNumber: (_b = scheduled_event.text_reminder_number) !== null && _b !== void 0 ? _b : "",
103
+ eventName: scheduled_event.name
96
104
  },
97
105
  });
98
106
  }
@@ -1 +1 @@
1
- {"version":3,"file":"eventCreated.js","sourceRoot":"","sources":["../../../../extensions/calendly/webhooks/eventCreated.ts"],"names":[],"mappings":";;;AAAA,mCAA8B;AAO9B,MAAM,UAAU,GAAG;IACjB,OAAO,EAAE;QACP,GAAG,EAAE,SAAS;QACd,SAAS,EAAE,QAAQ;KACpB;IACD,WAAW,EAAE;QACX,GAAG,EAAE,aAAa;QAClB,SAAS,EAAE,QAAQ;KACpB;IACD,YAAY,EAAE;QACZ,GAAG,EAAE,cAAc;QACnB,SAAS,EAAE,QAAQ;KACpB;IACD,gBAAg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AAM,oBAAoB,GAAG,eAAe,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAA;QAExE,MAAM,SAAS,GACb,eAAe,CAAC,iBAAiB,CAAC,MAAM,GAAG,CAAC;YAC1C,CAAC,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,UAAU;YACjD,CAAC,CAAC,EAAE,CAAA;QACR,MAAM,YAAY,GAChB,eAAe,CAAC,QAAQ,CAAC,IAAI,KAAK,MAAM;YACtC,CAAC,CAAC,eAAe,CAAC,QAAQ,CAAC,QAAQ;YACnC,CAAC,CAAC,EAAE,CAAA;QAER,IACE,CAAC,IAAA,cAAK,EAAC,gBAAgB,CAAC;YACxB,CAAC,IAAA,cAAK,EAAC,oBAAoB,CAAC;YAC5B,CAAC,WAAW,EACZ;YACA,MAAM,SAAS,CAAC;gBACd,WAAW,EAAE;oBACX,OAAO,EAAE,gBAAgB;oBACzB,WAAW,EAAE,oBAAoB;oBACjC,YAAY,EAAE,KAAK;oBACnB,gBAAgB,EAAE,UAAU;oBAC5B,eAAe,EAAE,SAAS;oBAC1B,WAAW,EAAE,IAAI;oBACjB,aAAa,EAAE,MAAM;oBACrB,eAAe,EAAE,QAAQ;oBACzB,SAAS,EAAE,eAAe,CAAC,UAAU;oBACrC,OAAO,EAAE,eAAe,CAAC,QAAQ;oBACjC,SAAS,EAAE,UAAU;oBACrB,aAAa,EAAE,cAAc;oBAC7B,SAAS;oBACT,YAAY;iBACb;aACF,CAAC,CAAA;SACH;QAED,MAAM,OAAO,CAAC;QACZ,sEAAsE;SACvE,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"eventCreated.js","sourceRoot":"","sources":["../../../../extensions/calendly/webhooks/eventCreated.ts"],"names":[],"mappings":";;;AAAA,mCAA8B;AAO9B,MAAM,UAAU,GAAG;IACjB,OAAO,EAAE;QACP,GAAG,EAAE,SAAS;QACd,SAAS,EAAE,QAAQ;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e,CAAC,IAAI;iBAChC;aACF,CAAC,CAAA;SACH;QAED,MAAM,OAAO,CAAC;QACZ,sEAAsE;SACvE,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
@@ -39,11 +39,11 @@ declare const dataPoints: {
39
39
  };
40
40
  startTime: {
41
41
  key: string;
42
- valueType: "string";
42
+ valueType: "date";
43
43
  };
44
44
  endTime: {
45
45
  key: string;
46
- valueType: "string";
46
+ valueType: "date";
47
47
  };
48
48
  cancelUrl: {
49
49
  key: string;
@@ -57,6 +57,14 @@ declare const dataPoints: {
57
57
  key: string;
58
58
  valueType: "string";
59
59
  };
60
+ eventName: {
61
+ key: string;
62
+ valueType: "string";
63
+ };
64
+ inviteePhoneNumber: {
65
+ key: string;
66
+ valueType: "string";
67
+ };
60
68
  };
61
69
  export declare const eventRescheduled: Webhook<keyof typeof dataPoints, CalendlyWebhookPayload>;
62
70
  export type EventRescheduled = typeof eventRescheduled;
@@ -41,11 +41,11 @@ const dataPoints = {
41
41
  },
42
42
  startTime: {
43
43
  key: 'startTime',
44
- valueType: 'string',
44
+ valueType: 'date',
45
45
  },
46
46
  endTime: {
47
47
  key: 'endTime',
48
- valueType: 'string',
48
+ valueType: 'date',
49
49
  },
50
50
  cancelUrl: {
51
51
  key: 'cancelUrl',
@@ -59,11 +59,20 @@ const dataPoints = {
59
59
  key: 'videoCallUrl',
60
60
  valueType: 'string',
61
61
  },
62
+ eventName: {
63
+ key: 'eventName',
64
+ valueType: 'string',
65
+ },
66
+ inviteePhoneNumber: {
67
+ key: 'inviteePhoneNumber',
68
+ valueType: 'string',
69
+ }
62
70
  };
63
71
  exports.eventRescheduled = {
64
72
  key: 'eventRescheduled',
65
73
  dataPoints,
66
74
  onWebhookReceived: async ({ payload }, onSuccess, onError) => {
75
+ var _a, _b;
67
76
  const { payload: { email, first_name, last_name, name, scheduled_event, status, timezone, cancel_url, reschedule_url, rescheduled, }, } = payload;
68
77
  if (rescheduled) {
69
78
  // https://api.calendly.com/scheduled_events/GBGBDCAADAEDCRZ2 => GBGBDCAADAEDCRZ2
@@ -72,9 +81,6 @@ exports.eventRescheduled = {
72
81
  const hostEmail = scheduled_event.event_memberships.length > 0
73
82
  ? scheduled_event.event_memberships[0].user_email
74
83
  : '';
75
- const videoCallUrl = scheduled_event.location.type === 'zoom'
76
- ? scheduled_event.location.join_url
77
- : '';
78
84
  if (!(0, lodash_1.isNil)(scheduledEventId) &&
79
85
  !(0, lodash_1.isNil)(scheduledEventTypeId) &&
80
86
  rescheduled) {
@@ -93,7 +99,9 @@ exports.eventRescheduled = {
93
99
  cancelUrl: cancel_url,
94
100
  rescheduleUrl: reschedule_url,
95
101
  hostEmail,
96
- videoCallUrl,
102
+ videoCallUrl: (_a = scheduled_event.location.join_url) !== null && _a !== void 0 ? _a : "",
103
+ inviteePhoneNumber: (_b = scheduled_event.text_reminder_number) !== null && _b !== void 0 ? _b : "",
104
+ eventName: scheduled_event.name
97
105
  },
98
106
  });
99
107
  }
@@ -1 +1 @@
1
- {"version":3,"file":"eventRescheduled.js","sourceRoot":"","sources":["../../../../extensions/calendly/webhooks/eventRescheduled.ts"],"names":[],"mappings":";;;AAAA,mCAA8B;AAO9B,MAAM,UAAU,GAAG;IACjB,OAAO,EAAE;QACP,GAAG,EAAE,SAAS;QACd,SAAS,EAAE,QAAQ;KACpB;IACD,WAAW,EAAE;QACX,GAAG,EAAE,aAAa;QAClB,SAAS,EAAE,QAAQ;KACpB;IACD,YAAY,EAAE;QACZ,GAAG,EAAE,cAAc;QACnB,SAAS,EAAE,QAAQ;KACpB;IACD,gBAAgB,EAAE;QAChB,GAAG,EAAE,kBAAkB;QACvB,SAAS,EAAE,QAAQ;KACpB;IACD,eAAe,EAAE;QACf,GAAG,EAAE,iBAAiB;QACtB,SAAS,EAAE,QAAQ;KACpB;IACD,WAAW,EAAE;QACX,GAAG,EAAE,aAAa;QAClB,SAAS,EAAE,QAAQ;KACpB;IACD,aAAa,EAAE;QACb,GAAG,EAAE,eAAe;QACpB,S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gBACjD,CAAC,CAAC,EAAE,CAAA;YACR,MAAM,YAAY,GAChB,eAAe,CAAC,QAAQ,CAAC,IAAI,KAAK,MAAM;gBACtC,CAAC,CAAC,eAAe,CAAC,QAAQ,CAAC,QAAQ;gBACnC,CAAC,CAAC,EAAE,CAAA;YAER,IACE,CAAC,IAAA,cAAK,EAAC,gBAAgB,CAAC;gBACxB,CAAC,IAAA,cAAK,EAAC,oBAAoB,CAAC;gBAC5B,WAAW,EACX;gBACA,MAAM,SAAS,CAAC;oBACd,WAAW,EAAE;wBACX,OAAO,EAAE,gBAAgB;wBACzB,WAAW,EAAE,oBAAoB;wBACjC,YAAY,EAAE,KAAK;wBACnB,gBAAgB,EAAE,UAAU;wBAC5B,eAAe,EAAE,SAAS;wBAC1B,WAAW,EAAE,IAAI;wBACjB,aAAa,EAAE,MAAM;wBACrB,eAAe,EAAE,QAAQ;wBACzB,SAAS,EAAE,eAAe,CAAC,UAAU;wBACrC,OAAO,EAAE,eAAe,CAAC,QAAQ;wBACjC,SAAS,EAAE,UAAU;wBACrB,aAAa,EAAE,cAAc;wBAC7B,SAAS;wBACT,YAAY;qBACb;iBACF,CAAC,CAAA;aACH;SACF;IACH,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"eventRescheduled.js","sourceRoot":"","sources":["../../../../extensions/calendly/webhooks/eventRescheduled.ts"],"names":[],"mappings":";;;AAAA,mCAA8B;AAO9B,MAAM,UAAU,GAAG;IACjB,OAAO,EAAE;QACP,GAAG,EAAE,SAAS;QACd,SAAS,EAAE,QAAQ;KACpB;IACD,WAAW,EAAE;QACX,GAAG,EAAE,aAAa;QAClB,SAAS,EAAE,QAAQ;KACpB;IACD,YAAY,EAAE;QACZ,GAAG,EAAE,cAAc;QACnB,SAAS,EAAE,QAAQ;KACpB;IACD,gBAAgB,EAAE;QAChB,GAAG,EAAE,kBAAkB;QACvB,SAAS,EAAE,QAAQ;KACpB;IACD,eAAe,EAAE;QACf,GAAG,EAAE,iBAAiB;QACtB,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AC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAA;YAE7D,MAAM,oBAAoB,GAAG,eAAe,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAA;YAExE,MAAM,SAAS,GACb,eAAe,CAAC,iBAAiB,CAAC,MAAM,GAAG,CAAC;gBAC1C,CAAC,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,UAAU;gBACjD,CAAC,CAAC,EAAE,CAAA;YAER,IACE,CAAC,IAAA,cAAK,EAAC,gBAAgB,CAAC;gBACxB,CAAC,IAAA,cAAK,EAAC,oBAAoB,CAAC;gBAC5B,WAAW,EACX;gBACA,MAAM,SAAS,CAAC;oBACd,WAAW,EAAE;wBACX,OAAO,EAAE,gBAAgB;wBACzB,WAAW,EAAE,oBAAoB;wBACjC,YAAY,EAAE,KAAK;wBACnB,gBAAgB,EAAE,UAAU;wBAC5B,eAAe,EAAE,SAAS;wBAC1B,WAAW,EAAE,IAAI;wBACjB,aAAa,EAAE,MAAM;wBACrB,eAAe,EAAE,QAAQ;wBACzB,SAAS,EAAE,eAAe,CAAC,UAAU;wBACrC,OAAO,EAAE,eAAe,CAAC,QAAQ;wBACjC,SAAS,EAAE,UAAU;wBACrB,aAAa,EAAE,cAAc;wBAC7B,SAAS;wBACT,YAAY,EAAE,MAAA,eAAe,CAAC,QAAQ,CAAC,QAAQ,mCAAI,EAAE;wBACrD,kBAAkB,EAAE,MAAA,eAAe,CAAC,oBAAoB,mCAAI,EAAE;wBAC9D,SAAS,EAAE,eAAe,CAAC,IAAI;qBAChC;iBACF,CAAC,CAAA;aACH;SACF;IACH,CAAC;CACF,CAAA"}
@@ -35,14 +35,48 @@ exports.sendChatMessage = {
35
35
  });
36
36
  return;
37
37
  }
38
+ if (provider_id === undefined) {
39
+ await onError({
40
+ events: [
41
+ {
42
+ date: new Date().toISOString(),
43
+ text: { en: 'Fields are missing' },
44
+ error: {
45
+ category: 'MISSING_FIELDS',
46
+ message: '`provider_id` is missing',
47
+ },
48
+ },
49
+ ],
50
+ });
51
+ return;
52
+ }
38
53
  const client = (0, graphqlClient_1.initialiseClient)(settings);
39
54
  if (client !== undefined) {
40
55
  const sdk = (0, sdk_1.getSdk)(client);
56
+ // The logic is as follows:
57
+ // 1. Get all conversations for the patient (by patient id)
58
+ // 2. Find the conversation that has the specified provider / current user as a member
59
+ // 3. If no conversation exists, create a new one including the patient and owned by the specified provider / current user
60
+ // 4. Send the (cleaned up) message to the conversation
61
+ // Questions:
62
+ // 1. What if the patient has multiple conversations with the same provider? -> We find the first conversation
63
+ // that matches the required conversation participants, so this is not deterministic
64
+ // 2. What is the dietitian id? -> This is provider_id, they are the same; dietitian_id is the old name
41
65
  const createConversation = async () => {
42
66
  var _a;
43
67
  const { data } = await sdk.createConversation({
44
- owner_id: provider_id,
68
+ /**
69
+ * Send the message in name of the specified provider.
70
+ * If empty or blank, it defaults to the current user.
71
+ * https://docs.gethealthie.com/docs/#createconversation-mutation
72
+ */
45
73
  simple_added_users: `user-${healthie_patient_id}`,
74
+ owner_id: provider_id,
75
+ // These are deprecated fields to account for how Healthie conversation lookup logic works for when
76
+ // a patient is (re)assigned a provider and Healthie automatically creates a new conversation between them
77
+ // @ts-expect-error these deprecated fields are not in the schema but are still supported
78
+ dietitian_id: provider_id,
79
+ patient_id: healthie_patient_id,
46
80
  });
47
81
  return (_a = data.createConversation) === null || _a === void 0 ? void 0 : _a.conversation;
48
82
  };
@@ -80,6 +114,13 @@ exports.sendChatMessage = {
80
114
  },
81
115
  });
82
116
  };
117
+ /**
118
+ * First checks if the conversation exists, if not, creates it.
119
+ * To check for existing conversation, it looks for an active, individual conversation
120
+ * that the patient and provider are both members of. If provider_id is not specified,
121
+ * it defaults to the current user.
122
+ * @returns The conversation object
123
+ */
83
124
  const getConversation = async () => {
84
125
  var _a, _b;
85
126
  const { data } = await sdk.getConversationList({
@@ -1 +1 @@
1
- {"version":3,"file":"sendChatMessage.js","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EAAE,kBAAkB;gCAC5B,OAAO,EAAE,4BAA4B;6BACtC;yBACF;qBACF;iBACF,CAAC,CAAA;aACH;SACF;QAAC,OAAO,GAAG,EAAE;YACZ,IAAI,GAAG,YAAY,sBAAa,EAAE;gBAChC,MAAM,MAAM,GAAG,IAAA,mCAA0B,EAAC,GAAG,CAAC,MAAM,CAAC,CAAA;gBACrD,MAAM,OAAO,CAAC;oBACZ,MAAM,EAAE,MAAM;iBACf,CAAC,CAAA;aACH;iBAAM;gBACL,MAAM,KAAK,GAAG,GAAY,CAAA;gBAC1B,MAAM,OAAO,CAAC;oBACZ,MAAM,EAAE;wBACN;4BACE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;4BAC9B,IAAI,EAAE,EAAE,EAAE,EAAE,gCAAgC,EAAE;4BAC9C,KAAK,EAAE;gCACL,QAAQ,EAAE,cAAc;gCACxB,OAAO,EAAE,KAAK,CAAC,OAAO;6BACvB;yBACF;qBACF;iBACF,CAAC,CAAA;aACH;SACF;IACH,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"sendChatMessage.js","sourceRoot":"","sources":["../../../../../extensions/healthie/actions/sendChatMessage/sendChatMessage.ts"],"names":[],"mappings":";;;AAAA,mCAA8B;AAC9B,qCAA6C;AAE7C,mEAAwD;AACxD,uCAAsC;AACtC,uDAAsD;AAGtD,yCAAwE;AACxE,qCAA6C;AAEhC,QAAA,eAAe,GAIxB;IACF,GAAG,EAAE,iBAAiB;IACtB,QAAQ,EAAE,0BAAQ,CAAC,gBAAgB;IACnC,KAAK,EAAE,mBAAmB;IAC1B,WAAW,EAAE,+CAA+C;IAC5D,MAAM,EAAN,eAAM;IACN,UAAU,EAAV,mBAAU;IACV,WAAW,EAAE,IAAI;IACjB,iBAAiB,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAiB,EAAE;QACvE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAA;QACpC,MAA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AAE,EAAE,4CAA4C,EAAE;4BAC1D,KAAK,EAAE;gCACL,QAAQ,EAAE,kBAAkB;gCAC5B,OAAO,EAAE,4BAA4B;6BACtC;yBACF;qBACF;iBACF,CAAC,CAAA;aACH;SACF;QAAC,OAAO,GAAG,EAAE;YACZ,IAAI,GAAG,YAAY,sBAAa,EAAE;gBAChC,MAAM,MAAM,GAAG,IAAA,mCAA0B,EAAC,GAAG,CAAC,MAAM,CAAC,CAAA;gBACrD,MAAM,OAAO,CAAC;oBACZ,MAAM,EAAE,MAAM;iBACf,CAAC,CAAA;aACH;iBAAM;gBACL,MAAM,KAAK,GAAG,GAAY,CAAA;gBAC1B,MAAM,OAAO,CAAC;oBACZ,MAAM,EAAE;wBACN;4BACE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;4BAC9B,IAAI,EAAE,EAAE,EAAE,EAAE,gCAAgC,EAAE;4BAC9C,KAAK,EAAE;gCACL,QAAQ,EAAE,cAAc;gCACxB,OAAO,EAAE,KAAK,CAAC,OAAO;6BACvB;yBACF;qBACF;iBACF,CAAC,CAAA;aACH;SACF;IACH,CAAC;CACF,CAAA"}
@@ -44,7 +44,7 @@
44
44
  "changelog": "# Formsort changelog"
45
45
  },
46
46
  "healthie": {
47
- "readme": "---\ntitle: Healthie\ndescription: Healthie offers infrastructure for next generation digital health organizations that provide virtual-first care.\n---\n\n# What is Healthie?\n\nHealthie offers infrastructure for next generation digital health organizations that provide virtual-first care. Healthie’s API-first and fully brandable suite of solutions (Scheduling, EMR, Client Engagement) enables healthcare builders to launch and scale best-in-class experiences for their members. Healthie also offers a built-in marketplace of business and clinical integrations used by our organizations.\n\nTo learn more, visit [www.gethealthie.com](www.gethealthie.com).\n\n## Healthie x Awell\n\nWith this extension, organizations are able to build clinical workflows in Awell’s low-code platform and easily integrate them into Healthie. By doing so, Healthie’s customers can automate routine clinical tasks, synchronize data between systems and drive seamless coordination between care team and patients.\n\nBy combining Healthie’s web and mobile platform with our clinical workflows, clinicians will be able to provide the right care, at the right time for the right patient.\n\n# Extension settings\n\nIn order to set up this extension, **you will need to provide a Healthie API key and Api url**. You can obtain an API key via the Healthie portal (`Settings > Developer > API keys`). You can obtain API url in the [DOCUMENTATION](https://docs.gethealthie.com/docs/#environments) in `Environments` section.\n\nPlease note that the extension automatically prefixes the API key with `Basic ` so please provide your raw API key without `Basic ` in front.\n\n# Custom Actions\n\n## Send chat message action\n\nSends a chat message to a patient in name of the provided provider ID. Will create a new conversation if no active conversation between patient and provider exists or sends a message in an existing conversation if there is an active conversation between the two.\n\n## Create patient\n\nCreates a new patient according to the passed fields. After completion the `healthiePatientId` will be exposed as a data point in the care flow.\n\n## Update patient\n\nUpdates a specific patient (defined by the provided `id`) according to the passed fields.\n\n## Apply tag to patient\n\nAdds a tag (existing one, identified by an `id`) to a patient. Although the Healthie API call allows assigning multiple tags per API call, for simplicity of the logic this action can only take one tag as input. Assigning multiple tags is possible by adding multiple actions.\n\n## Remove tag from patient\n\nRemoves a tag (identified by an `id`) from a patient.\n\n## Create charting note\n\nCreates a charting note with the provided `note_content`.\n\n**Prerequisites and set-up:**\n\n1. The form specified by the `form_id` exists in Healthie.\n2. The form specified by the `form_id` is a charting form (click \"Convert to charting form\" in the form options).\n3. The form contains at least one question of type `textarea` (long text answer). The action will write the content of the charting note in the first question of that type it finds in the form.\n\n## Send form completion request\n\nSend a form completion request to the patient. You will need the Healthie patient ID and the ID of the form you would like the patient to complete.\n\nAlthough the Healthie API call allows sending form completion requests to multiple users per API call (see recipient_ids in their docs), we decided that every action only sends one form completion request. This heavily simplifies the logic and better fits our domain model (1-to-1 relationship between patient and pathway). If a user would like to send multiple form completion requests, they you can just add multiple actions.\n\n## Archive patient\n\nArchives a patient with a given `id`.\n\n## Create location\n\nCreates a location. ID of the created location is stored as `locationId` data point.\n\n## Close chat conversation\n\nCloses chat conversation with a given `id` as a provider with the given `provider_id`.\n\n## Delete appointment\n\nDeletes an appointment with a given `id`.\n\n## Cancel appointment\n\nCancels an appointment with a given `id`.\n\n## Get metric entry\n\nRetrieve the most recent metric entry from a given `category`.\n## Create metric entry\n\nCreate a metric entry for a patient in Healthie.\n",
47
+ "readme": "---\ntitle: Healthie\ndescription: Healthie offers infrastructure for next generation digital health organizations that provide virtual-first care.\n---\n\n# What is Healthie?\n\nHealthie offers infrastructure for next generation digital health organizations that provide virtual-first care. Healthie’s API-first and fully brandable suite of solutions (Scheduling, EMR, Client Engagement) enables healthcare builders to launch and scale best-in-class experiences for their members. Healthie also offers a built-in marketplace of business and clinical integrations used by our organizations.\n\nTo learn more, visit [www.gethealthie.com](www.gethealthie.com).\n\n## Healthie x Awell\n\nWith this extension, organizations are able to build clinical workflows in Awell’s low-code platform and easily integrate them into Healthie. By doing so, Healthie’s customers can automate routine clinical tasks, synchronize data between systems and drive seamless coordination between care team and patients.\n\nBy combining Healthie’s web and mobile platform with our clinical workflows, clinicians will be able to provide the right care, at the right time for the right patient.\n\n# Extension settings\n\nIn order to set up this extension, **you will need to provide a Healthie API key and Api url**. You can obtain an API key via the Healthie portal (`Settings > Developer > API keys`). You can obtain API url in the [DOCUMENTATION](https://docs.gethealthie.com/docs/#environments) in `Environments` section.\n\nPlease note that the extension automatically prefixes the API key with `Basic ` so please provide your raw API key without `Basic ` in front.\n\n# Custom Actions\n\n## Send chat message action\n\nSends a chat message to a patient in name of the provided provider ID. Will create a new conversation if no active conversation between patient and provider exists or sends a message in an existing conversation if there is an active conversation between the two.\n\n## Create patient\n\nCreates a new patient according to the passed fields. After completion the `healthiePatientId` will be exposed as a data point in the care flow.\n\n## Update patient\n\nUpdates a specific patient (defined by the provided `id`) according to the passed fields.\n\n## Apply tag to patient\n\nAdds a tag (existing one, identified by an `id`) to a patient. Although the Healthie API call allows assigning multiple tags per API call, for simplicity of the logic this action can only take one tag as input. Assigning multiple tags is possible by adding multiple actions.\n\n## Remove tag from patient\n\nRemoves a tag (identified by an `id`) from a patient.\n\n## Create charting note\n\nCreates a charting note with the provided `note_content`.\n\n**Prerequisites and set-up:**\n\n1. The form specified by the `form_id` exists in Healthie.\n2. The form specified by the `form_id` is a charting form (click \"Convert to charting form\" in the form options).\n3. The form contains at least one question of type `textarea` (long text answer). The action will write the content of the charting note in the first question of that type it finds in the form.\n\n## Send form completion request\n\nSend a form completion request to the patient. You will need the Healthie patient ID and the ID of the form you would like the patient to complete.\n\nAlthough the Healthie API call allows sending form completion requests to multiple users per API call (see recipient_ids in their docs), we decided that every action only sends one form completion request. This heavily simplifies the logic and better fits our domain model (1-to-1 relationship between patient and pathway). If a user would like to send multiple form completion requests, they you can just add multiple actions.\n\n## Archive patient\n\nArchives a patient with a given `id`.\n\n## Create location\n\nCreates a location. ID of the created location is stored as `locationId` data point.\n\n## Close chat conversation\n\nCloses chat conversation with a given `id` as a provider with the given `provider_id`.\n\n## Delete appointment\n\nDeletes an appointment with a given `id`.\n\n## Cancel appointment\n\nCancels an appointment with a given `id`.\n\n## Get metric entry\n\nRetrieve the most recent metric entry from a given `category`.\n## Create metric entry\n\nCreate a metric entry for a patient in Healthie. The category of the metric is the literal name of the metric in Healthie. So if you have a metric in Healthie called \"Weight\", you should use \"Weight\" as the category.\n",
48
48
  "changelog": "# Healthie changelog\n\n## October 2023\n\n- Add \"Update patient quick notes\" action\n- Add \"Create metric entry\" action.\n\n## September 5, 2023\n\n- add Healthie gender to Sex in iso format mapper in `getPatient`\n\n## May 2023\n\n- New webhooks added: `appliedTagCreated`, `appliedTagDeleted`, `appointmentDeleted`, `appointmentUpdated`, `formAnswerGroupCreated`, `formAnswerGroupDeleted`, `formAnswerGroupLocked`, `formAnswerGroupSigned`, `labOrderCreated`, `labOrderUpdated`, `messageCreated`, `messageDeleted`, `metricEntryCreated`, `metricEntryDeleted`, `metricEntryUpdated`, `patientUpdated`, `requestFormCompletionCreated`, `requestFormCompletionDeleted`, `requestFormCompletionUpdated`, `taskCreated`, `taskDeleted`, `taskUpdated`\n\n## April 2023\n\n- Create task action: now also adds support for reminders.\n"
49
49
  },
50
50
  "hello-world": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awell-health/awell-extensions",
3
- "version": "1.0.131",
3
+ "version": "1.0.133",
4
4
  "packageManager": "yarn@3.4.1",
5
5
  "main": "dist/src/index.js",
6
6
  "repository": {