@cc-openmrs/cc-esm-active-prescriptions 1.0.26 → 1.0.27
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/296.js +1 -1
- package/dist/385.js +1 -1
- package/dist/477.js +1 -1
- package/dist/91.js +1 -1
- package/dist/main.js +1 -1
- package/dist/openmrs-esm-template-app.js.buildmanifest.json +15 -15
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/index.ts +3 -18
- package/src/prescriptions-actions/prescriptions-action-button.component.tsx +19 -5
- package/src/prescriptions-actions/prescriptions-action-menu-item.component.tsx +0 -1
- package/src/root.component.tsx +7 -1
package/dist/296.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_cc_openmrs_cc_esm_active_prescriptions=globalThis.webpackChunk_cc_openmrs_cc_esm_active_prescriptions||[]).push([[296],{4296(e,t,r){r.r(t),r.d(t,{default:()=>s});var n=r(6072),c=r(3335),i=r(4424),o=r(2076),p=r(8150);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const s=function(e){var t=e.patientUuid,r=(0,o.useTranslation)().t,s=(0,n.useCallback)(function(){
|
|
1
|
+
"use strict";(globalThis.webpackChunk_cc_openmrs_cc_esm_active_prescriptions=globalThis.webpackChunk_cc_openmrs_cc_esm_active_prescriptions||[]).push([[296],{4296(e,t,r){r.r(t),r.d(t,{default:()=>s});var n=r(6072),c=r(3335),i=r(4424),o=r(2076),p=r(8150);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const s=function(e){var t=e.patientUuid,r=(0,o.useTranslation)().t,s=(0,n.useCallback)(function(){(0,i.launchWorkspace)("active-prescriptions-workspace",{patientUuid:t,contextKey:"patient/".concat(t)})},[t]),u=r("prescriptionsActionMenuItem","Active prescriptions");return n.createElement(p.ED,{getIcon:function(e){return n.createElement(c.KM,(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){a(e,t,r[t])})}return e}({},e),r=null!=(r={"aria-hidden":"true"})?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t));var t,r},handler:s,iconDescription:u,label:u,type:"active-prescriptions"})}}}]);
|
package/dist/385.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see 385.js.LICENSE.txt */
|
|
2
|
-
"use strict";(globalThis.webpackChunk_cc_openmrs_cc_esm_active_prescriptions=globalThis.webpackChunk_cc_openmrs_cc_esm_active_prescriptions||[]).push([[385],{6052(e,n,t){t.d(n,{A:()=>s});var a=t(2996),i=t.n(a),o=t(159),r=t.n(o)()(i());r.push([e.id,".-cc-esm-active-prescriptions__root__workspace___\\+xqk5{padding:2rem;display:flex;flex-direction:column;gap:1.5rem;background-color:var(--cds-layer, #ffffff);min-height:100%}.-cc-esm-active-prescriptions__root__header___G1X3T{display:flex;flex-direction:column;gap:.5rem}.-cc-esm-active-prescriptions__root__subtitle___kRieu{font-size:var(--cds-body-01-font-size, 0.875rem);font-weight:var(--cds-body-01-font-weight, 400);line-height:var(--cds-body-01-line-height, 1.42857);letter-spacing:var(--cds-body-01-letter-spacing, 0.16px);color:var(--cds-text-secondary, #525252);margin:0;max-width:48rem}.-cc-esm-active-prescriptions__root__section___61mCr{background-color:var(--cds-layer-accent, #f4f4f4);padding:1rem;border-radius:.25rem;box-shadow:0 1px 2px rgba(0,0,0,.08)}.-cc-esm-active-prescriptions__root__fieldLabel___F2zAd{font-size:var(--cds-heading-compact-01-font-size, 0.875rem);font-weight:var(--cds-heading-compact-01-font-weight, 600);line-height:var(--cds-heading-compact-01-line-height, 1.28572);letter-spacing:var(--cds-heading-compact-01-letter-spacing, 0.16px);margin-bottom:.5rem}.-cc-esm-active-prescriptions__root__tabContent___DnbmQ{padding:1rem 0 0;display:flex;flex-direction:column;gap:1.5rem}.-cc-esm-active-prescriptions__root__fieldGroup___3aiba{display:flex;flex-direction:column;gap:.5rem}.-cc-esm-active-prescriptions__root__helperText___sr2T2{font-size:var(--cds-label-01-font-size, 0.75rem);font-weight:var(--cds-label-01-font-weight, 400);line-height:var(--cds-label-01-line-height, 1.33333);letter-spacing:var(--cds-label-01-letter-spacing, 0.32px);color:var(--cds-text-secondary, #525252);margin:0}.-cc-esm-active-prescriptions__root__ordersList___jcCvy{border:1px solid var(--cds-border-subtle, #e0e0e0);border-radius:.25rem;padding:.75rem;display:flex;flex-direction:column;gap:.5rem;background-color:var(--cds-layer, #ffffff)}.-cc-esm-active-prescriptions__root__orderLabel___3oBY3{display:flex;flex-direction:column;align-items:flex-start;gap:.125rem}.-cc-esm-active-prescriptions__root__orderName___QGKUy{font-size:var(--cds-body-compact-01-font-size, 0.875rem);font-weight:var(--cds-body-compact-01-font-weight, 400);line-height:var(--cds-body-compact-01-line-height, 1.28572);letter-spacing:var(--cds-body-compact-01-letter-spacing, 0.16px);font-weight:600}.-cc-esm-active-prescriptions__root__orderMeta___S7cGO{font-size:var(--cds-label-01-font-size, 0.75rem);font-weight:var(--cds-label-01-font-weight, 400);line-height:var(--cds-label-01-line-height, 1.33333);letter-spacing:var(--cds-label-01-letter-spacing, 0.32px);color:var(--cds-text-secondary, #525252)}.-cc-esm-active-prescriptions__root__selectionSummary___TD9ka{font-size:var(--cds-label-01-font-size, 0.75rem);font-weight:var(--cds-label-01-font-weight, 400);line-height:var(--cds-label-01-line-height, 1.33333);letter-spacing:var(--cds-label-01-letter-spacing, 0.32px);color:var(--cds-text-secondary, #525252);margin:.25rem 0 0}","",{version:3,sources:["webpack://./src/root.scss","webpack://./node_modules/@carbon/layout/scss/generated/_spacing.scss","webpack://./node_modules/@carbon/type/scss/_styles.scss"],names:[],mappings:"AAGA,wDACE,YCqCW,CDpCX,YAAA,CACA,qBAAA,CACA,UC6BW,CD5BX,0CAAA,CACA,eAAA,CAGF,oDACE,YAAA,CACA,qBAAA,CACA,SCMW,CDHb,sDEg1BI,gDAAA,CAAA,+CAAA,CAAA,mDAAA,CAAA,wDAAA,CF90BF,wCAAA,CACA,QAAA,CACA,eAAA,CAGF,qDACE,iDAAA,CACA,YCIW,CDHX,oBCZW,CDaX,oCAAA,CAGF,wDEk0BI,2DAAA,CAAA,0DAAA,CAAA,8DAAA,CAAA,mEAAA,CFh0BF,mBCbW,CDgBb,wDACE,gBAAA,CACA,YAAA,CACA,qBAAA,CACA,UCLW,CDQb,wDACE,YAAA,CACA,qBAAA,CACA,SC1BW,CD6Bb,wDEgzBI,gDAAA,CAAA,gDAAA,CAAA,oDAAA,CAAA,yDAAA,CF9yBF,wCAAA,CACA,QAAA,CAGF,wDACE,kDAAA,CACA,oBC1CW,CD2CX,cCjCW,CDkCX,YAAA,CACA,qBAAA,CACA,SCzCW,CD0CX,0CAAA,CAGF,wDACE,YAAA,CACA,qBAAA,CACA,sBAAA,CACA,WC3DW,CD8Db,uDEyxBI,wDAAA,CAAA,uDAAA,CAAA,2DAAA,CAAA,gEAAA,CFvxBF,eAAA,CAGF,uDEoxBI,gDAAA,CAAA,gDAAA,CAAA,oDAAA,CAAA,yDAAA,CFlxBF,wCAAA,CAGF,8DE+wBI,gDAAA,CAAA,gDAAA,CAAA,oDAAA,CAAA,yDAAA,CF7wBF,wCAAA,CACA,iBAAA",sourcesContent:["@use '@carbon/layout';\n@use '@carbon/type';\n\n.workspace {\n padding: layout.$spacing-07;\n display: flex;\n flex-direction: column;\n gap: layout.$spacing-06;\n background-color: var(--cds-layer, #ffffff);\n min-height: 100%;\n}\n\n.header {\n display: flex;\n flex-direction: column;\n gap: layout.$spacing-03;\n}\n\n.subtitle {\n @include type.type-style('body-01');\n color: var(--cds-text-secondary, #525252);\n margin: 0;\n max-width: 48rem;\n}\n\n.section {\n background-color: var(--cds-layer-accent, #f4f4f4);\n padding: layout.$spacing-05;\n border-radius: layout.$spacing-02;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);\n}\n\n.fieldLabel {\n @include type.type-style('heading-compact-01');\n margin-bottom: layout.$spacing-03;\n}\n\n.tabContent {\n padding: layout.$spacing-05 0 0;\n display: flex;\n flex-direction: column;\n gap: layout.$spacing-06;\n}\n\n.fieldGroup {\n display: flex;\n flex-direction: column;\n gap: layout.$spacing-03;\n}\n\n.helperText {\n @include type.type-style('label-01');\n color: var(--cds-text-secondary, #525252);\n margin: 0;\n}\n\n.ordersList {\n border: 1px solid var(--cds-border-subtle, #e0e0e0);\n border-radius: layout.$spacing-02;\n padding: layout.$spacing-04;\n display: flex;\n flex-direction: column;\n gap: layout.$spacing-03;\n background-color: var(--cds-layer, #ffffff);\n}\n\n.orderLabel {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: layout.$spacing-01;\n}\n\n.orderName {\n @include type.type-style('body-compact-01');\n font-weight: 600;\n}\n\n.orderMeta {\n @include type.type-style('label-01');\n color: var(--cds-text-secondary, #525252);\n}\n\n.selectionSummary {\n @include type.type-style('label-01');\n color: var(--cds-text-secondary, #525252);\n margin: layout.$spacing-02 0 0;\n}\n","// Code generated by @carbon/layout. DO NOT EDIT.\n//\n// Copyright IBM Corp. 2018, 2023\n//\n// This source code is licensed under the Apache-2.0 license found in the\n// LICENSE file in the root directory of this source tree.\n//\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-01: 0.125rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-02: 0.25rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-03: 0.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-04: 0.75rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-05: 1rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-06: 1.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-07: 2rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-08: 2.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-09: 3rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-10: 4rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-11: 5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-12: 6rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-13: 10rem !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/layout\n$spacing: (\n spacing-01: $spacing-01,\n spacing-02: $spacing-02,\n spacing-03: $spacing-03,\n spacing-04: $spacing-04,\n spacing-05: $spacing-05,\n spacing-06: $spacing-06,\n spacing-07: $spacing-07,\n spacing-08: $spacing-08,\n spacing-09: $spacing-09,\n spacing-10: $spacing-10,\n spacing-11: $spacing-11,\n spacing-12: $spacing-12,\n spacing-13: $spacing-13,\n);\n","//\n// Copyright IBM Corp. 2018, 2023\n//\n// This source code is licensed under the Apache-2.0 license found in the\n// LICENSE file in the root directory of this source tree.\n//\n\n// stylelint-disable number-max-precision\n\n@use 'sass:map';\n@use 'sass:math';\n@use '@carbon/grid/scss/config' as gridconfig;\n@use '@carbon/grid/scss/breakpoint' as grid;\n@use 'prefix' as *;\n@use 'font-family';\n@use 'scale';\n\n/// @type Map\n/// @access public\n/// @deprecated\n/// @group @carbon/type\n$caption-01: (\n font-size: scale.type-scale(1),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @deprecated\n/// @group @carbon/type\n$caption-02: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$label-01: (\n font-size: scale.type-scale(1),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$label-02: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$legal-01: (\n font-size: scale.type-scale(1),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$legal-02: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @deprecated\n/// @group @carbon/type\n$helper-text-01: (\n font-size: scale.type-scale(1),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @deprecated\n/// @group @carbon/type\n$helper-text-02: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-short-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-compact-01: $body-short-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-long-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.42857,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-01: $body-long-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-short-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.375,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-compact-02: $body-short-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-long-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.5,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-02: $body-long-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$code-01: (\n font-family: font-family.font-family('mono'),\n font-size: scale.type-scale(1),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$code-02: (\n font-family: font-family.font-family('mono'),\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.42857,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.42857,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-compact-01: $productive-heading-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.5,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.375,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-compact-02: $productive-heading-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-03: (\n font-size: scale.type-scale(5),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.4,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-03: $productive-heading-03 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-04: (\n font-size: scale.type-scale(7),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-04: $productive-heading-04 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-05: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.25,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-05: $productive-heading-05 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-06: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n // Extra digit needed for precision in Chrome\n line-height: 1.199,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-06: $productive-heading-06 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-07: (\n font-size: scale.type-scale(12),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-07: $productive-heading-07 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-01: $heading-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-02: $heading-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-03: (\n font-size: scale.type-scale(5),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.4,\n letter-spacing: 0,\n breakpoints: (\n xlg: (\n font-size: scale.type-scale(5),\n line-height: 1.4,\n ),\n max: (\n font-size: scale.type-scale(6),\n line-height: 1.334,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-03: $expressive-heading-03 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-04: (\n font-size: scale.type-scale(7),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0,\n breakpoints: (\n xlg: (\n font-size: scale.type-scale(8),\n line-height: 1.25,\n font-weight: font-family.font-weight('regular'),\n ),\n max: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('regular'),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-04: $expressive-heading-04 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-05: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.25,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(9),\n font-weight: font-family.font-weight('light'),\n line-height: 1.22,\n ),\n lg: (\n font-size: scale.type-scale(10),\n line-height: 1.19,\n ),\n xlg: (\n font-size: scale.type-scale(11),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(13),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-05: $expressive-heading-05 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-06: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.25,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(9),\n line-height: 1.22,\n ),\n lg: (\n font-size: scale.type-scale(10),\n line-height: 1.19,\n ),\n xlg: (\n font-size: scale.type-scale(11),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(13),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-06: $expressive-heading-06 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-paragraph-01: (\n font-size: scale.type-scale(6),\n font-weight: font-family.font-weight('light'),\n line-height: 1.334,\n letter-spacing: 0,\n breakpoints: (\n lg: (\n font-size: scale.type-scale(7),\n line-height: 1.28572,\n ),\n max: (\n font-size: scale.type-scale(8),\n line-height: 1.25,\n ),\n ),\n);\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-paragraph-01: $expressive-paragraph-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$quotation-01: (\n font-family: font-family.font-family('serif'),\n font-size: scale.type-scale(5),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.3,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(5),\n ),\n lg: (\n font-size: scale.type-scale(6),\n line-height: 1.334,\n ),\n xlg: (\n font-size: scale.type-scale(7),\n line-height: 1.28572,\n ),\n max: (\n font-size: scale.type-scale(8),\n line-height: 1.25,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-quotation-01: $quotation-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$quotation-02: (\n font-family: font-family.font-family('serif'),\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('light'),\n line-height: 1.25,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(9),\n line-height: 1.22,\n ),\n lg: (\n font-size: scale.type-scale(10),\n line-height: 1.19,\n ),\n xlg: (\n font-size: scale.type-scale(11),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(13),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-quotation-02: $quotation-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-01: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(10),\n ),\n lg: (\n font-size: scale.type-scale(12),\n ),\n xlg: (\n font-size: scale.type-scale(13),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(15),\n line-height: 1.13,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-01: $display-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-02: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(10),\n ),\n lg: (\n font-size: scale.type-scale(12),\n ),\n xlg: (\n font-size: scale.type-scale(13),\n line-height: 1.16,\n ),\n max: (\n font-size: scale.type-scale(15),\n line-height: 1.13,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-02: $display-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-03: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(12),\n line-height: 1.18,\n ),\n lg: (\n font-size: scale.type-scale(13),\n line-height: 1.16,\n letter-spacing: -0.64px,\n ),\n xlg: (\n font-size: scale.type-scale(15),\n line-height: 1.13,\n letter-spacing: -0.64px,\n ),\n max: (\n font-size: scale.type-scale(16),\n line-height: 1.11,\n letter-spacing: -0.96px,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-03: $display-03 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-04: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(14),\n line-height: 1.15,\n ),\n lg: (\n font-size: scale.type-scale(17),\n line-height: 1.11,\n letter-spacing: -0.64px,\n ),\n xlg: (\n font-size: scale.type-scale(20),\n line-height: 1.07,\n letter-spacing: -0.64px,\n ),\n max: (\n font-size: scale.type-scale(23),\n line-height: 1.05,\n letter-spacing: -0.96px,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-04: $display-04 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$tokens: (\n caption-01: $caption-01,\n caption-02: $caption-02,\n label-01: $label-01,\n label-02: $label-02,\n helper-text-01: $helper-text-01,\n helper-text-02: $helper-text-02,\n body-short-01: $body-short-01,\n body-short-02: $body-short-02,\n body-long-01: $body-long-01,\n body-long-02: $body-long-02,\n code-01: $code-01,\n code-02: $code-02,\n heading-01: $heading-01,\n heading-02: $heading-02,\n productive-heading-01: $productive-heading-01,\n productive-heading-02: $productive-heading-02,\n productive-heading-03: $productive-heading-03,\n productive-heading-04: $productive-heading-04,\n productive-heading-05: $productive-heading-05,\n productive-heading-06: $productive-heading-06,\n productive-heading-07: $productive-heading-07,\n expressive-paragraph-01: $expressive-paragraph-01,\n expressive-heading-01: $expressive-heading-01,\n expressive-heading-02: $expressive-heading-02,\n expressive-heading-03: $expressive-heading-03,\n expressive-heading-04: $expressive-heading-04,\n expressive-heading-05: $expressive-heading-05,\n expressive-heading-06: $expressive-heading-06,\n quotation-01: $quotation-01,\n quotation-02: $quotation-02,\n display-01: $display-01,\n display-02: $display-02,\n display-03: $display-03,\n display-04: $display-04,\n // V11 Tokens\n legal-01: $legal-01,\n legal-02: $legal-02,\n body-compact-01: $body-compact-01,\n body-compact-02: $body-compact-02,\n heading-compact-01: $heading-compact-01,\n heading-compact-02: $heading-compact-02,\n body-01: $body-01,\n body-02: $body-02,\n heading-03: $heading-03,\n heading-04: $heading-04,\n heading-05: $heading-05,\n heading-06: $heading-06,\n heading-07: $heading-07,\n fluid-heading-03: $fluid-heading-03,\n fluid-heading-04: $fluid-heading-04,\n fluid-heading-05: $fluid-heading-05,\n fluid-heading-06: $fluid-heading-06,\n fluid-paragraph-01: $fluid-paragraph-01,\n fluid-quotation-01: $fluid-quotation-01,\n fluid-quotation-02: $fluid-quotation-02,\n fluid-display-01: $fluid-display-01,\n fluid-display-02: $fluid-display-02,\n fluid-display-03: $fluid-display-03,\n fluid-display-04: $fluid-display-04,\n) !default;\n\n/// @param {Map} $map\n/// @access public\n/// @group @carbon/type\n@mixin properties($map) {\n @each $name, $value in $map {\n #{$name}: $value;\n }\n}\n\n/// @param {Number} $value - Number with units\n/// @return {Number} Without units\n/// @access public\n/// @group @carbon/type\n@function strip-unit($value) {\n @return math.div($value, $value * 0 + 1);\n}\n\n/// This helper includes fluid type styles for the given token value. Fluid type\n/// means that the `font-size` is computed using `calc()` in order to be\n/// determined by the screen size instead of a breakpoint. As a result, fluid\n/// styles should be used with caution in fixed width contexts.\n///\n/// In addition, we make use of %-based line-heights so that the line-height of\n/// each type style is computed correctly due to the dynamic nature of the\n/// `font-size`.\n///\n/// Most of the logic for this work comes from CSS Tricks:\n/// https://css-tricks.com/snippets/css/fluid-typography/\n///\n/// @param {Map} $type-styles - The value of a given type token\n/// @param {Map} $breakpoints [$grid-breakpoints] - Custom breakpoints to use\n/// @access public\n/// @group @carbon/type\n@mixin fluid-type($type-styles, $breakpoints: gridconfig.$grid-breakpoints) {\n // Include the initial styles for the given token by default without any\n // media query guard. This includes `font-size` as a fallback in the case\n // that a browser does not support `calc()`\n @include properties(map.remove($type-styles, breakpoints));\n // We also need to include the `sm` styles by default since they don't\n // appear in the fluid styles for tokens\n @include fluid-type-size($type-styles, sm, $breakpoints);\n\n // Finally, we need to go through all the breakpoints defined in the type\n // token and apply the properties and fluid type size for that given\n // breakpoint\n @each $name, $values in map.get($type-styles, breakpoints) {\n @include grid.breakpoint($name) {\n @include properties($values);\n @include fluid-type-size($type-styles, $name, $breakpoints);\n }\n }\n}\n\n/// Computes the fluid `font-size` for a given type style and breakpoint\n/// @param {Map} $type-styles - The styles for a given token\n/// @param {String} $name - The name of the breakpoint to which we apply the fluid\n/// @param {Map} $breakpoints [$grid-breakpoints] - The breakpoints for the grid system\n/// @access public\n/// @group @carbon/type\n@mixin fluid-type-size(\n $type-styles,\n $name,\n $breakpoints: gridconfig.$grid-breakpoints\n) {\n // Get the information about the breakpoint we're currently working in. Useful\n // for getting initial width information\n $breakpoint: map.get($breakpoints, $name);\n\n // Our fluid styles are captured under the 'breakpoints' property in our type\n // styles map. These define what values to treat as `max-` variables below\n $fluid-sizes: map.get($type-styles, breakpoints);\n $fluid-breakpoint: ();\n // Special case for `sm` because the styles for small are on the type style\n // directly\n @if $name == sm {\n $fluid-breakpoint: map.remove($type-styles, breakpoints);\n } @else {\n $fluid-breakpoint: map.get($fluid-sizes, $name);\n }\n\n // Initialize our font-sizes to the default size for the type style\n $max-font-size: map.get($type-styles, font-size);\n $min-font-size: map.get($type-styles, font-size);\n @if map.has-key($fluid-breakpoint, font-size) {\n $min-font-size: map.get($fluid-breakpoint, font-size);\n }\n\n // Initialize our min and max width to the width of the current breakpoint\n $max-vw: map.get($breakpoint, width);\n $min-vw: map.get($breakpoint, width);\n\n // We can use `breakpoint-next` to see if there is another breakpoint we can\n // use to update `max-font-size` and `max-vw` with larger values\n $next-breakpoint-available: grid.breakpoint-next($name, $breakpoints);\n $next-fluid-breakpoint-name: null;\n\n // We need to figure out what the next available fluid breakpoint is for our\n // given $type-styles. In this loop we try and iterate through breakpoints\n // until we either manually set $next-breakpoint-available to null or\n // `breakpoint-next` returns null.\n @while $next-breakpoint-available {\n @if map.has-key($fluid-sizes, $next-breakpoint-available) {\n $next-fluid-breakpoint-name: $next-breakpoint-available;\n $next-breakpoint-available: null;\n } @else {\n $next-breakpoint-available: grid.breakpoint-next(\n $next-breakpoint-available,\n $breakpoints\n );\n }\n }\n\n // If we have found the next available fluid breakpoint name, then we know\n // that we have values that we can use to set max-font-size and max-vw as both\n // values derive from the next breakpoint\n @if $next-fluid-breakpoint-name {\n $next-fluid-breakpoint: map.get($breakpoints, $next-fluid-breakpoint-name);\n $max-font-size: map.get(\n map.get($fluid-sizes, $next-fluid-breakpoint-name),\n font-size\n );\n $max-vw: map.get($next-fluid-breakpoint, width);\n\n // prettier-ignore\n font-size: calc(#{$min-font-size} +\n #{strip-unit($max-font-size - $min-font-size)} *\n ((100vw - #{$min-vw}) / #{strip-unit($max-vw - $min-vw)})\n );\n } @else {\n // Otherwise, just default to setting the font size found from the type\n // style or the given fluid breakpoint in the type style\n font-size: $min-font-size;\n }\n}\n\n// TODO move following variable and `custom-property` mixin into shared file for\n// both `@carbon/type` and `@carbon/themes`\n\n/// @access private\n/// @group @carbon/type\n@mixin custom-properties($name, $value) {\n @each $property, $value in $value {\n #{$property}: var(\n --#{$custom-property-prefix}-#{$name}-#{$property},\n #{$value}\n );\n }\n}\n\n/// Helper mixin to include the styles for a given token in any selector in your\n/// project. Also includes an optional fluid option that will enable fluid\n/// styles for the token if they are defined. Fluid styles will cause the\n/// token's font-size to be computed based on the viewport size. As a result, use\n/// with caution in fixed contexts.\n/// @param {String} $name - The name of the token to get the styles for\n/// @param {Boolean} $fluid [false] - Specify whether to include fluid styles for the\n/// @param {Map} $breakpoints [$grid-breakpoints] - Provide a custom breakpoint map to use\n/// @access public\n/// @group @carbon/type\n@mixin type-style(\n $name,\n $fluid: false,\n $breakpoints: gridconfig.$grid-breakpoints\n) {\n @if not map.has-key($tokens, $name) {\n @error 'Unable to find a token with the name: `#{$name}`';\n }\n\n $token: map.get($tokens, $name);\n\n // If $fluid is set to true and the token has breakpoints defined for fluid\n // styles, delegate to the fluid-type helper for the given token\n @if $fluid == true and map.has-key($token, 'breakpoints') {\n @include fluid-type($token, $breakpoints);\n } @else {\n @include custom-properties($name, $token);\n }\n}\n"],sourceRoot:""}]),r.locals={workspace:"-cc-esm-active-prescriptions__root__workspace___+xqk5",header:"-cc-esm-active-prescriptions__root__header___G1X3T",subtitle:"-cc-esm-active-prescriptions__root__subtitle___kRieu",section:"-cc-esm-active-prescriptions__root__section___61mCr",fieldLabel:"-cc-esm-active-prescriptions__root__fieldLabel___F2zAd",tabContent:"-cc-esm-active-prescriptions__root__tabContent___DnbmQ",fieldGroup:"-cc-esm-active-prescriptions__root__fieldGroup___3aiba",helperText:"-cc-esm-active-prescriptions__root__helperText___sr2T2",ordersList:"-cc-esm-active-prescriptions__root__ordersList___jcCvy",orderLabel:"-cc-esm-active-prescriptions__root__orderLabel___3oBY3",orderName:"-cc-esm-active-prescriptions__root__orderName___QGKUy",orderMeta:"-cc-esm-active-prescriptions__root__orderMeta___S7cGO",selectionSummary:"-cc-esm-active-prescriptions__root__selectionSummary___TD9ka"};const s=r},1046(e,n,t){t.r(n),t.d(n,{default:()=>S});var a=t(6072);function i(e,n,t,a,i,o,r){try{var s=e[o](r),l=s.value}catch(e){return void t(e)}s.done?n(l):Promise.resolve(l).then(a,i)}function o(e,n){for(var t=0;t<n.length;t++){var a=n[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}var r=function(){function e(){!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e)}var n,t;return n=e,t=[{key:"createPrescription",value:function(e){return(n=function(){return function(e,n){var t,a,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},r=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),s=Object.defineProperty;return s(r,"next",{value:l(0)}),s(r,"throw",{value:l(1)}),s(r,"return",{value:l(2)}),"function"==typeof Symbol&&s(r,Symbol.iterator,{value:function(){return this}}),r;function l(s){return function(l){return function(s){if(t)throw new TypeError("Generator is already executing.");for(;r&&(r=0,s[0]&&(o=0)),o;)try{if(t=1,a&&(i=2&s[0]?a.return:s[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,s[1])).done)return i;switch(a=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,a=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=n.call(e,o)}catch(e){s=[6,e],a=0}finally{t=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,function(n){return[2,fetch("/api/prescriptions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})]})},function(){var e=this,t=arguments;return new Promise(function(a,o){var r=n.apply(e,t);function s(e){i(r,a,o,s,l,"next",e)}function l(e){i(r,a,o,s,l,"throw",e)}s(void 0)})})();var n}}],null&&o(n.prototype,null),t&&o(n,t),e}(),s=t(4504),l=t(2076),c=t(4424),p=t(9324),u=encodeURIComponent("custom:(uuid,display,orderNumber,concept:(uuid,display),careSetting:(uuid,display),dateActivated)"),d=t(5072),f=t.n(d),g=t(7825),h=t.n(g),y=t(7659),b=t.n(y),m=t(5056),v=t.n(m),$=t(540),A=t.n($),w=t(1113),x=t.n(w),_=t(6052),k={};k.styleTagTransform=x(),k.setAttributes=v(),k.insert=b().bind(null,"head"),k.domAPI=h(),k.insertStyleElement=A(),f()(_.A,k);const C=_.A&&_.A.locals?_.A.locals:void 0;function z(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,a=new Array(n);t<n;t++)a[t]=e[t];return a}function M(e,n,t,a,i,o,r){try{var s=e[o](r),l=s.value}catch(e){return void t(e)}s.done?n(l):Promise.resolve(l).then(a,i)}function E(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var a,i,o=[],r=!0,s=!1;try{for(t=t.call(e);!(r=(a=t.next()).done)&&(o.push(a.value),!n||o.length!==n);r=!0);}catch(e){s=!0,i=e}finally{try{r||null==t.return||t.return()}finally{if(s)throw i}}return o}}(e,n)||function(e,n){if(e){if("string"==typeof e)return z(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?z(e,n):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const S=function(e){var n=e.patientUuid,t=(0,l.useTranslation)().t;if(!n)return a.createElement(s.jeF,{lowContrast:!0,kind:"warning",title:t("ordersMissingPatientTitle","Select a patient to continue")});var i=E((0,a.useState)("new"),2),o=i[0],d=i[1],f=E((0,a.useState)(null),2),g=f[0],h=f[1],y=E((0,a.useState)(""),2),b=y[0],m=y[1],v=E((0,a.useState)(new Set),2),$=v[0],A=v[1],w=E((0,a.useState)(!1),2),x=w[0],_=w[1],k=E((0,a.useState)(!1),2),z=k[0],S=k[1],T=E((0,a.useState)(!1),2),D=T[0],N=T[1],B=(0,c.useLocations)(),L=function(e){var n,t,a,i=e?"".concat(c.restBaseUrl,"/order?patient=").concat(e,"&status=active&v=").concat(u):null,o=(0,p.Ay)(i,c.openmrsFetch),r=o.data,s=o.error,l=o.isLoading,d=o.mutate;return{orders:null!==(n=null==r||null===(a=r.data)||void 0===a||null===(t=a.results)||void 0===t?void 0:t.map(function(e){var n,t,a,i;return{uuid:e.uuid,conceptName:null!==(n=null!==(t=null!==(a=null===(i=e.concept)||void 0===i?void 0:i.display)&&void 0!==a?a:e.display)&&void 0!==t?t:e.orderNumber)&&void 0!==n?n:e.uuid,orderNumber:e.orderNumber,display:e.display}}))&&void 0!==n?n:[],isLoading:l,error:s,refresh:d}}(n),I=L.orders,F=L.isLoading,P=L.error,q=(0,a.useMemo)(function(){return null!=B?B:[]},[B]),G=$.size>0?t("selectedOrdersCount",{count:$.size}):null;return a.createElement("div",{className:C.workspace},a.createElement("div",{className:C.header},a.createElement("h2",null,t("activePrescriptionsWorkspaceTitle","Active prescriptions")),a.createElement("p",{className:C.subtitle},t("activePrescriptionsHelper","Review the patient context, choose the visit details, and add the matching orders to the prescription."))),a.createElement("section",{className:C.section},a.createElement("p",{className:C.fieldLabel},t("visitTimingLabel","The visit is")),a.createElement(s.tUM,{selectedIndex:"new"===o?0:1,onChange:function(e){var n=e.selectedIndex;return d(0===n?"new":"past")}},a.createElement(s.wbY,{"aria-label":t("visitTimingLabel","The visit is")},a.createElement(s.ozo,null,t("visitTimingNew","New")),a.createElement(s.ozo,null,t("visitTimingPast","In the past"))),a.createElement(s.T2N,null,a.createElement(s.KpK,{className:C.tabContent},a.createElement("div",{className:C.fieldGroup},a.createElement(s.a32,{id:"visit-location",items:q,itemToString:function(e){var n;return null!==(n=null==e?void 0:e.display)&&void 0!==n?n:""},selectedItem:g,onChange:function(e){var n=e.selectedItem;return h(null!=n?n:null)},placeholder:t("visitLocationPlaceholder","Select a location"),titleText:t("visitLocationHeading","Visit location"),helperText:t("visitLocationHelper","Select where the visit will take place.")})),a.createElement("div",{className:C.fieldGroup},a.createElement("p",{className:C.fieldLabel},t("visitTypeHeading","Visit type")),a.createElement("p",{className:C.helperText},t("visitTypeHelper","Select the orders that should be included in this prescription.")),n?P?a.createElement(s.jeF,{lowContrast:!0,kind:"error",title:t("ordersErrorTitle","Unable to load orders"),subtitle:t("ordersErrorSubtitle","Try again or refresh the patient chart.")}):F?a.createElement(s.OuH,{description:"".concat(t("loading","Loading"),"...")}):I.length?a.createElement(a.Fragment,null,a.createElement("div",{className:C.ordersList,role:"group","aria-label":t("visitTypeHeading","Visit type")},I.map(function(e){return a.createElement(s.Sc0,{key:e.uuid,id:"order-".concat(e.uuid),labelText:a.createElement("span",{className:C.orderLabel},a.createElement("span",{className:C.orderName},e.conceptName),e.display&&a.createElement("span",{className:C.orderMeta},e.display),!e.display&&e.orderNumber&&a.createElement("span",{className:C.orderMeta},e.orderNumber)),checked:$.has(e.uuid),onChange:function(){return n=e.uuid,void A(function(e){var t=new Set(e);return t.has(n)?t.delete(n):t.add(n),t});var n}})})),G?a.createElement("p",{className:C.selectionSummary},G):null):a.createElement(s.jeF,{lowContrast:!0,kind:"info",title:t("ordersEmptyState","There are no orders for this patient yet.")}):null),a.createElement("div",{className:C.fieldGroup},a.createElement(s.ksK,{id:"insurance-policy",labelText:t("insurancePolicyNumberLabel","Insurance Policy Number (optional)"),placeholder:t("insurancePolicyNumberPlaceholder","Enter the policy number"),value:b,onChange:function(e){return m(e.target.value)}})),a.createElement("div",{className:C.fieldGroup},a.createElement(s.Sc0,{id:"sign-prescription-checkbox",labelText:t("signPrescriptionLabel","Digitally sign the prescription"),checked:x,onChange:function(){return _(function(e){return!e})}}),a.createElement(s.Sc0,{id:"print-prescription-checkbox",labelText:t("printPrescriptionLabel","Print the prescription"),checked:z,onChange:function(){return S(function(e){return!e})}})),a.createElement("div",{className:C.fieldGroup,style:{flexDirection:"row",gap:"1rem"}},a.createElement("button",{type:"button",id:"discard-prescription-btn",onClick:function(){h(null),m(""),A(new Set),_(!1),S(!1)},disabled:D},t("discardButtonLabel","Discard")),a.createElement("button",{type:"button",id:"create-prescription-btn",onClick:function(){return(e=function(){var e;return function(e,n){var t,a,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},r=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),s=Object.defineProperty;return s(r,"next",{value:l(0)}),s(r,"throw",{value:l(1)}),s(r,"return",{value:l(2)}),"function"==typeof Symbol&&s(r,Symbol.iterator,{value:function(){return this}}),r;function l(s){return function(l){return function(s){if(t)throw new TypeError("Generator is already executing.");for(;r&&(r=0,s[0]&&(o=0)),o;)try{if(t=1,a&&(i=2&s[0]?a.return:s[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,s[1])).done)return i;switch(a=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,a=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=n.call(e,o)}catch(e){s=[6,e],a=0}finally{t=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,function(t){switch(t.label){case 0:if(!n||!g||0===$.size)return[2];N(!0),e={patient:{uuid:n},provider:{uuid:"provider-uuid"},location:{uuid:g.uuid,name:g.display},policyNumber:b,orderUuids:Array.from($),digitallySigned:x,printRequested:z},t.label=1;case 1:return t.trys.push([1,3,4,5]),[4,r.createPrescription(e)];case 2:return t.sent(),h(null),m(""),A(new Set),_(!1),S(!1),[3,5];case 3:return t.sent(),[3,5];case 4:return N(!1),[7];case 5:return[2]}})},function(){var n=this,t=arguments;return new Promise(function(a,i){var o=e.apply(n,t);function r(e){M(o,a,i,r,s,"next",e)}function s(e){M(o,a,i,r,s,"throw",e)}r(void 0)})})();var e},disabled:D},D?t("loading","Loading"):t("createPrescriptionButtonLabel","Create Prescription")))),a.createElement(s.KpK,{className:C.tabContent},a.createElement(s.jeF,{lowContrast:!0,kind:"info",title:t("inPastTabPlaceholderTitle","Historic prescriptions will be available soon"),subtitle:t("inPastTabPlaceholderSubtitle","Switch back to the New tab to manage current orders.")}))))))}},8493(e,n,t){var a=t(6072),i="function"==typeof Object.is?Object.is:function(e,n){return e===n&&(0!==e||1/e==1/n)||e!=e&&n!=n},o=a.useState,r=a.useEffect,s=a.useLayoutEffect,l=a.useDebugValue;function c(e){var n=e.getSnapshot;e=e.value;try{var t=n();return!i(e,t)}catch(e){return!0}}var p="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,n){return n()}:function(e,n){var t=n(),a=o({inst:{value:t,getSnapshot:n}}),i=a[0].inst,p=a[1];return s(function(){i.value=t,i.getSnapshot=n,c(i)&&p({inst:i})},[e,t,n]),r(function(){return c(i)&&p({inst:i}),e(function(){c(i)&&p({inst:i})})},[e]),l(t),t};n.useSyncExternalStore=void 0!==a.useSyncExternalStore?a.useSyncExternalStore:p},9888(e,n,t){e.exports=t(8493)}}]);
|
|
2
|
+
"use strict";(globalThis.webpackChunk_cc_openmrs_cc_esm_active_prescriptions=globalThis.webpackChunk_cc_openmrs_cc_esm_active_prescriptions||[]).push([[385],{6052(e,n,t){t.d(n,{A:()=>s});var a=t(2996),i=t.n(a),o=t(159),r=t.n(o)()(i());r.push([e.id,".-cc-esm-active-prescriptions__root__workspace___\\+xqk5{padding:2rem;display:flex;flex-direction:column;gap:1.5rem;background-color:var(--cds-layer, #ffffff);min-height:100%}.-cc-esm-active-prescriptions__root__header___G1X3T{display:flex;flex-direction:column;gap:.5rem}.-cc-esm-active-prescriptions__root__subtitle___kRieu{font-size:var(--cds-body-01-font-size, 0.875rem);font-weight:var(--cds-body-01-font-weight, 400);line-height:var(--cds-body-01-line-height, 1.42857);letter-spacing:var(--cds-body-01-letter-spacing, 0.16px);color:var(--cds-text-secondary, #525252);margin:0;max-width:48rem}.-cc-esm-active-prescriptions__root__section___61mCr{background-color:var(--cds-layer-accent, #f4f4f4);padding:1rem;border-radius:.25rem;box-shadow:0 1px 2px rgba(0,0,0,.08)}.-cc-esm-active-prescriptions__root__fieldLabel___F2zAd{font-size:var(--cds-heading-compact-01-font-size, 0.875rem);font-weight:var(--cds-heading-compact-01-font-weight, 600);line-height:var(--cds-heading-compact-01-line-height, 1.28572);letter-spacing:var(--cds-heading-compact-01-letter-spacing, 0.16px);margin-bottom:.5rem}.-cc-esm-active-prescriptions__root__tabContent___DnbmQ{padding:1rem 0 0;display:flex;flex-direction:column;gap:1.5rem}.-cc-esm-active-prescriptions__root__fieldGroup___3aiba{display:flex;flex-direction:column;gap:.5rem}.-cc-esm-active-prescriptions__root__helperText___sr2T2{font-size:var(--cds-label-01-font-size, 0.75rem);font-weight:var(--cds-label-01-font-weight, 400);line-height:var(--cds-label-01-line-height, 1.33333);letter-spacing:var(--cds-label-01-letter-spacing, 0.32px);color:var(--cds-text-secondary, #525252);margin:0}.-cc-esm-active-prescriptions__root__ordersList___jcCvy{border:1px solid var(--cds-border-subtle, #e0e0e0);border-radius:.25rem;padding:.75rem;display:flex;flex-direction:column;gap:.5rem;background-color:var(--cds-layer, #ffffff)}.-cc-esm-active-prescriptions__root__orderLabel___3oBY3{display:flex;flex-direction:column;align-items:flex-start;gap:.125rem}.-cc-esm-active-prescriptions__root__orderName___QGKUy{font-size:var(--cds-body-compact-01-font-size, 0.875rem);font-weight:var(--cds-body-compact-01-font-weight, 400);line-height:var(--cds-body-compact-01-line-height, 1.28572);letter-spacing:var(--cds-body-compact-01-letter-spacing, 0.16px);font-weight:600}.-cc-esm-active-prescriptions__root__orderMeta___S7cGO{font-size:var(--cds-label-01-font-size, 0.75rem);font-weight:var(--cds-label-01-font-weight, 400);line-height:var(--cds-label-01-line-height, 1.33333);letter-spacing:var(--cds-label-01-letter-spacing, 0.32px);color:var(--cds-text-secondary, #525252)}.-cc-esm-active-prescriptions__root__selectionSummary___TD9ka{font-size:var(--cds-label-01-font-size, 0.75rem);font-weight:var(--cds-label-01-font-weight, 400);line-height:var(--cds-label-01-line-height, 1.33333);letter-spacing:var(--cds-label-01-letter-spacing, 0.32px);color:var(--cds-text-secondary, #525252);margin:.25rem 0 0}","",{version:3,sources:["webpack://./src/root.scss","webpack://./node_modules/@carbon/layout/scss/generated/_spacing.scss","webpack://./node_modules/@carbon/type/scss/_styles.scss"],names:[],mappings:"AAGA,wDACE,YCqCW,CDpCX,YAAA,CACA,qBAAA,CACA,UC6BW,CD5BX,0CAAA,CACA,eAAA,CAGF,oDACE,YAAA,CACA,qBAAA,CACA,SCMW,CDHb,sDEg1BI,gDAAA,CAAA,+CAAA,CAAA,mDAAA,CAAA,wDAAA,CF90BF,wCAAA,CACA,QAAA,CACA,eAAA,CAGF,qDACE,iDAAA,CACA,YCIW,CDHX,oBCZW,CDaX,oCAAA,CAGF,wDEk0BI,2DAAA,CAAA,0DAAA,CAAA,8DAAA,CAAA,mEAAA,CFh0BF,mBCbW,CDgBb,wDACE,gBAAA,CACA,YAAA,CACA,qBAAA,CACA,UCLW,CDQb,wDACE,YAAA,CACA,qBAAA,CACA,SC1BW,CD6Bb,wDEgzBI,gDAAA,CAAA,gDAAA,CAAA,oDAAA,CAAA,yDAAA,CF9yBF,wCAAA,CACA,QAAA,CAGF,wDACE,kDAAA,CACA,oBC1CW,CD2CX,cCjCW,CDkCX,YAAA,CACA,qBAAA,CACA,SCzCW,CD0CX,0CAAA,CAGF,wDACE,YAAA,CACA,qBAAA,CACA,sBAAA,CACA,WC3DW,CD8Db,uDEyxBI,wDAAA,CAAA,uDAAA,CAAA,2DAAA,CAAA,gEAAA,CFvxBF,eAAA,CAGF,uDEoxBI,gDAAA,CAAA,gDAAA,CAAA,oDAAA,CAAA,yDAAA,CFlxBF,wCAAA,CAGF,8DE+wBI,gDAAA,CAAA,gDAAA,CAAA,oDAAA,CAAA,yDAAA,CF7wBF,wCAAA,CACA,iBAAA",sourcesContent:["@use '@carbon/layout';\n@use '@carbon/type';\n\n.workspace {\n padding: layout.$spacing-07;\n display: flex;\n flex-direction: column;\n gap: layout.$spacing-06;\n background-color: var(--cds-layer, #ffffff);\n min-height: 100%;\n}\n\n.header {\n display: flex;\n flex-direction: column;\n gap: layout.$spacing-03;\n}\n\n.subtitle {\n @include type.type-style('body-01');\n color: var(--cds-text-secondary, #525252);\n margin: 0;\n max-width: 48rem;\n}\n\n.section {\n background-color: var(--cds-layer-accent, #f4f4f4);\n padding: layout.$spacing-05;\n border-radius: layout.$spacing-02;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);\n}\n\n.fieldLabel {\n @include type.type-style('heading-compact-01');\n margin-bottom: layout.$spacing-03;\n}\n\n.tabContent {\n padding: layout.$spacing-05 0 0;\n display: flex;\n flex-direction: column;\n gap: layout.$spacing-06;\n}\n\n.fieldGroup {\n display: flex;\n flex-direction: column;\n gap: layout.$spacing-03;\n}\n\n.helperText {\n @include type.type-style('label-01');\n color: var(--cds-text-secondary, #525252);\n margin: 0;\n}\n\n.ordersList {\n border: 1px solid var(--cds-border-subtle, #e0e0e0);\n border-radius: layout.$spacing-02;\n padding: layout.$spacing-04;\n display: flex;\n flex-direction: column;\n gap: layout.$spacing-03;\n background-color: var(--cds-layer, #ffffff);\n}\n\n.orderLabel {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: layout.$spacing-01;\n}\n\n.orderName {\n @include type.type-style('body-compact-01');\n font-weight: 600;\n}\n\n.orderMeta {\n @include type.type-style('label-01');\n color: var(--cds-text-secondary, #525252);\n}\n\n.selectionSummary {\n @include type.type-style('label-01');\n color: var(--cds-text-secondary, #525252);\n margin: layout.$spacing-02 0 0;\n}\n","// Code generated by @carbon/layout. DO NOT EDIT.\n//\n// Copyright IBM Corp. 2018, 2023\n//\n// This source code is licensed under the Apache-2.0 license found in the\n// LICENSE file in the root directory of this source tree.\n//\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-01: 0.125rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-02: 0.25rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-03: 0.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-04: 0.75rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-05: 1rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-06: 1.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-07: 2rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-08: 2.5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-09: 3rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-10: 4rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-11: 5rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-12: 6rem !default;\n\n/// @type Number\n/// @access public\n/// @group @carbon/layout\n$spacing-13: 10rem !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/layout\n$spacing: (\n spacing-01: $spacing-01,\n spacing-02: $spacing-02,\n spacing-03: $spacing-03,\n spacing-04: $spacing-04,\n spacing-05: $spacing-05,\n spacing-06: $spacing-06,\n spacing-07: $spacing-07,\n spacing-08: $spacing-08,\n spacing-09: $spacing-09,\n spacing-10: $spacing-10,\n spacing-11: $spacing-11,\n spacing-12: $spacing-12,\n spacing-13: $spacing-13,\n);\n","//\n// Copyright IBM Corp. 2018, 2023\n//\n// This source code is licensed under the Apache-2.0 license found in the\n// LICENSE file in the root directory of this source tree.\n//\n\n// stylelint-disable number-max-precision\n\n@use 'sass:map';\n@use 'sass:math';\n@use '@carbon/grid/scss/config' as gridconfig;\n@use '@carbon/grid/scss/breakpoint' as grid;\n@use 'prefix' as *;\n@use 'font-family';\n@use 'scale';\n\n/// @type Map\n/// @access public\n/// @deprecated\n/// @group @carbon/type\n$caption-01: (\n font-size: scale.type-scale(1),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @deprecated\n/// @group @carbon/type\n$caption-02: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$label-01: (\n font-size: scale.type-scale(1),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$label-02: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$legal-01: (\n font-size: scale.type-scale(1),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$legal-02: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @deprecated\n/// @group @carbon/type\n$helper-text-01: (\n font-size: scale.type-scale(1),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @deprecated\n/// @group @carbon/type\n$helper-text-02: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-short-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-compact-01: $body-short-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-long-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.42857,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-01: $body-long-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-short-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.375,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-compact-02: $body-short-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-long-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.5,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$body-02: $body-long-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$code-01: (\n font-family: font-family.font-family('mono'),\n font-size: scale.type-scale(1),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.33333,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$code-02: (\n font-family: font-family.font-family('mono'),\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.42857,\n letter-spacing: 0.32px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.42857,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-01: (\n font-size: scale.type-scale(2),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.28572,\n letter-spacing: 0.16px,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-compact-01: $productive-heading-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.5,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-02: (\n font-size: scale.type-scale(3),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.375,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-compact-02: $productive-heading-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-03: (\n font-size: scale.type-scale(5),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.4,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-03: $productive-heading-03 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-04: (\n font-size: scale.type-scale(7),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-04: $productive-heading-04 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-05: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.25,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-05: $productive-heading-05 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-06: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n // Extra digit needed for precision in Chrome\n line-height: 1.199,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-06: $productive-heading-06 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$productive-heading-07: (\n font-size: scale.type-scale(12),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$heading-07: $productive-heading-07 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-01: $heading-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-02: $heading-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-03: (\n font-size: scale.type-scale(5),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.4,\n letter-spacing: 0,\n breakpoints: (\n xlg: (\n font-size: scale.type-scale(5),\n line-height: 1.4,\n ),\n max: (\n font-size: scale.type-scale(6),\n line-height: 1.334,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-03: $expressive-heading-03 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-04: (\n font-size: scale.type-scale(7),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.28572,\n letter-spacing: 0,\n breakpoints: (\n xlg: (\n font-size: scale.type-scale(8),\n line-height: 1.25,\n font-weight: font-family.font-weight('regular'),\n ),\n max: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('regular'),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-04: $expressive-heading-04 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-05: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.25,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(9),\n font-weight: font-family.font-weight('light'),\n line-height: 1.22,\n ),\n lg: (\n font-size: scale.type-scale(10),\n line-height: 1.19,\n ),\n xlg: (\n font-size: scale.type-scale(11),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(13),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-05: $expressive-heading-05 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-heading-06: (\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.25,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(9),\n line-height: 1.22,\n ),\n lg: (\n font-size: scale.type-scale(10),\n line-height: 1.19,\n ),\n xlg: (\n font-size: scale.type-scale(11),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(13),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-heading-06: $expressive-heading-06 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$expressive-paragraph-01: (\n font-size: scale.type-scale(6),\n font-weight: font-family.font-weight('light'),\n line-height: 1.334,\n letter-spacing: 0,\n breakpoints: (\n lg: (\n font-size: scale.type-scale(7),\n line-height: 1.28572,\n ),\n max: (\n font-size: scale.type-scale(8),\n line-height: 1.25,\n ),\n ),\n);\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-paragraph-01: $expressive-paragraph-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$quotation-01: (\n font-family: font-family.font-family('serif'),\n font-size: scale.type-scale(5),\n font-weight: font-family.font-weight('regular'),\n line-height: 1.3,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(5),\n ),\n lg: (\n font-size: scale.type-scale(6),\n line-height: 1.334,\n ),\n xlg: (\n font-size: scale.type-scale(7),\n line-height: 1.28572,\n ),\n max: (\n font-size: scale.type-scale(8),\n line-height: 1.25,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-quotation-01: $quotation-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$quotation-02: (\n font-family: font-family.font-family('serif'),\n font-size: scale.type-scale(8),\n font-weight: font-family.font-weight('light'),\n line-height: 1.25,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(9),\n line-height: 1.22,\n ),\n lg: (\n font-size: scale.type-scale(10),\n line-height: 1.19,\n ),\n xlg: (\n font-size: scale.type-scale(11),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(13),\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-quotation-02: $quotation-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-01: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(10),\n ),\n lg: (\n font-size: scale.type-scale(12),\n ),\n xlg: (\n font-size: scale.type-scale(13),\n line-height: 1.17,\n ),\n max: (\n font-size: scale.type-scale(15),\n line-height: 1.13,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-01: $display-01 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-02: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('semibold'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(10),\n ),\n lg: (\n font-size: scale.type-scale(12),\n ),\n xlg: (\n font-size: scale.type-scale(13),\n line-height: 1.16,\n ),\n max: (\n font-size: scale.type-scale(15),\n line-height: 1.13,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-02: $display-02 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-03: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(12),\n line-height: 1.18,\n ),\n lg: (\n font-size: scale.type-scale(13),\n line-height: 1.16,\n letter-spacing: -0.64px,\n ),\n xlg: (\n font-size: scale.type-scale(15),\n line-height: 1.13,\n letter-spacing: -0.64px,\n ),\n max: (\n font-size: scale.type-scale(16),\n line-height: 1.11,\n letter-spacing: -0.96px,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-03: $display-03 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$display-04: (\n font-size: scale.type-scale(10),\n font-weight: font-family.font-weight('light'),\n line-height: 1.19,\n letter-spacing: 0,\n breakpoints: (\n md: (\n font-size: scale.type-scale(14),\n line-height: 1.15,\n ),\n lg: (\n font-size: scale.type-scale(17),\n line-height: 1.11,\n letter-spacing: -0.64px,\n ),\n xlg: (\n font-size: scale.type-scale(20),\n line-height: 1.07,\n letter-spacing: -0.64px,\n ),\n max: (\n font-size: scale.type-scale(23),\n line-height: 1.05,\n letter-spacing: -0.96px,\n ),\n ),\n) !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$fluid-display-04: $display-04 !default;\n\n/// @type Map\n/// @access public\n/// @group @carbon/type\n$tokens: (\n caption-01: $caption-01,\n caption-02: $caption-02,\n label-01: $label-01,\n label-02: $label-02,\n helper-text-01: $helper-text-01,\n helper-text-02: $helper-text-02,\n body-short-01: $body-short-01,\n body-short-02: $body-short-02,\n body-long-01: $body-long-01,\n body-long-02: $body-long-02,\n code-01: $code-01,\n code-02: $code-02,\n heading-01: $heading-01,\n heading-02: $heading-02,\n productive-heading-01: $productive-heading-01,\n productive-heading-02: $productive-heading-02,\n productive-heading-03: $productive-heading-03,\n productive-heading-04: $productive-heading-04,\n productive-heading-05: $productive-heading-05,\n productive-heading-06: $productive-heading-06,\n productive-heading-07: $productive-heading-07,\n expressive-paragraph-01: $expressive-paragraph-01,\n expressive-heading-01: $expressive-heading-01,\n expressive-heading-02: $expressive-heading-02,\n expressive-heading-03: $expressive-heading-03,\n expressive-heading-04: $expressive-heading-04,\n expressive-heading-05: $expressive-heading-05,\n expressive-heading-06: $expressive-heading-06,\n quotation-01: $quotation-01,\n quotation-02: $quotation-02,\n display-01: $display-01,\n display-02: $display-02,\n display-03: $display-03,\n display-04: $display-04,\n // V11 Tokens\n legal-01: $legal-01,\n legal-02: $legal-02,\n body-compact-01: $body-compact-01,\n body-compact-02: $body-compact-02,\n heading-compact-01: $heading-compact-01,\n heading-compact-02: $heading-compact-02,\n body-01: $body-01,\n body-02: $body-02,\n heading-03: $heading-03,\n heading-04: $heading-04,\n heading-05: $heading-05,\n heading-06: $heading-06,\n heading-07: $heading-07,\n fluid-heading-03: $fluid-heading-03,\n fluid-heading-04: $fluid-heading-04,\n fluid-heading-05: $fluid-heading-05,\n fluid-heading-06: $fluid-heading-06,\n fluid-paragraph-01: $fluid-paragraph-01,\n fluid-quotation-01: $fluid-quotation-01,\n fluid-quotation-02: $fluid-quotation-02,\n fluid-display-01: $fluid-display-01,\n fluid-display-02: $fluid-display-02,\n fluid-display-03: $fluid-display-03,\n fluid-display-04: $fluid-display-04,\n) !default;\n\n/// @param {Map} $map\n/// @access public\n/// @group @carbon/type\n@mixin properties($map) {\n @each $name, $value in $map {\n #{$name}: $value;\n }\n}\n\n/// @param {Number} $value - Number with units\n/// @return {Number} Without units\n/// @access public\n/// @group @carbon/type\n@function strip-unit($value) {\n @return math.div($value, $value * 0 + 1);\n}\n\n/// This helper includes fluid type styles for the given token value. Fluid type\n/// means that the `font-size` is computed using `calc()` in order to be\n/// determined by the screen size instead of a breakpoint. As a result, fluid\n/// styles should be used with caution in fixed width contexts.\n///\n/// In addition, we make use of %-based line-heights so that the line-height of\n/// each type style is computed correctly due to the dynamic nature of the\n/// `font-size`.\n///\n/// Most of the logic for this work comes from CSS Tricks:\n/// https://css-tricks.com/snippets/css/fluid-typography/\n///\n/// @param {Map} $type-styles - The value of a given type token\n/// @param {Map} $breakpoints [$grid-breakpoints] - Custom breakpoints to use\n/// @access public\n/// @group @carbon/type\n@mixin fluid-type($type-styles, $breakpoints: gridconfig.$grid-breakpoints) {\n // Include the initial styles for the given token by default without any\n // media query guard. This includes `font-size` as a fallback in the case\n // that a browser does not support `calc()`\n @include properties(map.remove($type-styles, breakpoints));\n // We also need to include the `sm` styles by default since they don't\n // appear in the fluid styles for tokens\n @include fluid-type-size($type-styles, sm, $breakpoints);\n\n // Finally, we need to go through all the breakpoints defined in the type\n // token and apply the properties and fluid type size for that given\n // breakpoint\n @each $name, $values in map.get($type-styles, breakpoints) {\n @include grid.breakpoint($name) {\n @include properties($values);\n @include fluid-type-size($type-styles, $name, $breakpoints);\n }\n }\n}\n\n/// Computes the fluid `font-size` for a given type style and breakpoint\n/// @param {Map} $type-styles - The styles for a given token\n/// @param {String} $name - The name of the breakpoint to which we apply the fluid\n/// @param {Map} $breakpoints [$grid-breakpoints] - The breakpoints for the grid system\n/// @access public\n/// @group @carbon/type\n@mixin fluid-type-size(\n $type-styles,\n $name,\n $breakpoints: gridconfig.$grid-breakpoints\n) {\n // Get the information about the breakpoint we're currently working in. Useful\n // for getting initial width information\n $breakpoint: map.get($breakpoints, $name);\n\n // Our fluid styles are captured under the 'breakpoints' property in our type\n // styles map. These define what values to treat as `max-` variables below\n $fluid-sizes: map.get($type-styles, breakpoints);\n $fluid-breakpoint: ();\n // Special case for `sm` because the styles for small are on the type style\n // directly\n @if $name == sm {\n $fluid-breakpoint: map.remove($type-styles, breakpoints);\n } @else {\n $fluid-breakpoint: map.get($fluid-sizes, $name);\n }\n\n // Initialize our font-sizes to the default size for the type style\n $max-font-size: map.get($type-styles, font-size);\n $min-font-size: map.get($type-styles, font-size);\n @if map.has-key($fluid-breakpoint, font-size) {\n $min-font-size: map.get($fluid-breakpoint, font-size);\n }\n\n // Initialize our min and max width to the width of the current breakpoint\n $max-vw: map.get($breakpoint, width);\n $min-vw: map.get($breakpoint, width);\n\n // We can use `breakpoint-next` to see if there is another breakpoint we can\n // use to update `max-font-size` and `max-vw` with larger values\n $next-breakpoint-available: grid.breakpoint-next($name, $breakpoints);\n $next-fluid-breakpoint-name: null;\n\n // We need to figure out what the next available fluid breakpoint is for our\n // given $type-styles. In this loop we try and iterate through breakpoints\n // until we either manually set $next-breakpoint-available to null or\n // `breakpoint-next` returns null.\n @while $next-breakpoint-available {\n @if map.has-key($fluid-sizes, $next-breakpoint-available) {\n $next-fluid-breakpoint-name: $next-breakpoint-available;\n $next-breakpoint-available: null;\n } @else {\n $next-breakpoint-available: grid.breakpoint-next(\n $next-breakpoint-available,\n $breakpoints\n );\n }\n }\n\n // If we have found the next available fluid breakpoint name, then we know\n // that we have values that we can use to set max-font-size and max-vw as both\n // values derive from the next breakpoint\n @if $next-fluid-breakpoint-name {\n $next-fluid-breakpoint: map.get($breakpoints, $next-fluid-breakpoint-name);\n $max-font-size: map.get(\n map.get($fluid-sizes, $next-fluid-breakpoint-name),\n font-size\n );\n $max-vw: map.get($next-fluid-breakpoint, width);\n\n // prettier-ignore\n font-size: calc(#{$min-font-size} +\n #{strip-unit($max-font-size - $min-font-size)} *\n ((100vw - #{$min-vw}) / #{strip-unit($max-vw - $min-vw)})\n );\n } @else {\n // Otherwise, just default to setting the font size found from the type\n // style or the given fluid breakpoint in the type style\n font-size: $min-font-size;\n }\n}\n\n// TODO move following variable and `custom-property` mixin into shared file for\n// both `@carbon/type` and `@carbon/themes`\n\n/// @access private\n/// @group @carbon/type\n@mixin custom-properties($name, $value) {\n @each $property, $value in $value {\n #{$property}: var(\n --#{$custom-property-prefix}-#{$name}-#{$property},\n #{$value}\n );\n }\n}\n\n/// Helper mixin to include the styles for a given token in any selector in your\n/// project. Also includes an optional fluid option that will enable fluid\n/// styles for the token if they are defined. Fluid styles will cause the\n/// token's font-size to be computed based on the viewport size. As a result, use\n/// with caution in fixed contexts.\n/// @param {String} $name - The name of the token to get the styles for\n/// @param {Boolean} $fluid [false] - Specify whether to include fluid styles for the\n/// @param {Map} $breakpoints [$grid-breakpoints] - Provide a custom breakpoint map to use\n/// @access public\n/// @group @carbon/type\n@mixin type-style(\n $name,\n $fluid: false,\n $breakpoints: gridconfig.$grid-breakpoints\n) {\n @if not map.has-key($tokens, $name) {\n @error 'Unable to find a token with the name: `#{$name}`';\n }\n\n $token: map.get($tokens, $name);\n\n // If $fluid is set to true and the token has breakpoints defined for fluid\n // styles, delegate to the fluid-type helper for the given token\n @if $fluid == true and map.has-key($token, 'breakpoints') {\n @include fluid-type($token, $breakpoints);\n } @else {\n @include custom-properties($name, $token);\n }\n}\n"],sourceRoot:""}]),r.locals={workspace:"-cc-esm-active-prescriptions__root__workspace___+xqk5",header:"-cc-esm-active-prescriptions__root__header___G1X3T",subtitle:"-cc-esm-active-prescriptions__root__subtitle___kRieu",section:"-cc-esm-active-prescriptions__root__section___61mCr",fieldLabel:"-cc-esm-active-prescriptions__root__fieldLabel___F2zAd",tabContent:"-cc-esm-active-prescriptions__root__tabContent___DnbmQ",fieldGroup:"-cc-esm-active-prescriptions__root__fieldGroup___3aiba",helperText:"-cc-esm-active-prescriptions__root__helperText___sr2T2",ordersList:"-cc-esm-active-prescriptions__root__ordersList___jcCvy",orderLabel:"-cc-esm-active-prescriptions__root__orderLabel___3oBY3",orderName:"-cc-esm-active-prescriptions__root__orderName___QGKUy",orderMeta:"-cc-esm-active-prescriptions__root__orderMeta___S7cGO",selectionSummary:"-cc-esm-active-prescriptions__root__selectionSummary___TD9ka"};const s=r},1046(e,n,t){t.r(n),t.d(n,{default:()=>S});var a=t(6072);function i(e,n,t,a,i,o,r){try{var s=e[o](r),l=s.value}catch(e){return void t(e)}s.done?n(l):Promise.resolve(l).then(a,i)}function o(e,n){for(var t=0;t<n.length;t++){var a=n[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}var r=function(){function e(){!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e)}var n,t;return n=e,t=[{key:"createPrescription",value:function(e){return(n=function(){return function(e,n){var t,a,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},r=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),s=Object.defineProperty;return s(r,"next",{value:l(0)}),s(r,"throw",{value:l(1)}),s(r,"return",{value:l(2)}),"function"==typeof Symbol&&s(r,Symbol.iterator,{value:function(){return this}}),r;function l(s){return function(l){return function(s){if(t)throw new TypeError("Generator is already executing.");for(;r&&(r=0,s[0]&&(o=0)),o;)try{if(t=1,a&&(i=2&s[0]?a.return:s[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,s[1])).done)return i;switch(a=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,a=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=n.call(e,o)}catch(e){s=[6,e],a=0}finally{t=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,function(n){return[2,fetch("/api/prescriptions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})]})},function(){var e=this,t=arguments;return new Promise(function(a,o){var r=n.apply(e,t);function s(e){i(r,a,o,s,l,"next",e)}function l(e){i(r,a,o,s,l,"throw",e)}s(void 0)})})();var n}}],null&&o(n.prototype,null),t&&o(n,t),e}(),s=t(4504),l=t(2076),c=t(4424),p=t(9324),u=encodeURIComponent("custom:(uuid,display,orderNumber,concept:(uuid,display),careSetting:(uuid,display),dateActivated)"),d=t(5072),f=t.n(d),g=t(7825),h=t.n(g),y=t(7659),b=t.n(y),m=t(5056),v=t.n(m),$=t(540),A=t.n($),w=t(1113),x=t.n(w),_=t(6052),k={};k.styleTagTransform=x(),k.setAttributes=v(),k.insert=b().bind(null,"head"),k.domAPI=h(),k.insertStyleElement=A(),f()(_.A,k);const C=_.A&&_.A.locals?_.A.locals:void 0;function z(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,a=new Array(n);t<n;t++)a[t]=e[t];return a}function M(e,n,t,a,i,o,r){try{var s=e[o](r),l=s.value}catch(e){return void t(e)}s.done?n(l):Promise.resolve(l).then(a,i)}function E(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var a,i,o=[],r=!0,s=!1;try{for(t=t.call(e);!(r=(a=t.next()).done)&&(o.push(a.value),!n||o.length!==n);r=!0);}catch(e){s=!0,i=e}finally{try{r||null==t.return||t.return()}finally{if(s)throw i}}return o}}(e,n)||function(e,n){if(e){if("string"==typeof e)return z(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?z(e,n):void 0}}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const S=function(e){var n;console.log("Root props:",e);var t=e.patientUuid||(null===(n=e.patient)||void 0===n?void 0:n.uuid),i=(0,l.useTranslation)().t;if(!t)return a.createElement(s.jeF,{lowContrast:!0,kind:"warning",title:i("ordersMissingPatientTitle","Select a patient to continue")});var o=E((0,a.useState)("new"),2),d=o[0],f=o[1],g=E((0,a.useState)(null),2),h=g[0],y=g[1],b=E((0,a.useState)(""),2),m=b[0],v=b[1],$=E((0,a.useState)(new Set),2),A=$[0],w=$[1],x=E((0,a.useState)(!1),2),_=x[0],k=x[1],z=E((0,a.useState)(!1),2),S=z[0],T=z[1],D=E((0,a.useState)(!1),2),N=D[0],B=D[1],L=(0,c.useLocations)(),I=function(e){var n,t,a,i=e?"".concat(c.restBaseUrl,"/order?patient=").concat(e,"&status=active&v=").concat(u):null,o=(0,p.Ay)(i,c.openmrsFetch),r=o.data,s=o.error,l=o.isLoading,d=o.mutate;return{orders:null!==(n=null==r||null===(a=r.data)||void 0===a||null===(t=a.results)||void 0===t?void 0:t.map(function(e){var n,t,a,i;return{uuid:e.uuid,conceptName:null!==(n=null!==(t=null!==(a=null===(i=e.concept)||void 0===i?void 0:i.display)&&void 0!==a?a:e.display)&&void 0!==t?t:e.orderNumber)&&void 0!==n?n:e.uuid,orderNumber:e.orderNumber,display:e.display}}))&&void 0!==n?n:[],isLoading:l,error:s,refresh:d}}(t),F=I.orders,P=I.isLoading,q=I.error,G=(0,a.useMemo)(function(){return null!=L?L:[]},[L]),O=A.size>0?i("selectedOrdersCount",{count:A.size}):null;return a.createElement("div",{className:C.workspace},a.createElement("div",{className:C.header},a.createElement("h2",null,i("activePrescriptionsWorkspaceTitle","Active prescriptions")),a.createElement("p",{className:C.subtitle},i("activePrescriptionsHelper","Review the patient context, choose the visit details, and add the matching orders to the prescription."))),a.createElement("section",{className:C.section},a.createElement("p",{className:C.fieldLabel},i("visitTimingLabel","The visit is")),a.createElement(s.tUM,{selectedIndex:"new"===d?0:1,onChange:function(e){var n=e.selectedIndex;return f(0===n?"new":"past")}},a.createElement(s.wbY,{"aria-label":i("visitTimingLabel","The visit is")},a.createElement(s.ozo,null,i("visitTimingNew","New")),a.createElement(s.ozo,null,i("visitTimingPast","In the past"))),a.createElement(s.T2N,null,a.createElement(s.KpK,{className:C.tabContent},a.createElement("div",{className:C.fieldGroup},a.createElement(s.a32,{id:"visit-location",items:G,itemToString:function(e){var n;return null!==(n=null==e?void 0:e.display)&&void 0!==n?n:""},selectedItem:h,onChange:function(e){var n=e.selectedItem;return y(null!=n?n:null)},placeholder:i("visitLocationPlaceholder","Select a location"),titleText:i("visitLocationHeading","Visit location"),helperText:i("visitLocationHelper","Select where the visit will take place.")})),a.createElement("div",{className:C.fieldGroup},a.createElement("p",{className:C.fieldLabel},i("visitTypeHeading","Visit type")),a.createElement("p",{className:C.helperText},i("visitTypeHelper","Select the orders that should be included in this prescription.")),t?q?a.createElement(s.jeF,{lowContrast:!0,kind:"error",title:i("ordersErrorTitle","Unable to load orders"),subtitle:i("ordersErrorSubtitle","Try again or refresh the patient chart.")}):P?a.createElement(s.OuH,{description:"".concat(i("loading","Loading"),"...")}):F.length?a.createElement(a.Fragment,null,a.createElement("div",{className:C.ordersList,role:"group","aria-label":i("visitTypeHeading","Visit type")},F.map(function(e){return a.createElement(s.Sc0,{key:e.uuid,id:"order-".concat(e.uuid),labelText:a.createElement("span",{className:C.orderLabel},a.createElement("span",{className:C.orderName},e.conceptName),e.display&&a.createElement("span",{className:C.orderMeta},e.display),!e.display&&e.orderNumber&&a.createElement("span",{className:C.orderMeta},e.orderNumber)),checked:A.has(e.uuid),onChange:function(){return n=e.uuid,void w(function(e){var t=new Set(e);return t.has(n)?t.delete(n):t.add(n),t});var n}})})),O?a.createElement("p",{className:C.selectionSummary},O):null):a.createElement(s.jeF,{lowContrast:!0,kind:"info",title:i("ordersEmptyState","There are no orders for this patient yet.")}):null),a.createElement("div",{className:C.fieldGroup},a.createElement(s.ksK,{id:"insurance-policy",labelText:i("insurancePolicyNumberLabel","Insurance Policy Number (optional)"),placeholder:i("insurancePolicyNumberPlaceholder","Enter the policy number"),value:m,onChange:function(e){return v(e.target.value)}})),a.createElement("div",{className:C.fieldGroup},a.createElement(s.Sc0,{id:"sign-prescription-checkbox",labelText:i("signPrescriptionLabel","Digitally sign the prescription"),checked:_,onChange:function(){return k(function(e){return!e})}}),a.createElement(s.Sc0,{id:"print-prescription-checkbox",labelText:i("printPrescriptionLabel","Print the prescription"),checked:S,onChange:function(){return T(function(e){return!e})}})),a.createElement("div",{className:C.fieldGroup,style:{flexDirection:"row",gap:"1rem"}},a.createElement("button",{type:"button",id:"discard-prescription-btn",onClick:function(){y(null),v(""),w(new Set),k(!1),T(!1)},disabled:N},i("discardButtonLabel","Discard")),a.createElement("button",{type:"button",id:"create-prescription-btn",onClick:function(){return(e=function(){var e;return function(e,n){var t,a,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},r=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),s=Object.defineProperty;return s(r,"next",{value:l(0)}),s(r,"throw",{value:l(1)}),s(r,"return",{value:l(2)}),"function"==typeof Symbol&&s(r,Symbol.iterator,{value:function(){return this}}),r;function l(s){return function(l){return function(s){if(t)throw new TypeError("Generator is already executing.");for(;r&&(r=0,s[0]&&(o=0)),o;)try{if(t=1,a&&(i=2&s[0]?a.return:s[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,s[1])).done)return i;switch(a=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,a=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=n.call(e,o)}catch(e){s=[6,e],a=0}finally{t=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}(this,function(n){switch(n.label){case 0:if(!t||!h||0===A.size)return[2];B(!0),e={patient:{uuid:t},provider:{uuid:"provider-uuid"},location:{uuid:h.uuid,name:h.display},policyNumber:m,orderUuids:Array.from(A),digitallySigned:_,printRequested:S},n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,r.createPrescription(e)];case 2:return n.sent(),y(null),v(""),w(new Set),k(!1),T(!1),[3,5];case 3:return n.sent(),[3,5];case 4:return B(!1),[7];case 5:return[2]}})},function(){var n=this,t=arguments;return new Promise(function(a,i){var o=e.apply(n,t);function r(e){M(o,a,i,r,s,"next",e)}function s(e){M(o,a,i,r,s,"throw",e)}r(void 0)})})();var e},disabled:N},N?i("loading","Loading"):i("createPrescriptionButtonLabel","Create Prescription")))),a.createElement(s.KpK,{className:C.tabContent},a.createElement(s.jeF,{lowContrast:!0,kind:"info",title:i("inPastTabPlaceholderTitle","Historic prescriptions will be available soon"),subtitle:i("inPastTabPlaceholderSubtitle","Switch back to the New tab to manage current orders.")}))))))}},8493(e,n,t){var a=t(6072),i="function"==typeof Object.is?Object.is:function(e,n){return e===n&&(0!==e||1/e==1/n)||e!=e&&n!=n},o=a.useState,r=a.useEffect,s=a.useLayoutEffect,l=a.useDebugValue;function c(e){var n=e.getSnapshot;e=e.value;try{var t=n();return!i(e,t)}catch(e){return!0}}var p="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,n){return n()}:function(e,n){var t=n(),a=o({inst:{value:t,getSnapshot:n}}),i=a[0].inst,p=a[1];return s(function(){i.value=t,i.getSnapshot=n,c(i)&&p({inst:i})},[e,t,n]),r(function(){return c(i)&&p({inst:i}),e(function(){c(i)&&p({inst:i})})},[e]),l(t),t};n.useSyncExternalStore=void 0!==a.useSyncExternalStore?a.useSyncExternalStore:p},9888(e,n,t){e.exports=t(8493)}}]);
|
package/dist/477.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(globalThis.webpackChunk_cc_openmrs_cc_esm_active_prescriptions=globalThis.webpackChunk_cc_openmrs_cc_esm_active_prescriptions||[]).push([[477],{4477(
|
|
1
|
+
"use strict";(globalThis.webpackChunk_cc_openmrs_cc_esm_active_prescriptions=globalThis.webpackChunk_cc_openmrs_cc_esm_active_prescriptions||[]).push([[477],{4477(e,c,t){t.r(c),t.d(c,{default:()=>r});var i=t(6072),s=t(4504),n=t(4424),o=t(2076);const r=function(e){var c=e.patientUuid,t=e.closeOverflowMenu,r=(0,o.useTranslation)().t,p=(r("prescriptionsActionButton","Active prescriptions"),(0,i.useCallback)(function(){console.log("Botão clicado, patientUuid:",c),(0,n.launchWorkspace)("active-prescriptions-workspace",{patientUuid:c,workspaceTitle:"Active prescriptions"}),t&&t()},[c,t]));return i.createElement(s.XSD,{itemText:r("prescriptionsActionButton","Active prescriptions"),onClick:p})}}}]);
|
package/dist/91.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.webpackChunk_cc_openmrs_cc_esm_active_prescriptions=globalThis.webpackChunk_cc_openmrs_cc_esm_active_prescriptions||[]).push([[91],{8091(e,n,t){"use strict";t.r(n),t.d(n,{blueBox:()=>p,brandBox:()=>
|
|
1
|
+
(globalThis.webpackChunk_cc_openmrs_cc_esm_active_prescriptions=globalThis.webpackChunk_cc_openmrs_cc_esm_active_prescriptions||[]).push([[91],{8091(e,n,t){"use strict";t.r(n),t.d(n,{blueBox:()=>p,brandBox:()=>m,importTranslation:()=>c,prescriptionsActionButton:()=>d,prescriptionsActionMenuItem:()=>f,redBox:()=>u,root:()=>l,startupApp:()=>a});var r=t(4424),o={casualGreeting:{_type:r.Type.Boolean,_default:!1,_description:"Whether to use a casual greeting (or a formal one)."},whoToGreet:{_type:r.Type.Array,_default:["World"],_description:"Who should be greeted. Names will be separated by a comma and space.",_elements:{_type:r.Type.String},_validators:[(0,r.validator)(function(e){return e.length>0},"At least one person must be greeted.")]}},i="@cc-openmrs/cc-esm-active-prescriptions",s={featureName:"active-prescriptions",moduleName:i},c=t(4767);function a(){(0,r.defineConfigSchema)(i,o)}var l=(0,r.getAsyncLifecycle)(function(){return Promise.all([t.e(961),t.e(504),t.e(104),t.e(72),t.e(76),t.e(385)]).then(t.bind(t,1046))},s),u=(0,r.getAsyncLifecycle)(function(){return Promise.all([t.e(72),t.e(970)]).then(t.bind(t,970))},s),p=(0,r.getAsyncLifecycle)(function(){return Promise.all([t.e(72),t.e(389)]).then(t.bind(t,1389))},s),m=(0,r.getAsyncLifecycle)(function(){return Promise.all([t.e(72),t.e(488)]).then(t.bind(t,488))},s),d=(0,r.getAsyncLifecycle)(function(){return Promise.all([t.e(961),t.e(504),t.e(72),t.e(76),t.e(477)]).then(t.bind(t,4477))},s),f=(0,r.getAsyncLifecycle)(function(){return Promise.all([t.e(961),t.e(504),t.e(478),t.e(104),t.e(150),t.e(335),t.e(72),t.e(76),t.e(250),t.e(296)]).then(t.bind(t,4296))},s)},4767(e,n,t){var r={"./am.json":[1197,[197]],"./en.json":[4300,[300]],"./es.json":[3099,[99]],"./fr.json":[4055,[55]],"./he.json":[4652,[652]],"./km.json":[6716,[716]],"./pt.json":[6679,[679]]};function o(e){if(!t.o(r,e))return Promise.resolve().then(()=>{var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n});var n=r[e],o=n[0];return t.e(n[1][0]).then(()=>t(o))}o.keys=()=>Object.keys(r),o.id=4767,e.exports=o}}]);
|
package/dist/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var e,r,t,n,o={8091(e,r,t){"use strict";var n=t(4424),o={featureName:"
|
|
1
|
+
(()=>{var e,r,t,n,o={8091(e,r,t){"use strict";var n=t(4424),o={featureName:"active-prescriptions",moduleName:(n.Type.Boolean,n.Type.Array,n.Type.String,(0,n.validator)(function(e){return e.length>0},"At least one person must be greeted."),"@cc-openmrs/cc-esm-active-prescriptions")};t(4767),(0,n.getAsyncLifecycle)(function(){return Promise.all([t.e(961),t.e(504),t.e(104),t.e(72),t.e(76),t.e(385)]).then(t.bind(t,1046))},o),(0,n.getAsyncLifecycle)(function(){return Promise.all([t.e(72),t.e(970)]).then(t.bind(t,970))},o),(0,n.getAsyncLifecycle)(function(){return Promise.all([t.e(72),t.e(389)]).then(t.bind(t,1389))},o),(0,n.getAsyncLifecycle)(function(){return Promise.all([t.e(72),t.e(488)]).then(t.bind(t,488))},o),(0,n.getAsyncLifecycle)(function(){return Promise.all([t.e(961),t.e(504),t.e(72),t.e(76),t.e(477)]).then(t.bind(t,4477))},o),(0,n.getAsyncLifecycle)(function(){return Promise.all([t.e(961),t.e(504),t.e(478),t.e(104),t.e(150),t.e(335),t.e(72),t.e(76),t.e(250),t.e(296)]).then(t.bind(t,4296))},o)},4767(e,r,t){var n={"./am.json":[1197,[197]],"./en.json":[4300,[300]],"./es.json":[3099,[99]],"./fr.json":[4055,[55]],"./he.json":[4652,[652]],"./km.json":[6716,[716]],"./pt.json":[6679,[679]]};function o(e){if(!t.o(n,e))return Promise.resolve().then(()=>{var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r});var r=n[e],o=r[0];return t.e(r[1][0]).then(()=>t(o))}o.keys=()=>Object.keys(n),o.id=4767,e.exports=o}},a={};function i(e){var r=a[e];if(void 0!==r)return r.exports;var t=a[e]={id:e,exports:{}};return o[e].call(t.exports,t,t.exports,i),t.exports}i.m=o,i.c=a,i.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return i.d(r,{a:r}),r},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(t,n){if(1&n&&(t=this(t)),8&n)return t;if("object"==typeof t&&t){if(4&n&&t.__esModule)return t;if(16&n&&"function"==typeof t.then)return t}var o=Object.create(null);i.r(o);var a={};e=e||[null,r({}),r([]),r(r)];for(var s=2&n&&t;("object"==typeof s||"function"==typeof s)&&!~e.indexOf(s);s=r(s))Object.getOwnPropertyNames(s).forEach(e=>a[e]=()=>t[e]);return a.default=()=>t,i.d(o,a),o},i.d=(e,r)=>{for(var t in r)i.o(r,t)&&!i.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce((r,t)=>(i.f[t](e,r),r),[])),i.u=e=>e+".js",i.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t={},n="@cc-openmrs/cc-esm-active-prescriptions:",i.l=(e,r,o,a)=>{if(t[e])t[e].push(r);else{var s,c;if(void 0!==o)for(var l=document.getElementsByTagName("script"),u=0;u<l.length;u++){var f=l[u];if(f.getAttribute("src")==e||f.getAttribute("data-webpack")==n+o){s=f;break}}s||(c=!0,(s=document.createElement("script")).charset="utf-8",i.nc&&s.setAttribute("nonce",i.nc),s.setAttribute("data-webpack",n+o),s.src=e),t[e]=[r];var p=(r,n)=>{s.onerror=s.onload=null,clearTimeout(d);var o=t[e];if(delete t[e],s.parentNode&&s.parentNode.removeChild(s),o&&o.forEach(e=>e(n)),r)return r(n)},d=setTimeout(p.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=p.bind(null,s.onerror),s.onload=p.bind(null,s.onload),c&&document.head.appendChild(s)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{i.S={};var e={},r={};i.I=(t,n)=>{n||(n=[]);var o=r[t];if(o||(o=r[t]={}),!(n.indexOf(o)>=0)){if(n.push(o),e[t])return e[t];i.o(i.S,t)||(i.S[t]={});var a=i.S[t],s="@cc-openmrs/cc-esm-active-prescriptions",c=(e,r,t,n)=>{var o=a[e]=a[e]||{},i=o[r];(!i||!i.loaded&&(!n!=!i.eager?n:s>i.from))&&(o[r]={get:t,from:s,eager:!!n})},l=[];return"default"===t&&(c("@openmrs/esm-framework","8.0.0",()=>Promise.all([i.e(961),i.e(504),i.e(478),i.e(104),i.e(150),i.e(935),i.e(72),i.e(76),i.e(250),i.e(424)]).then(()=>()=>i(7935))),c("dayjs","1.11.19",()=>i.e(353).then(()=>()=>i(9115))),c("react-i18next","16.5.4",()=>Promise.all([i.e(478),i.e(311),i.e(72)]).then(()=>()=>i(3311))),c("react-router-dom","6.30.3",()=>Promise.all([i.e(961),i.e(282),i.e(72)]).then(()=>()=>i(282))),c("react","18.3.1",()=>i.e(540).then(()=>()=>i(6540))),c("rxjs","6.6.7",()=>i.e(184).then(()=>()=>i(3184)))),e[t]=l.length?Promise.all(l).then(()=>e[t]=1):1}}})(),(()=>{var e;globalThis.importScripts&&(e=globalThis.location+"");var r=globalThis.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var n=t.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=t[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e})(),(()=>{var e=e=>{var r=e=>e.split(".").map(e=>+e==e?+e:e),t=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),n=t[1]?r(t[1]):[];return t[2]&&(n.length++,n.push.apply(n,r(t[2]))),t[3]&&(n.push([]),n.push.apply(n,r(t[3]))),n},r=e=>{var t=e[0],n="";if(1===e.length)return"*";if(t+.5){n+=0==t?">=":-1==t?"<":1==t?"^":2==t?"~":t>0?"=":"!=";for(var o=1,a=1;a<e.length;a++)o--,n+="u"==(typeof(s=e[a]))[0]?"-":(o>0?".":"")+(o=2,s);return n}var i=[];for(a=1;a<e.length;a++){var s=e[a];i.push(0===s?"not("+c()+")":1===s?"("+c()+" || "+c()+")":2===s?i.pop()+" "+i.pop():r(s))}return c();function c(){return i.pop().replace(/^\((.+)\)$/,"$1")}},t=(r,n)=>{if(0 in r){n=e(n);var o=r[0],a=o<0;a&&(o=-o-1);for(var i=0,s=1,c=!0;;s++,i++){var l,u,f=s<r.length?(typeof r[s])[0]:"";if(i>=n.length||"o"==(u=(typeof(l=n[i]))[0]))return!c||("u"==f?s>o&&!a:""==f!=a);if("u"==u){if(!c||"u"!=f)return!1}else if(c)if(f==u)if(s<=o){if(l!=r[s])return!1}else{if(a?l>r[s]:l<r[s])return!1;l!=r[s]&&(c=!1)}else if("s"!=f&&"n"!=f){if(a||s<=o)return!1;c=!1,s--}else{if(s<=o||u<f!=a)return!1;c=!1}else"s"!=f&&"n"!=f&&(c=!1,s--)}}var p=[],d=p.pop.bind(p);for(i=1;i<r.length;i++){var h=r[i];p.push(1==h?d()|d():2==h?d()&d():h?t(h,n):!d())}return!!d()},n=(r,t,n)=>{var o=n?(e=>Object.keys(e).reduce((r,t)=>(e[t].eager&&(r[t]=e[t]),r),{}))(r[t]):r[t];return Object.keys(o).reduce((r,t)=>!r||!o[r].loaded&&((r,t)=>{r=e(r),t=e(t);for(var n=0;;){if(n>=r.length)return n<t.length&&"u"!=(typeof t[n])[0];var o=r[n],a=(typeof o)[0];if(n>=t.length)return"u"==a;var i=t[n],s=(typeof i)[0];if(a!=s)return"o"==a&&"n"==s||"s"==s||"u"==a;if("o"!=a&&"u"!=a&&o!=i)return o<i;n++}})(r,t)?t:r,0)},o=(e,r,t)=>t?t():((e,r)=>(e=>{throw new Error(e)})("Shared module "+r+" doesn't exist in shared scope "+e))(e,r),a=(e=>function(r,t,n,o,a){var s=i.I(r);return s&&s.then&&!n?s.then(e.bind(e,r,i.S[r],t,!1,o,a)):e(r,i.S[r],t,n,o,a)})((e,a,s,c,l,u)=>{if(!((e,r)=>e&&i.o(e,r))(a,s))return o(e,s,u);var f,p,d=n(a,s,c);return t(l,d)||(p=((e,t,n,o)=>"Unsatisfied version "+n+" from "+(n&&e[t][n].from)+" of shared singleton module "+t+" (required "+r(o)+")")(a,s,d,l),"undefined"!=typeof console&&console.warn&&console.warn(p)),(f=a[s][d]).loaded=1,f.get()}),s={},c={4424:()=>a("default","@openmrs/esm-framework",!1,[1,9,0,0],()=>Promise.all([i.e(961),i.e(504),i.e(478),i.e(104),i.e(150),i.e(935),i.e(72),i.e(76),i.e(250)]).then(()=>()=>i(7935))),6072:()=>a("default","react",!1,[1,18],()=>i.e(540).then(()=>()=>i(6540))),2076:()=>a("default","react-i18next",!1,[1,16],()=>Promise.all([i.e(478),i.e(311)]).then(()=>()=>i(3311))),231:()=>a("default","dayjs",!1,[1,1],()=>i.e(353).then(()=>()=>i(9115))),3083:()=>a("default","rxjs",!1,[1,6],()=>i.e(184).then(()=>()=>i(3184))),7114:()=>a("default","react-router-dom",!1,[1,6],()=>i.e(282).then(()=>()=>i(282)))};[4424].forEach(e=>{i.m[e]=r=>{s[e]=0,delete i.c[e];var t=c[e]();if("function"!=typeof t)throw new Error("Shared module is not available for eager consumption: "+e);r.exports=t()}});var l={72:[6072],76:[2076],250:[231,3083,7114],424:[4424],792:[4424]},u={};i.f.consumes=(e,r)=>{i.o(l,e)&&l[e].forEach(e=>{if(i.o(s,e))return r.push(s[e]);if(!u[e]){var t=r=>{s[e]=0,i.m[e]=t=>{delete i.c[e],t.exports=r()}};u[e]=!0;var n=r=>{delete s[e],i.m[e]=t=>{throw delete i.c[e],r}};try{var o=c[e]();o.then?r.push(s[e]=o.then(t).catch(n)):t(o)}catch(e){n(e)}}})}})(),(()=>{var e={91:0,424:0,792:0};i.f.j=(r,t)=>{var n=i.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else if(/^(250|424|72|76)$/.test(r))e[r]=0;else{var o=new Promise((t,o)=>n=e[r]=[t,o]);t.push(n[2]=o);var a=i.p+i.u(r),s=new Error;i.l(a,t=>{if(i.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var o=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;s.message="Loading chunk "+r+" failed.\n("+o+": "+a+")",s.name="ChunkLoadError",s.type=o,s.request=a,n[1](s)}},"chunk-"+r,r)}};var r=(r,t)=>{var n,o,[a,s,c]=t,l=0;if(a.some(r=>0!==e[r])){for(n in s)i.o(s,n)&&(i.m[n]=s[n]);c&&c(i)}for(r&&r(t);l<a.length;l++)o=a[l],i.o(e,o)&&e[o]&&e[o][0](),e[o]=0},t=globalThis.webpackChunk_cc_openmrs_cc_esm_active_prescriptions=globalThis.webpackChunk_cc_openmrs_cc_esm_active_prescriptions||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),i.nc=void 0,i(8091)})();
|
|
@@ -69,9 +69,9 @@
|
|
|
69
69
|
"initial": false,
|
|
70
70
|
"entry": false,
|
|
71
71
|
"recorded": false,
|
|
72
|
-
"size":
|
|
72
|
+
"size": 3382,
|
|
73
73
|
"sizes": {
|
|
74
|
-
"javascript":
|
|
74
|
+
"javascript": 3382
|
|
75
75
|
},
|
|
76
76
|
"names": [],
|
|
77
77
|
"idHints": [],
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"auxiliaryFiles": [
|
|
85
85
|
"91.js.map"
|
|
86
86
|
],
|
|
87
|
-
"hash": "
|
|
87
|
+
"hash": "4b73bd1944b6cc20",
|
|
88
88
|
"childrenByOrder": {}
|
|
89
89
|
},
|
|
90
90
|
{
|
|
@@ -265,9 +265,9 @@
|
|
|
265
265
|
"initial": false,
|
|
266
266
|
"entry": false,
|
|
267
267
|
"recorded": false,
|
|
268
|
-
"size":
|
|
268
|
+
"size": 2957,
|
|
269
269
|
"sizes": {
|
|
270
|
-
"javascript":
|
|
270
|
+
"javascript": 2957
|
|
271
271
|
},
|
|
272
272
|
"names": [],
|
|
273
273
|
"idHints": [],
|
|
@@ -281,7 +281,7 @@
|
|
|
281
281
|
"auxiliaryFiles": [
|
|
282
282
|
"296.js.map"
|
|
283
283
|
],
|
|
284
|
-
"hash": "
|
|
284
|
+
"hash": "56dddee2e1367ccf",
|
|
285
285
|
"childrenByOrder": {}
|
|
286
286
|
},
|
|
287
287
|
{
|
|
@@ -416,9 +416,9 @@
|
|
|
416
416
|
"initial": false,
|
|
417
417
|
"entry": false,
|
|
418
418
|
"recorded": false,
|
|
419
|
-
"size":
|
|
419
|
+
"size": 63849,
|
|
420
420
|
"sizes": {
|
|
421
|
-
"javascript":
|
|
421
|
+
"javascript": 63849
|
|
422
422
|
},
|
|
423
423
|
"names": [],
|
|
424
424
|
"idHints": [],
|
|
@@ -432,7 +432,7 @@
|
|
|
432
432
|
"auxiliaryFiles": [
|
|
433
433
|
"385.js.map"
|
|
434
434
|
],
|
|
435
|
-
"hash": "
|
|
435
|
+
"hash": "c083830be0cd5d97",
|
|
436
436
|
"childrenByOrder": {}
|
|
437
437
|
},
|
|
438
438
|
{
|
|
@@ -485,9 +485,9 @@
|
|
|
485
485
|
"initial": false,
|
|
486
486
|
"entry": false,
|
|
487
487
|
"recorded": false,
|
|
488
|
-
"size":
|
|
488
|
+
"size": 1115,
|
|
489
489
|
"sizes": {
|
|
490
|
-
"javascript":
|
|
490
|
+
"javascript": 1115
|
|
491
491
|
},
|
|
492
492
|
"names": [],
|
|
493
493
|
"idHints": [],
|
|
@@ -501,7 +501,7 @@
|
|
|
501
501
|
"auxiliaryFiles": [
|
|
502
502
|
"477.js.map"
|
|
503
503
|
],
|
|
504
|
-
"hash": "
|
|
504
|
+
"hash": "83830adcb3eeb26e",
|
|
505
505
|
"childrenByOrder": {}
|
|
506
506
|
},
|
|
507
507
|
{
|
|
@@ -677,10 +677,10 @@
|
|
|
677
677
|
"initial": true,
|
|
678
678
|
"entry": true,
|
|
679
679
|
"recorded": false,
|
|
680
|
-
"size":
|
|
680
|
+
"size": 24585,
|
|
681
681
|
"sizes": {
|
|
682
682
|
"consume-shared": 42,
|
|
683
|
-
"javascript":
|
|
683
|
+
"javascript": 3382,
|
|
684
684
|
"share-init": 252,
|
|
685
685
|
"runtime": 20909
|
|
686
686
|
},
|
|
@@ -697,7 +697,7 @@
|
|
|
697
697
|
"auxiliaryFiles": [
|
|
698
698
|
"main.js.map"
|
|
699
699
|
],
|
|
700
|
-
"hash": "
|
|
700
|
+
"hash": "0bdfd4fab15d91c6",
|
|
701
701
|
"childrenByOrder": {}
|
|
702
702
|
},
|
|
703
703
|
{
|
package/dist/routes.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":">=2.2.0"},"extensions":[{"name":"Red box","component":"redBox","slot":"Boxes"},{"name":"Blue box","component":"blueBox","slot":"Boxes"},{"name":"Brand box","component":"brandBox","slot":"Boxes"},{"name":"prescriptions-action-menu","component":"prescriptionsActionMenuItem","slot":"action-menu-patient-chart-items-slot","order":4},{"name":"prescriptions-action","component":"prescriptionsActionButton","slot":"patient-actions-slot","order":50}],"pages":[{"component":"root","route":"root"}],"workspaces":[{"name":"active-prescriptions-workspace","title":"Active prescriptions","component":"root","canHide":true,"width":"wider"}],"version":"1.0.
|
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":">=2.2.0"},"extensions":[{"name":"Red box","component":"redBox","slot":"Boxes"},{"name":"Blue box","component":"blueBox","slot":"Boxes"},{"name":"Brand box","component":"brandBox","slot":"Boxes"},{"name":"prescriptions-action-menu","component":"prescriptionsActionMenuItem","slot":"action-menu-patient-chart-items-slot","order":4},{"name":"prescriptions-action","component":"prescriptionsActionButton","slot":"patient-actions-slot","order":50}],"pages":[{"component":"root","route":"root"}],"workspaces":[{"name":"active-prescriptions-workspace","title":"Active prescriptions","component":"root","canHide":true,"width":"wider"}],"version":"1.0.27"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -10,33 +10,17 @@ import { configSchema } from './config-schema';
|
|
|
10
10
|
const moduleName = '@cc-openmrs/cc-esm-active-prescriptions';
|
|
11
11
|
|
|
12
12
|
const options = {
|
|
13
|
-
featureName: '
|
|
13
|
+
featureName: 'active-prescriptions',
|
|
14
14
|
moduleName,
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
/**
|
|
18
|
-
* This tells the app shell how to obtain translation files: that they
|
|
19
|
-
* are JSON files in the directory `../translations` (which you should
|
|
20
|
-
* see in the directory structure).
|
|
21
|
-
*/
|
|
22
17
|
export const importTranslation = require.context('../translations', false, /.json$/, 'lazy');
|
|
23
18
|
|
|
24
|
-
/**
|
|
25
|
-
* This function performs any setup that should happen at microfrontend
|
|
26
|
-
* load-time (such as defining the config schema) and then returns an
|
|
27
|
-
* object which describes how the React application(s) should be
|
|
28
|
-
* rendered.
|
|
29
|
-
*/
|
|
30
19
|
export function startupApp() {
|
|
31
20
|
defineConfigSchema(moduleName, configSchema);
|
|
32
21
|
}
|
|
33
22
|
|
|
34
|
-
|
|
35
|
-
* This named export tells the app shell that the default export of `root.component.tsx`
|
|
36
|
-
* should be rendered when the route matches `root`. The full route
|
|
37
|
-
* will be `openmrsSpaBase() + 'root'`, which is usually
|
|
38
|
-
* `/openmrs/spa/root`.
|
|
39
|
-
*/
|
|
23
|
+
// Export root para o workspace
|
|
40
24
|
export const root = getAsyncLifecycle(() => import('./root.component'), options);
|
|
41
25
|
|
|
42
26
|
/**
|
|
@@ -48,6 +32,7 @@ export const blueBox = getAsyncLifecycle(() => import('./boxes/extensions/blue-b
|
|
|
48
32
|
|
|
49
33
|
export const brandBox = getAsyncLifecycle(() => import('./boxes/extensions/brand-box.component'), options);
|
|
50
34
|
|
|
35
|
+
// Exportações necessárias para os botões
|
|
51
36
|
export const prescriptionsActionButton = getAsyncLifecycle(
|
|
52
37
|
() => import('./prescriptions-actions/prescriptions-action-button.component'),
|
|
53
38
|
options,
|
|
@@ -5,21 +5,35 @@ import { useTranslation } from 'react-i18next';
|
|
|
5
5
|
|
|
6
6
|
interface PrescriptionsActionButtonProps {
|
|
7
7
|
patientUuid?: string;
|
|
8
|
+
closeOverflowMenu?: () => void; // Importante para fechar o menu
|
|
8
9
|
}
|
|
9
10
|
|
|
10
|
-
const PrescriptionsActionButton: React.FC<PrescriptionsActionButtonProps> = ({
|
|
11
|
+
const PrescriptionsActionButton: React.FC<PrescriptionsActionButtonProps> = ({
|
|
12
|
+
patientUuid,
|
|
13
|
+
closeOverflowMenu
|
|
14
|
+
}) => {
|
|
11
15
|
const { t } = useTranslation();
|
|
12
16
|
const label = t('prescriptionsActionButton', 'Active prescriptions');
|
|
13
17
|
|
|
14
18
|
const handleClick = useCallback(() => {
|
|
15
|
-
|
|
19
|
+
console.log('Botão clicado, patientUuid:', patientUuid); // 👈 DEBUG
|
|
20
|
+
|
|
16
21
|
launchWorkspace('active-prescriptions-workspace', {
|
|
17
22
|
patientUuid,
|
|
18
|
-
|
|
23
|
+
workspaceTitle: 'Active prescriptions',
|
|
19
24
|
});
|
|
20
|
-
|
|
25
|
+
|
|
26
|
+
if (closeOverflowMenu) {
|
|
27
|
+
closeOverflowMenu();
|
|
28
|
+
}
|
|
29
|
+
}, [patientUuid, closeOverflowMenu]);
|
|
21
30
|
|
|
22
|
-
return
|
|
31
|
+
return (
|
|
32
|
+
<OverflowMenuItem
|
|
33
|
+
itemText={t('prescriptionsActionButton', 'Active prescriptions')}
|
|
34
|
+
onClick={handleClick}
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
23
37
|
};
|
|
24
38
|
|
|
25
39
|
export default PrescriptionsActionButton;
|
|
@@ -12,7 +12,6 @@ const PrescriptionsActionMenuItem: React.FC<PrescriptionsActionMenuItemProps> =
|
|
|
12
12
|
const { t } = useTranslation();
|
|
13
13
|
|
|
14
14
|
const handleClick = useCallback(() => {
|
|
15
|
-
if (!patientUuid) return;
|
|
16
15
|
launchWorkspace('active-prescriptions-workspace', {
|
|
17
16
|
patientUuid,
|
|
18
17
|
contextKey: `patient/${patientUuid}`,
|
package/src/root.component.tsx
CHANGED
|
@@ -29,9 +29,15 @@ import styles from './root.scss';
|
|
|
29
29
|
|
|
30
30
|
interface RootProps {
|
|
31
31
|
patientUuid?: string;
|
|
32
|
+
patient?: { uuid: string }; // Alguns workspaces passam assim
|
|
32
33
|
}
|
|
33
34
|
|
|
34
|
-
const Root: React.FC<RootProps> = (
|
|
35
|
+
const Root: React.FC<RootProps> = (props) => {
|
|
36
|
+
console.log('Root props:', props); // 👈 ADICIONE para debug
|
|
37
|
+
|
|
38
|
+
// Tenta pegar patientUuid de diferentes formas
|
|
39
|
+
const patientUuid = props.patientUuid || props.patient?.uuid;
|
|
40
|
+
|
|
35
41
|
const { t } = useTranslation();
|
|
36
42
|
if (!patientUuid) {
|
|
37
43
|
return (
|