@awell-health/awell-extensions 2.1.1 → 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/markdown.json +1 -1
- 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/dist/extensions/transform/index.js +1 -0
- package/dist/extensions/transform/index.js.map +1 -1
- package/dist/extensions/transform/v1/actions/combineDateAndTime/combineDateAndTime.d.ts +4 -0
- package/dist/extensions/transform/v1/actions/combineDateAndTime/combineDateAndTime.js +65 -0
- package/dist/extensions/transform/v1/actions/combineDateAndTime/combineDateAndTime.js.map +1 -0
- package/dist/extensions/transform/v1/actions/combineDateAndTime/config/dataPoints.d.ts +6 -0
- package/dist/extensions/transform/v1/actions/combineDateAndTime/config/dataPoints.js +10 -0
- package/dist/extensions/transform/v1/actions/combineDateAndTime/config/dataPoints.js.map +1 -0
- package/dist/extensions/transform/v1/actions/combineDateAndTime/config/fields.d.ts +28 -0
- package/dist/extensions/transform/v1/actions/combineDateAndTime/config/fields.js +26 -0
- package/dist/extensions/transform/v1/actions/combineDateAndTime/config/fields.js.map +1 -0
- package/dist/extensions/transform/v1/actions/combineDateAndTime/config/index.d.ts +2 -0
- package/dist/extensions/transform/v1/actions/combineDateAndTime/config/index.js +9 -0
- package/dist/extensions/transform/v1/actions/combineDateAndTime/config/index.js.map +1 -0
- package/dist/extensions/transform/v1/actions/combineDateAndTime/index.d.ts +1 -0
- package/dist/extensions/transform/v1/actions/combineDateAndTime/index.js +6 -0
- package/dist/extensions/transform/v1/actions/combineDateAndTime/index.js.map +1 -0
- package/dist/extensions/transform/v1/actions/index.d.ts +1 -0
- package/dist/extensions/transform/v1/actions/index.js +3 -1
- package/dist/extensions/transform/v1/actions/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -208,7 +208,7 @@
|
|
|
208
208
|
"changelog": "# TextLine changelog\n\n## 2024-03-11\n\n1. Add option to set department ID when sending messages and when retrieving messages. Check official documentation here: https://textline.docs.apiary.io/#reference/conversations/phone-numbers/message-a-phone-number\n## 2024-03-5\n\n1. Add capability to set contact consent status (https://textline.docs.apiary.io/#reference/customers/set-contact-consent/set-contact-consent)\n2. Add several fixes and tweaks to improve current actions\n\n## 2024-02-26\n\n1. Add capability to search for messages using all the allowed filters provided by TextLine API.\n2. Add \"Send SMS\" action\n"
|
|
209
209
|
},
|
|
210
210
|
"transform": {
|
|
211
|
-
"readme": "---\ntitle: Transform\ndescription: Transform is an extension with utility functions that allows you to transform or parse data to a format of your liking\n---\n\n# Transform\n\nTransform is an extension on Awell's Marketplace with utility functions that allows you to transform data from one type to another. These functions are particularly useful e.g. when system A works with IDs that are numbers but system B works with IDs that are strings.\n\n## Custom Actions\n\n### Parse number to text\n\nTransform or parse a number to text (string).\n\n### Parse text to number\n\nTransform or parse text (string) to a number. Will return NaN if the input data is not an actual number.\n\n### Parse date to unix timestamp\n\nTransform or parse a date to a unix timestamp.\n\n### Parse unix timestamp to unix date\n\nTransform or parse a unix timestamp to a date.\n\n## Parse number to text with dictionary\n\nTransform or parse a number to a string using a dictionary. Useful for when you have numeric data points but want to map them to strings based on a dictionary. When the action is called with a number that does not have a corresponding mapping in the provided dictionary, it simply returns the number itself as a string. \n\nThe dictionary should be structured in JSON format with string keys mapping to string values. Each key represents a number (as a string), and each value is the corresponding text representation.\n\n**Example:**\n```json\n{\n \"0\": \"Male\",\n \"1\": \"Female\",\n \"2\": \"Not known\",\n // ... other number mappings ...\n}\n```\n\n## Generate dynamic URL\n\nGenerate a dynamic URL based on a URL template with placeholder and a data point value.\n\n```\nurlTemplate https://your-url.com/{{placeholder}}\nvalue hello-world\noutcome https://your-url.com/hello-world\n```\n\n## Feet and inches to inches\n\nConverts a measurement in feet and inches to just inches.",
|
|
211
|
+
"readme": "---\ntitle: Transform\ndescription: Transform is an extension with utility functions that allows you to transform or parse data to a format of your liking\n---\n\n# Transform\n\nTransform is an extension on Awell's Marketplace with utility functions that allows you to transform data from one type to another. These functions are particularly useful e.g. when system A works with IDs that are numbers but system B works with IDs that are strings.\n\n## Custom Actions\n\n### Parse number to text\n\nTransform or parse a number to text (string).\n\n### Parse text to number\n\nTransform or parse text (string) to a number. Will return NaN if the input data is not an actual number.\n\n### Parse date to unix timestamp\n\nTransform or parse a date to a unix timestamp.\n\n### Parse unix timestamp to unix date\n\nTransform or parse a unix timestamp to a date.\n\n## Parse number to text with dictionary\n\nTransform or parse a number to a string using a dictionary. Useful for when you have numeric data points but want to map them to strings based on a dictionary. When the action is called with a number that does not have a corresponding mapping in the provided dictionary, it simply returns the number itself as a string. \n\nThe dictionary should be structured in JSON format with string keys mapping to string values. Each key represents a number (as a string), and each value is the corresponding text representation.\n\n**Example:**\n```json\n{\n \"0\": \"Male\",\n \"1\": \"Female\",\n \"2\": \"Not known\",\n // ... other number mappings ...\n}\n```\n\n## Generate dynamic URL\n\nGenerate a dynamic URL based on a URL template with placeholder and a data point value.\n\n```\nurlTemplate https://your-url.com/{{placeholder}}\nvalue hello-world\noutcome https://your-url.com/hello-world\n```\n\n## Feet and inches to inches\n\nConverts a measurement in feet and inches to just inches.\n\n## Combine date and time\n\nCombines a reference date with a time string to create a complete datetime in UTC format. This action supports two input formats for the time string:\n\n1. **Simple time format (HH:mm:ss)**: Combines the reference date with the specified time in ISO format (e.g., \"14:30:00\" not \"2PM\")\n2. **Full datetime with timezone**: Accepts ISO8601 datetime strings with timezone offsets and converts them to UTC\n\n**Examples:**\n\n**Example 1 - Simple time combination:**\n```\nReference date: 2025-09-13\nTime string: 17:45:00\nResult: 2025-09-13T17:45:00Z\n```\n\n**Example 2 - Reference date precedence with timezone-aware datetime:**\n```\nReference date: 2025-09-01\nTime string: 2025-09-06T15:34:44+02:00\nResult: 2025-09-01T13:34:44Z (reference date takes precedence, time converted from +02:00 to UTC)\n```\n\n**Example 3 - Different timezone offset:**\n```\nReference date: 2025-09-06\nTime string: 2025-09-06T10:30:00-05:00\nResult: 2025-09-06T15:30:00Z (converted from -05:00 to UTC)\n```\n\nThis action is particularly useful for scheduling systems like Bland API where you need to combine dates and times from different sources, or when working with timezone-aware scheduling data that needs to be normalized to UTC.\n",
|
|
212
212
|
"changelog": "# Transform changelog\n\n## June 2024\n\n- Added \"Feet and inches to inches\" action\n## March 2024\n\n- Added \"Generate dynamic URL\" action\n\n## January 2024\n\n- Added \"Parse number to text with dictionary\" action"
|
|
213
213
|
},
|
|
214
214
|
"twilio": {
|
|
@@ -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":";;;AAEa,QAAA,qBAAqB,GAAG;IACnC,YAAY,EAAE,mBAAmB;IACjC,EAAE,EAAE,WAAW;IACf,SAAS,EAAE,CAAC;YACV,YAAY,EAAE,YAAY;YAC1B,EAAE,EAAE,SAAS;YACb,IAAI,EAAE;gBACJ,MAAM,EAAE,CAAC;wBACP,MAAM,EAAE,wBAAwB;wBAChC,IAAI,EAAE,WAAW;wBACjB,OAAO,EAAE,qHAAqH;qBAC/H,CAAC;aACH;SACF,CAAC;IACF,UAAU,EAAE,CAAC;YACX,GAAG,EAAE,UAAU;YACf,MAAM,EAAE,wCAAwC;YAChD,KAAK,EAAE,UAAU;SAClB,CAAC;IACF,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,OAAO;IACf,mBAAmB,EAAE;QACnB,SAAS,EAAE,UAAU;QACrB,OAAO,EAAE,uCAAuC;KACjD;IACD,OAAO,EAAE;QACP,SAAS,EAAE,cAAc;QACzB,OAAO,EAAE,aAAa;KACvB;IACD,UAAU,EAAE,YAAY;IACxB,SAAS,EAAE;QACT,SAAS,EAAE,mBAAmB;QAC9B,OAAO,EAAE,cAAc;KACxB;IACD,iBAAiB,EAAE,CAAC;YAClB,QAAQ,EAAE,CAAC;YACX,IAAI,EAAE,wEAAwE;YAC9E,MAAM,EAAE;gBACN,MAAM,EAAE;oBACN,SAAS,EAAE,CAAC;oBACZ,MAAM,EAAE,CAAC;oBACT,UAAU,EAAE,GAAG;iBAChB;aACF;YACD,WAAW,EAAE,CAAC;oBACZ,IAAI,EAAE;wBACJ,MAAM,EAAE,CAAC;gCACP,MAAM,EAAE,sDAAsD;gCAC9D,IAAI,EAAE,SAAS;gCACf,OAAO,EAAE,SAAS;6BACnB,CAAC;qBACH;oBACD,YAAY,EAAE;wBACZ,KAAK,EAAE,EAAE;wBACT,IAAI,EAAE,MAAM;wBACZ,MAAM,EAAE,4DAA4D;wBACpE,IAAI,EAAE,MAAM;qBACb;iBACF,CAAC;SACH,CAAC;IACF,eAAe,EAAE;QACf,cAAc,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;IACjB,UAAU,EAAV,mBAAU;IACV,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,EAAiB,EAAE;;QACjE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,MAAM,IAAA,kCAA0B,EAAC;YACrE,YAAY,EAAE,+BAAsB;YACpC,OAAO;SACR,CAAC,CAAA;QAEF,MAAM,UAAU,GACd,MAAA,IAAA,qCAAiB,EAAC,KAAK,CAAC,UAAU,EAAE,mBAAmB,CAAC,mCAAI,EAAE,CAAA;QAEhE,MAAM,GAAG,GAAG,MAAM,UAAU,CAAC,YAAY,CAAC,mBAAmB,EAAE,UAAU,CAAC,CAAA;QAE1E,MAAM,YAAY,GAAG,GAAkB,EAAE;;YACvC,MAAM,gBAAgB,GAAG,MAAA,MAAA,GAAG,CAAC,OAAO,0CAAE,SAAS,mCAAI,EAAE,CAAA;YAErD,IAAI,gBAAgB,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;gBAC3C,OAAO,IAAA,qCAAiB,EAAC,gBAAgB,EAAE,SAAS,CAAC,CAAA;YACvD,CAAC;YAED,OAAO,IAAI,CAAA;QACb,CAAC,CAAA;QAED,MAAM,oBAAoB,GAAG,GAAW,EAAE;;YACxC,IAAI,MAAA,MAAA,MAAA,GAAG,CAAC,yBAAyB,0CAAE,MAAM,0CAAG,CAAC,CAAC,0CAAE,OAAO,EAAE,CAAC;gBACxD,OAAO,GAAG,CAAC,yBAAyB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAA;YACxD,CAAC;YACD,IAAI,MAAA,GAAG,CAAC,yBAAyB,0CAAE,IAAI,EAAE,CAAC;gBACxC,OAAO,GAAG,CAAC,yBAAyB,CAAC,IAAI,CAAA;YAC3C,CAAC;YACD,IAAI,MAAA,GAAG,CAAC,mBAAmB,0CAAE,OAAO,EAAE,CAAC;gBACrC,OAAO,GAAG,CAAC,mBAAmB,CAAC,OAAO,CAAA;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"}
|
|
@@ -24,6 +24,7 @@ exports.Transform = {
|
|
|
24
24
|
parseTextToNumber: actions_1.parseTextToNumber,
|
|
25
25
|
parseUnixTimestampToDate: actions_1.parseUnixTimestampToDate,
|
|
26
26
|
serializeJson: actions_1.serializeJson,
|
|
27
|
+
combineDateAndTime: actions_1.combineDateAndTime,
|
|
27
28
|
},
|
|
28
29
|
settings: settings_1.settings,
|
|
29
30
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../extensions/transform/index.ts"],"names":[],"mappings":";;;AACA,mEAAoE;AACpE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../extensions/transform/index.ts"],"names":[],"mappings":";;;AACA,mEAAoE;AACpE,0CAYqB;AACrB,yCAAqC;AAExB,QAAA,SAAS,GAAc;IAClC,GAAG,EAAE,WAAW;IAChB,KAAK,EAAE,WAAW;IAClB,QAAQ,EACN,mLAAmL;IACrL,WAAW,EACT,qIAAqI;IACvI,QAAQ,EAAE,0BAAQ,CAAC,IAAI;IACvB,MAAM,EAAE;QACN,UAAU,EAAE,4BAAU,CAAC,KAAK;KAC7B;IACD,OAAO,EAAE;QACP,qBAAqB,EAArB,+BAAqB;QACrB,kBAAkB,EAAlB,4BAAkB;QAClB,SAAS,EAAT,mBAAS;QACT,wBAAwB,EAAxB,kCAAwB;QACxB,iBAAiB,EAAjB,2BAAiB;QACjB,+BAA+B,EAA/B,yCAA+B;QAC/B,wBAAwB,EAAxB,kCAAwB;QACxB,iBAAiB,EAAjB,2BAAiB;QACjB,wBAAwB,EAAxB,kCAAwB;QACxB,aAAa,EAAb,uBAAa;QACb,kBAAkB,EAAlB,4BAAkB;KACnB;IACD,QAAQ,EAAR,mBAAQ;CACT,CAAA"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.combineDateAndTime = void 0;
|
|
4
|
+
const extensions_core_1 = require("@awell-health/extensions-core");
|
|
5
|
+
const config_1 = require("./config");
|
|
6
|
+
const zod_1 = require("zod");
|
|
7
|
+
const date_fns_1 = require("date-fns");
|
|
8
|
+
exports.combineDateAndTime = {
|
|
9
|
+
key: 'combineDateAndTime',
|
|
10
|
+
title: 'Combine date and time',
|
|
11
|
+
description: 'Combine a reference date with a time string to create an ISO8601 datetime in UTC.',
|
|
12
|
+
category: extensions_core_1.Category.DATA,
|
|
13
|
+
fields: config_1.fields,
|
|
14
|
+
dataPoints: config_1.dataPoints,
|
|
15
|
+
previewable: true,
|
|
16
|
+
onActivityCreated: async (payload, onComplete, onError) => {
|
|
17
|
+
const { fields: { referenceDate, timeString }, } = (0, extensions_core_1.validate)({
|
|
18
|
+
schema: zod_1.z.object({
|
|
19
|
+
fields: config_1.FieldsValidationSchema,
|
|
20
|
+
}),
|
|
21
|
+
payload,
|
|
22
|
+
});
|
|
23
|
+
let combinedDate;
|
|
24
|
+
const parsedTime = (0, date_fns_1.parse)(timeString, 'HH:mm:ss', new Date());
|
|
25
|
+
if ((0, date_fns_1.isValid)(parsedTime)) {
|
|
26
|
+
const baseDate = new Date(referenceDate);
|
|
27
|
+
combinedDate = new Date(baseDate);
|
|
28
|
+
combinedDate.setHours(parsedTime.getHours());
|
|
29
|
+
combinedDate.setMinutes(parsedTime.getMinutes());
|
|
30
|
+
combinedDate.setSeconds(parsedTime.getSeconds());
|
|
31
|
+
combinedDate.setMilliseconds(0);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
const parsedDateTime = (0, date_fns_1.parseISO)(timeString);
|
|
35
|
+
if (!(0, date_fns_1.isValid)(parsedDateTime)) {
|
|
36
|
+
await onError({
|
|
37
|
+
events: [
|
|
38
|
+
{
|
|
39
|
+
date: new Date().toISOString(),
|
|
40
|
+
text: { en: 'Invalid time string format' },
|
|
41
|
+
error: {
|
|
42
|
+
category: 'WRONG_INPUT',
|
|
43
|
+
message: 'Time string must be in ISO format HH:mm:ss (e.g., "14:30:00") or valid ISO8601 datetime with timezone (e.g., "2025-09-06T15:34:44+02:00")',
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
});
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const baseDate = new Date(referenceDate);
|
|
51
|
+
combinedDate = new Date(baseDate);
|
|
52
|
+
combinedDate.setHours(parsedDateTime.getHours());
|
|
53
|
+
combinedDate.setMinutes(parsedDateTime.getMinutes());
|
|
54
|
+
combinedDate.setSeconds(parsedDateTime.getSeconds());
|
|
55
|
+
combinedDate.setMilliseconds(0);
|
|
56
|
+
}
|
|
57
|
+
const isoDateTime = (0, date_fns_1.formatISO)(combinedDate);
|
|
58
|
+
await onComplete({
|
|
59
|
+
data_points: {
|
|
60
|
+
combinedDateTime: isoDateTime,
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=combineDateAndTime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combineDateAndTime.js","sourceRoot":"","sources":["../../../../../../extensions/transform/v1/actions/combineDateAndTime/combineDateAndTime.ts"],"names":[],"mappings":";;;AACA,mEAAkE;AAElE,qCAAqE;AACrE,6BAAuB;AACvB,uCAA8D;AAEjD,QAAA,kBAAkB,GAI3B;IACF,GAAG,EAAE,oBAAoB;IACzB,KAAK,EAAE,uBAAuB;IAC9B,WAAW,EACT,mFAAmF;IACrF,QAAQ,EAAE,0BAAQ,CAAC,IAAI;IACvB,MAAM,EAAN,eAAM;IACN,UAAU,EAAV,mBAAU;IACV,WAAW,EAAE,IAAI;IACjB,iBAAiB,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE;QACxD,MAAM,EACJ,MAAM,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,GACtC,GAAG,IAAA,0BAAQ,EAAC;YACX,MAAM,EAAE,OAAC,CAAC,MAAM,CAAC;gBACf,MAAM,EAAE,+BAAsB;aAC/B,CAAC;YACF,OAAO;SACR,CAAC,CAAA;QAEF,IAAI,YAAkB,CAAA;QAEtB,MAAM,UAAU,GAAG,IAAA,gBAAK,EAAC,UAAU,EAAE,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,CAAA;QAC5D,IAAI,IAAA,kBAAO,EAAC,UAAU,CAAC,EAAE,CAAC;YACxB,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,aAAa,CAAC,CAAA;YACxC,YAAY,GAAG,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAA;YACjC,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAA;YAC5C,YAAY,CAAC,UAAU,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC,CAAA;YAChD,YAAY,CAAC,UAAU,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC,CAAA;YAChD,YAAY,CAAC,eAAe,CAAC,CAAC,CAAC,CAAA;QACjC,CAAC;aAAM,CAAC;YACN,MAAM,cAAc,GAAG,IAAA,mBAAQ,EAAC,UAAU,CAAC,CAAA;YAC3C,IAAI,CAAC,IAAA,kBAAO,EAAC,cAAc,CAAC,EAAE,CAAC;gBAC7B,MAAM,OAAO,CAAC;oBACZ,MAAM,EAAE;wBACN;4BACE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;4BAC9B,IAAI,EAAE,EAAE,EAAE,EAAE,4BAA4B,EAAE;4BAC1C,KAAK,EAAE;gCACL,QAAQ,EAAE,aAAa;gCACvB,OAAO,EACL,2IAA2I;6BAC9I;yBACF;qBACF;iBACF,CAAC,CAAA;gBACF,OAAM;YACR,CAAC;YAED,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,aAAa,CAAC,CAAA;YACxC,YAAY,GAAG,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAA;YACjC,YAAY,CAAC,QAAQ,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC,CAAA;YAChD,YAAY,CAAC,UAAU,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC,CAAA;YACpD,YAAY,CAAC,UAAU,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC,CAAA;YACpD,YAAY,CAAC,eAAe,CAAC,CAAC,CAAC,CAAA;QACjC,CAAC;QAED,MAAM,WAAW,GAAG,IAAA,oBAAS,EAAC,YAAY,CAAC,CAAA;QAE3C,MAAM,UAAU,CAAC;YACf,WAAW,EAAE;gBACX,gBAAgB,EAAE,WAAW;aAC9B;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataPoints.js","sourceRoot":"","sources":["../../../../../../../extensions/transform/v1/actions/combineDateAndTime/config/dataPoints.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG;IACxB,gBAAgB,EAAE;QAChB,GAAG,EAAE,kBAAkB;QACvB,SAAS,EAAE,MAAM;KAClB;CAC4C,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { FieldType } from '@awell-health/extensions-core';
|
|
3
|
+
export declare const fields: {
|
|
4
|
+
referenceDate: {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
description: string;
|
|
8
|
+
type: FieldType.DATE;
|
|
9
|
+
required: true;
|
|
10
|
+
};
|
|
11
|
+
timeString: {
|
|
12
|
+
id: string;
|
|
13
|
+
label: string;
|
|
14
|
+
description: string;
|
|
15
|
+
type: FieldType.STRING;
|
|
16
|
+
required: true;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare const FieldsValidationSchema: z.ZodObject<{
|
|
20
|
+
referenceDate: z.ZodEffects<z.ZodDate, string, Date>;
|
|
21
|
+
timeString: z.ZodString;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
referenceDate: string;
|
|
24
|
+
timeString: string;
|
|
25
|
+
}, {
|
|
26
|
+
referenceDate: Date;
|
|
27
|
+
timeString: string;
|
|
28
|
+
}>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FieldsValidationSchema = exports.fields = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const extensions_core_1 = require("@awell-health/extensions-core");
|
|
6
|
+
exports.fields = {
|
|
7
|
+
referenceDate: {
|
|
8
|
+
id: 'referenceDate',
|
|
9
|
+
label: 'Reference date',
|
|
10
|
+
description: 'The date you want to use as the base for the combined datetime.',
|
|
11
|
+
type: extensions_core_1.FieldType.DATE,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
timeString: {
|
|
15
|
+
id: 'timeString',
|
|
16
|
+
label: 'Time string',
|
|
17
|
+
description: 'The time in ISO format HH:mm:ss (e.g., "14:30:00" not "2PM") or full ISO8601 datetime with timezone (e.g., "2025-09-06T15:34:44+02:00").',
|
|
18
|
+
type: extensions_core_1.FieldType.STRING,
|
|
19
|
+
required: true,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
exports.FieldsValidationSchema = zod_1.z.object({
|
|
23
|
+
referenceDate: extensions_core_1.DateOnlySchema,
|
|
24
|
+
timeString: zod_1.z.string(),
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../../extensions/transform/v1/actions/combineDateAndTime/config/fields.ts"],"names":[],"mappings":";;;AAAA,6BAAwC;AACxC,mEAIsC;AAEzB,QAAA,MAAM,GAAG;IACpB,aAAa,EAAE;QACb,EAAE,EAAE,eAAe;QACnB,KAAK,EAAE,gBAAgB;QACvB,WAAW,EACT,iEAAiE;QACnE,IAAI,EAAE,2BAAS,CAAC,IAAI;QACpB,QAAQ,EAAE,IAAI;KACf;IACD,UAAU,EAAE;QACV,EAAE,EAAE,YAAY;QAChB,KAAK,EAAE,aAAa;QACpB,WAAW,EACT,0IAA0I;QAC5I,IAAI,EAAE,2BAAS,CAAC,MAAM;QACtB,QAAQ,EAAE,IAAI;KACf;CAC8B,CAAA;AAEpB,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,aAAa,EAAE,gCAAc;IAC7B,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE;CAC2B,CAAC,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dataPoints = exports.FieldsValidationSchema = exports.fields = void 0;
|
|
4
|
+
var fields_1 = require("./fields");
|
|
5
|
+
Object.defineProperty(exports, "fields", { enumerable: true, get: function () { return fields_1.fields; } });
|
|
6
|
+
Object.defineProperty(exports, "FieldsValidationSchema", { enumerable: true, get: function () { return fields_1.FieldsValidationSchema; } });
|
|
7
|
+
var dataPoints_1 = require("./dataPoints");
|
|
8
|
+
Object.defineProperty(exports, "dataPoints", { enumerable: true, get: function () { return dataPoints_1.dataPoints; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../extensions/transform/v1/actions/combineDateAndTime/config/index.ts"],"names":[],"mappings":";;;AAAA,mCAAyD;AAAhD,gGAAA,MAAM,OAAA;AAAE,gHAAA,sBAAsB,OAAA;AACvC,2CAAyC;AAAhC,wGAAA,UAAU,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { combineDateAndTime } from './combineDateAndTime';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.combineDateAndTime = void 0;
|
|
4
|
+
var combineDateAndTime_1 = require("./combineDateAndTime");
|
|
5
|
+
Object.defineProperty(exports, "combineDateAndTime", { enumerable: true, get: function () { return combineDateAndTime_1.combineDateAndTime; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../extensions/transform/v1/actions/combineDateAndTime/index.ts"],"names":[],"mappings":";;;AAAA,2DAAyD;AAAhD,wHAAA,kBAAkB,OAAA"}
|
|
@@ -8,3 +8,4 @@ export { parseStringToPhoneNumber } from './parseStringToPhoneNumber';
|
|
|
8
8
|
export { feetAndInchesToInches } from './feetAndInchesToInches';
|
|
9
9
|
export { serializeJson } from './serializeJson';
|
|
10
10
|
export { htmlToPdf } from './htmlToPdf';
|
|
11
|
+
export { combineDateAndTime } from './combineDateAndTime';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.htmlToPdf = exports.serializeJson = exports.feetAndInchesToInches = exports.parseStringToPhoneNumber = exports.generateDynamicUrl = exports.parseNumberToTextWithDictionary = exports.parseUnixTimestampToDate = exports.parseNumberToText = exports.parseDateToUnixTimestamp = exports.parseTextToNumber = void 0;
|
|
3
|
+
exports.combineDateAndTime = exports.htmlToPdf = exports.serializeJson = exports.feetAndInchesToInches = exports.parseStringToPhoneNumber = exports.generateDynamicUrl = exports.parseNumberToTextWithDictionary = exports.parseUnixTimestampToDate = exports.parseNumberToText = exports.parseDateToUnixTimestamp = exports.parseTextToNumber = void 0;
|
|
4
4
|
var parseTextToNumber_1 = require("./parseTextToNumber");
|
|
5
5
|
Object.defineProperty(exports, "parseTextToNumber", { enumerable: true, get: function () { return parseTextToNumber_1.parseTextToNumber; } });
|
|
6
6
|
var parseDateToUnixTimestamp_1 = require("./parseDateToUnixTimestamp");
|
|
@@ -21,4 +21,6 @@ var serializeJson_1 = require("./serializeJson");
|
|
|
21
21
|
Object.defineProperty(exports, "serializeJson", { enumerable: true, get: function () { return serializeJson_1.serializeJson; } });
|
|
22
22
|
var htmlToPdf_1 = require("./htmlToPdf");
|
|
23
23
|
Object.defineProperty(exports, "htmlToPdf", { enumerable: true, get: function () { return htmlToPdf_1.htmlToPdf; } });
|
|
24
|
+
var combineDateAndTime_1 = require("./combineDateAndTime");
|
|
25
|
+
Object.defineProperty(exports, "combineDateAndTime", { enumerable: true, get: function () { return combineDateAndTime_1.combineDateAndTime; } });
|
|
24
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/transform/v1/actions/index.ts"],"names":[],"mappings":";;;AAAA,yDAAuD;AAA9C,sHAAA,iBAAiB,OAAA;AAC1B,uEAAqE;AAA5D,oIAAA,wBAAwB,OAAA;AACjC,yDAAuD;AAA9C,sHAAA,iBAAiB,OAAA;AAC1B,uEAAqE;AAA5D,oIAAA,wBAAwB,OAAA;AACjC,qFAAmF;AAA1E,kJAAA,+BAA+B,OAAA;AACxC,2DAAyD;AAAhD,wHAAA,kBAAkB,OAAA;AAC3B,uEAAqE;AAA5D,oIAAA,wBAAwB,OAAA;AACjC,iEAA+D;AAAtD,8HAAA,qBAAqB,OAAA;AAC9B,iDAA+C;AAAtC,8GAAA,aAAa,OAAA;AACtB,yCAAuC;AAA9B,sGAAA,SAAS,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/transform/v1/actions/index.ts"],"names":[],"mappings":";;;AAAA,yDAAuD;AAA9C,sHAAA,iBAAiB,OAAA;AAC1B,uEAAqE;AAA5D,oIAAA,wBAAwB,OAAA;AACjC,yDAAuD;AAA9C,sHAAA,iBAAiB,OAAA;AAC1B,uEAAqE;AAA5D,oIAAA,wBAAwB,OAAA;AACjC,qFAAmF;AAA1E,kJAAA,+BAA+B,OAAA;AACxC,2DAAyD;AAAhD,wHAAA,kBAAkB,OAAA;AAC3B,uEAAqE;AAA5D,oIAAA,wBAAwB,OAAA;AACjC,iEAA+D;AAAtD,8HAAA,qBAAqB,OAAA;AAC9B,iDAA+C;AAAtC,8GAAA,aAAa,OAAA;AACtB,yCAAuC;AAA9B,sGAAA,SAAS,OAAA;AAClB,2DAAyD;AAAhD,wHAAA,kBAAkB,OAAA"}
|