fluent-cerner-js 0.7.2-alpha.0 → 0.9.0-alpha.0
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/fluent-cerner-js.cjs.development.js +27 -5
- package/dist/fluent-cerner-js.cjs.development.js.map +1 -1
- package/dist/fluent-cerner-js.cjs.production.min.js +1 -1
- package/dist/fluent-cerner-js.cjs.production.min.js.map +1 -1
- package/dist/fluent-cerner-js.esm.js +27 -5
- package/dist/fluent-cerner-js.esm.js.map +1 -1
- package/dist/functional/makeCclRequest.d.ts +7 -2
- package/dist/functional/submitOrders.d.ts +2 -4
- package/dist/index.d.ts +4 -0
- package/package.json +1 -1
- package/src/functional/makeCclRequest.spec.ts +15 -0
- package/src/functional/makeCclRequest.ts +29 -6
- package/src/functional/submitOrders.ts +2 -1
- package/src/index.ts +4 -0
|
@@ -237,7 +237,11 @@ function makeCclRequest(opts) {
|
|
|
237
237
|
meta: {
|
|
238
238
|
responseText: responseText || 'no response text',
|
|
239
239
|
status: request.status,
|
|
240
|
-
statusText: statusText || 'status refers to unknown error'
|
|
240
|
+
statusText: statusText || 'status refers to unknown error',
|
|
241
|
+
statusDetails: request.statusText,
|
|
242
|
+
prgName: request.url,
|
|
243
|
+
prgArguments: request.requestText,
|
|
244
|
+
__original: request
|
|
241
245
|
},
|
|
242
246
|
data: data
|
|
243
247
|
};
|
|
@@ -258,18 +262,36 @@ function makeCclRequest(opts) {
|
|
|
258
262
|
}
|
|
259
263
|
/**
|
|
260
264
|
* A function which processes the CCL request parameters, converting them to a string compatible with an XmlCclRequest.
|
|
261
|
-
* @param params {Array<CclCallParam>} An array of CclCallParam objects
|
|
265
|
+
* @param params {Array<CclCallParam|string|number>} An array of CclCallParam objects when explicitly defining
|
|
266
|
+
* type, or strings and numbers when implicitly defining type, each of which represents
|
|
262
267
|
* @param excludeMine {boolean} Determines whether or not to include the "MINE" parameter as the
|
|
263
268
|
* @returns {string} the XmlCclRequest compatible string.
|
|
264
269
|
*/
|
|
265
270
|
function processCclRequestParams(params, excludeMine) {
|
|
266
271
|
params = params || [];
|
|
267
272
|
excludeMine = excludeMine || false;
|
|
268
|
-
var
|
|
273
|
+
var processedParams = params.map(function (param) {
|
|
274
|
+
if (typeof param === 'string') {
|
|
275
|
+
return {
|
|
276
|
+
type: 'string',
|
|
277
|
+
param: param
|
|
278
|
+
};
|
|
279
|
+
} else if (typeof param === 'number') {
|
|
280
|
+
return {
|
|
281
|
+
type: 'number',
|
|
282
|
+
param: param
|
|
283
|
+
};
|
|
284
|
+
} else if (typeof param === 'object' && param.param && param.type) {
|
|
285
|
+
return param;
|
|
286
|
+
} else {
|
|
287
|
+
throw new Error("Invalid parameter type. Expected string, number, or a valid CclCallParam object. Received " + typeof param);
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
var finalParams = excludeMine ? [].concat(processedParams) : [{
|
|
269
291
|
type: 'string',
|
|
270
292
|
param: 'MINE'
|
|
271
|
-
}].concat(
|
|
272
|
-
var paramString =
|
|
293
|
+
}].concat(processedParams);
|
|
294
|
+
var paramString = finalParams.map(function (_ref) {
|
|
273
295
|
var type = _ref.type,
|
|
274
296
|
param = _ref.param;
|
|
275
297
|
return type === 'string' ? "'" + param + "'" : param;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fluent-cerner-js.cjs.development.js","sources":["../src/utils/index.ts","../src/functional/launchClinicalNote.ts","../src/functional/launchPowerForm.ts","../src/functional/launchPowerNote.ts","../src/functional/makeCclRequest.ts","../src/functional/openPatientTab.ts","../src/functional/openOrganizerTab.ts","../src/functional/orderString.ts","../src/functional/submitOrders.ts","../src/MPageOrderEvent.ts","../src/MPageOrder.ts"],"sourcesContent":["/**\n * Compose an error message for a rejected XMLCclRequest.\n * @param req {XMLCclRequest} - The XMLCclRequest object which represents the request.\n * @param prg {string} - The program which was called.\n * @param params {string} - The parameters which were passed to the program.\n * @returns a string which represents the error message composed of the above parameters.\n */\nexport const composeXmlCclReqRejectMsg = (\n req: XMLCclRequest,\n prg: string,\n params: string\n): string => {\n const { status, readyState, responseText } = req;\n return `error with status ${status} and readyState ${readyState} on ${prg} with params ${params} returning response text: ${responseText ||\n 'no response text'}`;\n};\n\n/**\n * Process the response text from an XMLCclRequest for use in the `makeCclRequest` function.\n * @param responseText {string} - The response text from the XMLCclRequest.\n * @returns the response text if it is not an empty string, otherwise returns `undefined`.\n */\nexport const processXmlCclReqResponseText = (\n responseText: string\n): string | undefined => {\n const rt = responseText.trim();\n return rt === '' ? undefined : rt;\n};\n\n/**\n * Check to see if the error reflects likely being outside of PowerChart.\n * @param e {Error} - The error to be checked.\n * @returns {boolean} - Returns `true` if the error is one of two cases that result\n * from being outside of Cerner PowerChart.\n */\nexport function outsideOfPowerChartError(e: unknown) {\n return (\n (e instanceof TypeError &&\n e.message === 'window.MPAGES_EVENT is not a function') ||\n (e instanceof TypeError &&\n e.message === 'window.XMLCclRequest is not a function') ||\n (e instanceof TypeError &&\n e.message === 'window.APPLINK is not a function') ||\n (e instanceof ReferenceError && e.message === 'window is not defined')\n );\n}\n\n/**\n * A wrapper function for the `console.warn` function which logs a warning message.\n * @param eventString {string} - The event string to be logged.\n */\nexport const warnAttemptedOrdersOutsideOfPowerChart = (\n eventString: string\n): void => {\n console.warn(`window.MPAGES_EVENT('ORDERS', '${eventString}')`);\n};\n","import { MPageEventReturn } from '.';\nimport { outsideOfPowerChartError } from '../utils';\n\n/**\n * Available options for the Clinical Note view.\n *\n * @documentation [MPAGES_EVENT - CLINICAL NOTE](https://wiki.cerner.com/display/public/MPDEVWIKI/MPAGES_EVENT+-+CLINICALNOTE)\n */\nexport type ViewOption =\n | 'menu'\n | 'buttons'\n | 'toolbar'\n | 'calculator'\n | 'view-only';\n\n/**\n * Launches a clinical note in PowerChart inhereting the preferences of the component and view described below.\n * If any of the values is invalid, it will use the default values.\n * @param {string} viewName - The view name for the view-level preference of the tab to model the preferences after.\n * @param {number} viewSeq - The view sequence for the view-level preference of the tab to model the\n * preferences after. An invalid viewSeq loads the clinical note with the default preferences.\n * @param {string} compName - The component name for the component-level preference of the tab to model the\n * preferences after. An invalid compName loads the clinical note with the default preferences.\n * @param {number} compSeq - \tThe component sequence for the component-level preference of the tab to model\n * the preferences after. An invalid compSeq loads the clinical note with the default preferences.\n *\n * @documentation [MPAGES_EVENT - CLINICAL NOTE](https://wiki.cerner.com/display/public/MPDEVWIKI/MPAGES_EVENT+-+CLINICALNOTE)\n */\nexport type InheretanceProps = {\n viewName: string;\n viewSeq: number;\n compName: string;\n compSeq: number;\n};\n\n/**\n * A type which represents the parameters to be be passed into the launchClinicalNote() function.\n * @param {number} personId - The identifier for the patient to whom the note belongs.\n * Cerner context variable: PAT_PersonId.\n * @param {number} encounterId - The identifier for the encounter belonging to the patient where\n * this note will be launched. Cerner context variable: VIS_EncntrId.\n * @param {Array<number>} eventIds - An array of `event_id`'s of the clinical note(s) to be displayed.\n * @param {string} windowTitle - The text to be displayed in the first section of the title for the\n * Clinical Notes window.\n * @param {Array<ViewOption>} viewOptionFlags - (optional) View options for the Clinical Notes window.\n * If not provided, defaults to `view-only` with no other options.\n * @param {InheretanceProps} inheritanceProps - (optional) The view and component names and sequences\n * to be used for the Clinical Notes window. If not provided, uses default preferences.\n *\n * @documentation [MPAGES_EVENT - CLINICAL NOTE](https://wiki.cerner.com/display/public/MPDEVWIKI/MPAGES_EVENT+-+CLINICALNOTE)\n **/\nexport type ClinicalNoteOpts = {\n personId: number;\n encounterId: number;\n eventIds: Array<number>;\n windowTitle: string;\n viewOptionFlags?: Array<ViewOption>;\n inheritanceProps?: InheretanceProps;\n};\n\n/**\n * Launch a ClinicalNote in Cerner's PowerChart.\n * @param {ClinicalNoteOpts} opts - The parameters passed, as specified in `ClinicalNoteOpts`\n * @returns {MPageEventReturn} - An object containing the `eventString` and `inPowerChart` values.\n *\n * @documentation [MPAGES_EVENT - CLINICAL NOTE](https://wiki.cerner.com/display/public/MPDEVWIKI/MPAGES_EVENT+-+CLINICALNOTE)\n **/\nexport const launchClinicalNote = (\n opts: ClinicalNoteOpts\n): MPageEventReturn => {\n const {\n personId,\n encounterId,\n eventIds,\n windowTitle,\n viewOptionFlags,\n } = opts;\n const { viewName, viewSeq, compName, compSeq } = opts.inheritanceProps || {};\n\n let inPowerChart = true;\n const params: Array<string> = [`${personId}`, `${encounterId}`];\n\n const _viewOptsFlags: Array<ViewOption> =\n !viewOptionFlags || viewOptionFlags.length === 0\n ? ['view-only']\n : viewOptionFlags;\n\n params.push(`[${eventIds.join('|')}]`);\n params.push(`${windowTitle}`);\n params.push(`${calculateViewOptionFlag(_viewOptsFlags)}`);\n params.push(`${viewName || ''}`);\n params.push(`${viewSeq || ''}`);\n params.push(`${compName || ''}`);\n params.push(`${compSeq || ''}`);\n\n const eventString = `${params.join('|')}`;\n try {\n window.MPAGES_EVENT('CLINICALNOTE', eventString);\n } catch (e) {\n if (outsideOfPowerChartError(e)) {\n inPowerChart = false;\n console.warn(`window.MPAGES_EVENT('CLINICALNOTE', '${eventString}')`);\n } else {\n throw e;\n }\n }\n\n return { inPowerChart, eventString };\n};\n\nfunction calculateViewOptionFlag(viewOptionFlags: Array<ViewOption>): number {\n let total = 0;\n viewOptionFlags.forEach(flag => {\n if (flag === 'menu') total += 1;\n if (flag === 'buttons') total += 2;\n if (flag === 'toolbar') total += 4;\n if (flag === 'calculator') total += 8;\n if (flag === 'view-only') total += 16;\n });\n return total;\n}\n","import { MPageEventReturn } from '.';\nimport { outsideOfPowerChartError } from '../utils';\n\n/**\n * A type which represents the parameters to be be passed into the launchPowerForm() function.\n * @param {number} personId - The identifier for the patient to whom the note belongs.\n * Cerner context variable: PAT_PersonId.\n * @param {number} encounterId - The identifier for the encounter belonging to the patient where\n * this note will be launched. Cerner context variable: VIS_EncntrId.\n * @param {string} target - Determines whether to target (open) a \"new form\" of a specified\n * type, a \"completed form\", or a \"new form search\" box.\n * @param {number} targetId - (optional) For a new form, this is the formId (pulled from DCP_FORMS_REF_ID).\n * For a completed form, this is the activityId (pulled from DCP_FORMS_ACTIVITY_ID). This parameter is\n * required only for `new form` or `completed form` targets.\n * @param {string} permissions - (optional) The permissions to open the document with. Choices\n * are: \"modify\" or \"read-only\". When not provided, defaults to \"read-only\".\n *\n * @documentation [MPAGES_EVENT - POWERFORM](https://wiki.cerner.com/display/public/MPDEVWIKI/MPAGES_EVENT+-+POWERFORM)\n **/\nexport type PowerFormOpts = {\n personId: number;\n encounterId: number;\n target: 'new form' | 'completed form' | 'new form search';\n targetId?: number;\n permissions?: 'modify' | 'read only';\n};\n\n/**\n * Launch a PowerForm in Cerner's PowerChart.\n * @param {PowerFormOpts} opts - The parameters passed, as specified in `PowerFormOpts`\n * @returns {MPageEventReturn} - An object containing the `eventString` and `inPowerChart` values.\n *\n * @documentation [MPAGES_EVENT - POWERFORM](https://wiki.cerner.com/display/public/MPDEVWIKI/MPAGES_EVENT+-+POWERFORM)\n **/\nexport const launchPowerForm = (opts: PowerFormOpts): MPageEventReturn => {\n const { personId, encounterId, target, targetId, permissions } = opts;\n\n if ((target === 'new form' || target === 'completed form') && !targetId) {\n throw new Error(\n \"'targetId' is required for 'new form' and 'completed form' targets.\"\n );\n }\n\n const params: Array<string> = [`${personId}`, `${encounterId}`];\n if (target === 'new form') {\n params.push(`${targetId}`);\n params.push('0');\n }\n if (target === 'completed form') {\n params.push('0');\n params.push(`${targetId}`);\n }\n if (target === 'new form search') {\n params.push('0');\n params.push('0');\n }\n params.push(permissions === 'modify' ? '0' : '1');\n\n let inPowerChart = true;\n const eventString = `${params.join('|')}`;\n\n try {\n window.MPAGES_EVENT('POWERFORM', eventString);\n } catch (e) {\n if (outsideOfPowerChartError(e)) {\n inPowerChart = false;\n console.warn(`window.MPAGES_EVENT('POWERFORM', '${eventString}')`);\n } else {\n throw e;\n }\n }\n\n return { inPowerChart, eventString };\n};\n","import { MPageEventReturn } from '.';\nimport { outsideOfPowerChartError } from '../utils';\n\n/**\n * A type which represents the parameters to be be passed into the launchPowerNote() function.\n * @param {number} personId - The identifier for the patient to whom the note belongs.\n * Cerner context variable: PAT_PersonId.\n * @param {number} encounterId - The identifier for the encounter belonging to the patient where\n * this note will be launched. Cerner context variable: VIS_EncntrId.\n * @param {string} target - Determines whether to target (open) a \"new\" PowerNote or an \"existing\" PowerNote.\n * @param {number | string} targetId - For a `new` note, this value should be a `string` representing the\n * CKI value for an encounter pathway. For an `existing` note, this value should be a `number` representing\n * the eventId of the note to be opened.\n * corresponds to an encounter pathway.\n * @param {number} eventId - (exclusive option to CKI) An event_id for an existing PowerNote to load.\n *\n * @documentation [MPAGES_EVENT - POWERNOTE](https://wiki.cerner.com/display/public/MPDEVWIKI/MPAGES_EVENT+-+POWERNOTE)\n **/\nexport type PowerNoteOpts = {\n personId: number;\n encounterId: number;\n target: 'new' | 'existing';\n targetId: string | number;\n};\n\n/**\n * Launch a PowerNote in Cerner's PowerChart.\n * @param {PowerNoteOpts} opts - The parameters passed, as specified in `PowerNoteOpts`\n * @returns {MPageEventReturn} - An object containing the `eventString` and `inPowerChart` values.\n * @throws {Error} - if there is a type mismatch between the provided option for `target` and `targetId`.\n *\n * @documentation [MPAGES_EVENT - POWERNOTE](https://wiki.cerner.com/display/public/MPDEVWIKI/MPAGES_EVENT+-+POWERNOTE)\n **/\nexport const launchPowerNote = (opts: PowerNoteOpts): MPageEventReturn => {\n const { personId, encounterId, target, targetId } = opts;\n\n if (target === 'new' && typeof targetId !== 'string') {\n throw new Error('CKI must be a string when launching a new PowerNote.');\n }\n\n if (target === 'existing' && typeof targetId !== 'number') {\n throw new Error(\n 'eventId must be a number when loading an existing PowerNote.'\n );\n }\n const params: Array<string> = [\n `${personId}`,\n `${encounterId}`,\n `${target === 'new' ? targetId : ''}`,\n `${target === 'existing' ? targetId : 0}`,\n ];\n\n const eventString = `${params.join('|')}`;\n let inPowerChart = true;\n try {\n window.MPAGES_EVENT('POWERNOTE', eventString);\n } catch (e) {\n if (outsideOfPowerChartError(e)) {\n inPowerChart = false;\n console.warn(`window.MPAGES_EVENT('POWERNOTE', '${eventString}')`);\n } else {\n throw e;\n }\n }\n\n return { eventString, inPowerChart };\n};\n","import {\n composeXmlCclReqRejectMsg,\n outsideOfPowerChartError,\n processXmlCclReqResponseText,\n} from '../utils';\n\n/**\n * A type which represents the input parameter for an `XmlCclRequest`, which is wrapped by `makeCclRequest`.\n * The parameters are passed in a string, and numbers and strings are interpreted within this string by\n * the presence of quotes within quotes (e.g. single within double or vice versa). By strongly typing\n * the CclCallParam we can ensure that the parameters are always passed in a way that properly represents\n * their type.\n * @param {'string'|'number'} type - The type of the parameter.\n * @param {string} param - The string representing the parameters value.\n */\nexport type CclCallParam = {\n type: 'string' | 'number';\n param: string | number;\n};\n\n/**\n * A type which represents the full set of data required to make an XmlCclRequest, which is wrapped\n * by `makeCclRequest`.\n * @param {string} prg - The name of the CCL program to run, e.g. 12_USER_DETAILS.\n * @param {boolean?} excludeMine - Determines whether or not to include the \"MINE\" parameter as the\n * first parameter in the CCL call. This defaults to `false`, and almost all cases will require\n * the \"MINE\" parameter to be included.\n * @param {CclCallParam[]} params - An array of CclCallParam objects, each of which represents\n * a strongly typed parameter.\n */\nexport type CclOpts = {\n prg: string;\n excludeMine?: boolean;\n params: Array<CclCallParam>;\n};\n\n/**\n * A type functioning as a convience wrapper for the ready state of an XmlCclRequest.\n */\nexport type XmlCclReadyState =\n | 'uninitialized'\n | 'loading'\n | 'loaded'\n | 'interactive'\n | 'completed';\n\n/**\n * A type functioning as a convience wrapper for several status\n * codes, respresented as strings, that are returned by XMLCclRequest.\n */\nexport type XmlCclStatus =\n | 'success'\n | 'method not allowed'\n | 'invalid state'\n | 'non-fatal error'\n | 'memory error'\n | 'internal server exception'\n | 'status refers to unknown error';\n\n/**\n * A type which represents the full set of data returned from an XmlCclRequest and important, formatted\n * metadata to help with debugging and error management. This is a generic type and data will represent\n * the type `T` which is the type or interface which represents the resolved data from the CCL request.\n */\nexport type CclRequestResponse<T> = {\n meta: {\n responseText: string;\n status: number;\n statusText: XmlCclStatus;\n };\n data: T | undefined;\n};\n\nconst readyStateMap: Map<number, XmlCclReadyState> = new Map();\nreadyStateMap.set(0, 'uninitialized');\nreadyStateMap.set(1, 'loading');\nreadyStateMap.set(2, 'loaded');\nreadyStateMap.set(3, 'interactive');\nreadyStateMap.set(4, 'completed');\n\nconst statusCodeMap: Map<number, XmlCclStatus> = new Map();\nstatusCodeMap.set(200, 'success');\nstatusCodeMap.set(405, 'method not allowed');\nstatusCodeMap.set(409, 'invalid state');\nstatusCodeMap.set(492, 'non-fatal error');\nstatusCodeMap.set(493, 'memory error');\nstatusCodeMap.set(500, 'internal server exception');\n\n/**\n * A generic wrapper function for `XMLCclRequest` which simplifies it's use. Of note,\n * use of this requires the `head` of the HTML document contain the following\n * `meta` tag: `<META content='XMLCCLREQUEST' name='discern'>` so that it might\n * interface with the appropriate COM object.\n * @param {CclOpts} opts - Required options for the CCL request.\n * @returns a promise of type `CclRequestResponse<T>` where `T` is the type\n * or interface which represents the resolved data from the CCL request. If\n * no data are returned, that is an empty string, from the XMLCclRequest then\n * the `data` field will be set to `undefined`. The objects `meta` field\n * includes `responseText`, `status`, and `statusTest` fields.\n * @resolves the `CclRequestResponse<T>` where `T` is the type\n * or interface which represents the resolved data from the CCL request. If\n * no data are returned, that is an empty string, from the XMLCclRequest then\n * the `data` field will be set to `undefined`. The objects `meta` field\n * includes `responseText`, `status`, and `statusTest` fields.\n * @rejects with an error message if the CCL request fails.\n *\n * @documentation - [XMLCclRequest](https://wiki.cerner.com/display/MPAGES/MPages+JavaScript+Reference#MPagesJavaScriptReference-XMLCclRequest)\n */\nexport function makeCclRequest<T>(\n opts: CclOpts\n): Promise<CclRequestResponse<T>> {\n const { prg, excludeMine, params } = opts;\n const paramsList = processCclRequestParams(params, excludeMine || false);\n\n return new Promise((resolve, reject) => {\n try {\n // @ts-ignore - From Powerchart context\n const request: XMLCclRequest = window.XMLCclRequest();\n\n request.open('GET', `${prg}`);\n request.send(paramsList);\n request.onreadystatechange = function() {\n const readyState = readyStateMap.get(request.readyState);\n\n if (readyState !== 'completed') return;\n\n const statusText = statusCodeMap.get(request.status);\n const responseText = processXmlCclReqResponseText(request.responseText);\n const data: T | undefined = responseText && JSON.parse(responseText);\n\n const response: CclRequestResponse<T> = {\n meta: {\n responseText: responseText || 'no response text',\n status: request.status,\n statusText: statusText || 'status refers to unknown error',\n },\n data,\n };\n\n if (statusText === 'success') {\n resolve(response);\n } else {\n reject(composeXmlCclReqRejectMsg(request, prg, paramsList));\n }\n };\n } catch (e) {\n if (outsideOfPowerChartError(e)) {\n reject((e as Error).message);\n } else {\n throw e;\n }\n }\n });\n}\n\n/**\n * A function which processes the CCL request parameters, converting them to a string compatible with an XmlCclRequest.\n * @param params {Array<CclCallParam>} An array of CclCallParam objects, each of which represents\n * @param excludeMine {boolean} Determines whether or not to include the \"MINE\" parameter as the\n * @returns {string} the XmlCclRequest compatible string.\n */\nexport function processCclRequestParams(\n params?: Array<CclCallParam>,\n excludeMine?: boolean\n) {\n params = params || [];\n excludeMine = excludeMine || false;\n\n const updatedParams: Array<CclCallParam> = excludeMine\n ? [...params]\n : [{ type: 'string', param: 'MINE' }, ...params];\n\n const paramString = updatedParams\n .map(({ type, param }) => (type === 'string' ? `'${param}'` : param))\n .join(',');\n\n return paramString;\n}\n","import { MPageEventReturn } from '.';\nimport { outsideOfPowerChartError } from '../utils';\n\n/**\n * Attempts to open a tab with the name given to the `tab` variable in a\n * patients chart given in the context of a given encounter.\n * @param {number} personId - The identifier for the patient to whom the note belongs.\n * Cerner context variable: PAT_PersonId.\n * @param {number} encounterId - The identifier for the encounter belonging to the patient where\n * this note will be launched. Cerner context variable: VIS_EncntrId.\n * @param tab The string which represents the tab to open\n * (case insensitive). Navigation will be made to the first\n * upper-level tab in the chart that that matches the `tab` string\n * If no match is found, then sub-tab names will be searched and\n * navigation made to the first sub-tab that matches\n * the `tab` string. If no matches are found, no navigation will occur.\n * @param quickAdd {boolean} - (optional) If true, will attempt to open the window\n * in a quick add mode. E.g. if the Orders tab is connected to it will\n * attempt to launch the Add Order window so long as Enhanced Navigation is\n * supported by your installation. Defaults to false.\n *\n * @documentation [APPLINK](https://wiki.cerner.com/display/public/MPDEVWIKI/APPLINK)\n */\nexport function openPatientTab(\n personId: number,\n encounterId: number,\n tab: string,\n quickAdd?: boolean\n): MPageEventReturn {\n let inPowerChart = true;\n const eventString = `/PERSONID=${personId} /ENCNTRID=${encounterId} /FIRSTTAB=^${tab.toUpperCase()}${\n quickAdd || false ? '+' : ''\n }^`;\n\n try {\n window.APPLINK(1, '$APP_APPNAME$', eventString);\n } catch (e) {\n if (outsideOfPowerChartError(e)) {\n inPowerChart = false;\n } else {\n throw e;\n }\n }\n return { eventString, inPowerChart };\n}\n","import { MPageEventReturn } from '.';\nimport { outsideOfPowerChartError } from '../utils';\n\n/**\n * Attempts to open a tab with the name given to the `tab` variable in at the chart organizer\n * level.\n * @param tab The string which represents the tab to open\n * (case insensitive). Navigation will be made to the first\n * upper-level tab in the chart that that matches the `tab` string\n * If no match is found, then sub-tab names will be searched and\n * navigation made to the first sub-tab that matches\n * the `tab` string. If no matches are found, no navigation will occur.\n *\n * @documentation [APPLINK](https://wiki.cerner.com/display/public/MPDEVWIKI/APPLINK)\n */\nexport function openOrganizerTab(tab: string): MPageEventReturn {\n let inPowerChart = true;\n const eventString = `/ORGANIZERTAB=^${tab}^`;\n try {\n window.APPLINK(0, 'Powerchart.exe', eventString);\n } catch (e) {\n if (outsideOfPowerChartError(e)) {\n inPowerChart = false;\n } else {\n throw e;\n }\n }\n return { eventString, inPowerChart };\n}\n","/**\n * A type for the options that can be passed to the makeMpageOrder function.\n * @action `launch moew` - Launches the MOEW.\n * @action `activate existing` - Activates an existing order.\n * @action `cancel-discontinue` - Cancels and discontinues an existing order.\\n\n * @action `cancel-reorder` - Cancels and reorders an existing order.\n * @action `clear actions` - Clear actions of a future existing order.\n * @action `convert inpatient` - Converts a prescription order into an inpatient order.\n * @action `convert prescription` - Converts an inpatient order into a prescription.\n * @action `modify` - Modifies an existing future order.\n * @action `new order` - Creates a new order.\n * @action `renew` - Renews an existing non-prescription order.\n * @action `renew prescription` - Renews an existing prescription order.\n * @action `copy existing` - Copy an existing order.\n * @action `resume` - Resumes an existing order.\n * @action `suspend` - Suspends an existing order.\n *\n * @documentation [MPAGES_EVENT - ORDER](https://wiki.cerner.com/display/public/MPDEVWIKI/MPAGES_EVENT+-+ORDERS)\n */\nexport type OrderAction =\n | 'launch moew'\n | 'activate existing'\n | 'cancel-discontinue'\n | 'cancel-reorder'\n | 'clear actions'\n | 'convert inpatient'\n | 'convert prescription'\n | 'modify'\n | 'new order'\n | 'renew'\n | 'renew prescription'\n | 'copy existing'\n | 'resume'\n | 'suspend';\n\n/**\n * @param `synonymId` - The Cerner synonym_id for the order to be generated.\n * @param `orderSentenceId` - (optional) The order sentence id to be associated with the new order.\n * This is an accompanied value to the synonymId and provides specificity to the order type.\n * @param `nomenclatureIds` - (optional) An array of nomenclature ids (identifiers for problems/diagnoses) to be associated with the new order.\n * @param `interaction` - (optional) Defines when an interaction between the provider and PowerChart takes place only at sign time, or impromptu.\n * @param `origination` - (optional) Defines the origination of the order as `satellite`, `prescription`, or `normal`.\n *\n * @documentation [MPAGES_EVENT - ORDER](https://wiki.cerner.com/display/public/MPDEVWIKI/MPAGES_EVENT+-+ORDERS)\n */\nexport type NewOrderStrOpts = {\n synonymId: number;\n orderSentenceId?: number;\n nomenclatureIds?: Array<number>;\n interactionCheck?: 'on sign' | 'default';\n origination?: 'satellite' | 'prescription' | 'normal';\n};\n\n/**\n * @param {number} orderId - (optional) The order id value for the order to activate.\n * @param {NewOrderOpts}newOrderOpts - (optional) The options for the new order.\n *\n * @documentation [MPAGES_EVENT - ORDER](https://wiki.cerner.com/display/public/MPDEVWIKI/MPAGES_EVENT+-+ORDERS)\n */\nexport type OrderStrOpts = {\n orderId?: number;\n newOrderOpts?: NewOrderStrOpts;\n};\n\n/**\n * Creates a new pipe-delimited MPage Order string.\n * @since 0.4.0\n * @param {OrderAction} action - The action to be performed on the order.\n * @param {OrderStrOpts} opts - (optional) The options for the order.\n * @returns {string} - A pipe-delimited string which can be integrated into an MPage Event for one or more orders.\n * @throws {Error} - If the action is not a valid order action.\n *\n * @documentation [MPAGES_EVENT - ORDER](https://wiki.cerner.com/display/public/MPDEVWIKI/MPAGES_EVENT+-+ORDERS)\n */\nexport const orderString = (\n action: OrderAction,\n opts?: OrderStrOpts\n): string => {\n const { orderId, newOrderOpts } = opts || {};\n const {\n synonymId,\n orderSentenceId,\n nomenclatureIds,\n interactionCheck: interaction,\n origination,\n } = newOrderOpts || {};\n\n let params: Array<string> = [orderActionMap.get(action)];\n\n const nids = nomenclatureIds || [];\n\n switch (action) {\n case 'launch moew':\n params = params.concat(['0', '0', '0', '0', '0']);\n break;\n case 'new order':\n if (!synonymId)\n throw new Error(`synonymId is required for the '${action}' action`);\n params = params.concat([\n `${synonymId}`,\n `${originationMap.get(origination) || 0}`,\n `${orderSentenceId || 0}`,\n nids.length > 1 ? `[${nids.join('|')}]` : `${nids[0] || 0}`,\n `${interactionMap.get(interaction) || 0}`,\n ]);\n break;\n default:\n if (!orderId)\n throw new Error(`orderId is required for the '${action}' action`);\n params = params.concat([`${orderId}`]);\n break;\n }\n\n return `{${params.join('|')}}`;\n};\n\nconst orderActionMap = new Map()\n .set('launch moew', 'ORDER')\n .set('activate existing', 'ACTIVATE')\n .set('cancel-discontinue', 'CANCEL DC')\n .set('cancel-reorder', 'CANCEL REORD')\n .set('clear actions', 'CLEAR')\n .set('convert inpatient', 'CONVERT_INPAT')\n .set('convert prescription', 'CONVERT_RX')\n .set('modify', 'MODIFY')\n .set('new order', 'ORDER')\n .set('renew', 'RENEW')\n .set('renew prescription', 'RENEW_RX')\n .set('copy existing', 'REPEAT')\n .set('resume', 'RESUME')\n .set('suspend', 'SUSPEND');\n\nconst originationMap = new Map()\n .set('satellite', '5')\n .set('prescription', '1')\n .set('normal', '0');\n\nconst interactionMap = new Map().set('on sign', '1').set('default', '0');\n","import {\n outsideOfPowerChartError,\n warnAttemptedOrdersOutsideOfPowerChart,\n} from '../utils';\n\nconst launchViewMap = new Map()\n .set('search', 8)\n .set('profile', 16)\n .set('signature', 32);\n\nconst tabsMap = new Map<string, { tab: number; display: number }>()\n .set('orders', { tab: 2, display: 0 })\n .set('power orders', { tab: 2, display: 127 })\n .set('medications', { tab: 3, display: 0 })\n .set('power medications', { tab: 3, display: 127 });\n\n/**\n * @action `targetTab` - (optional) Sets the tab to be displayed, with and without power orders.\n * If not provided, will default to `orders`, that is the orders tab with _PowerOrders_ disabled.\n * Any tab with the term _power_ in it will enable both _PowerOrders_ and _PowerPlans_ in _PowerChart_.\n * @action `launchView` - (optional) Sets the view to be displayed.If not provided,\n * will default to `search` view.\n * @action `signSilently` - (optional) Signs the orders silently. Orders are not signed silently by default.\n * @action `dryRun` - (optional) If set to true, will not submit the order.\n * @documentation [MPAGES_EVENT - ORDER](https://wiki.cerner.com/display/public/MPDEVWIKI/MPAGES_EVENT+-+ORDERS)\n * @warning Our internal testing suggests there is a _PowerChart_ bug relating to the use of power\n * orders. When making MPAGES_EVENT calls (which we do in this library through `submitOrders`)\n * in series with power orders enabled, the result was that some MPAGES_EVENT calls failed to be invoked.\n * Please keep this in mind when enabling this option. For our own use, we have disabled power orders when\n * using `submitOrders` in such a way that calls are made in series.\n */\nexport type SubmitOrderOpts = {\n targetTab?: 'orders' | 'power orders' | 'medications' | 'power medications';\n launchView?: 'search' | 'profile' | 'signature';\n signSilently?: boolean;\n dryRun?: boolean;\n};\n\n/**\n * Submit orders for a patient in a given encounter through the _Cerner PowerChart_ `MPAGES_EVENT` function.\n * By default, _PowerPlans_ are disabled (potential bug in _PowerChart_), _PowerOrders_ are disabled,\n * the target tab is set to orders, and will launch to the signature view.\n * @param {number} personId - The identifier for the patient to whom the note belongs.\n * Cerner context variable: PAT_PersonId.\n * @param {number} encounterId - The identifier for the encounter belonging to the patient where\n * this note will be launched. Cerner context variable: VIS_EncntrId.\n * @param orders - The orders to be submitted. Orders are given in the form of a a series of pipe-delimited\n * parameters as specified in the `MPAGES_EVENT` documentation (below). Use the `fluent-cerner-js` library's\n * `orderString` function to simplify building these pipe-delimited order strings.\n * @param opts - (optional) User defined options for the order submission event. The options allow for\n * changing the target tab, the view to be launched, and whether or not the orders should be signed silently.\n * @returns an object with the order `eventString` and a boolean flag set to notify the user if\n * the attempt was made outside of PowerChart, `inPowerChart`.\n *\n * @documentation [MPAGES_EVENT - ORDER](https://wiki.cerner.com/display/public/MPDEVWIKI/MPAGES_EVENT+-+ORDERS)\n */\nexport const submitOrders = (\n personId: number,\n encounterId: number,\n orders: Array<string>,\n opts?: SubmitOrderOpts\n): { eventString: string; inPowerChart: boolean } => {\n let { targetTab, launchView, signSilently, dryRun } = opts || {};\n if (!targetTab) targetTab = 'orders';\n if (!launchView) launchView = 'signature';\n const enablePowerPlans =\n targetTab === 'power orders' || targetTab === 'power medications';\n\n let inPowerChart = true;\n\n let params: Array<string> = [\n `${personId}`,\n `${encounterId}`,\n orders.join(''),\n ];\n\n params.push(enablePowerPlans ? '24' : '0');\n\n const { tab, display } = tabsMap.get(targetTab) || { tab: 2, display: 127 };\n params.push(`{${tab}|${display}}`);\n\n params.push(`${launchViewMap.get(launchView) || 32}`);\n\n params.push(`${signSilently ? '1' : '0'}`);\n\n const eventString = params.join('|');\n\n if (dryRun) return { eventString, inPowerChart };\n\n try {\n window.MPAGES_EVENT('ORDERS', eventString);\n } catch (e) {\n if (outsideOfPowerChartError(e)) {\n inPowerChart = false;\n warnAttemptedOrdersOutsideOfPowerChart(eventString);\n } else {\n throw e;\n }\n }\n return { eventString, inPowerChart };\n};\n","import { MPageOrder } from '.';\nimport {\n outsideOfPowerChartError,\n warnAttemptedOrdersOutsideOfPowerChart,\n} from './utils';\n\nclass MPageOrderEvent {\n private _orders: Array<MPageOrder>;\n getOrders = () => this._orders;\n\n private _tabList: { tab: number; tabDisplayFlag: number } = {\n tab: 0,\n tabDisplayFlag: 0,\n };\n getTabList = () => this._tabList;\n\n private _personId: number = 0;\n getPersonId = () => this._personId;\n\n private _encounterId: number = 0;\n getEncounterId = () => this._encounterId;\n\n private _powerPlanFlag: number = 0;\n getPowerPlanFlag = () => this._powerPlanFlag;\n\n private _defaultDisplay: number = 0;\n getDefaultDisplay = () => this._defaultDisplay;\n\n private _silentSignFlag: number = 0;\n getSilentSignFlag = () => this._silentSignFlag;\n\n constructor() {\n this._orders = [];\n this._tabList = { tab: 0, tabDisplayFlag: 0 };\n // Disable PowerPlans by default\n this._powerPlanFlag = 0;\n // Disable PowerOrders by default\n this._tabList.tabDisplayFlag = 0;\n this.customizeOrderListProfile();\n this.launchOrderProfile();\n // Do NOT sign silently by default\n this._silentSignFlag = 0;\n }\n\n forPerson(id: number) {\n this._personId = id;\n return this;\n }\n\n forEncounter(id: number) {\n this._encounterId = id;\n return this;\n }\n\n addOrders(orders: Array<MPageOrder> | MPageOrder) {\n if (!Array.isArray(orders)) {\n orders = [orders];\n }\n this._orders = this._orders.concat(orders);\n return this;\n }\n\n enablePowerPlans() {\n this._powerPlanFlag = 24;\n return this;\n }\n\n customizeOrderListProfile() {\n this._tabList.tab = 2;\n return this;\n }\n\n customizeMedicationListProfile() {\n this._tabList.tab = 3;\n return this;\n }\n\n enablePowerOrders() {\n this._tabList.tabDisplayFlag = 127;\n return this;\n }\n\n launchOrderSearch() {\n this._defaultDisplay = 8;\n return this;\n }\n\n launchOrderProfile() {\n this._defaultDisplay = 16;\n return this;\n }\n\n launchOrdersForSignature() {\n this._defaultDisplay = 32;\n return this;\n }\n\n signSilently() {\n this._silentSignFlag = 1;\n return this;\n }\n\n send() {\n try {\n window.MPAGES_EVENT('ORDERS', this.toString());\n } catch (e) {\n if (outsideOfPowerChartError(e)) {\n warnAttemptedOrdersOutsideOfPowerChart(this.toString());\n } else {\n throw e;\n }\n }\n }\n\n toString(): string {\n const head = `${this._personId}|${this._encounterId}|`;\n let body: string = '';\n this._orders.forEach(order => {\n body += order.toString();\n });\n const tail = `|${this._powerPlanFlag}|{${this._tabList.tab}|${this._tabList.tabDisplayFlag}}|${this._defaultDisplay}|${this._silentSignFlag}`;\n\n return `${head}${body}${tail}`;\n }\n}\n\nexport { MPageOrderEvent };\n","/**\n * Options for a new order\n * @param {boolean} isRxOrder Marks the order order as a prescription. Is mutually exclusive from\n * isSatelliteOrder. Field will be set to false if left undefined; this resolves to 0 when built.\n * @param {boolean} isSatelliteOrder Moarks the order origination as satellite. Is mutually\n * exclusive from isRxOrder. Field will be set to false if left undefined; this resolves to 0 when built.\n * @param {number} orderSentenceId The optional Cerner order_sentence_id to be associated with\n * the new order. Field will be set to 0 if undefined.\n * @param {number} nomenclatureId The optional Cerner nomenclature_id to be associated with the\n * new order. Field will be set to 0 if undefined.\n * @param {boolean} skipInteractionCheckUntilSign Determines cerner sign-time interaction\n * checking. A value of true skips checking for interactions until orders are signed, false\n * will not. Field will be set to false if left undefined; this resolves to 0 when built.\n */\nexport type NewOrderOpts = {\n isRxOrder?: boolean;\n isSatelliteOrder?: boolean;\n orderSentenceId?: number;\n nomenclatureId?: number;\n skipInteractionCheckUntilSign?: boolean;\n};\n\nexport class MPageOrder {\n private _orderAction: string = '';\n getOrderAction = () => this._orderAction;\n\n private _orderId: number = 0;\n getOrderId = () => this._orderId;\n\n private _synonymId: number = 0;\n getSynonymId = () => this._synonymId;\n\n private _orderOrigination: number = 0;\n getOrderOrigination = () => this._orderOrigination;\n\n private _orderSentenceId: number = 0;\n getOrderSentenceId = () => this._orderSentenceId;\n\n private _nomenclatureId: number = 0;\n getNomenclatureId = () => this._nomenclatureId;\n\n private _signTimeInteraction: number = 0;\n getSignTimeInteraction = () => this._signTimeInteraction;\n\n /**\n * Creates a new MPageOrder with the order action 'ACTIVATE', which is the prototype for activating an existing future order.\n *\n * @since 0.1.0\n * @category MPage Events - Orders\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willActivate(orderId: number) {\n this._orderAction = 'ACTIVATE';\n this._orderId = orderId;\n return this;\n }\n /**\n * Creates a new MPageOrder with the order action 'CANCEL DC', which is the prototype for canceling and discontinuing an existing future order.\n *\n * @since 0.1.0\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willCancelDiscontinue(orderId: number) {\n this._orderAction = 'CANCEL DC';\n this._orderId = orderId;\n return this;\n }\n /**\n * Creates a new MPageOrder with the order action 'CANCEL REORD', which is the prototype for cancelling and reordering an existing future order.\n *\n * @since 0.1.0\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willCancelReorder(orderId: number) {\n this._orderAction = 'CANCEL REORD';\n this._orderId = orderId;\n return this;\n }\n /**\n * Creates a new MPageOrder with the order action 'CLEAR', which is the prototype for clearing actions of an existing future order.\n *\n * @since 0.1.0\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willClear(orderId: number) {\n this._orderAction = 'CLEAR';\n this._orderId = orderId;\n return this;\n }\n /**\n * Creates a new MPageOrder with the order action 'CONVERT_INPAT', which is the prototype for converting a prescription order into an inpatient order.\n *\n * @since 0.1.0\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willConvertInpatient(orderId: number) {\n this._orderAction = 'CONVERT_INPAT';\n this._orderId = orderId;\n return this;\n }\n /**\n * Creates a new MPageOrder with the order action 'CONVERT_RX', which is the prototype for converting an inpatient order into a prescription.\n *\n * @since 0.1.0\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willConvertToPrescriptionOrder(orderId: number) {\n this._orderAction = 'CONVERT_RX';\n this._orderId = orderId;\n return this;\n }\n /**\n * Creates a new MPageOrder with the order action 'MODIFY', which is the prototype for modifying an existing future order.\n *\n * @since 0.1.0\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willModify(orderId: number) {\n this._orderAction = 'MODIFY';\n this._orderId = orderId;\n return this;\n }\n /**\n * Creates a new MPage Order with order action 'ORDER'.\n *\n * @since 0.1.0\n * @category MPage Events - Orders\n * @param {number} synonymId The Cerner synonym_id to be associated with the new order. Must be set.\n * @param {NewOrderOpts} options required when making a new order\n * @returns {this} Returns itself to continue chaining method calls.\n * default to a normal order type.\n * @throws Error if `isRxOrder` and `isSatelliteOrder` are both set to true. These two are mutually exclusive and setting\n * both creates underfined behavior with respect the order origination field.\n * @example\n * m.willMakeNewOrder(34, true, 13, 42, true).toString() => \"{'ORDER'|34|5|1342|1}\"\n */\n willMakeNewOrder(synonymId: number, opts?: NewOrderOpts) {\n const {\n isRxOrder,\n isSatelliteOrder,\n orderSentenceId,\n nomenclatureId,\n skipInteractionCheckUntilSign,\n } = opts || {};\n\n if (isRxOrder && isSatelliteOrder)\n throw new Error('must select either isRxOrder or isSatelliteOrder');\n this._orderAction = 'ORDER';\n this._synonymId = synonymId;\n this._orderSentenceId = orderSentenceId || 0;\n this._nomenclatureId = nomenclatureId || 0;\n this._signTimeInteraction = skipInteractionCheckUntilSign ? 1 : 0;\n this._orderOrigination = isSatelliteOrder ? 5 : isRxOrder ? 1 : 0;\n\n return this;\n }\n\n /**\n * Creates a new MPageOrder with the order action 'RENEW', which is the prototype for reviewing an existing non-prescription order.\n *\n * @since 0.1.0\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willRenewNonPrescription(orderId: number) {\n this._orderAction = 'RENEW';\n this._orderId = orderId;\n return this;\n }\n /**\n * Creates a new MPageOrder with the order action 'RENEW_RX', which is the prototype for renewing an existing prescription order.\n *\n * @since 0.1.0\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willRenewPrescription(orderId: number) {\n this._orderAction = 'RENEW_RX';\n this._orderId = orderId;\n return this;\n }\n /**\n * Creates a new MPageOrder with the order action 'REPEAT', which is the prototype for copying an order.\n *\n * @since 0.1.0\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willCopyExistingOrder(orderId: number) {\n this._orderAction = 'REPEAT';\n this._orderId = orderId;\n return this;\n }\n /**\n * Creates a new MPageOrder with the order action 'RESUME', which is the prototype for resuming a suspended order.\n *\n * @since 0.1.0\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willResumeSuspendedOrder(orderId: number) {\n this._orderAction = 'RESUME';\n this._orderId = orderId;\n return this;\n }\n /**\n * Creates a new MPageOrder with the order action 'SUSPEND', which is the prototype for suspending an existing order.\n *\n * @since 0.1.0\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willSuspend(orderId: number) {\n this._orderAction = 'SUSPEND';\n this._orderId = orderId;\n return this;\n }\n\n /**\n * Overrides the toString() method for representing the objects internal state as a string.\n *\n * @since 0.1.0\n * @returns {string} string representation of MPageOrder's internal state\n */\n toString(): string {\n return this._orderAction === 'ORDER'\n ? `{${this._orderAction}|${this._synonymId}|${this._orderOrigination}|${this._orderSentenceId}|${this._nomenclatureId}|${this._signTimeInteraction}}`\n : `{${this._orderAction}|${this._orderId}}`;\n }\n}\n"],"names":["composeXmlCclReqRejectMsg","req","prg","params","status","readyState","responseText","processXmlCclReqResponseText","rt","trim","undefined","outsideOfPowerChartError","e","TypeError","message","ReferenceError","warnAttemptedOrdersOutsideOfPowerChart","eventString","console","warn","launchClinicalNote","opts","personId","encounterId","eventIds","windowTitle","viewOptionFlags","_ref","inheritanceProps","viewName","viewSeq","compName","compSeq","inPowerChart","_viewOptsFlags","length","push","join","calculateViewOptionFlag","window","MPAGES_EVENT","total","forEach","flag","launchPowerForm","target","targetId","permissions","Error","launchPowerNote","readyStateMap","Map","set","statusCodeMap","makeCclRequest","excludeMine","paramsList","processCclRequestParams","Promise","resolve","reject","request","XMLCclRequest","open","send","onreadystatechange","get","statusText","data","JSON","parse","response","meta","updatedParams","concat","type","param","paramString","map","openPatientTab","tab","quickAdd","toUpperCase","APPLINK","openOrganizerTab","orderString","action","orderId","newOrderOpts","_ref2","synonymId","orderSentenceId","nomenclatureIds","interaction","interactionCheck","origination","orderActionMap","nids","originationMap","interactionMap","launchViewMap","tabsMap","display","submitOrders","orders","targetTab","launchView","signSilently","dryRun","enablePowerPlans","MPageOrderEvent","_this","_orders","tabDisplayFlag","_tabList","_personId","_encounterId","_powerPlanFlag","_defaultDisplay","_silentSignFlag","customizeOrderListProfile","launchOrderProfile","_proto","prototype","forPerson","id","forEncounter","addOrders","Array","isArray","customizeMedicationListProfile","enablePowerOrders","launchOrderSearch","launchOrdersForSignature","toString","head","body","order","tail","MPageOrder","_orderAction","_orderId","_synonymId","_orderOrigination","_orderSentenceId","_nomenclatureId","_signTimeInteraction","willActivate","willCancelDiscontinue","willCancelReorder","willClear","willConvertInpatient","willConvertToPrescriptionOrder","willModify","willMakeNewOrder","isRxOrder","isSatelliteOrder","nomenclatureId","skipInteractionCheckUntilSign","willRenewNonPrescription","willRenewPrescription","willCopyExistingOrder","willResumeSuspendedOrder","willSuspend"],"mappings":";;;;AAAA;;;;;;;AAOO,IAAMA,yBAAyB,GAAG,SAA5BA,yBAAyBA,CACpCC,GAAkB,EAClBC,GAAW,EACXC,MAAc;EAEd,IAAQC,MAAM,GAA+BH,GAAG,CAAxCG,MAAM;IAAEC,UAAU,GAAmBJ,GAAG,CAAhCI,UAAU;IAAEC,YAAY,GAAKL,GAAG,CAApBK,YAAY;EACxC,8BAA4BF,MAAM,wBAAmBC,UAAU,YAAOH,GAAG,qBAAgBC,MAAM,mCAA6BG,YAAY,IACtI,kBAAkB;AACtB,CAAC;AAED;;;;;AAKO,IAAMC,4BAA4B,GAAG,SAA/BA,4BAA4BA,CACvCD,YAAoB;EAEpB,IAAME,EAAE,GAAGF,YAAY,CAACG,IAAI,EAAE;EAC9B,OAAOD,EAAE,KAAK,EAAE,GAAGE,SAAS,GAAGF,EAAE;AACnC,CAAC;AAED;;;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EAEbmC,MAAA,CAOAwC,wBAAwB,GAAxB,SAAAA,yBAAyB3E,OAAe;IACtC,IAAI,CAACqD,YAAY,GAAG,QAAQ;IAC5B,IAAI,CAACC,QAAQ,GAAGtD,OAAO;IACvB,OAAO,IAAI;;;;;;;;;EAEbmC,MAAA,CAOAyC,WAAW,GAAX,SAAAA,YAAY5E,OAAe;IACzB,IAAI,CAACqD,YAAY,GAAG,SAAS;IAC7B,IAAI,CAACC,QAAQ,GAAGtD,OAAO;IACvB,OAAO,IAAI;;;;;;;;EAGbmC,MAAA,CAMAY,QAAQ,GAAR,SAAAA;IACE,OAAO,IAAI,CAACM,YAAY,KAAK,OAAO,SAC5B,IAAI,CAACA,YAAY,SAAI,IAAI,CAACE,UAAU,SAAI,IAAI,CAACC,iBAAiB,SAAI,IAAI,CAACC,gBAAgB,SAAI,IAAI,CAACC,eAAe,SAAI,IAAI,CAACC,oBAAoB,eAC5I,IAAI,CAACN,YAAY,SAAI,IAAI,CAACC,QAAQ,MAAG;GAC9C;EAAA,OAAAF,UAAA;AAAA;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"fluent-cerner-js.cjs.development.js","sources":["../src/utils/index.ts","../src/functional/launchClinicalNote.ts","../src/functional/launchPowerForm.ts","../src/functional/launchPowerNote.ts","../src/functional/makeCclRequest.ts","../src/functional/openPatientTab.ts","../src/functional/openOrganizerTab.ts","../src/functional/orderString.ts","../src/functional/submitOrders.ts","../src/MPageOrderEvent.ts","../src/MPageOrder.ts"],"sourcesContent":["/**\n * Compose an error message for a rejected XMLCclRequest.\n * @param req {XMLCclRequest} - The XMLCclRequest object which represents the request.\n * @param prg {string} - The program which was called.\n * @param params {string} - The parameters which were passed to the program.\n * @returns a string which represents the error message composed of the above parameters.\n */\nexport const composeXmlCclReqRejectMsg = (\n req: XMLCclRequest,\n prg: string,\n params: string\n): string => {\n const { status, readyState, responseText } = req;\n return `error with status ${status} and readyState ${readyState} on ${prg} with params ${params} returning response text: ${responseText ||\n 'no response text'}`;\n};\n\n/**\n * Process the response text from an XMLCclRequest for use in the `makeCclRequest` function.\n * @param responseText {string} - The response text from the XMLCclRequest.\n * @returns the response text if it is not an empty string, otherwise returns `undefined`.\n */\nexport const processXmlCclReqResponseText = (\n responseText: string\n): string | undefined => {\n const rt = responseText.trim();\n return rt === '' ? undefined : rt;\n};\n\n/**\n * Check to see if the error reflects likely being outside of PowerChart.\n * @param e {Error} - The error to be checked.\n * @returns {boolean} - Returns `true` if the error is one of two cases that result\n * from being outside of Cerner PowerChart.\n */\nexport function outsideOfPowerChartError(e: unknown) {\n return (\n (e instanceof TypeError &&\n e.message === 'window.MPAGES_EVENT is not a function') ||\n (e instanceof TypeError &&\n e.message === 'window.XMLCclRequest is not a function') ||\n (e instanceof TypeError &&\n e.message === 'window.APPLINK is not a function') ||\n (e instanceof ReferenceError && e.message === 'window is not defined')\n );\n}\n\n/**\n * A wrapper function for the `console.warn` function which logs a warning message.\n * @param eventString {string} - The event string to be logged.\n */\nexport const warnAttemptedOrdersOutsideOfPowerChart = (\n eventString: string\n): void => {\n console.warn(`window.MPAGES_EVENT('ORDERS', '${eventString}')`);\n};\n","import { MPageEventReturn } from '.';\nimport { outsideOfPowerChartError } from '../utils';\n\n/**\n * Available options for the Clinical Note view.\n *\n * @documentation [MPAGES_EVENT - CLINICAL NOTE](https://wiki.cerner.com/display/public/MPDEVWIKI/MPAGES_EVENT+-+CLINICALNOTE)\n */\nexport type ViewOption =\n | 'menu'\n | 'buttons'\n | 'toolbar'\n | 'calculator'\n | 'view-only';\n\n/**\n * Launches a clinical note in PowerChart inhereting the preferences of the component and view described below.\n * If any of the values is invalid, it will use the default values.\n * @param {string} viewName - The view name for the view-level preference of the tab to model the preferences after.\n * @param {number} viewSeq - The view sequence for the view-level preference of the tab to model the\n * preferences after. An invalid viewSeq loads the clinical note with the default preferences.\n * @param {string} compName - The component name for the component-level preference of the tab to model the\n * preferences after. An invalid compName loads the clinical note with the default preferences.\n * @param {number} compSeq - \tThe component sequence for the component-level preference of the tab to model\n * the preferences after. An invalid compSeq loads the clinical note with the default preferences.\n *\n * @documentation [MPAGES_EVENT - CLINICAL NOTE](https://wiki.cerner.com/display/public/MPDEVWIKI/MPAGES_EVENT+-+CLINICALNOTE)\n */\nexport type InheretanceProps = {\n viewName: string;\n viewSeq: number;\n compName: string;\n compSeq: number;\n};\n\n/**\n * A type which represents the parameters to be be passed into the launchClinicalNote() function.\n * @param {number} personId - The identifier for the patient to whom the note belongs.\n * Cerner context variable: PAT_PersonId.\n * @param {number} encounterId - The identifier for the encounter belonging to the patient where\n * this note will be launched. Cerner context variable: VIS_EncntrId.\n * @param {Array<number>} eventIds - An array of `event_id`'s of the clinical note(s) to be displayed.\n * @param {string} windowTitle - The text to be displayed in the first section of the title for the\n * Clinical Notes window.\n * @param {Array<ViewOption>} viewOptionFlags - (optional) View options for the Clinical Notes window.\n * If not provided, defaults to `view-only` with no other options.\n * @param {InheretanceProps} inheritanceProps - (optional) The view and component names and sequences\n * to be used for the Clinical Notes window. If not provided, uses default preferences.\n *\n * @documentation [MPAGES_EVENT - CLINICAL NOTE](https://wiki.cerner.com/display/public/MPDEVWIKI/MPAGES_EVENT+-+CLINICALNOTE)\n **/\nexport type ClinicalNoteOpts = {\n personId: number;\n encounterId: number;\n eventIds: Array<number>;\n windowTitle: string;\n viewOptionFlags?: Array<ViewOption>;\n inheritanceProps?: InheretanceProps;\n};\n\n/**\n * Launch a ClinicalNote in Cerner's PowerChart.\n * @param {ClinicalNoteOpts} opts - The parameters passed, as specified in `ClinicalNoteOpts`\n * @returns {MPageEventReturn} - An object containing the `eventString` and `inPowerChart` values.\n *\n * @documentation [MPAGES_EVENT - CLINICAL NOTE](https://wiki.cerner.com/display/public/MPDEVWIKI/MPAGES_EVENT+-+CLINICALNOTE)\n **/\nexport const launchClinicalNote = (\n opts: ClinicalNoteOpts\n): MPageEventReturn => {\n const {\n personId,\n encounterId,\n eventIds,\n windowTitle,\n viewOptionFlags,\n } = opts;\n const { viewName, viewSeq, compName, compSeq } = opts.inheritanceProps || {};\n\n let inPowerChart = true;\n const params: Array<string> = [`${personId}`, `${encounterId}`];\n\n const _viewOptsFlags: Array<ViewOption> =\n !viewOptionFlags || viewOptionFlags.length === 0\n ? ['view-only']\n : viewOptionFlags;\n\n params.push(`[${eventIds.join('|')}]`);\n params.push(`${windowTitle}`);\n params.push(`${calculateViewOptionFlag(_viewOptsFlags)}`);\n params.push(`${viewName || ''}`);\n params.push(`${viewSeq || ''}`);\n params.push(`${compName || ''}`);\n params.push(`${compSeq || ''}`);\n\n const eventString = `${params.join('|')}`;\n try {\n window.MPAGES_EVENT('CLINICALNOTE', eventString);\n } catch (e) {\n if (outsideOfPowerChartError(e)) {\n inPowerChart = false;\n console.warn(`window.MPAGES_EVENT('CLINICALNOTE', '${eventString}')`);\n } else {\n throw e;\n }\n }\n\n return { inPowerChart, eventString };\n};\n\nfunction calculateViewOptionFlag(viewOptionFlags: Array<ViewOption>): number {\n let total = 0;\n viewOptionFlags.forEach(flag => {\n if (flag === 'menu') total += 1;\n if (flag === 'buttons') total += 2;\n if (flag === 'toolbar') total += 4;\n if (flag === 'calculator') total += 8;\n if (flag === 'view-only') total += 16;\n });\n return total;\n}\n","import { MPageEventReturn } from '.';\nimport { outsideOfPowerChartError } from '../utils';\n\n/**\n * A type which represents the parameters to be be passed into the launchPowerForm() function.\n * @param {number} personId - The identifier for the patient to whom the note belongs.\n * Cerner context variable: PAT_PersonId.\n * @param {number} encounterId - The identifier for the encounter belonging to the patient where\n * this note will be launched. Cerner context variable: VIS_EncntrId.\n * @param {string} target - Determines whether to target (open) a \"new form\" of a specified\n * type, a \"completed form\", or a \"new form search\" box.\n * @param {number} targetId - (optional) For a new form, this is the formId (pulled from DCP_FORMS_REF_ID).\n * For a completed form, this is the activityId (pulled from DCP_FORMS_ACTIVITY_ID). This parameter is\n * required only for `new form` or `completed form` targets.\n * @param {string} permissions - (optional) The permissions to open the document with. Choices\n * are: \"modify\" or \"read-only\". When not provided, defaults to \"read-only\".\n *\n * @documentation [MPAGES_EVENT - POWERFORM](https://wiki.cerner.com/display/public/MPDEVWIKI/MPAGES_EVENT+-+POWERFORM)\n **/\nexport type PowerFormOpts = {\n personId: number;\n encounterId: number;\n target: 'new form' | 'completed form' | 'new form search';\n targetId?: number;\n permissions?: 'modify' | 'read only';\n};\n\n/**\n * Launch a PowerForm in Cerner's PowerChart.\n * @param {PowerFormOpts} opts - The parameters passed, as specified in `PowerFormOpts`\n * @returns {MPageEventReturn} - An object containing the `eventString` and `inPowerChart` values.\n *\n * @documentation [MPAGES_EVENT - POWERFORM](https://wiki.cerner.com/display/public/MPDEVWIKI/MPAGES_EVENT+-+POWERFORM)\n **/\nexport const launchPowerForm = (opts: PowerFormOpts): MPageEventReturn => {\n const { personId, encounterId, target, targetId, permissions } = opts;\n\n if ((target === 'new form' || target === 'completed form') && !targetId) {\n throw new Error(\n \"'targetId' is required for 'new form' and 'completed form' targets.\"\n );\n }\n\n const params: Array<string> = [`${personId}`, `${encounterId}`];\n if (target === 'new form') {\n params.push(`${targetId}`);\n params.push('0');\n }\n if (target === 'completed form') {\n params.push('0');\n params.push(`${targetId}`);\n }\n if (target === 'new form search') {\n params.push('0');\n params.push('0');\n }\n params.push(permissions === 'modify' ? '0' : '1');\n\n let inPowerChart = true;\n const eventString = `${params.join('|')}`;\n\n try {\n window.MPAGES_EVENT('POWERFORM', eventString);\n } catch (e) {\n if (outsideOfPowerChartError(e)) {\n inPowerChart = false;\n console.warn(`window.MPAGES_EVENT('POWERFORM', '${eventString}')`);\n } else {\n throw e;\n }\n }\n\n return { inPowerChart, eventString };\n};\n","import { MPageEventReturn } from '.';\nimport { outsideOfPowerChartError } from '../utils';\n\n/**\n * A type which represents the parameters to be be passed into the launchPowerNote() function.\n * @param {number} personId - The identifier for the patient to whom the note belongs.\n * Cerner context variable: PAT_PersonId.\n * @param {number} encounterId - The identifier for the encounter belonging to the patient where\n * this note will be launched. Cerner context variable: VIS_EncntrId.\n * @param {string} target - Determines whether to target (open) a \"new\" PowerNote or an \"existing\" PowerNote.\n * @param {number | string} targetId - For a `new` note, this value should be a `string` representing the\n * CKI value for an encounter pathway. For an `existing` note, this value should be a `number` representing\n * the eventId of the note to be opened.\n * corresponds to an encounter pathway.\n * @param {number} eventId - (exclusive option to CKI) An event_id for an existing PowerNote to load.\n *\n * @documentation [MPAGES_EVENT - POWERNOTE](https://wiki.cerner.com/display/public/MPDEVWIKI/MPAGES_EVENT+-+POWERNOTE)\n **/\nexport type PowerNoteOpts = {\n personId: number;\n encounterId: number;\n target: 'new' | 'existing';\n targetId: string | number;\n};\n\n/**\n * Launch a PowerNote in Cerner's PowerChart.\n * @param {PowerNoteOpts} opts - The parameters passed, as specified in `PowerNoteOpts`\n * @returns {MPageEventReturn} - An object containing the `eventString` and `inPowerChart` values.\n * @throws {Error} - if there is a type mismatch between the provided option for `target` and `targetId`.\n *\n * @documentation [MPAGES_EVENT - POWERNOTE](https://wiki.cerner.com/display/public/MPDEVWIKI/MPAGES_EVENT+-+POWERNOTE)\n **/\nexport const launchPowerNote = (opts: PowerNoteOpts): MPageEventReturn => {\n const { personId, encounterId, target, targetId } = opts;\n\n if (target === 'new' && typeof targetId !== 'string') {\n throw new Error('CKI must be a string when launching a new PowerNote.');\n }\n\n if (target === 'existing' && typeof targetId !== 'number') {\n throw new Error(\n 'eventId must be a number when loading an existing PowerNote.'\n );\n }\n const params: Array<string> = [\n `${personId}`,\n `${encounterId}`,\n `${target === 'new' ? targetId : ''}`,\n `${target === 'existing' ? targetId : 0}`,\n ];\n\n const eventString = `${params.join('|')}`;\n let inPowerChart = true;\n try {\n window.MPAGES_EVENT('POWERNOTE', eventString);\n } catch (e) {\n if (outsideOfPowerChartError(e)) {\n inPowerChart = false;\n console.warn(`window.MPAGES_EVENT('POWERNOTE', '${eventString}')`);\n } else {\n throw e;\n }\n }\n\n return { eventString, inPowerChart };\n};\n","import {\n composeXmlCclReqRejectMsg,\n outsideOfPowerChartError,\n processXmlCclReqResponseText,\n} from '../utils';\n\n/**\n * A type which represents the input parameter for an `XmlCclRequest`, which is wrapped by `makeCclRequest`.\n * The parameters are passed in a string, and numbers and strings are interpreted within this string by\n * the presence of quotes within quotes (e.g. single within double or vice versa). By strongly typing\n * the CclCallParam we can ensure that the parameters are always passed in a way that properly represents\n * their type.\n * @param {'string'|'number'} type - The type of the parameter.\n * @param {string} param - The string representing the parameters value.\n */\nexport type CclCallParam = {\n type: 'string' | 'number';\n param: string | number;\n};\n\n/**\n * A type which represents the full set of data required to make an XmlCclRequest, which is wrapped\n * by `makeCclRequest`.\n * @param {string} prg - The name of the CCL program to run, e.g. 12_USER_DETAILS.\n * @param {boolean?} excludeMine - Determines whether or not to include the \"MINE\" parameter as the\n * first parameter in the CCL call. This defaults to `false`, and almost all cases will require\n * the \"MINE\" parameter to be included.\n * @param {CclCallParam[]} params - An array of CclCallParam objects, each of which represents\n * a strongly typed parameter.\n */\nexport type CclOpts = {\n prg: string;\n excludeMine?: boolean;\n params: Array<CclCallParam>;\n};\n\n/**\n * A type functioning as a convience wrapper for the ready state of an XmlCclRequest.\n */\nexport type XmlCclReadyState =\n | 'uninitialized'\n | 'loading'\n | 'loaded'\n | 'interactive'\n | 'completed';\n\n/**\n * A type functioning as a convience wrapper for several status\n * codes, respresented as strings, that are returned by XMLCclRequest.\n */\nexport type XmlCclStatus =\n | 'success'\n | 'method not allowed'\n | 'invalid state'\n | 'non-fatal error'\n | 'memory error'\n | 'internal server exception'\n | 'status refers to unknown error';\n\n/**\n * A type which represents the full set of data returned from an XmlCclRequest and important, formatted\n * metadata to help with debugging and error management. This is a generic type and data will represent\n * the type `T` which is the type or interface which represents the resolved data from the CCL request.\n */\nexport type CclRequestResponse<T> = {\n meta: {\n responseText: string;\n status: number;\n statusText: XmlCclStatus;\n statusDetails: string;\n prgName: string;\n prgArguments: string;\n __original: XMLCclRequest;\n };\n data: T | undefined;\n};\n\nconst readyStateMap: Map<number, XmlCclReadyState> = new Map();\nreadyStateMap.set(0, 'uninitialized');\nreadyStateMap.set(1, 'loading');\nreadyStateMap.set(2, 'loaded');\nreadyStateMap.set(3, 'interactive');\nreadyStateMap.set(4, 'completed');\n\nconst statusCodeMap: Map<number, XmlCclStatus> = new Map();\nstatusCodeMap.set(200, 'success');\nstatusCodeMap.set(405, 'method not allowed');\nstatusCodeMap.set(409, 'invalid state');\nstatusCodeMap.set(492, 'non-fatal error');\nstatusCodeMap.set(493, 'memory error');\nstatusCodeMap.set(500, 'internal server exception');\n\n/**\n * A generic wrapper function for `XMLCclRequest` which simplifies it's use. Of note,\n * use of this requires the `head` of the HTML document contain the following\n * `meta` tag: `<META content='XMLCCLREQUEST' name='discern'>` so that it might\n * interface with the appropriate COM object.\n * @param {CclOpts} opts - Required options for the CCL request.\n * @returns a promise of type `CclRequestResponse<T>` where `T` is the type\n * or interface which represents the resolved data from the CCL request. If\n * no data are returned, that is an empty string, from the XMLCclRequest then\n * the `data` field will be set to `undefined`. The objects `meta` field\n * includes `responseText`, `status`, and `statusTest` fields.\n * @resolves the `CclRequestResponse<T>` where `T` is the type\n * or interface which represents the resolved data from the CCL request. If\n * no data are returned, that is an empty string, from the XMLCclRequest then\n * the `data` field will be set to `undefined`. The objects `meta` field\n * includes `responseText`, `status`, and `statusTest` fields.\n * @rejects with an error message if the CCL request fails.\n *\n * @documentation - [XMLCclRequest](https://wiki.cerner.com/display/MPAGES/MPages+JavaScript+Reference#MPagesJavaScriptReference-XMLCclRequest)\n */\nexport function makeCclRequest<T>(\n opts: CclOpts\n): Promise<CclRequestResponse<T>> {\n const { prg, excludeMine, params } = opts;\n const paramsList = processCclRequestParams(params, excludeMine || false);\n\n return new Promise((resolve, reject) => {\n try {\n // @ts-ignore - From Powerchart context\n const request: XMLCclRequest = window.XMLCclRequest();\n\n request.open('GET', `${prg}`);\n request.send(paramsList);\n request.onreadystatechange = function() {\n const readyState = readyStateMap.get(request.readyState);\n\n if (readyState !== 'completed') return;\n\n const statusText = statusCodeMap.get(request.status);\n const responseText = processXmlCclReqResponseText(request.responseText);\n const data: T | undefined = responseText && JSON.parse(responseText);\n\n const response: CclRequestResponse<T> = {\n meta: {\n responseText: responseText || 'no response text',\n status: request.status,\n statusText: statusText || 'status refers to unknown error',\n statusDetails: request.statusText,\n prgName: request.url,\n prgArguments: request.requestText,\n __original: request,\n },\n data,\n };\n\n if (statusText === 'success') {\n resolve(response);\n } else {\n reject(composeXmlCclReqRejectMsg(request, prg, paramsList));\n }\n };\n } catch (e) {\n if (outsideOfPowerChartError(e)) {\n reject((e as Error).message);\n } else {\n throw e;\n }\n }\n });\n}\n\n/**\n * A function which processes the CCL request parameters, converting them to a string compatible with an XmlCclRequest.\n * @param params {Array<CclCallParam|string|number>} An array of CclCallParam objects when explicitly defining\n * type, or strings and numbers when implicitly defining type, each of which represents\n * @param excludeMine {boolean} Determines whether or not to include the \"MINE\" parameter as the\n * @returns {string} the XmlCclRequest compatible string.\n */\nexport function processCclRequestParams(\n params?: Array<CclCallParam | string | number>,\n excludeMine?: boolean\n) {\n params = params || [];\n excludeMine = excludeMine || false;\n\n const processedParams: Array<CclCallParam> = params.map(param => {\n if (typeof param === 'string') {\n return { type: 'string', param: param };\n } else if (typeof param === 'number') {\n return { type: 'number', param: param };\n } else if (typeof param === 'object' && param.param && param.type) {\n return param;\n } else {\n throw new Error(\n `Invalid parameter type. Expected string, number, or a valid CclCallParam object. Received ${typeof param}`\n );\n }\n });\n\n const finalParams = excludeMine\n ? [...processedParams]\n : [{ type: 'string', param: 'MINE' }, ...processedParams];\n\n const paramString = finalParams\n .map(({ type, param }) => (type === 'string' ? `'${param}'` : param))\n .join(',');\n\n return paramString;\n}\n","import { MPageEventReturn } from '.';\nimport { outsideOfPowerChartError } from '../utils';\n\n/**\n * Attempts to open a tab with the name given to the `tab` variable in a\n * patients chart given in the context of a given encounter.\n * @param {number} personId - The identifier for the patient to whom the note belongs.\n * Cerner context variable: PAT_PersonId.\n * @param {number} encounterId - The identifier for the encounter belonging to the patient where\n * this note will be launched. Cerner context variable: VIS_EncntrId.\n * @param tab The string which represents the tab to open\n * (case insensitive). Navigation will be made to the first\n * upper-level tab in the chart that that matches the `tab` string\n * If no match is found, then sub-tab names will be searched and\n * navigation made to the first sub-tab that matches\n * the `tab` string. If no matches are found, no navigation will occur.\n * @param quickAdd {boolean} - (optional) If true, will attempt to open the window\n * in a quick add mode. E.g. if the Orders tab is connected to it will\n * attempt to launch the Add Order window so long as Enhanced Navigation is\n * supported by your installation. Defaults to false.\n *\n * @documentation [APPLINK](https://wiki.cerner.com/display/public/MPDEVWIKI/APPLINK)\n */\nexport function openPatientTab(\n personId: number,\n encounterId: number,\n tab: string,\n quickAdd?: boolean\n): MPageEventReturn {\n let inPowerChart = true;\n const eventString = `/PERSONID=${personId} /ENCNTRID=${encounterId} /FIRSTTAB=^${tab.toUpperCase()}${\n quickAdd || false ? '+' : ''\n }^`;\n\n try {\n window.APPLINK(1, '$APP_APPNAME$', eventString);\n } catch (e) {\n if (outsideOfPowerChartError(e)) {\n inPowerChart = false;\n } else {\n throw e;\n }\n }\n return { eventString, inPowerChart };\n}\n","import { MPageEventReturn } from '.';\nimport { outsideOfPowerChartError } from '../utils';\n\n/**\n * Attempts to open a tab with the name given to the `tab` variable in at the chart organizer\n * level.\n * @param tab The string which represents the tab to open\n * (case insensitive). Navigation will be made to the first\n * upper-level tab in the chart that that matches the `tab` string\n * If no match is found, then sub-tab names will be searched and\n * navigation made to the first sub-tab that matches\n * the `tab` string. If no matches are found, no navigation will occur.\n *\n * @documentation [APPLINK](https://wiki.cerner.com/display/public/MPDEVWIKI/APPLINK)\n */\nexport function openOrganizerTab(tab: string): MPageEventReturn {\n let inPowerChart = true;\n const eventString = `/ORGANIZERTAB=^${tab}^`;\n try {\n window.APPLINK(0, 'Powerchart.exe', eventString);\n } catch (e) {\n if (outsideOfPowerChartError(e)) {\n inPowerChart = false;\n } else {\n throw e;\n }\n }\n return { eventString, inPowerChart };\n}\n","/**\n * A type for the options that can be passed to the makeMpageOrder function.\n * @action `launch moew` - Launches the MOEW.\n * @action `activate existing` - Activates an existing order.\n * @action `cancel-discontinue` - Cancels and discontinues an existing order.\\n\n * @action `cancel-reorder` - Cancels and reorders an existing order.\n * @action `clear actions` - Clear actions of a future existing order.\n * @action `convert inpatient` - Converts a prescription order into an inpatient order.\n * @action `convert prescription` - Converts an inpatient order into a prescription.\n * @action `modify` - Modifies an existing future order.\n * @action `new order` - Creates a new order.\n * @action `renew` - Renews an existing non-prescription order.\n * @action `renew prescription` - Renews an existing prescription order.\n * @action `copy existing` - Copy an existing order.\n * @action `resume` - Resumes an existing order.\n * @action `suspend` - Suspends an existing order.\n *\n * @documentation [MPAGES_EVENT - ORDER](https://wiki.cerner.com/display/public/MPDEVWIKI/MPAGES_EVENT+-+ORDERS)\n */\nexport type OrderAction =\n | 'launch moew'\n | 'activate existing'\n | 'cancel-discontinue'\n | 'cancel-reorder'\n | 'clear actions'\n | 'convert inpatient'\n | 'convert prescription'\n | 'modify'\n | 'new order'\n | 'renew'\n | 'renew prescription'\n | 'copy existing'\n | 'resume'\n | 'suspend';\n\n/**\n * @param `synonymId` - The Cerner synonym_id for the order to be generated.\n * @param `orderSentenceId` - (optional) The order sentence id to be associated with the new order.\n * This is an accompanied value to the synonymId and provides specificity to the order type.\n * @param `nomenclatureIds` - (optional) An array of nomenclature ids (identifiers for problems/diagnoses) to be associated with the new order.\n * @param `interaction` - (optional) Defines when an interaction between the provider and PowerChart takes place only at sign time, or impromptu.\n * @param `origination` - (optional) Defines the origination of the order as `satellite`, `prescription`, or `normal`.\n *\n * @documentation [MPAGES_EVENT - ORDER](https://wiki.cerner.com/display/public/MPDEVWIKI/MPAGES_EVENT+-+ORDERS)\n */\nexport type NewOrderStrOpts = {\n synonymId: number;\n orderSentenceId?: number;\n nomenclatureIds?: Array<number>;\n interactionCheck?: 'on sign' | 'default';\n origination?: 'satellite' | 'prescription' | 'normal';\n};\n\n/**\n * @param {number} orderId - (optional) The order id value for the order to activate.\n * @param {NewOrderOpts}newOrderOpts - (optional) The options for the new order.\n *\n * @documentation [MPAGES_EVENT - ORDER](https://wiki.cerner.com/display/public/MPDEVWIKI/MPAGES_EVENT+-+ORDERS)\n */\nexport type OrderStrOpts = {\n orderId?: number;\n newOrderOpts?: NewOrderStrOpts;\n};\n\n/**\n * Creates a new pipe-delimited MPage Order string.\n * @since 0.4.0\n * @param {OrderAction} action - The action to be performed on the order.\n * @param {OrderStrOpts} opts - (optional) The options for the order.\n * @returns {string} - A pipe-delimited string which can be integrated into an MPage Event for one or more orders.\n * @throws {Error} - If the action is not a valid order action.\n *\n * @documentation [MPAGES_EVENT - ORDER](https://wiki.cerner.com/display/public/MPDEVWIKI/MPAGES_EVENT+-+ORDERS)\n */\nexport const orderString = (\n action: OrderAction,\n opts?: OrderStrOpts\n): string => {\n const { orderId, newOrderOpts } = opts || {};\n const {\n synonymId,\n orderSentenceId,\n nomenclatureIds,\n interactionCheck: interaction,\n origination,\n } = newOrderOpts || {};\n\n let params: Array<string> = [orderActionMap.get(action)];\n\n const nids = nomenclatureIds || [];\n\n switch (action) {\n case 'launch moew':\n params = params.concat(['0', '0', '0', '0', '0']);\n break;\n case 'new order':\n if (!synonymId)\n throw new Error(`synonymId is required for the '${action}' action`);\n params = params.concat([\n `${synonymId}`,\n `${originationMap.get(origination) || 0}`,\n `${orderSentenceId || 0}`,\n nids.length > 1 ? `[${nids.join('|')}]` : `${nids[0] || 0}`,\n `${interactionMap.get(interaction) || 0}`,\n ]);\n break;\n default:\n if (!orderId)\n throw new Error(`orderId is required for the '${action}' action`);\n params = params.concat([`${orderId}`]);\n break;\n }\n\n return `{${params.join('|')}}`;\n};\n\nconst orderActionMap = new Map()\n .set('launch moew', 'ORDER')\n .set('activate existing', 'ACTIVATE')\n .set('cancel-discontinue', 'CANCEL DC')\n .set('cancel-reorder', 'CANCEL REORD')\n .set('clear actions', 'CLEAR')\n .set('convert inpatient', 'CONVERT_INPAT')\n .set('convert prescription', 'CONVERT_RX')\n .set('modify', 'MODIFY')\n .set('new order', 'ORDER')\n .set('renew', 'RENEW')\n .set('renew prescription', 'RENEW_RX')\n .set('copy existing', 'REPEAT')\n .set('resume', 'RESUME')\n .set('suspend', 'SUSPEND');\n\nconst originationMap = new Map()\n .set('satellite', '5')\n .set('prescription', '1')\n .set('normal', '0');\n\nconst interactionMap = new Map().set('on sign', '1').set('default', '0');\n","import { MPageEventReturn } from '.';\nimport {\n outsideOfPowerChartError,\n warnAttemptedOrdersOutsideOfPowerChart,\n} from '../utils';\n\nconst launchViewMap = new Map()\n .set('search', 8)\n .set('profile', 16)\n .set('signature', 32);\n\nconst tabsMap = new Map<string, { tab: number; display: number }>()\n .set('orders', { tab: 2, display: 0 })\n .set('power orders', { tab: 2, display: 127 })\n .set('medications', { tab: 3, display: 0 })\n .set('power medications', { tab: 3, display: 127 });\n\n/**\n * @action `targetTab` - (optional) Sets the tab to be displayed, with and without power orders.\n * If not provided, will default to `orders`, that is the orders tab with _PowerOrders_ disabled.\n * Any tab with the term _power_ in it will enable both _PowerOrders_ and _PowerPlans_ in _PowerChart_.\n * @action `launchView` - (optional) Sets the view to be displayed.If not provided,\n * will default to `search` view.\n * @action `signSilently` - (optional) Signs the orders silently. Orders are not signed silently by default.\n * @action `dryRun` - (optional) If set to true, will not submit the order.\n * @documentation [MPAGES_EVENT - ORDER](https://wiki.cerner.com/display/public/MPDEVWIKI/MPAGES_EVENT+-+ORDERS)\n * @warning Our internal testing suggests there is a _PowerChart_ bug relating to the use of power\n * orders. When making MPAGES_EVENT calls (which we do in this library through `submitOrders`)\n * in series with power orders enabled, the result was that some MPAGES_EVENT calls failed to be invoked.\n * Please keep this in mind when enabling this option. For our own use, we have disabled power orders when\n * using `submitOrders` in such a way that calls are made in series.\n */\nexport type SubmitOrderOpts = {\n targetTab?: 'orders' | 'power orders' | 'medications' | 'power medications';\n launchView?: 'search' | 'profile' | 'signature';\n signSilently?: boolean;\n dryRun?: boolean;\n};\n\n/**\n * Submit orders for a patient in a given encounter through the _Cerner PowerChart_ `MPAGES_EVENT` function.\n * By default, _PowerPlans_ are disabled (potential bug in _PowerChart_), _PowerOrders_ are disabled,\n * the target tab is set to orders, and will launch to the signature view.\n * @param {number} personId - The identifier for the patient to whom the note belongs.\n * Cerner context variable: PAT_PersonId.\n * @param {number} encounterId - The identifier for the encounter belonging to the patient where\n * this note will be launched. Cerner context variable: VIS_EncntrId.\n * @param orders - The orders to be submitted. Orders are given in the form of a a series of pipe-delimited\n * parameters as specified in the `MPAGES_EVENT` documentation (below). Use the `fluent-cerner-js` library's\n * `orderString` function to simplify building these pipe-delimited order strings.\n * @param opts - (optional) User defined options for the order submission event. The options allow for\n * changing the target tab, the view to be launched, and whether or not the orders should be signed silently.\n * @returns an object with the order `eventString` and a boolean flag set to notify the user if\n * the attempt was made outside of PowerChart, `inPowerChart`.\n *\n * @documentation [MPAGES_EVENT - ORDER](https://wiki.cerner.com/display/public/MPDEVWIKI/MPAGES_EVENT+-+ORDERS)\n */\nexport const submitOrders = (\n personId: number,\n encounterId: number,\n orders: Array<string>,\n opts?: SubmitOrderOpts\n): MPageEventReturn => {\n let { targetTab, launchView, signSilently, dryRun } = opts || {};\n if (!targetTab) targetTab = 'orders';\n if (!launchView) launchView = 'signature';\n const enablePowerPlans =\n targetTab === 'power orders' || targetTab === 'power medications';\n\n let inPowerChart = true;\n\n let params: Array<string> = [\n `${personId}`,\n `${encounterId}`,\n orders.join(''),\n ];\n\n params.push(enablePowerPlans ? '24' : '0');\n\n const { tab, display } = tabsMap.get(targetTab) || { tab: 2, display: 127 };\n params.push(`{${tab}|${display}}`);\n\n params.push(`${launchViewMap.get(launchView) || 32}`);\n\n params.push(`${signSilently ? '1' : '0'}`);\n\n const eventString = params.join('|');\n\n if (dryRun) return { eventString, inPowerChart };\n\n try {\n window.MPAGES_EVENT('ORDERS', eventString);\n } catch (e) {\n if (outsideOfPowerChartError(e)) {\n inPowerChart = false;\n warnAttemptedOrdersOutsideOfPowerChart(eventString);\n } else {\n throw e;\n }\n }\n return { eventString, inPowerChart };\n};\n","import { MPageOrder } from '.';\nimport {\n outsideOfPowerChartError,\n warnAttemptedOrdersOutsideOfPowerChart,\n} from './utils';\n\nclass MPageOrderEvent {\n private _orders: Array<MPageOrder>;\n getOrders = () => this._orders;\n\n private _tabList: { tab: number; tabDisplayFlag: number } = {\n tab: 0,\n tabDisplayFlag: 0,\n };\n getTabList = () => this._tabList;\n\n private _personId: number = 0;\n getPersonId = () => this._personId;\n\n private _encounterId: number = 0;\n getEncounterId = () => this._encounterId;\n\n private _powerPlanFlag: number = 0;\n getPowerPlanFlag = () => this._powerPlanFlag;\n\n private _defaultDisplay: number = 0;\n getDefaultDisplay = () => this._defaultDisplay;\n\n private _silentSignFlag: number = 0;\n getSilentSignFlag = () => this._silentSignFlag;\n\n constructor() {\n this._orders = [];\n this._tabList = { tab: 0, tabDisplayFlag: 0 };\n // Disable PowerPlans by default\n this._powerPlanFlag = 0;\n // Disable PowerOrders by default\n this._tabList.tabDisplayFlag = 0;\n this.customizeOrderListProfile();\n this.launchOrderProfile();\n // Do NOT sign silently by default\n this._silentSignFlag = 0;\n }\n\n forPerson(id: number) {\n this._personId = id;\n return this;\n }\n\n forEncounter(id: number) {\n this._encounterId = id;\n return this;\n }\n\n addOrders(orders: Array<MPageOrder> | MPageOrder) {\n if (!Array.isArray(orders)) {\n orders = [orders];\n }\n this._orders = this._orders.concat(orders);\n return this;\n }\n\n enablePowerPlans() {\n this._powerPlanFlag = 24;\n return this;\n }\n\n customizeOrderListProfile() {\n this._tabList.tab = 2;\n return this;\n }\n\n customizeMedicationListProfile() {\n this._tabList.tab = 3;\n return this;\n }\n\n enablePowerOrders() {\n this._tabList.tabDisplayFlag = 127;\n return this;\n }\n\n launchOrderSearch() {\n this._defaultDisplay = 8;\n return this;\n }\n\n launchOrderProfile() {\n this._defaultDisplay = 16;\n return this;\n }\n\n launchOrdersForSignature() {\n this._defaultDisplay = 32;\n return this;\n }\n\n signSilently() {\n this._silentSignFlag = 1;\n return this;\n }\n\n send() {\n try {\n window.MPAGES_EVENT('ORDERS', this.toString());\n } catch (e) {\n if (outsideOfPowerChartError(e)) {\n warnAttemptedOrdersOutsideOfPowerChart(this.toString());\n } else {\n throw e;\n }\n }\n }\n\n toString(): string {\n const head = `${this._personId}|${this._encounterId}|`;\n let body: string = '';\n this._orders.forEach(order => {\n body += order.toString();\n });\n const tail = `|${this._powerPlanFlag}|{${this._tabList.tab}|${this._tabList.tabDisplayFlag}}|${this._defaultDisplay}|${this._silentSignFlag}`;\n\n return `${head}${body}${tail}`;\n }\n}\n\nexport { MPageOrderEvent };\n","/**\n * Options for a new order\n * @param {boolean} isRxOrder Marks the order order as a prescription. Is mutually exclusive from\n * isSatelliteOrder. Field will be set to false if left undefined; this resolves to 0 when built.\n * @param {boolean} isSatelliteOrder Moarks the order origination as satellite. Is mutually\n * exclusive from isRxOrder. Field will be set to false if left undefined; this resolves to 0 when built.\n * @param {number} orderSentenceId The optional Cerner order_sentence_id to be associated with\n * the new order. Field will be set to 0 if undefined.\n * @param {number} nomenclatureId The optional Cerner nomenclature_id to be associated with the\n * new order. Field will be set to 0 if undefined.\n * @param {boolean} skipInteractionCheckUntilSign Determines cerner sign-time interaction\n * checking. A value of true skips checking for interactions until orders are signed, false\n * will not. Field will be set to false if left undefined; this resolves to 0 when built.\n */\nexport type NewOrderOpts = {\n isRxOrder?: boolean;\n isSatelliteOrder?: boolean;\n orderSentenceId?: number;\n nomenclatureId?: number;\n skipInteractionCheckUntilSign?: boolean;\n};\n\nexport class MPageOrder {\n private _orderAction: string = '';\n getOrderAction = () => this._orderAction;\n\n private _orderId: number = 0;\n getOrderId = () => this._orderId;\n\n private _synonymId: number = 0;\n getSynonymId = () => this._synonymId;\n\n private _orderOrigination: number = 0;\n getOrderOrigination = () => this._orderOrigination;\n\n private _orderSentenceId: number = 0;\n getOrderSentenceId = () => this._orderSentenceId;\n\n private _nomenclatureId: number = 0;\n getNomenclatureId = () => this._nomenclatureId;\n\n private _signTimeInteraction: number = 0;\n getSignTimeInteraction = () => this._signTimeInteraction;\n\n /**\n * Creates a new MPageOrder with the order action 'ACTIVATE', which is the prototype for activating an existing future order.\n *\n * @since 0.1.0\n * @category MPage Events - Orders\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willActivate(orderId: number) {\n this._orderAction = 'ACTIVATE';\n this._orderId = orderId;\n return this;\n }\n /**\n * Creates a new MPageOrder with the order action 'CANCEL DC', which is the prototype for canceling and discontinuing an existing future order.\n *\n * @since 0.1.0\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willCancelDiscontinue(orderId: number) {\n this._orderAction = 'CANCEL DC';\n this._orderId = orderId;\n return this;\n }\n /**\n * Creates a new MPageOrder with the order action 'CANCEL REORD', which is the prototype for cancelling and reordering an existing future order.\n *\n * @since 0.1.0\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willCancelReorder(orderId: number) {\n this._orderAction = 'CANCEL REORD';\n this._orderId = orderId;\n return this;\n }\n /**\n * Creates a new MPageOrder with the order action 'CLEAR', which is the prototype for clearing actions of an existing future order.\n *\n * @since 0.1.0\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willClear(orderId: number) {\n this._orderAction = 'CLEAR';\n this._orderId = orderId;\n return this;\n }\n /**\n * Creates a new MPageOrder with the order action 'CONVERT_INPAT', which is the prototype for converting a prescription order into an inpatient order.\n *\n * @since 0.1.0\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willConvertInpatient(orderId: number) {\n this._orderAction = 'CONVERT_INPAT';\n this._orderId = orderId;\n return this;\n }\n /**\n * Creates a new MPageOrder with the order action 'CONVERT_RX', which is the prototype for converting an inpatient order into a prescription.\n *\n * @since 0.1.0\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willConvertToPrescriptionOrder(orderId: number) {\n this._orderAction = 'CONVERT_RX';\n this._orderId = orderId;\n return this;\n }\n /**\n * Creates a new MPageOrder with the order action 'MODIFY', which is the prototype for modifying an existing future order.\n *\n * @since 0.1.0\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willModify(orderId: number) {\n this._orderAction = 'MODIFY';\n this._orderId = orderId;\n return this;\n }\n /**\n * Creates a new MPage Order with order action 'ORDER'.\n *\n * @since 0.1.0\n * @category MPage Events - Orders\n * @param {number} synonymId The Cerner synonym_id to be associated with the new order. Must be set.\n * @param {NewOrderOpts} options required when making a new order\n * @returns {this} Returns itself to continue chaining method calls.\n * default to a normal order type.\n * @throws Error if `isRxOrder` and `isSatelliteOrder` are both set to true. These two are mutually exclusive and setting\n * both creates underfined behavior with respect the order origination field.\n * @example\n * m.willMakeNewOrder(34, true, 13, 42, true).toString() => \"{'ORDER'|34|5|1342|1}\"\n */\n willMakeNewOrder(synonymId: number, opts?: NewOrderOpts) {\n const {\n isRxOrder,\n isSatelliteOrder,\n orderSentenceId,\n nomenclatureId,\n skipInteractionCheckUntilSign,\n } = opts || {};\n\n if (isRxOrder && isSatelliteOrder)\n throw new Error('must select either isRxOrder or isSatelliteOrder');\n this._orderAction = 'ORDER';\n this._synonymId = synonymId;\n this._orderSentenceId = orderSentenceId || 0;\n this._nomenclatureId = nomenclatureId || 0;\n this._signTimeInteraction = skipInteractionCheckUntilSign ? 1 : 0;\n this._orderOrigination = isSatelliteOrder ? 5 : isRxOrder ? 1 : 0;\n\n return this;\n }\n\n /**\n * Creates a new MPageOrder with the order action 'RENEW', which is the prototype for reviewing an existing non-prescription order.\n *\n * @since 0.1.0\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willRenewNonPrescription(orderId: number) {\n this._orderAction = 'RENEW';\n this._orderId = orderId;\n return this;\n }\n /**\n * Creates a new MPageOrder with the order action 'RENEW_RX', which is the prototype for renewing an existing prescription order.\n *\n * @since 0.1.0\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willRenewPrescription(orderId: number) {\n this._orderAction = 'RENEW_RX';\n this._orderId = orderId;\n return this;\n }\n /**\n * Creates a new MPageOrder with the order action 'REPEAT', which is the prototype for copying an order.\n *\n * @since 0.1.0\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willCopyExistingOrder(orderId: number) {\n this._orderAction = 'REPEAT';\n this._orderId = orderId;\n return this;\n }\n /**\n * Creates a new MPageOrder with the order action 'RESUME', which is the prototype for resuming a suspended order.\n *\n * @since 0.1.0\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willResumeSuspendedOrder(orderId: number) {\n this._orderAction = 'RESUME';\n this._orderId = orderId;\n return this;\n }\n /**\n * Creates a new MPageOrder with the order action 'SUSPEND', which is the prototype for suspending an existing order.\n *\n * @since 0.1.0\n * @param {number} orderId The order id value for the order to activate.\n * @returns {this} Returns itself to continue chaining method calls.\n */\n willSuspend(orderId: number) {\n this._orderAction = 'SUSPEND';\n this._orderId = orderId;\n return this;\n }\n\n /**\n * Overrides the toString() method for representing the objects internal state as a string.\n *\n * @since 0.1.0\n * @returns {string} string representation of MPageOrder's internal state\n */\n toString(): string {\n return this._orderAction === 'ORDER'\n ? `{${this._orderAction}|${this._synonymId}|${this._orderOrigination}|${this._orderSentenceId}|${this._nomenclatureId}|${this._signTimeInteraction}}`\n : `{${this._orderAction}|${this._orderId}}`;\n }\n}\n"],"names":["composeXmlCclReqRejectMsg","req","prg","params","status","readyState","responseText","processXmlCclReqResponseText","rt","trim","undefined","outsideOfPowerChartError","e","TypeError","message","ReferenceError","warnAttemptedOrdersOutsideOfPowerChart","eventString","console","warn","launchClinicalNote","opts","personId","encounterId","eventIds","windowTitle","viewOptionFlags","_ref","inheritanceProps","viewName","viewSeq","compName","compSeq","inPowerChart","_viewOptsFlags","length","push","join","calculateViewOptionFlag","window","MPAGES_EVENT","total","forEach","flag","launchPowerForm","target","targetId","permissions","Error","launchPowerNote","readyStateMap","Map","set","statusCodeMap","makeCclRequest","excludeMine","paramsList","processCclRequestParams","Promise","resolve","reject","request","XMLCclRequest","open","send","onreadystatechange","get","statusText","data","JSON","parse","response","meta","statusDetails","prgName","url","prgArguments","requestText","__original","processedParams","map","param","type","finalParams","concat","paramString","openPatientTab","tab","quickAdd","toUpperCase","APPLINK","openOrganizerTab","orderString","action","orderId","newOrderOpts","_ref2","synonymId","orderSentenceId","nomenclatureIds","interaction","interactionCheck","origination","orderActionMap","nids","originationMap","interactionMap","launchViewMap","tabsMap","display","submitOrders","orders","targetTab","launchView","signSilently","dryRun","enablePowerPlans","MPageOrderEvent","_this","_orders","tabDisplayFlag","_tabList","_personId","_encounterId","_powerPlanFlag","_defaultDisplay","_silentSignFlag","customizeOrderListProfile","launchOrderProfile","_proto","prototype","forPerson","id","forEncounter","addOrders","Array","isArray","customizeMedicationListProfile","enablePowerOrders","launchOrderSearch","launchOrdersForSignature","toString","head","body","order","tail","MPageOrder","_orderAction","_orderId","_synonymId","_orderOrigination","_orderSentenceId","_nomenclatureId","_signTimeInteraction","willActivate","willCancelDiscontinue","willCancelReorder","willClear","willConvertInpatient","willConvertToPrescriptionOrder","willModify","willMakeNewOrder","isRxOrder","isSatelliteOrder","nomenclatureId","skipInteractionCheckUntilSign","willRenewNonPrescription","willRenewPrescription","willCopyExistingOrder","willResumeSuspendedOrder","willSuspend"],"mappings":";;;;AAAA;;;;;;;AAOO,IAAMA,yBAAyB,GAAG,SAA5BA,yBAAyBA,CACpCC,GAAkB,EAClBC,GAAW,EACXC,MAAc;EAEd,IAAQC,MAAM,GAA+BH,GAAG,CAAxCG,MAAM;IAAEC,UAAU,GAAmBJ,GAAG,CAAhCI,UAAU;IAAEC,YAAY,GAAKL,GAAG,CAApBK,YAAY;EACxC,8BAA4BF,MAAM,wBAAmBC,UAAU,YAAO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MAY,QAAQ,GAAR,SAAAA;IACE,OAAO,IAAI,CAACM,YAAY,KAAK,OAAO,SAC5B,IAAI,CAACA,YAAY,SAAI,IAAI,CAACE,UAAU,SAAI,IAAI,CAACC,iBAAiB,SAAI,IAAI,CAACC,gBAAgB,SAAI,IAAI,CAACC,eAAe,SAAI,IAAI,CAACC,oBAAoB,eAC5I,IAAI,CAACN,YAAY,SAAI,IAAI,CAACC,QAAQ,MAAG;GAC9C;EAAA,OAAAF,UAAA;AAAA;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";function t(t){return t instanceof TypeError&&"window.MPAGES_EVENT is not a function"===t.message||t instanceof TypeError&&"window.XMLCclRequest is not a function"===t.message||t instanceof TypeError&&"window.APPLINK is not a function"===t.message||t instanceof ReferenceError&&"window is not defined"===t.message}Object.defineProperty(exports,"__esModule",{value:!0});var e=function(t){console.warn("window.MPAGES_EVENT('ORDERS', '"+t+"')")},r=new Map;r.set(0,"uninitialized"),r.set(1,"loading"),r.set(2,"loaded"),r.set(3,"interactive"),r.set(4,"completed");var n=new Map;n.set(200,"success"),n.set(405,"method not allowed"),n.set(409,"invalid state"),n.set(492,"non-fatal error"),n.set(493,"memory error"),n.set(500,"internal server exception");var i=(new Map).set("launch moew","ORDER").set("activate existing","ACTIVATE").set("cancel-discontinue","CANCEL DC").set("cancel-reorder","CANCEL REORD").set("clear actions","CLEAR").set("convert inpatient","CONVERT_INPAT").set("convert prescription","CONVERT_RX").set("modify","MODIFY").set("new order","ORDER").set("renew","RENEW").set("renew prescription","RENEW_RX").set("copy existing","REPEAT").set("resume","RESUME").set("suspend","SUSPEND"),o=(new Map).set("satellite","5").set("prescription","1").set("normal","0"),s=(new Map).set("on sign","1").set("default","0"),a=(new Map).set("search",8).set("profile",16).set("signature",32),c=(new Map).set("orders",{tab:2,display:0}).set("power orders",{tab:2,display:127}).set("medications",{tab:3,display:0}).set("power medications",{tab:3,display:127}),d=function(){function r(){var t=this;this.getOrders=function(){return t._orders},this._tabList={tab:0,tabDisplayFlag:0},this.getTabList=function(){return t._tabList},this._personId=0,this.getPersonId=function(){return t._personId},this._encounterId=0,this.getEncounterId=function(){return t._encounterId},this._powerPlanFlag=0,this.getPowerPlanFlag=function(){return t._powerPlanFlag},this._defaultDisplay=0,this.getDefaultDisplay=function(){return t._defaultDisplay},this._silentSignFlag=0,this.getSilentSignFlag=function(){return t._silentSignFlag},this._orders=[],this._tabList={tab:0,tabDisplayFlag:0},this._powerPlanFlag=0,this._tabList.tabDisplayFlag=0,this.customizeOrderListProfile(),this.launchOrderProfile(),this._silentSignFlag=0}var n=r.prototype;return n.forPerson=function(t){return this._personId=t,this},n.forEncounter=function(t){return this._encounterId=t,this},n.addOrders=function(t){return Array.isArray(t)||(t=[t]),this._orders=this._orders.concat(t),this},n.enablePowerPlans=function(){return this._powerPlanFlag=24,this},n.customizeOrderListProfile=function(){return this._tabList.tab=2,this},n.customizeMedicationListProfile=function(){return this._tabList.tab=3,this},n.enablePowerOrders=function(){return this._tabList.tabDisplayFlag=127,this},n.launchOrderSearch=function(){return this._defaultDisplay=8,this},n.launchOrderProfile=function(){return this._defaultDisplay=16,this},n.launchOrdersForSignature=function(){return this._defaultDisplay=32,this},n.signSilently=function(){return this._silentSignFlag=1,this},n.send=function(){try{window.MPAGES_EVENT("ORDERS",this.toString())}catch(r){if(!t(r))throw r;e(this.toString())}},n.toString=function(){var t=this._personId+"|"+this._encounterId+"|",e="";return this._orders.forEach((function(t){e+=t.toString()})),""+t+e+"|"+this._powerPlanFlag+"|{"+this._tabList.tab+"|"+this._tabList.tabDisplayFlag+"}|"+this._defaultDisplay+"|"+this._silentSignFlag},r}();exports.MPageOrder=function(){function t(){var t=this;this._orderAction="",this.getOrderAction=function(){return t._orderAction},this._orderId=0,this.getOrderId=function(){return t._orderId},this._synonymId=0,this.getSynonymId=function(){return t._synonymId},this._orderOrigination=0,this.getOrderOrigination=function(){return t._orderOrigination},this._orderSentenceId=0,this.getOrderSentenceId=function(){return t._orderSentenceId},this._nomenclatureId=0,this.getNomenclatureId=function(){return t._nomenclatureId},this._signTimeInteraction=0,this.getSignTimeInteraction=function(){return t._signTimeInteraction}}var e=t.prototype;return e.willActivate=function(t){return this._orderAction="ACTIVATE",this._orderId=t,this},e.willCancelDiscontinue=function(t){return this._orderAction="CANCEL DC",this._orderId=t,this},e.willCancelReorder=function(t){return this._orderAction="CANCEL REORD",this._orderId=t,this},e.willClear=function(t){return this._orderAction="CLEAR",this._orderId=t,this},e.willConvertInpatient=function(t){return this._orderAction="CONVERT_INPAT",this._orderId=t,this},e.willConvertToPrescriptionOrder=function(t){return this._orderAction="CONVERT_RX",this._orderId=t,this},e.willModify=function(t){return this._orderAction="MODIFY",this._orderId=t,this},e.willMakeNewOrder=function(t,e){var r=e||{},n=r.isRxOrder,i=r.isSatelliteOrder,o=r.orderSentenceId,s=r.nomenclatureId,a=r.skipInteractionCheckUntilSign;if(n&&i)throw new Error("must select either isRxOrder or isSatelliteOrder");return this._orderAction="ORDER",this._synonymId=t,this._orderSentenceId=o||0,this._nomenclatureId=s||0,this._signTimeInteraction=a?1:0,this._orderOrigination=i?5:n?1:0,this},e.willRenewNonPrescription=function(t){return this._orderAction="RENEW",this._orderId=t,this},e.willRenewPrescription=function(t){return this._orderAction="RENEW_RX",this._orderId=t,this},e.willCopyExistingOrder=function(t){return this._orderAction="REPEAT",this._orderId=t,this},e.willResumeSuspendedOrder=function(t){return this._orderAction="RESUME",this._orderId=t,this},e.willSuspend=function(t){return this._orderAction="SUSPEND",this._orderId=t,this},e.toString=function(){return"ORDER"===this._orderAction?"{"+this._orderAction+"|"+this._synonymId+"|"+this._orderOrigination+"|"+this._orderSentenceId+"|"+this._nomenclatureId+"|"+this._signTimeInteraction+"}":"{"+this._orderAction+"|"+this._orderId+"}"},t}(),exports.MPageOrderEvent=d,exports.launchClinicalNote=function(e){var r=e.windowTitle,n=e.viewOptionFlags,i=e.inheritanceProps||{},o=i.viewName,s=i.viewSeq,a=i.compName,c=i.compSeq,d=!0,u=[""+e.personId,""+e.encounterId],h=n&&0!==n.length?n:["view-only"];u.push("["+e.eventIds.join("|")+"]"),u.push(""+r),u.push(""+function(t){var e=0;return t.forEach((function(t){"menu"===t&&(e+=1),"buttons"===t&&(e+=2),"toolbar"===t&&(e+=4),"calculator"===t&&(e+=8),"view-only"===t&&(e+=16)})),e}(h)),u.push(""+(o||"")),u.push(""+(s||"")),u.push(""+(a||"")),u.push(""+(c||""));var l=""+u.join("|");try{window.MPAGES_EVENT("CLINICALNOTE",l)}catch(e){if(!t(e))throw e;d=!1,console.warn("window.MPAGES_EVENT('CLINICALNOTE', '"+l+"')")}return{inPowerChart:d,eventString:l}},exports.launchPowerForm=function(e){var r=e.personId,n=e.encounterId,i=e.target,o=e.targetId,s=e.permissions;if(("new form"===i||"completed form"===i)&&!o)throw new Error("'targetId' is required for 'new form' and 'completed form' targets.");var a=[""+r,""+n];"new form"===i&&(a.push(""+o),a.push("0")),"completed form"===i&&(a.push("0"),a.push(""+o)),"new form search"===i&&(a.push("0"),a.push("0")),a.push("modify"===s?"0":"1");var c=!0,d=""+a.join("|");try{window.MPAGES_EVENT("POWERFORM",d)}catch(e){if(!t(e))throw e;c=!1,console.warn("window.MPAGES_EVENT('POWERFORM', '"+d+"')")}return{inPowerChart:c,eventString:d}},exports.launchPowerNote=function(e){var r=e.personId,n=e.encounterId,i=e.target,o=e.targetId;if("new"===i&&"string"!=typeof o)throw new Error("CKI must be a string when launching a new PowerNote.");if("existing"===i&&"number"!=typeof o)throw new Error("eventId must be a number when loading an existing PowerNote.");var s=""+[""+r,""+n,""+("new"===i?o:""),""+("existing"===i?o:0)].join("|"),a=!0;try{window.MPAGES_EVENT("POWERNOTE",s)}catch(e){if(!t(e))throw e;a=!1,console.warn("window.MPAGES_EVENT('POWERNOTE', '"+s+"')")}return{eventString:s,inPowerChart:a}},exports.makeCclRequest=function(e){var i,o=e.prg,s=(i=(i=e.params)||[],(e.excludeMine?[].concat(i):[{type:"string",param:"MINE"}].concat(i)).map((function(t){var e=t.param;return"string"===t.type?"'"+e+"'":e})).join(","));return new Promise((function(e,i){try{var a=window.XMLCclRequest();a.open("GET",""+o),a.send(s),a.onreadystatechange=function(){if("completed"===r.get(a.readyState)){var t=n.get(a.status),c=function(t){var e=t.trim();return""===e?void 0:e}(a.responseText),d=c&&JSON.parse(c);"success"===t?e({meta:{responseText:c||"no response text",status:a.status,statusText:t||"status refers to unknown error"},data:d}):i(function(t,e,r){return"error with status "+t.status+" and readyState "+t.readyState+" on "+e+" with params "+r+" returning response text: "+(t.responseText||"no response text")}(a,o,s))}}}catch(e){if(!t(e))throw e;i(e.message)}}))},exports.openOrganizerTab=function(e){var r=!0,n="/ORGANIZERTAB=^"+e+"^";try{window.APPLINK(0,"Powerchart.exe",n)}catch(e){if(!t(e))throw e;r=!1}return{eventString:n,inPowerChart:r}},exports.openPatientTab=function(e,r,n,i){var o=!0,s="/PERSONID="+e+" /ENCNTRID="+r+" /FIRSTTAB=^"+n.toUpperCase()+(i?"+":"")+"^";try{window.APPLINK(1,"$APP_APPNAME$",s)}catch(e){if(!t(e))throw e;o=!1}return{eventString:s,inPowerChart:o}},exports.orderString=function(t,e){var r=e||{},n=r.orderId,a=r.newOrderOpts||{},c=a.synonymId,d=a.orderSentenceId,u=a.nomenclatureIds,h=a.interactionCheck,l=a.origination,w=[i.get(t)],p=u||[];switch(t){case"launch moew":w=w.concat(["0","0","0","0","0"]);break;case"new order":if(!c)throw new Error("synonymId is required for the '"+t+"' action");w=w.concat([""+c,""+(o.get(l)||0),""+(d||0),p.length>1?"["+p.join("|")+"]":""+(p[0]||0),""+(s.get(h)||0)]);break;default:if(!n)throw new Error("orderId is required for the '"+t+"' action");w=w.concat([""+n])}return"{"+w.join("|")+"}"},exports.submitOrders=function(r,n,i,o){var s=o||{},d=s.targetTab,u=s.launchView,h=s.signSilently,l=s.dryRun;d||(d="orders"),u||(u="signature");var w="power orders"===d||"power medications"===d,p=!0,f=[""+r,""+n,i.join("")];f.push(w?"24":"0");var _=c.get(d)||{tab:2,display:127};f.push("{"+_.tab+"|"+_.display+"}"),f.push(""+(a.get(u)||32)),f.push(h?"1":"0");var g=f.join("|");if(l)return{eventString:g,inPowerChart:p};try{window.MPAGES_EVENT("ORDERS",g)}catch(r){if(!t(r))throw r;p=!1,e(g)}return{eventString:g,inPowerChart:p}};
|
|
1
|
+
"use strict";function t(t){return t instanceof TypeError&&"window.MPAGES_EVENT is not a function"===t.message||t instanceof TypeError&&"window.XMLCclRequest is not a function"===t.message||t instanceof TypeError&&"window.APPLINK is not a function"===t.message||t instanceof ReferenceError&&"window is not defined"===t.message}Object.defineProperty(exports,"__esModule",{value:!0});var e=function(t){console.warn("window.MPAGES_EVENT('ORDERS', '"+t+"')")},r=new Map;r.set(0,"uninitialized"),r.set(1,"loading"),r.set(2,"loaded"),r.set(3,"interactive"),r.set(4,"completed");var n=new Map;n.set(200,"success"),n.set(405,"method not allowed"),n.set(409,"invalid state"),n.set(492,"non-fatal error"),n.set(493,"memory error"),n.set(500,"internal server exception");var i=(new Map).set("launch moew","ORDER").set("activate existing","ACTIVATE").set("cancel-discontinue","CANCEL DC").set("cancel-reorder","CANCEL REORD").set("clear actions","CLEAR").set("convert inpatient","CONVERT_INPAT").set("convert prescription","CONVERT_RX").set("modify","MODIFY").set("new order","ORDER").set("renew","RENEW").set("renew prescription","RENEW_RX").set("copy existing","REPEAT").set("resume","RESUME").set("suspend","SUSPEND"),o=(new Map).set("satellite","5").set("prescription","1").set("normal","0"),s=(new Map).set("on sign","1").set("default","0"),a=(new Map).set("search",8).set("profile",16).set("signature",32),c=(new Map).set("orders",{tab:2,display:0}).set("power orders",{tab:2,display:127}).set("medications",{tab:3,display:0}).set("power medications",{tab:3,display:127}),u=function(){function r(){var t=this;this.getOrders=function(){return t._orders},this._tabList={tab:0,tabDisplayFlag:0},this.getTabList=function(){return t._tabList},this._personId=0,this.getPersonId=function(){return t._personId},this._encounterId=0,this.getEncounterId=function(){return t._encounterId},this._powerPlanFlag=0,this.getPowerPlanFlag=function(){return t._powerPlanFlag},this._defaultDisplay=0,this.getDefaultDisplay=function(){return t._defaultDisplay},this._silentSignFlag=0,this.getSilentSignFlag=function(){return t._silentSignFlag},this._orders=[],this._tabList={tab:0,tabDisplayFlag:0},this._powerPlanFlag=0,this._tabList.tabDisplayFlag=0,this.customizeOrderListProfile(),this.launchOrderProfile(),this._silentSignFlag=0}var n=r.prototype;return n.forPerson=function(t){return this._personId=t,this},n.forEncounter=function(t){return this._encounterId=t,this},n.addOrders=function(t){return Array.isArray(t)||(t=[t]),this._orders=this._orders.concat(t),this},n.enablePowerPlans=function(){return this._powerPlanFlag=24,this},n.customizeOrderListProfile=function(){return this._tabList.tab=2,this},n.customizeMedicationListProfile=function(){return this._tabList.tab=3,this},n.enablePowerOrders=function(){return this._tabList.tabDisplayFlag=127,this},n.launchOrderSearch=function(){return this._defaultDisplay=8,this},n.launchOrderProfile=function(){return this._defaultDisplay=16,this},n.launchOrdersForSignature=function(){return this._defaultDisplay=32,this},n.signSilently=function(){return this._silentSignFlag=1,this},n.send=function(){try{window.MPAGES_EVENT("ORDERS",this.toString())}catch(r){if(!t(r))throw r;e(this.toString())}},n.toString=function(){var t=this._personId+"|"+this._encounterId+"|",e="";return this._orders.forEach((function(t){e+=t.toString()})),""+t+e+"|"+this._powerPlanFlag+"|{"+this._tabList.tab+"|"+this._tabList.tabDisplayFlag+"}|"+this._defaultDisplay+"|"+this._silentSignFlag},r}();exports.MPageOrder=function(){function t(){var t=this;this._orderAction="",this.getOrderAction=function(){return t._orderAction},this._orderId=0,this.getOrderId=function(){return t._orderId},this._synonymId=0,this.getSynonymId=function(){return t._synonymId},this._orderOrigination=0,this.getOrderOrigination=function(){return t._orderOrigination},this._orderSentenceId=0,this.getOrderSentenceId=function(){return t._orderSentenceId},this._nomenclatureId=0,this.getNomenclatureId=function(){return t._nomenclatureId},this._signTimeInteraction=0,this.getSignTimeInteraction=function(){return t._signTimeInteraction}}var e=t.prototype;return e.willActivate=function(t){return this._orderAction="ACTIVATE",this._orderId=t,this},e.willCancelDiscontinue=function(t){return this._orderAction="CANCEL DC",this._orderId=t,this},e.willCancelReorder=function(t){return this._orderAction="CANCEL REORD",this._orderId=t,this},e.willClear=function(t){return this._orderAction="CLEAR",this._orderId=t,this},e.willConvertInpatient=function(t){return this._orderAction="CONVERT_INPAT",this._orderId=t,this},e.willConvertToPrescriptionOrder=function(t){return this._orderAction="CONVERT_RX",this._orderId=t,this},e.willModify=function(t){return this._orderAction="MODIFY",this._orderId=t,this},e.willMakeNewOrder=function(t,e){var r=e||{},n=r.isRxOrder,i=r.isSatelliteOrder,o=r.orderSentenceId,s=r.nomenclatureId,a=r.skipInteractionCheckUntilSign;if(n&&i)throw new Error("must select either isRxOrder or isSatelliteOrder");return this._orderAction="ORDER",this._synonymId=t,this._orderSentenceId=o||0,this._nomenclatureId=s||0,this._signTimeInteraction=a?1:0,this._orderOrigination=i?5:n?1:0,this},e.willRenewNonPrescription=function(t){return this._orderAction="RENEW",this._orderId=t,this},e.willRenewPrescription=function(t){return this._orderAction="RENEW_RX",this._orderId=t,this},e.willCopyExistingOrder=function(t){return this._orderAction="REPEAT",this._orderId=t,this},e.willResumeSuspendedOrder=function(t){return this._orderAction="RESUME",this._orderId=t,this},e.willSuspend=function(t){return this._orderAction="SUSPEND",this._orderId=t,this},e.toString=function(){return"ORDER"===this._orderAction?"{"+this._orderAction+"|"+this._synonymId+"|"+this._orderOrigination+"|"+this._orderSentenceId+"|"+this._nomenclatureId+"|"+this._signTimeInteraction+"}":"{"+this._orderAction+"|"+this._orderId+"}"},t}(),exports.MPageOrderEvent=u,exports.launchClinicalNote=function(e){var r=e.windowTitle,n=e.viewOptionFlags,i=e.inheritanceProps||{},o=i.viewName,s=i.viewSeq,a=i.compName,c=i.compSeq,u=!0,d=[""+e.personId,""+e.encounterId],h=n&&0!==n.length?n:["view-only"];d.push("["+e.eventIds.join("|")+"]"),d.push(""+r),d.push(""+function(t){var e=0;return t.forEach((function(t){"menu"===t&&(e+=1),"buttons"===t&&(e+=2),"toolbar"===t&&(e+=4),"calculator"===t&&(e+=8),"view-only"===t&&(e+=16)})),e}(h)),d.push(""+(o||"")),d.push(""+(s||"")),d.push(""+(a||"")),d.push(""+(c||""));var l=""+d.join("|");try{window.MPAGES_EVENT("CLINICALNOTE",l)}catch(e){if(!t(e))throw e;u=!1,console.warn("window.MPAGES_EVENT('CLINICALNOTE', '"+l+"')")}return{inPowerChart:u,eventString:l}},exports.launchPowerForm=function(e){var r=e.personId,n=e.encounterId,i=e.target,o=e.targetId,s=e.permissions;if(("new form"===i||"completed form"===i)&&!o)throw new Error("'targetId' is required for 'new form' and 'completed form' targets.");var a=[""+r,""+n];"new form"===i&&(a.push(""+o),a.push("0")),"completed form"===i&&(a.push("0"),a.push(""+o)),"new form search"===i&&(a.push("0"),a.push("0")),a.push("modify"===s?"0":"1");var c=!0,u=""+a.join("|");try{window.MPAGES_EVENT("POWERFORM",u)}catch(e){if(!t(e))throw e;c=!1,console.warn("window.MPAGES_EVENT('POWERFORM', '"+u+"')")}return{inPowerChart:c,eventString:u}},exports.launchPowerNote=function(e){var r=e.personId,n=e.encounterId,i=e.target,o=e.targetId;if("new"===i&&"string"!=typeof o)throw new Error("CKI must be a string when launching a new PowerNote.");if("existing"===i&&"number"!=typeof o)throw new Error("eventId must be a number when loading an existing PowerNote.");var s=""+[""+r,""+n,""+("new"===i?o:""),""+("existing"===i?o:0)].join("|"),a=!0;try{window.MPAGES_EVENT("POWERNOTE",s)}catch(e){if(!t(e))throw e;a=!1,console.warn("window.MPAGES_EVENT('POWERNOTE', '"+s+"')")}return{eventString:s,inPowerChart:a}},exports.makeCclRequest=function(e){var i=e.prg,o=function(t,e){e=e||!1;var r=(t=t||[]).map((function(t){if("string"==typeof t)return{type:"string",param:t};if("number"==typeof t)return{type:"number",param:t};if("object"==typeof t&&t.param&&t.type)return t;throw new Error("Invalid parameter type. Expected string, number, or a valid CclCallParam object. Received "+typeof t)}));return(e?[].concat(r):[{type:"string",param:"MINE"}].concat(r)).map((function(t){var e=t.param;return"string"===t.type?"'"+e+"'":e})).join(",")}(e.params,e.excludeMine||!1);return new Promise((function(e,s){try{var a=window.XMLCclRequest();a.open("GET",""+i),a.send(o),a.onreadystatechange=function(){if("completed"===r.get(a.readyState)){var t=n.get(a.status),c=function(t){var e=t.trim();return""===e?void 0:e}(a.responseText),u=c&&JSON.parse(c);"success"===t?e({meta:{responseText:c||"no response text",status:a.status,statusText:t||"status refers to unknown error",statusDetails:a.statusText,prgName:a.url,prgArguments:a.requestText,__original:a},data:u}):s(function(t,e,r){return"error with status "+t.status+" and readyState "+t.readyState+" on "+e+" with params "+r+" returning response text: "+(t.responseText||"no response text")}(a,i,o))}}}catch(e){if(!t(e))throw e;s(e.message)}}))},exports.openOrganizerTab=function(e){var r=!0,n="/ORGANIZERTAB=^"+e+"^";try{window.APPLINK(0,"Powerchart.exe",n)}catch(e){if(!t(e))throw e;r=!1}return{eventString:n,inPowerChart:r}},exports.openPatientTab=function(e,r,n,i){var o=!0,s="/PERSONID="+e+" /ENCNTRID="+r+" /FIRSTTAB=^"+n.toUpperCase()+(i?"+":"")+"^";try{window.APPLINK(1,"$APP_APPNAME$",s)}catch(e){if(!t(e))throw e;o=!1}return{eventString:s,inPowerChart:o}},exports.orderString=function(t,e){var r=e||{},n=r.orderId,a=r.newOrderOpts||{},c=a.synonymId,u=a.orderSentenceId,d=a.nomenclatureIds,h=a.interactionCheck,l=a.origination,p=[i.get(t)],w=d||[];switch(t){case"launch moew":p=p.concat(["0","0","0","0","0"]);break;case"new order":if(!c)throw new Error("synonymId is required for the '"+t+"' action");p=p.concat([""+c,""+(o.get(l)||0),""+(u||0),w.length>1?"["+w.join("|")+"]":""+(w[0]||0),""+(s.get(h)||0)]);break;default:if(!n)throw new Error("orderId is required for the '"+t+"' action");p=p.concat([""+n])}return"{"+p.join("|")+"}"},exports.submitOrders=function(r,n,i,o){var s=o||{},u=s.targetTab,d=s.launchView,h=s.signSilently,l=s.dryRun;u||(u="orders"),d||(d="signature");var p="power orders"===u||"power medications"===u,w=!0,f=[""+r,""+n,i.join("")];f.push(p?"24":"0");var g=c.get(u)||{tab:2,display:127};f.push("{"+g.tab+"|"+g.display+"}"),f.push(""+(a.get(d)||32)),f.push(h?"1":"0");var _=f.join("|");if(l)return{eventString:_,inPowerChart:w};try{window.MPAGES_EVENT("ORDERS",_)}catch(r){if(!t(r))throw r;w=!1,e(_)}return{eventString:_,inPowerChart:w}};
|
|
2
2
|
//# sourceMappingURL=fluent-cerner-js.cjs.production.min.js.map
|