@awell-health/awell-extensions 1.0.171 → 1.0.173

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. package/dist/extensions/wellinks/actions/createChartingNoteAdvanced/config/fields.d.ts +66 -0
  2. package/dist/extensions/wellinks/actions/createChartingNoteAdvanced/config/fields.js +59 -0
  3. package/dist/extensions/wellinks/actions/createChartingNoteAdvanced/config/fields.js.map +1 -0
  4. package/dist/extensions/wellinks/actions/createChartingNoteAdvanced/config/index.d.ts +1 -0
  5. package/dist/extensions/wellinks/actions/createChartingNoteAdvanced/config/index.js +6 -0
  6. package/dist/extensions/wellinks/actions/createChartingNoteAdvanced/config/index.js.map +1 -0
  7. package/dist/extensions/wellinks/actions/createChartingNoteAdvanced/createChartingNoteAdvanced.d.ts +4 -0
  8. package/dist/extensions/wellinks/actions/createChartingNoteAdvanced/createChartingNoteAdvanced.js +80 -0
  9. package/dist/extensions/wellinks/actions/createChartingNoteAdvanced/createChartingNoteAdvanced.js.map +1 -0
  10. package/dist/extensions/wellinks/actions/createChartingNoteAdvanced/createChartingNoteAdvanced.test.d.ts +1 -0
  11. package/dist/extensions/wellinks/actions/createChartingNoteAdvanced/createChartingNoteAdvanced.test.js +47 -0
  12. package/dist/extensions/wellinks/actions/createChartingNoteAdvanced/createChartingNoteAdvanced.test.js.map +1 -0
  13. package/dist/extensions/wellinks/actions/createChartingNoteAdvanced/index.d.ts +1 -0
  14. package/dist/extensions/wellinks/actions/createChartingNoteAdvanced/index.js +6 -0
  15. package/dist/extensions/wellinks/actions/createChartingNoteAdvanced/index.js.map +1 -0
  16. package/dist/extensions/wellinks/actions/index.d.ts +108 -0
  17. package/dist/extensions/wellinks/actions/index.js +2 -0
  18. package/dist/extensions/wellinks/actions/index.js.map +1 -1
  19. package/dist/extensions/wellinks/api/clients/wellinksGraphqlClient.d.ts +1 -1
  20. package/dist/extensions/wellinks/api/clients/wellinksGraphqlClient.js +15 -10
  21. package/dist/extensions/wellinks/api/clients/wellinksGraphqlClient.js.map +1 -1
  22. package/dist/extensions/wellinks/gql/wellinksSdk.d.ts +7403 -2868
  23. package/dist/extensions/wellinks/gql/wellinksSdk.js +550 -1
  24. package/dist/extensions/wellinks/gql/wellinksSdk.js.map +1 -1
  25. package/dist/extensions/wellinks/graphql/mutations.d.ts +1 -0
  26. package/dist/extensions/wellinks/graphql/mutations.js +17 -0
  27. package/dist/extensions/wellinks/graphql/mutations.js.map +1 -0
  28. package/dist/extensions/wellinks/graphql/queries.d.ts +2 -1
  29. package/dist/extensions/wellinks/graphql/queries.js +26 -7
  30. package/dist/extensions/wellinks/graphql/queries.js.map +1 -1
  31. package/package.json +2 -2
