@awell-health/awell-extensions 2.1.210 → 2.1.211
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.
|
@@ -28,6 +28,16 @@ const isKnownType = (text) => {
|
|
|
28
28
|
};
|
|
29
29
|
const conditionLabel = (concept) => { var _a, _b, _c; return (_a = concept === null || concept === void 0 ? void 0 : concept.text) !== null && _a !== void 0 ? _a : (_c = (_b = concept === null || concept === void 0 ? void 0 : concept.coding) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.display; };
|
|
30
30
|
const nonEmpty = (value) => value !== undefined && value.length > 0;
|
|
31
|
+
/**
|
|
32
|
+
* The first location's name, read from the Location the reference points at
|
|
33
|
+
* in the bundle. The reference's own `display` is only a fallback: Metriport
|
|
34
|
+
* does not reliably set it.
|
|
35
|
+
*/
|
|
36
|
+
const locationLabel = (index, encounter) => {
|
|
37
|
+
var _a, _b, _c, _d;
|
|
38
|
+
const reference = (_b = (_a = encounter.location) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.location;
|
|
39
|
+
return ((_d = (_c = (0, resolve_1.resolve)(index, reference, 'Location')) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : reference === null || reference === void 0 ? void 0 : reference.display);
|
|
40
|
+
};
|
|
31
41
|
/**
|
|
32
42
|
* The fields of the first Encounter in a webhook bundle — the same Encounter
|
|
33
43
|
* `findEncounterId` reads. A diagnosis is labelled by its reference's
|
|
@@ -35,7 +45,7 @@ const nonEmpty = (value) => value !== undefined && value.length > 0;
|
|
|
35
45
|
* carries it.
|
|
36
46
|
*/
|
|
37
47
|
const extractEncounterFields = (bundle) => {
|
|
38
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
48
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
39
49
|
const encounter = (_b = (_a = bundle.entry) === null || _a === void 0 ? void 0 : _a.find((entry) => { var _a; return ((_a = entry.resource) === null || _a === void 0 ? void 0 : _a.resourceType) === 'Encounter'; })) === null || _b === void 0 ? void 0 : _b.resource;
|
|
40
50
|
if (encounter === undefined)
|
|
41
51
|
return {};
|
|
@@ -56,8 +66,8 @@ const extractEncounterFields = (bundle) => {
|
|
|
56
66
|
? classDisplay
|
|
57
67
|
: encounterType,
|
|
58
68
|
encounterType,
|
|
59
|
-
encounterLocation: (
|
|
60
|
-
encounterReason: (
|
|
69
|
+
encounterLocation: locationLabel(index, encounter),
|
|
70
|
+
encounterReason: (_j = (_h = encounter.reasonCode) === null || _h === void 0 ? void 0 : _h.find((reason) => nonEmpty(reason.text))) === null || _j === void 0 ? void 0 : _j.text,
|
|
61
71
|
encounterDiagnoses: diagnoses.length > 0 ? JSON.stringify(diagnoses) : undefined,
|
|
62
72
|
};
|
|
63
73
|
return Object.fromEntries(Object.entries(fields).filter(([, value]) => nonEmpty(value)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encounter.js","sourceRoot":"","sources":["../../../../../../extensions/metriport/actions/webhookBundle/bundle/encounter.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"encounter.js","sourceRoot":"","sources":["../../../../../../extensions/metriport/actions/webhookBundle/bundle/encounter.ts"],"names":[],"mappings":";;;AAOA,yDAAsF;AAEtF;;;;;;;;;;;;GAYG;AACI,MAAM,eAAe,GAAG,CAAC,MAAc,EAAsB,EAAE;;IACpE,OAAA,MAAA,MAAA,MAAA,MAAM,CAAC,KAAK,0CAAE,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,WAAC,OAAA,CAAA,MAAA,KAAK,CAAC,QAAQ,0CAAE,YAAY,MAAK,WAAW,CAAA,EAAA,CAAC,0CACvE,QAAQ,0CAAE,EAAE,CAAA;CAAA,CAAA;AAFL,QAAA,eAAe,mBAEV;AAkBlB,gFAAgF;AAChF,MAAM,qBAAqB,GAAG,CAAC,WAAW,EAAE,YAAY,EAAE,WAAW,CAAC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