@awell-health/awell-extensions 2.1.2 → 2.1.3
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/medplum/actions/getMedicationRequest/__testdata__/MedicationRequest.mock.d.ts +80 -0
- package/dist/extensions/medplum/actions/getMedicationRequest/__testdata__/MedicationRequest.mock.js +84 -0
- package/dist/extensions/medplum/actions/getMedicationRequest/__testdata__/MedicationRequest.mock.js.map +1 -0
- package/dist/extensions/medplum/actions/getMedicationRequest/config/dataPoints.d.ts +30 -0
- package/dist/extensions/medplum/actions/getMedicationRequest/config/dataPoints.js +34 -0
- package/dist/extensions/medplum/actions/getMedicationRequest/config/dataPoints.js.map +1 -0
- package/dist/extensions/medplum/actions/getMedicationRequest/config/fields.d.ts +18 -0
- package/dist/extensions/medplum/actions/getMedicationRequest/config/fields.js +20 -0
- package/dist/extensions/medplum/actions/getMedicationRequest/config/fields.js.map +1 -0
- package/dist/extensions/medplum/actions/getMedicationRequest/config/index.d.ts +2 -0
- package/dist/extensions/medplum/actions/getMedicationRequest/config/index.js +19 -0
- package/dist/extensions/medplum/actions/getMedicationRequest/config/index.js.map +1 -0
- package/dist/extensions/medplum/actions/getMedicationRequest/getMedicationRequest.d.ts +4 -0
- package/dist/extensions/medplum/actions/getMedicationRequest/getMedicationRequest.js +65 -0
- package/dist/extensions/medplum/actions/getMedicationRequest/getMedicationRequest.js.map +1 -0
- package/dist/extensions/medplum/actions/getMedicationRequest/index.d.ts +1 -0
- package/dist/extensions/medplum/actions/getMedicationRequest/index.js +18 -0
- package/dist/extensions/medplum/actions/getMedicationRequest/index.js.map +1 -0
- package/dist/extensions/medplum/actions/index.d.ts +1 -0
- package/dist/extensions/medplum/actions/index.js +3 -1
- package/dist/extensions/medplum/actions/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
export declare const MedicationRequestMock: {
|
|
2
|
+
resourceType: "MedicationRequest";
|
|
3
|
+
id: string;
|
|
4
|
+
contained: {
|
|
5
|
+
resourceType: "Medication";
|
|
6
|
+
id: string;
|
|
7
|
+
code: {
|
|
8
|
+
coding: {
|
|
9
|
+
system: string;
|
|
10
|
+
code: string;
|
|
11
|
+
display: string;
|
|
12
|
+
}[];
|
|
13
|
+
};
|
|
14
|
+
}[];
|
|
15
|
+
identifier: {
|
|
16
|
+
use: "official";
|
|
17
|
+
system: string;
|
|
18
|
+
value: string;
|
|
19
|
+
}[];
|
|
20
|
+
status: "completed";
|
|
21
|
+
intent: "order";
|
|
22
|
+
medicationReference: {
|
|
23
|
+
reference: string;
|
|
24
|
+
display: string;
|
|
25
|
+
};
|
|
26
|
+
subject: {
|
|
27
|
+
reference: string;
|
|
28
|
+
display: string;
|
|
29
|
+
};
|
|
30
|
+
authoredOn: string;
|
|
31
|
+
requester: {
|
|
32
|
+
reference: string;
|
|
33
|
+
display: string;
|
|
34
|
+
};
|
|
35
|
+
dosageInstruction: {
|
|
36
|
+
sequence: number;
|
|
37
|
+
text: string;
|
|
38
|
+
timing: {
|
|
39
|
+
repeat: {
|
|
40
|
+
frequency: number;
|
|
41
|
+
period: number;
|
|
42
|
+
periodUnit: "d";
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
doseAndRate: {
|
|
46
|
+
type: {
|
|
47
|
+
coding: {
|
|
48
|
+
system: string;
|
|
49
|
+
code: string;
|
|
50
|
+
display: string;
|
|
51
|
+
}[];
|
|
52
|
+
};
|
|
53
|
+
doseQuantity: {
|
|
54
|
+
value: number;
|
|
55
|
+
unit: string;
|
|
56
|
+
system: string;
|
|
57
|
+
code: string;
|
|
58
|
+
};
|
|
59
|
+
}[];
|
|
60
|
+
}[];
|
|
61
|
+
dispenseRequest: {
|
|
62
|
+
validityPeriod: {
|
|
63
|
+
start: string;
|
|
64
|
+
end: string;
|
|
65
|
+
};
|
|
66
|
+
numberOfRepeatsAllowed: number;
|
|
67
|
+
quantity: {
|
|
68
|
+
value: number;
|
|
69
|
+
unit: string;
|
|
70
|
+
system: string;
|
|
71
|
+
code: string;
|
|
72
|
+
};
|
|
73
|
+
expectedSupplyDuration: {
|
|
74
|
+
value: number;
|
|
75
|
+
unit: string;
|
|
76
|
+
system: string;
|
|
77
|
+
code: string;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
};
|
package/dist/extensions/medplum/actions/getMedicationRequest/__testdata__/MedicationRequest.mock.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MedicationRequestMock = void 0;
|
|
4
|
+
exports.MedicationRequestMock = {
|
|
5
|
+
resourceType: 'MedicationRequest',
|
|
6
|
+
id: 'medrx0304',
|
|
7
|
+
contained: [{
|
|
8
|
+
resourceType: 'Medication',
|
|
9
|
+
id: 'med0312',
|
|
10
|
+
code: {
|
|
11
|
+
coding: [{
|
|
12
|
+
system: 'http://snomed.info/sct',
|
|
13
|
+
code: '324689003',
|
|
14
|
+
display: 'Product containing precisely nystatin 100000 unit/1 milliliter conventional release oral suspension (clinical drug)'
|
|
15
|
+
}]
|
|
16
|
+
}
|
|
17
|
+
}],
|
|
18
|
+
identifier: [{
|
|
19
|
+
use: 'official',
|
|
20
|
+
system: 'http://www.bmc.nl/portal/prescriptions',
|
|
21
|
+
value: '12345689'
|
|
22
|
+
}],
|
|
23
|
+
status: 'completed',
|
|
24
|
+
intent: 'order',
|
|
25
|
+
medicationReference: {
|
|
26
|
+
reference: '#med0312',
|
|
27
|
+
display: 'Nystatin 100,000 u/ml oral suspension'
|
|
28
|
+
},
|
|
29
|
+
subject: {
|
|
30
|
+
reference: 'Patient/pat1',
|
|
31
|
+
display: 'Donald Duck'
|
|
32
|
+
},
|
|
33
|
+
authoredOn: '2015-01-15',
|
|
34
|
+
requester: {
|
|
35
|
+
reference: 'Practitioner/f007',
|
|
36
|
+
display: 'Patrick Pump'
|
|
37
|
+
},
|
|
38
|
+
dosageInstruction: [{
|
|
39
|
+
sequence: 1,
|
|
40
|
+
text: '10 drops four times daily - apply in mouth using cotton swab or finger',
|
|
41
|
+
timing: {
|
|
42
|
+
repeat: {
|
|
43
|
+
frequency: 4,
|
|
44
|
+
period: 1,
|
|
45
|
+
periodUnit: 'd'
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
doseAndRate: [{
|
|
49
|
+
type: {
|
|
50
|
+
coding: [{
|
|
51
|
+
system: 'http://terminology.hl7.org/CodeSystem/dose-rate-type',
|
|
52
|
+
code: 'ordered',
|
|
53
|
+
display: 'Ordered'
|
|
54
|
+
}]
|
|
55
|
+
},
|
|
56
|
+
doseQuantity: {
|
|
57
|
+
value: 10,
|
|
58
|
+
unit: 'drop',
|
|
59
|
+
system: 'http://terminology.hl7.org/CodeSystem/v3-orderableDrugForm',
|
|
60
|
+
code: 'DROP'
|
|
61
|
+
}
|
|
62
|
+
}]
|
|
63
|
+
}],
|
|
64
|
+
dispenseRequest: {
|
|
65
|
+
validityPeriod: {
|
|
66
|
+
start: '2015-01-15',
|
|
67
|
+
end: '2016-01-15'
|
|
68
|
+
},
|
|
69
|
+
numberOfRepeatsAllowed: 3,
|
|
70
|
+
quantity: {
|
|
71
|
+
value: 10,
|
|
72
|
+
unit: 'ml',
|
|
73
|
+
system: 'http://unitsofmeasure.org',
|
|
74
|
+
code: 'ml'
|
|
75
|
+
},
|
|
76
|
+
expectedSupplyDuration: {
|
|
77
|
+
value: 10,
|
|
78
|
+
unit: 'days',
|
|
79
|
+
system: 'http://unitsofmeasure.org',
|
|
80
|
+
code: 'd'
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
//# sourceMappingURL=MedicationRequest.mock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MedicationRequest.mock.js","sourceRoot":"","sources":["../../../../../../extensions/medplum/actions/getMedicationRequest/__testdata__/MedicationRequest.mock.ts"],"names":[],"mappings":";;;AAE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EAAE;YACd,KAAK,EAAE,YAAY;YACnB,GAAG,EAAE,YAAY;SAClB;QACD,sBAAsB,EAAE,CAAC;QACzB,QAAQ,EAAE;YACR,KAAK,EAAE,EAAE;YACT,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,2BAA2B;YACnC,IAAI,EAAE,IAAI;SACX;QACD,sBAAsB,EAAE;YACtB,KAAK,EAAE,EAAE;YACT,IAAI,EAAE,MAAM;YACZ,MAAM,EAAE,2BAA2B;YACnC,IAAI,EAAE,GAAG;SACV;KACF;CAC0B,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const dataPoints: {
|
|
2
|
+
medicationRequest: {
|
|
3
|
+
key: string;
|
|
4
|
+
valueType: "json";
|
|
5
|
+
};
|
|
6
|
+
status: {
|
|
7
|
+
key: string;
|
|
8
|
+
valueType: "string";
|
|
9
|
+
};
|
|
10
|
+
intent: {
|
|
11
|
+
key: string;
|
|
12
|
+
valueType: "string";
|
|
13
|
+
};
|
|
14
|
+
priority: {
|
|
15
|
+
key: string;
|
|
16
|
+
valueType: "string";
|
|
17
|
+
};
|
|
18
|
+
medicationDisplay: {
|
|
19
|
+
key: string;
|
|
20
|
+
valueType: "string";
|
|
21
|
+
};
|
|
22
|
+
dosageInstructions: {
|
|
23
|
+
key: string;
|
|
24
|
+
valueType: "string";
|
|
25
|
+
};
|
|
26
|
+
patientId: {
|
|
27
|
+
key: string;
|
|
28
|
+
valueType: "string";
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dataPoints = void 0;
|
|
4
|
+
exports.dataPoints = {
|
|
5
|
+
medicationRequest: {
|
|
6
|
+
key: 'medicationRequest',
|
|
7
|
+
valueType: 'json',
|
|
8
|
+
},
|
|
9
|
+
status: {
|
|
10
|
+
key: 'status',
|
|
11
|
+
valueType: 'string',
|
|
12
|
+
},
|
|
13
|
+
intent: {
|
|
14
|
+
key: 'intent',
|
|
15
|
+
valueType: 'string',
|
|
16
|
+
},
|
|
17
|
+
priority: {
|
|
18
|
+
key: 'priority',
|
|
19
|
+
valueType: 'string',
|
|
20
|
+
},
|
|
21
|
+
medicationDisplay: {
|
|
22
|
+
key: 'medicationDisplay',
|
|
23
|
+
valueType: 'string',
|
|
24
|
+
},
|
|
25
|
+
dosageInstructions: {
|
|
26
|
+
key: 'dosageInstructions',
|
|
27
|
+
valueType: 'string',
|
|
28
|
+
},
|
|
29
|
+
patientId: {
|
|
30
|
+
key: 'patientId',
|
|
31
|
+
valueType: 'string',
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=dataPoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataPoints.js","sourceRoot":"","sources":["../../../../../../extensions/medplum/actions/getMedicationRequest/config/dataPoints.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG;IACxB,iBAAiB,EAAE;QACjB,GAAG,EAAE,mBAAmB;QACxB,SAAS,EAAE,MAAM;KAClB;IACD,MAAM,EAAE;QACN,GAAG,EAAE,QAAQ;QACb,SAAS,EAAE,QAAQ;KACpB;IACD,MAAM,EAAE;QACN,GAAG,EAAE,QAAQ;QACb,SAAS,EAAE,QAAQ;KACpB;IACD,QAAQ,EAAE;QACR,GAAG,EAAE,UAAU;QACf,SAAS,EAAE,QAAQ;KACpB;IACD,iBAAiB,EAAE;QACjB,GAAG,EAAE,mBAAmB;QACxB,SAAS,EAAE,QAAQ;KACpB;IACD,kBAAkB,EAAE;QAClB,GAAG,EAAE,oBAAoB;QACzB,SAAS,EAAE,QAAQ;KACpB;IACD,SAAS,EAAE;QACT,GAAG,EAAE,WAAW;QAChB,SAAS,EAAE,QAAQ;KACpB;CAC4C,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FieldType } from '@awell-health/extensions-core';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export declare const fields: {
|
|
4
|
+
resourceId: {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
description: string;
|
|
8
|
+
type: FieldType.STRING;
|
|
9
|
+
required: true;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare const FieldsValidationSchema: z.ZodObject<{
|
|
13
|
+
resourceId: z.ZodString;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
resourceId: string;
|
|
16
|
+
}, {
|
|
17
|
+
resourceId: string;
|
|
18
|
+
}>;
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
resourceId: {
|
|
8
|
+
id: 'resourceId',
|
|
9
|
+
label: 'Resource ID',
|
|
10
|
+
description: 'The resource ID of the MedicationRequest in Medplum',
|
|
11
|
+
type: extensions_core_1.FieldType.STRING,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
exports.FieldsValidationSchema = zod_1.z.object({
|
|
16
|
+
resourceId: zod_1.z.string().nonempty({
|
|
17
|
+
message: 'Missing "Resource ID"',
|
|
18
|
+
}),
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../extensions/medplum/actions/getMedicationRequest/config/fields.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AACrE,6BAAwC;AAE3B,QAAA,MAAM,GAAG;IACpB,UAAU,EAAE;QACV,EAAE,EAAE,YAAY;QAChB,KAAK,EAAE,aAAa;QACpB,WAAW,EAAE,qDAAqD;QAClE,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC;QAC9B,OAAO,EAAE,uBAAuB;KACjC,CAAC;CAC+C,CAAC,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./dataPoints"), exports);
|
|
18
|
+
__exportStar(require("./fields"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../extensions/medplum/actions/getMedicationRequest/config/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA4B;AAC5B,2CAAwB"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMedicationRequest = void 0;
|
|
4
|
+
const extensions_core_1 = require("@awell-health/extensions-core");
|
|
5
|
+
const config_1 = require("./config");
|
|
6
|
+
const utils_1 = require("../../utils");
|
|
7
|
+
const extractResourceId_1 = require("../../utils/extractResourceId/extractResourceId");
|
|
8
|
+
exports.getMedicationRequest = {
|
|
9
|
+
key: 'getMedicationRequest',
|
|
10
|
+
category: extensions_core_1.Category.EHR_INTEGRATIONS,
|
|
11
|
+
title: 'Get medication request',
|
|
12
|
+
description: 'Retrieve medication request details from Medplum',
|
|
13
|
+
fields: config_1.fields,
|
|
14
|
+
previewable: true,
|
|
15
|
+
dataPoints: config_1.dataPoints,
|
|
16
|
+
onEvent: async ({ payload, onComplete, onError }) => {
|
|
17
|
+
var _a;
|
|
18
|
+
const { fields: input, medplumSdk } = await (0, utils_1.validateAndCreateSdkClient)({
|
|
19
|
+
fieldsSchema: config_1.FieldsValidationSchema,
|
|
20
|
+
payload,
|
|
21
|
+
});
|
|
22
|
+
const resourceId = (_a = (0, extractResourceId_1.extractResourceId)(input.resourceId, 'MedicationRequest')) !== null && _a !== void 0 ? _a : '';
|
|
23
|
+
const res = await medplumSdk.readResource('MedicationRequest', resourceId);
|
|
24
|
+
const getPatientId = () => {
|
|
25
|
+
var _a, _b;
|
|
26
|
+
const subjectReference = (_b = (_a = res.subject) === null || _a === void 0 ? void 0 : _a.reference) !== null && _b !== void 0 ? _b : '';
|
|
27
|
+
if (subjectReference.startsWith('Patient')) {
|
|
28
|
+
return (0, extractResourceId_1.extractResourceId)(subjectReference, 'Patient');
|
|
29
|
+
}
|
|
30
|
+
return null;
|
|
31
|
+
};
|
|
32
|
+
const getMedicationDisplay = () => {
|
|
33
|
+
var _a, _b, _c, _d, _e;
|
|
34
|
+
if ((_c = (_b = (_a = res.medicationCodeableConcept) === null || _a === void 0 ? void 0 : _a.coding) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.display) {
|
|
35
|
+
return res.medicationCodeableConcept.coding[0].display;
|
|
36
|
+
}
|
|
37
|
+
if ((_d = res.medicationCodeableConcept) === null || _d === void 0 ? void 0 : _d.text) {
|
|
38
|
+
return res.medicationCodeableConcept.text;
|
|
39
|
+
}
|
|
40
|
+
if ((_e = res.medicationReference) === null || _e === void 0 ? void 0 : _e.display) {
|
|
41
|
+
return res.medicationReference.display;
|
|
42
|
+
}
|
|
43
|
+
return '';
|
|
44
|
+
};
|
|
45
|
+
const getDosageInstructions = () => {
|
|
46
|
+
var _a, _b;
|
|
47
|
+
if ((_b = (_a = res.dosageInstruction) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.text) {
|
|
48
|
+
return res.dosageInstruction[0].text;
|
|
49
|
+
}
|
|
50
|
+
return '';
|
|
51
|
+
};
|
|
52
|
+
await onComplete({
|
|
53
|
+
data_points: {
|
|
54
|
+
medicationRequest: JSON.stringify(res),
|
|
55
|
+
status: res.status,
|
|
56
|
+
intent: res.intent,
|
|
57
|
+
priority: res.priority,
|
|
58
|
+
medicationDisplay: getMedicationDisplay(),
|
|
59
|
+
dosageInstructions: getDosageInstructions(),
|
|
60
|
+
patientId: getPatientId(),
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=getMedicationRequest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getMedicationRequest.js","sourceRoot":"","sources":["../../../../../extensions/medplum/actions/getMedicationRequest/getMedicationRequest.ts"],"names":[],"mappings":";;;AAAA,mEAAqE;AAErE,qCAAqE;AACrE,uCAAwD;AACxD,uFAAmF;AAEtE,QAAA,oBAAoB,GAI7B;IACF,GAAG,EAAE,sBAAsB;IAC3B,QAAQ,EAAE,0BAAQ,CAAC,gBAAgB;IACnC,KAAK,EAAE,wBAAwB;IAC/B,WAAW,EAAE,kDAAkD;IAC/D,MAAM,EAAN,eAAM;IACN,WAAW,EAAE,IAAI;IACj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AAA;YACxC,CAAC;YACD,OAAO,EAAE,CAAA;QACX,CAAC,CAAA;QAED,MAAM,qBAAqB,GAAG,GAAW,EAAE;;YACzC,IAAI,MAAA,MAAA,GAAG,CAAC,iBAAiB,0CAAG,CAAC,CAAC,0CAAE,IAAI,EAAE,CAAC;gBACrC,OAAO,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;YACtC,CAAC;YACD,OAAO,EAAE,CAAA;QACX,CAAC,CAAA;QAED,MAAM,UAAU,CAAC;YACf,WAAW,EAAE;gBACX,iBAAiB,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC;gBACtC,MAAM,EAAE,GAAG,CAAC,MAAM;gBAClB,MAAM,EAAE,GAAG,CAAC,MAAM;gBAClB,QAAQ,EAAE,GAAG,CAAC,QAAQ;gBACtB,iBAAiB,EAAE,oBAAoB,EAAE;gBACzC,kBAAkB,EAAE,qBAAqB,EAAE;gBAC3C,SAAS,EAAE,YAAY,EAAE;aAC1B;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './getMedicationRequest';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./getMedicationRequest"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/medplum/actions/getMedicationRequest/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAsC"}
|
|
@@ -8,4 +8,5 @@ export { submitQuestionnaireResponse } from './submitQuestionnaireResponse';
|
|
|
8
8
|
export { createCalculationObservation } from './createCalculationObservation';
|
|
9
9
|
export { addSideEffect } from './addSideEffect';
|
|
10
10
|
export { getServiceRequest } from './getServiceRequest';
|
|
11
|
+
export { getMedicationRequest } from './getMedicationRequest';
|
|
11
12
|
export { searchPatient } from './searchPatient';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.searchPatient = exports.getServiceRequest = exports.addSideEffect = exports.createCalculationObservation = exports.submitQuestionnaireResponse = exports.createServiceRequest = exports.createTask = exports.executeBot = exports.getAppointment = exports.createPatient = exports.getPatient = void 0;
|
|
3
|
+
exports.searchPatient = exports.getMedicationRequest = exports.getServiceRequest = exports.addSideEffect = exports.createCalculationObservation = exports.submitQuestionnaireResponse = exports.createServiceRequest = exports.createTask = exports.executeBot = exports.getAppointment = exports.createPatient = exports.getPatient = void 0;
|
|
4
4
|
var getPatient_1 = require("./getPatient");
|
|
5
5
|
Object.defineProperty(exports, "getPatient", { enumerable: true, get: function () { return getPatient_1.getPatient; } });
|
|
6
6
|
var createPatient_1 = require("./createPatient");
|
|
@@ -21,6 +21,8 @@ var addSideEffect_1 = require("./addSideEffect");
|
|
|
21
21
|
Object.defineProperty(exports, "addSideEffect", { enumerable: true, get: function () { return addSideEffect_1.addSideEffect; } });
|
|
22
22
|
var getServiceRequest_1 = require("./getServiceRequest");
|
|
23
23
|
Object.defineProperty(exports, "getServiceRequest", { enumerable: true, get: function () { return getServiceRequest_1.getServiceRequest; } });
|
|
24
|
+
var getMedicationRequest_1 = require("./getMedicationRequest");
|
|
25
|
+
Object.defineProperty(exports, "getMedicationRequest", { enumerable: true, get: function () { return getMedicationRequest_1.getMedicationRequest; } });
|
|
24
26
|
var searchPatient_1 = require("./searchPatient");
|
|
25
27
|
Object.defineProperty(exports, "searchPatient", { enumerable: true, get: function () { return searchPatient_1.searchPatient; } });
|
|
26
28
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../extensions/medplum/actions/index.ts"],"names":[],"mappings":";;;AAAA,2CAAyC;AAAhC,wGAAA,UAAU,OAAA;AACnB,iDAA+C;AAAtC,8GAAA,aAAa,OAAA;AACtB,mDAAiD;AAAxC,gHAAA,cAAc,OAAA;AACvB,2CAAyC;AAAhC,wGAAA,UAAU,OAAA;AACnB,2CAAyC;AAAhC,wGAAA,UAAU,OAAA;AACnB,+DAA6D;AAApD,4HAAA,oBAAoB,OAAA;AAC7B,6EAA2E;AAAlE,0IAAA,2BAA2B,OAAA;AACpC,+EAA6E;AAApE,4IAAA,4BAA4B,OAAA;AACrC,iDAA+C;AAAtC,8GAAA,aAAa,OAAA;AACtB,yDAAuD;AAA9C,sHAAA,iBAAiB,OAAA;AAC1B,iDAA+C;AAAtC,8GAAA,aAAa,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../extensions/medplum/actions/index.ts"],"names":[],"mappings":";;;AAAA,2CAAyC;AAAhC,wGAAA,UAAU,OAAA;AACnB,iDAA+C;AAAtC,8GAAA,aAAa,OAAA;AACtB,mDAAiD;AAAxC,gHAAA,cAAc,OAAA;AACvB,2CAAyC;AAAhC,wGAAA,UAAU,OAAA;AACnB,2CAAyC;AAAhC,wGAAA,UAAU,OAAA;AACnB,+DAA6D;AAApD,4HAAA,oBAAoB,OAAA;AAC7B,6EAA2E;AAAlE,0IAAA,2BAA2B,OAAA;AACpC,+EAA6E;AAApE,4IAAA,4BAA4B,OAAA;AACrC,iDAA+C;AAAtC,8GAAA,aAAa,OAAA;AACtB,yDAAuD;AAA9C,sHAAA,iBAAiB,OAAA;AAC1B,+DAA6D;AAApD,4HAAA,oBAAoB,OAAA;AAC7B,iDAA+C;AAAtC,8GAAA,aAAa,OAAA"}
|