@@ -0,0 +1,66 @@
1
+ import { FieldType } from '@awell-health/extensions-core';
2
+ import { z } from 'zod';
3
+ export declare const fields: {
4
+ healthie_patient_id: {
5
+ id: string;
6
+ label: string;
7
+ description: string;
8
+ type: FieldType.STRING;
9
+ required: true;
10
+ };
11
+ form_id: {
12
+ id: string;
13
+ label: string;
14
+ description: string;
15
+ type: FieldType.STRING;
16
+ required: true;
17
+ };
18
+ note_content: {
19
+ id: string;
20
+ label: string;
21
+ description: string;
22
+ type: FieldType.JSON;
23
+ required: true;
24
+ };
25
+ marked_locked: {
26
+ id: string;
27
+ label: string;
28
+ description: string;
29
+ type: FieldType.BOOLEAN;
30
+ required: false;
31
+ };
32
+ appointment_id: {
33
+ id: string;
34
+ label: string;
35
+ description: string;
36
+ type: FieldType.STRING;
37
+ required: false;
38
+ };
39
+ };
40
+ export declare const FieldsValidationSchema: z.ZodObject<{
41
+ healthie_patient_id: z.ZodString;
42
+ form_id: z.ZodString;
43
+ note_content: z.ZodEffects<z.ZodEffects<z.ZodString, any, string>, {
44
+ answer: string;
45
+ user_id: string;
46
+ custom_module_id: string;
47
+ }[], string>;
48
+ marked_locked: z.ZodOptional<z.ZodBoolean>;
49
+ appointment_id: z.ZodOptional<z.ZodString>;
50
+ }, "strip", z.ZodTypeAny, {
51
+ healthie_patient_id: string;
52
+ form_id: string;
53
+ note_content: {
54
+ answer: string;
55
+ user_id: string;
56
+ custom_module_id: string;
57
+ }[];
58
+ marked_locked?: boolean | undefined;
59
+ appointment_id?: string | undefined;
60
+ }, {
61
+ healthie_patient_id: string;
62
+ form_id: string;
63
+ note_content: string;
64
+ marked_locked?: boolean | undefined;
65
+ appointment_id?: string | undefined;
66
+ }>;
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FieldsValidationSchema = exports.fields = void 0;
4
+ const extensions_core_1 = require("@awell-health/extensions-core");
5
+ const zod_1 = require("zod");
6
+ exports.fields = {
7
+ healthie_patient_id: {
8
+ id: 'healthie_patient_id',
9
+ label: 'Healthie Patient ID',
10
+ description: 'The ID of the patient you would like to create a charting note for.',
11
+ type: extensions_core_1.FieldType.STRING,
12
+ required: true,
13
+ },
14
+ form_id: {
15
+ id: 'form_id',
16
+ label: 'Form ID',
17
+ description: 'The ID of the form you would like to create the charting note against.',
18
+ type: extensions_core_1.FieldType.STRING,
19
+ required: true,
20
+ },
21
+ note_content: {
22
+ id: 'note_content',
23
+ label: 'Note content',
24
+ description: 'The json content of the charting note.',
25
+ type: extensions_core_1.FieldType.JSON,
26
+ required: true,
27
+ },
28
+ marked_locked: {
29
+ id: 'marked_locked',
30
+ label: 'Mark as locked?',
31
+ description: 'This field allows you to mark the content as locked.',
32
+ type: extensions_core_1.FieldType.BOOLEAN,
33
+ required: false,
34
+ },
35
+ appointment_id: {
36
+ id: 'appointment_id',
37
+ label: 'Appointment ID',
38
+ description: 'The ID of the appointment you would like the charting note associated with.',
39
+ type: extensions_core_1.FieldType.STRING,
40
+ required: false,
41
+ },
42
+ };
43
+ const FormAnswerSchema = zod_1.z.object({
44
+ custom_module_id: zod_1.z.string(),
45
+ user_id: zod_1.z.string(),
46
+ answer: zod_1.z.string(),
47
+ });
48
+ const FormAnswersSchema = zod_1.z.array(FormAnswerSchema);
49
+ exports.FieldsValidationSchema = zod_1.z.object({
50
+ healthie_patient_id: zod_1.z.string(),
51
+ form_id: zod_1.z.string(),
52
+ note_content: zod_1.z
53
+ .string()
54
+ .transform((t) => JSON.parse(t))
55
+ .transform((v) => FormAnswersSchema.parse(v)),
56
+ marked_locked: zod_1.z.boolean().optional(),
57
+ appointment_id: zod_1.z.string().optional(),
58
+ });
59
+ //# sourceMappingURL=fields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../extensions/wellinks/actions/createChartingNoteAdvanced/config/fields.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AACrE,6BAAwB;AAEX,QAAA,MAAM,GAAG;IACpB,mBAAmB,EAAE;QACjB,EAAE,EAAE,qBAAqB;QACzB,KAAK,EAAE,qBAAqB;QAC5B,WAAW,EACP,qEAAqE;QACzE,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACjB;IACD,OAAO,EAAE;QACL,EAAE,EAAE,SAAS;QACb,KAAK,EAAE,SAAS;QAChB,WAAW,EACP,wEAAwE;QAC5E,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACjB;IACD,YAAY,EAAE;QACV,EAAE,EAAE,cAAc;QAClB,KAAK,EAAE,cAAc;QACrB,WAAW,EAAE,wCAAwC;QACrD,IAAI,EAAE,2BAAS,CAAC,IAAI;QACpB,QAAQ,EAAE,IAAI;KACjB;IACD,aAAa,EAAE;QACX,EAAE,EAAE,eAAe;QACnB,KAAK,EAAE,iBAAiB;QACxB,WAAW,EAAE,sDAAsD;QACnE,IAAI,EAAE,2BAAS,CAAC,OAAO;QACvB,QAAQ,EAAE,KAAK;KAClB;IACD,cAAc,EAAE;QACZ,EAAE,EAAE,gBAAgB;QACpB,KAAK,EAAE,gBAAgB;QACvB,WAAW,EACP,6EAA6E;QACjF,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,KAAK;KAClB;CAC8B,CAAA;AAEjC,MAAM,gBAAgB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9B,gBAAgB,EAAE,OAAC,CAAC,MAAM,EAAE;IAC5B,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;IACnB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;CACrB,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAG,OAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;AAEvC,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,mBAAmB,EAAE,OAAC,CAAC,MAAM,EAAE;IAC/B,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;IACnB,YAAY,EAAE,OAAC;SACZ,MAAM,EAAE;SACR,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SAC/B,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC/C,aAAa,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACrC,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACtC,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export { fields } from './fields';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fields = void 0;
4
+ var fields_1 = require("./fields");
5
+ Object.defineProperty(exports, "fields", { enumerable: true, get: function () { return fields_1.fields; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../extensions/wellinks/actions/createChartingNoteAdvanced/config/index.ts"],"names":[],"mappings":";;;AAAA,mCAAiC;AAAxB,gGAAA,MAAM,OAAA"}
@@ -0,0 +1,4 @@
1
+ import { type Action } from '@awell-health/extensions-core';
2
+ import { type settings } from '../../config/settings';
3
+ import { fields } from './config/fields';
4
+ export declare const createChartingNoteAdvanced: Action<typeof fields, typeof settings>;
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createChartingNoteAdvanced = void 0;
4
+ const extensions_core_1 = require("@awell-health/extensions-core");
5
+ const lodash_1 = require("lodash");
6
+ const wellinksGraphqlClient_1 = require("../../api/clients/wellinksGraphqlClient");
7
+ const errors_1 = require("../../../healthie/errors");
8
+ const wellinksSdk_1 = require("../../gql/wellinksSdk");
9
+ const fields_1 = require("./config/fields");
10
+ exports.createChartingNoteAdvanced = {
11
+ key: 'createChartingNoteAdvanced',
12
+ category: extensions_core_1.Category.EHR_INTEGRATIONS,
13
+ title: 'Fill Form entrance',
14
+ description: 'Fill a multi-part form in Healthie. Note Content must be in an array of FormAnswer objects.',
15
+ fields: fields_1.fields,
16
+ previewable: true,
17
+ onActivityCreated: async (payload, onComplete, onError) => {
18
+ const { fields, settings } = payload;
19
+ const { healthie_patient_id, form_id, note_content, marked_locked, appointment_id } = fields_1.FieldsValidationSchema.parse(fields);
20
+ try {
21
+ const client = (0, wellinksGraphqlClient_1.initialiseClient)(settings);
22
+ if (typeof client === 'undefined') {
23
+ throw new Error();
24
+ }
25
+ const sdk = (0, wellinksSdk_1.getSdk)(client);
26
+ const { data } = await sdk.getFormTemplate({ id: form_id, });
27
+ const moduleForm = data.customModuleForm;
28
+ if ((0, lodash_1.isNil)(moduleForm)) {
29
+ throw new Error(`Form with id ${form_id} doesn't exist`);
30
+ }
31
+ if (moduleForm.use_for_charting === false) {
32
+ throw new Error(`Form with id ${form_id} cannot be used for charting`);
33
+ }
34
+ const answers = formatAnswers(note_content, moduleForm.custom_modules);
35
+ if ((answers === null || answers === void 0 ? void 0 : answers.length) === 0) {
36
+ throw new Error(`There are no answers in the request`);
37
+ }
38
+ await sdk.createFormAnswerGroup({
39
+ input: {
40
+ finished: true,
41
+ custom_module_form_id: form_id,
42
+ user_id: healthie_patient_id,
43
+ appointment_id,
44
+ form_answers: answers,
45
+ marked_locked: marked_locked !== null && marked_locked !== void 0 ? marked_locked : false,
46
+ },
47
+ });
48
+ await onComplete();
49
+ }
50
+ catch (error) {
51
+ if (error instanceof errors_1.HealthieError) {
52
+ const errors = (0, errors_1.mapHealthieToActivityError)(error.errors);
53
+ await onError({
54
+ events: errors,
55
+ });
56
+ }
57
+ else {
58
+ throw error;
59
+ }
60
+ }
61
+ },
62
+ };
63
+ const formatAnswers = (content, customModules) => {
64
+ const customModuleIds = customModules.map((item) => item.id);
65
+ try {
66
+ const answers = content.map((item) => {
67
+ const x = {
68
+ custom_module_id: item.custom_module_id,
69
+ user_id: item.user_id,
70
+ answer: item.answer,
71
+ };
72
+ return x;
73
+ });
74
+ return answers.filter((item) => customModuleIds.includes(item.custom_module_id));
75
+ }
76
+ catch (err) {
77
+ return [];
78
+ }
79
+ };
80
+ //# sourceMappingURL=createChartingNoteAdvanced.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createChartingNoteAdvanced.js","sourceRoot":"","sources":["../../../../../extensions/wellinks/actions/createChartingNoteAdvanced/createChartingNoteAdvanced.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tests_1 = require("../../../../src/tests");
4
+ const wellinksSdk_1 = require("../../gql/wellinksSdk");
5
+ const sdk_1 = require("../../../healthie/gql/__mocks__/sdk");
6
+ const _1 = require(".");
7
+ const settings_1 = require("../../__mocks__/config/settings");
8
+ jest.mock('../../gql/wellinksSdk');
9
+ jest.mock('../../api/clients/wellinksGraphqlClient');
10
+ const content = [
11
+ {
12
+ "id": "3486803",
13
+ "custom_module_id": "question-1",
14
+ "answer": "Open Answer(Short) sample answer",
15
+ "user_id": "51065",
16
+ "label": "Test Open Answer(Short)",
17
+ "filter_type": null,
18
+ "value_to_filter": null,
19
+ "conditional_custom_module_id": null
20
+ },
21
+ ];
22
+ describe('createChartingNote action', () => {
23
+ const onComplete = jest.fn();
24
+ beforeAll(() => {
25
+ ;
26
+ wellinksSdk_1.getSdk.mockImplementation(sdk_1.mockGetSdk);
27
+ });
28
+ beforeEach(() => {
29
+ jest.clearAllMocks();
30
+ });
31
+ test('Should create a charting note', async () => {
32
+ await _1.createChartingNoteAdvanced.onActivityCreated((0, tests_1.generateTestPayload)({
33
+ fields: {
34
+ form_id: 'form-template-1',
35
+ healthie_patient_id: 'patient-1',
36
+ note_content: JSON.stringify(content),
37
+ marked_locked: true,
38
+ appointment_id: 'appointment-1'
39
+ },
40
+ settings: settings_1.mockSettings,
41
+ }), onComplete, jest.fn());
42
+ expect(sdk_1.mockGetSdkReturn.getFormTemplate).toHaveBeenCalled();
43
+ expect(sdk_1.mockGetSdkReturn.createFormAnswerGroup).toHaveBeenCalled();
44
+ expect(onComplete).toHaveBeenCalled();
45
+ });
46
+ });
47
+ //# sourceMappingURL=createChartingNoteAdvanced.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createChartingNoteAdvanced.test.js","sourceRoot":"","sources":["../../../../../extensions/wellinks/actions/createChartingNoteAdvanced/createChartingNoteAdvanced.test.ts"],"names":[],"mappings":";;AAAA,iDAA2D;AAC3D,uDAA8C;AAC9C,6DAAkF;AAClF,wBAA8C;AAC9C,8DAA8D;AAE9D,IAAI,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAA;AAClC,IAAI,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAA;AACpD,MAAM,OAAO,GAAG;IACd;QACE,IAAI,EAAE,SAAS;QACf,kBAAkB,EAAE,YAAY;QAChC,QAAQ,EAAE,kCAAkC;QAC5C,SAAS,EAAE,OAAO;QAClB,OAAO,EAAE,yBAAyB;QAClC,aAAa,EAAE,IAAI;QACnB,iBAAiB,EAAE,IAAI;QACvB,8BAA8B,EAAE,IAAI;KACrC;CACF,CAAC;AACF,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACzC,MAAM,UAAU,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAE5B,SAAS,CAAC,GAAG,EAAE;QACb,CAAC;QAAE,oBAAoB,CAAC,kBAAkB,CAAC,gBAAU,CAAC,CAAA;IACxD,CAAC,CAAC,CAAA;IAEF,UAAU,CAAC,GAAG,EAAE;QACd,IAAI,CAAC,aAAa,EAAE,CAAA;IACtB,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,+BAA+B,EAAE,KAAK,IAAI,EAAE;QAC/C,MAAM,6BAA0B,CAAC,iBAAiB,CAChD,IAAA,2BAAmB,EAAC;YAClB,MAAM,EAAE;gBACN,OAAO,EAAE,iBAAiB;gBAC1B,mBAAmB,EAAE,WAAW;gBAChC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;gBACrC,aAAa,EAAE,IAAI;gBACnB,cAAc,EAAE,eAAe;aAChC;YACD,QAAQ,EAAE,uBAAY;SACvB,CAAC,EACF,UAAU,EACV,IAAI,CAAC,EAAE,EAAE,CACV,CAAC;QAEF,MAAM,CAAC,sBAAgB,CAAC,eAAe,CAAC,CAAC,gBAAgB,EAAE,CAAA;QAC3D,MAAM,CAAC,sBAAgB,CAAC,qBAAqB,CAAC,CAAC,gBAAgB,EAAE,CAAA;QACjE,MAAM,CAAC,UAAU,CAAC,CAAC,gBAAgB,EAAE,CAAA;IACvC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -0,0 +1 @@
1
+ export { createChartingNoteAdvanced } from './createChartingNoteAdvanced';
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createChartingNoteAdvanced = void 0;
4
+ var createChartingNoteAdvanced_1 = require("./createChartingNoteAdvanced");
5
+ Object.defineProperty(exports, "createChartingNoteAdvanced", { enumerable: true, get: function () { return createChartingNoteAdvanced_1.createChartingNoteAdvanced; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/wellinks/actions/createChartingNoteAdvanced/index.ts"],"names":[],"mappings":";;;AAAA,2EAAyE;AAAhE,wIAAA,0BAA0B,OAAA"}
@@ -856,4 +856,112 @@ export declare const actions: {
856
856
  description: string;
857
857
  };
858
858
  }, "createSuccessful", never>;
859
+ createChartingNoteAdvanced: import("@awell-health/extensions-core").Action<{
860
+ healthie_patient_id: {
861
+ id: string;
862
+ label: string;
863
+ description: string;
864
+ type: import("@awell-health/extensions-core").FieldType.STRING;
865
+ required: true;
866
+ };
867
+ form_id: {
868
+ id: string;
869
+ label: string;
870
+ description: string;
871
+ type: import("@awell-health/extensions-core").FieldType.STRING;
872
+ required: true;
873
+ };
874
+ note_content: {
875
+ id: string;
876
+ label: string;
877
+ description: string;
878
+ type: import("@awell-health/extensions-core").FieldType.JSON;
879
+ required: true;
880
+ };
881
+ marked_locked: {
882
+ id: string;
883
+ label: string;
884
+ description: string;
885
+ type: import("@awell-health/extensions-core").FieldType.BOOLEAN;
886
+ required: false;
887
+ };
888
+ appointment_id: {
889
+ id: string;
890
+ label: string;
891
+ description: string;
892
+ type: import("@awell-health/extensions-core").FieldType.STRING;
893
+ required: false;
894
+ };
895
+ }, {
896
+ platformApiUrl: {
897
+ key: string;
898
+ label: string;
899
+ obfuscated: false;
900
+ required: false;
901
+ description: string;
902
+ };
903
+ platformApiKey: {
904
+ key: string;
905
+ label: string;
906
+ obfuscated: true;
907
+ required: false;
908
+ description: string;
909
+ };
910
+ apiUrl: {
911
+ key: string;
912
+ label: string;
913
+ obfuscated: false;
914
+ required: true;
915
+ description: string;
916
+ };
917
+ apiKey: {
918
+ key: string;
919
+ label: string;
920
+ obfuscated: true;
921
+ required: true;
922
+ description: string;
923
+ };
924
+ selectEventTypeQuestion: {
925
+ key: string;
926
+ label: string;
927
+ obfuscated: false;
928
+ required: false;
929
+ description: string;
930
+ };
931
+ startSendingRemindersQuestions: {
932
+ key: string;
933
+ label: string;
934
+ obfuscated: false;
935
+ required: false;
936
+ description: string;
937
+ };
938
+ memberEventFormId: {
939
+ key: string;
940
+ label: string;
941
+ obfuscated: false;
942
+ required: false;
943
+ description: string;
944
+ };
945
+ flourishApiUrl: {
946
+ key: string;
947
+ label: string;
948
+ obfuscated: false;
949
+ required: false;
950
+ description: string;
951
+ };
952
+ flourishApiKey: {
953
+ key: string;
954
+ label: string;
955
+ obfuscated: true;
956
+ required: false;
957
+ description: string;
958
+ };
959
+ flourishClientExtId: {
960
+ key: string;
961
+ label: string;
962
+ obfuscated: false;
963
+ required: false;
964
+ description: string;
965
+ };
966
+ }, string, never>;
859
967
  };
@@ -9,6 +9,7 @@ const insertMemberListEvent_1 = require("./insertMemberListEvent/insertMemberLis
9
9
  const checkFlourishCustomer_1 = require("./checkFlourishCustomer/checkFlourishCustomer");
10
10
  const submitPamSurvey_1 = require("./submitPamSurvey/submitPamSurvey");
11
11
  const createFlourishCustomer_1 = require("./createFlourishCustomer/createFlourishCustomer");
12
+ const createChartingNoteAdvanced_1 = require("./createChartingNoteAdvanced");
12
13
  exports.actions = {
13
14
  checkForOverride: checkForOverride_1.checkForOverride,
14
15
  checkForScheduledAppointment: checkForScheduledAppointment_1.checkForScheduledAppointment,
@@ -18,5 +19,6 @@ exports.actions = {
18
19
  checkFlourishCustomer: checkFlourishCustomer_1.checkFlourishCustomer,
19
20
  submitPamSurvey: submitPamSurvey_1.submitPamSurvey,
20
21
  createFlourishCustomer: createFlourishCustomer_1.createFlourishCustomer,
22
+ createChartingNoteAdvanced: createChartingNoteAdvanced_1.createChartingNoteAdvanced,
21
23
  };
22
24
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../extensions/wellinks/actions/index.ts"],"names":[],"mappings":";;;AAAA,0EAAsE;AACtE,8GAA0G;AAC1G,8DAA0D;AAC1D,+FAA2F;AAC3F,yFAAqF;AACrF,yFAAqF;AACrF,uEAAmE;AACnE,4FAAwF;AAC3E,QAAA,OAAO,GAAG;IACrB,gBAAgB,EAAhB,mCAAgB;IAChB,4BAA4B,EAA5B,2DAA4B;IAC5B,YAAY,EAAZ,2BAAY;IACZ,uBAAuB,EAAvB,iDAAuB;IACvB,qBAAqB,EAArB,6CAAqB;IACrB,qBAAqB,EAArB,6CAAqB;IACrB,eAAe,EAAf,iCAAe;IACf,sBAAsB,EAAtB,+CAAsB;CACvB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../extensions/wellinks/actions/index.ts"],"names":[],"mappings":";;;AAAA,0EAAsE;AACtE,8GAA0G;AAC1G,8DAA0D;AAC1D,+FAA2F;AAC3F,yFAAqF;AACrF,yFAAqF;AACrF,uEAAmE;AACnE,4FAAwF;AACxF,6EAAyE;AAC5D,QAAA,OAAO,GAAG;IACrB,gBAAgB,EAAhB,mCAAgB;IAChB,4BAA4B,EAA5B,2DAA4B;IAC5B,YAAY,EAAZ,2BAAY;IACZ,uBAAuB,EAAvB,iDAAuB;IACvB,qBAAqB,EAArB,6CAAqB;IACrB,qBAAqB,EAArB,6CAAqB;IACrB,eAAe,EAAf,iCAAe;IACf,sBAAsB,EAAtB,+CAAsB;IACtB,0BAA0B,EAA1B,uDAA0B;CAC3B,CAAA"}
@@ -1,3 +1,3 @@
1
1
  import { GraphQLClient } from 'graphql-request';
2
2
  import { type settings } from '../../config/settings';
3
- export declare const initialiseClient: (s: Record<keyof typeof settings, string | undefined>) => GraphQLClient | undefined;
3
+ export declare const initialiseClient: (s: Partial<Record<keyof typeof settings, string | undefined>>) => GraphQLClient | undefined;
@@ -1,18 +1,23 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.initialiseClient = void 0;
4
7
  const graphql_request_1 = require("graphql-request");
8
+ const zod_1 = __importDefault(require("zod"));
9
+ const ClientSchema = zod_1.default.object({
10
+ apiUrl: zod_1.default.string(),
11
+ apiKey: zod_1.default.string(),
12
+ });
5
13
  const initialiseClient = (s) => {
6
- const { apiUrl, apiKey } = s;
7
- if (apiUrl !== undefined && apiKey !== undefined) {
8
- return new graphql_request_1.GraphQLClient(apiUrl, {
9
- headers: {
10
- AuthorizationSource: 'API',
11
- Authorization: `Basic ${apiKey}`,
12
- },
13
- });
14
- }
15
- return undefined;
14
+ const { apiUrl, apiKey } = ClientSchema.parse(s);
15
+ return new graphql_request_1.GraphQLClient(apiUrl, {
16
+ headers: {
17
+ AuthorizationSource: 'API',
18
+ Authorization: `Basic ${apiKey}`,
19
+ },
20
+ });
16
21
  };
17
22
  exports.initialiseClient = initialiseClient;
18
23
  //# sourceMappingURL=wellinksGraphqlClient.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"wellinksGraphqlClient.js","sourceRoot":"","sources":["../../../../../extensions/wellinks/api/clients/wellinksGraphqlClient.ts"],"names":[],"mappings":";;;AAAA,qDAA+C;AAGxC,MAAM,gBAAgB,GAAG,CAC9B,CAAoD,EACzB,EAAE;IAC7B,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAA;IAC5B,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,SAAS,EAAE;QAChD,OAAO,IAAI,+BAAa,CAAC,MAAM,EAAE;YAC/B,OAAO,EAAE;gBACP,mBAAmB,EAAE,KAAK;gBAC1B,aAAa,EAAE,SAAS,MAAM,EAAE;aACjC;SACF,CAAC,CAAA;KACH;IACD,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA;AAbY,QAAA,gBAAgB,oBAa5B"}
1
+ {"version":3,"file":"wellinksGraphqlClient.js","sourceRoot":"","sources":["../../../../../extensions/wellinks/api/clients/wellinksGraphqlClient.ts"],"names":[],"mappings":";;;;;;AAAA,qDAA+C;AAE/C,8CAAmB;AACnB,MAAM,YAAY,GAAG,aAAC,CAAC,MAAM,CAAC;IAC5B,MAAM,EAAE,aAAC,CAAC,MAAM,EAAE;IAClB,MAAM,EAAE,aAAC,CAAC,MAAM,EAAE;CACnB,CAAC,CAAA;AACK,MAAM,gBAAgB,GAAG,CAC9B,CAA6D,EAClC,EAAE;IAC7B,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAChD,OAAO,IAAI,+BAAa,CAAC,MAAM,EAAE;QAC/B,OAAO,EAAE;YACP,mBAAmB,EAAE,KAAK;YAC1B,aAAa,EAAE,SAAS,MAAM,EAAE;SACjC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA;AAVY,QAAA,gBAAgB,oBAU5B"}