@pih/esm-dispensing-app
Version:
Medication dispensing application
1 lines • 63.8 kB
JavaScript
"use strict";(globalThis.webpackChunk_pih_esm_dispensing_app=globalThis.webpackChunk_pih_esm_dispensing_app||[]).push([[4099],{10452:(e,n,t)=>{t.d(n,{A:()=>s});var i=t(54991),a=t.n(i),o=t(76314),r=t.n(o)()(a());r.push([e.id,":root{--brand-01: #005d5d;--brand-02: #004144;--brand-03: #007d79;--bottom-nav-height: 4rem;--workspace-header-height: 3rem;--tablet-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--bottom-nav-height));--desktop-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--workspace-header-height))}.-esm-dispensing__medication-dispense-review__medicationDispenseReviewContainer___b9ZuZ{display:flex;flex-direction:column;padding-bottom:10px}.-esm-dispensing__medication-dispense-review__medicationDispenseReviewContainer___b9ZuZ .cds--css-grid{padding-left:0 !important;padding-right:0 !important}.-esm-dispensing__medication-dispense-review__dispenseDetailsContainer___DjhAn{display:flex;flex-direction:row;flex:1;gap:1rem}.-esm-dispensing__medication-dispense-review__substitutionReason___efxL5{width:100%}.-esm-dispensing__medication-dispense-review__substitutionType___dK\\+H9{width:100%}.-esm-dispensing__medication-dispense-review__productiveHeading02___\\+\\+vqK,.-esm-dispensing__medication-dispense-review__formGroup___KjyuB span{color:#525252;font-size:var(--cds-heading-02-font-size, 1rem);font-weight:var(--cds-heading-02-font-weight, 600);line-height:var(--cds-heading-02-line-height, 1.5);letter-spacing:var(--cds-heading-02-letter-spacing, 0)}.omrs-breakpoint-lt-desktop .-esm-dispensing__medication-dispense-review__formWrapper___NIVKI{background-color:#f4f4f4}.omrs-breakpoint-gt-tablet .-esm-dispensing__medication-dispense-review__formWrapper___NIVKI{background-color:#fff}.-esm-dispensing__medication-dispense-review__formGroup___KjyuB{display:flex;margin-bottom:.25rem;padding:1rem}.omrs-breakpoint-lt-desktop .-esm-dispensing__medication-dispense-review__formGroup___KjyuB>span{flex:1}.omrs-breakpoint-lt-desktop .-esm-dispensing__medication-dispense-review__formGroup___KjyuB>div{flex:3}.-esm-dispensing__medication-dispense-review__patientInfo___BsSmN{position:sticky;z-index:1000;background-color:#fff;top:3rem;overflow-y:auto}.omrs-breakpoint-lt-desktop .-esm-dispensing__medication-dispense-review__formGroup___KjyuB{flex-direction:row}.omrs-breakpoint-gt-tablet .-esm-dispensing__medication-dispense-review__formGroup___KjyuB{flex-direction:column}.-esm-dispensing__medication-dispense-review__buttonGroup___3zwj4{display:flex;position:sticky;bottom:0;width:100%}.omrs-breakpoint-lt-desktop .-esm-dispensing__medication-dispense-review__buttonGroup___3zwj4{padding:1rem 1.5rem;background-color:#fff}.-esm-dispensing__medication-dispense-review__buttonGroup___3zwj4 button{max-width:none;width:50%;height:4rem;align-items:flex-start}.-esm-dispensing__medication-dispense-review__quantitySummary___WanAL{display:flex;flex-direction:column;font-size:.8rem}","",{version:3,sources:["webpack://./node_modules/@openmrs/esm-styleguide/src/_vars.scss","webpack://./src/components/medication-dispense-review.scss","webpack://./node_modules/@carbon/layout/scss/generated/_spacing.scss","webpack://./node_modules/@carbon/type/scss/_styles.scss"],names:[],mappings:"AAsDA,MACE,mBAAA,CACA,mBAAA,CACA,mBAAA,CACA,yBAAA,CACA,+BAAA,CACA,oGAAA,CACA,2GAAA,CCzDF,wFACE,YAAA,CACA,qBAAA,CACA,mBAAA,CAEA,uGACE,yBAAA,CACA,0BAAA,CAIJ,+EACE,YAAA,CACA,kBAAA,CACA,MAAA,CACA,QCYW,CDTb,yEACE,UAAA,CAGF,wEACE,UAAA,CAGF,iJACE,aDpBc,CGu1BZ,+CAAA,CAAA,kDAAA,CAAA,kDAAA,CAAA,sDAAA,CF/zBJ,8FACE,wBDfwB,CCkB1B,6FACE,qBDrCM,CCwCR,gEACE,YAAA,CACA,oBC7BW,CD8BX,YCfW,CDkBb,iGACE,MAAA,CAGF,gGACE,MAAA,CAOF,kEACE,eAAA,CACA,YAAA,CACA,qBD7DM,CC8DN,QCdW,CDeX,eAAA,CAGF,4FACE,kBAAA,CAGF,2FACE,qBAAA,CAGF,kEACE,YAAA,CACA,eAAA,CACA,QAAA,CACA,UAAA,CAGF,8FACE,mBAAA,CACA,qBDnFM,CCsFR,yEACE,cAAA,CACA,SAAA,CACA,WCpCW,CDqCX,sBAAA,CAGF,sEACE,YAAA,CACA,qBAAA,CACA,eAAA",sourcesContent:["@use '@carbon/layout';\n\n$ui-01: #f4f4f4;\n$ui-02: #ffffff;\n$ui-03: #e0e0e0;\n$ui-04: #8d8d8d;\n$ui-05: #161616;\n$text-02: #525252;\n$text-03: #a8a8a8;\n$ui-background: #ffffff;\n$color-gray-30: #c6c6c6;\n$color-gray-70: #525252;\n$color-gray-100: #161616;\n$color-blue-60-2: #0f62fe;\n$color-blue-10: #edf5ff;\n$color-yellow-50: #feecae;\n$carbon--red-50: #fa4d56;\n$inverse-link: #78a9ff;\n$support-02: #24a148;\n$inverse-support-03: #f1c21b;\n$warning-background: #fff8e1;\n$openmrs-background-grey: #f4f4f4;\n$danger: #da1e28;\n$interactive-01: #0f62fe;\n$field-01: #f4f4f4;\n$grey-2: #e0e0e0;\n$labeldropdown: #c6c6c6;\n\n$brand-primary-10: #d9fbfb;\n$brand-primary-20: #9ef0f0;\n$brand-primary-30: #3ddbd9;\n$brand-primary-40: #08bdba;\n$brand-primary-50: #009d9a;\n\n/* 60,70 and 80 are already declared as brand-01, 02 and 03 respectively */\n\n$brand-primary-90: #022b30;\n$brand-primary-100: #081a1c;\n\n@mixin brand-01($property) {\n #{$property}: #005d5d;\n #{$property}: var(--brand-01);\n}\n\n@mixin brand-02($property) {\n #{$property}: #004144;\n #{$property}: var(--brand-02);\n}\n\n@mixin brand-03($property) {\n #{$property}: #007d79;\n #{$property}: var(--brand-03);\n}\n\n:root {\n --brand-01: #005d5d;\n --brand-02: #004144;\n --brand-03: #007d79;\n --bottom-nav-height: #{layout.$spacing-10};\n --workspace-header-height: #{layout.$spacing-09};\n --tablet-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--bottom-nav-height));\n --desktop-workspace-window-height: calc(100vh - var(--omrs-navbar-height) - var(--workspace-header-height));\n}\n\n$breakpoint-phone-min: 0px;\n$breakpoint-phone-max: 600px;\n$breakpoint-tablet-min: 601px;\n$breakpoint-tablet-max: 1023px;\n$breakpoint-small-desktop-min: 1024px;\n$breakpoint-small-desktop-max: 1439px;\n$breakpoint-large-desktop-min: 1440px;\n$breakpoint-large-desktop-max: 99999999px;\n\n/* These color variables will be removed in a future release */\n$brand-teal-01: #007d79;\n$brand-01: #005d5d;\n$brand-02: #004144;\n","@use '@carbon/layout';\n@use '@carbon/type';\n@use '@openmrs/esm-styleguide/src/vars' as *;\n\n.medicationDispenseReviewContainer {\n display: flex;\n flex-direction: column;\n padding-bottom: 10px;\n\n :global(.cds--css-grid) {\n padding-left: 0 !important;\n padding-right: 0 !important;\n }\n}\n\n.dispenseDetailsContainer {\n display: flex;\n flex-direction: row;\n flex: 1;\n gap: layout.$spacing-05;\n}\n\n.substitutionReason {\n width: 100%;\n}\n\n.substitutionType {\n width: 100%;\n}\n\n.productiveHeading02 {\n color: $color-gray-70;\n @include type.type-style('heading-02');\n}\n\n:global(.omrs-breakpoint-lt-desktop) .formWrapper {\n background-color: $openmrs-background-grey;\n}\n\n:global(.omrs-breakpoint-gt-tablet) .formWrapper {\n background-color: $ui-02;\n}\n\n.formGroup {\n display: flex;\n margin-bottom: layout.$spacing-02;\n padding: layout.$spacing-05;\n}\n\n:global(.omrs-breakpoint-lt-desktop) .formGroup > span {\n flex: 1;\n}\n\n:global(.omrs-breakpoint-lt-desktop) .formGroup > div {\n flex: 3;\n}\n\n.formGroup span {\n @extend .productiveHeading02;\n}\n\n.patientInfo {\n position: sticky;\n z-index: 1000;\n background-color: $ui-02;\n top: layout.$spacing-09;\n overflow-y: auto;\n}\n\n:global(.omrs-breakpoint-lt-desktop) .formGroup {\n flex-direction: row;\n}\n\n:global(.omrs-breakpoint-gt-tablet) .formGroup {\n flex-direction: column;\n}\n\n.buttonGroup {\n display: flex;\n position: sticky;\n bottom: 0;\n width: 100%;\n}\n\n:global(.omrs-breakpoint-lt-desktop) .buttonGroup {\n padding: layout.$spacing-05 layout.$spacing-06;\n background-color: $ui-02;\n}\n\n.buttonGroup button {\n max-width: none;\n width: 50%;\n height: layout.$spacing-10;\n align-items: flex-start;\n}\n\n.quantitySummary {\n display: flex;\n flex-direction: column;\n font-size: 0.8rem;\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={medicationDispenseReviewContainer:"-esm-dispensing__medication-dispense-review__medicationDispenseReviewContainer___b9ZuZ",dispenseDetailsContainer:"-esm-dispensing__medication-dispense-review__dispenseDetailsContainer___DjhAn",substitutionReason:"-esm-dispensing__medication-dispense-review__substitutionReason___efxL5",substitutionType:"-esm-dispensing__medication-dispense-review__substitutionType___dK+H9",productiveHeading02:"-esm-dispensing__medication-dispense-review__productiveHeading02___++vqK",formGroup:"-esm-dispensing__medication-dispense-review__formGroup___KjyuB",formWrapper:"-esm-dispensing__medication-dispense-review__formWrapper___NIVKI",patientInfo:"-esm-dispensing__medication-dispense-review__patientInfo___BsSmN",buttonGroup:"-esm-dispensing__medication-dispense-review__buttonGroup___3zwj4",quantitySummary:"-esm-dispensing__medication-dispense-review__quantitySummary___WanAL"};const s=r},54099:(e,n,t)=>{t.r(n),t.d(n,{default:()=>K});var i=t(16072),a=t.n(i),o=t(53941),r=t(78792),s=t(25987),l=t(27042),c=t(9806),p=t(92177);function d(e,n,t,i,a,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(i,a)}function u(e,n){return(t=function(){return function(e,n){var t,i,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},r=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return r.next=s(0),r.throw=s(1),r.return=s(2),"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(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,i&&(a=2&s[0]?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]<a[3])){o.label=s[1];break}if(6===s[0]&&o.label<a[1]){o.label=a[1],a=s;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(s);break}a[2]&&o.ops.pop(),o.trys.pop();continue}s=n.call(e,o)}catch(e){s=[6,e],i=0}finally{t=a=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:return[4,(0,s.openmrsFetch)("/ws/rest/v1/stockmanagement/dispenserequest",{method:"POST",signal:n.signal,headers:{"Content-Type":"application/json"},body:JSON.stringify({dispenseItems:[e]})})];case 1:return[2,t.sent()]}}))},function(){var e=this,n=arguments;return new Promise((function(i,a){var o=t.apply(e,n);function r(e){d(o,i,a,r,s,"next",e)}function s(e){d(o,i,a,r,s,"throw",e)}r(void 0)}))})();var t}var f=t(24756),g=t(85316),m=t(70231),y=t.n(m),h=t(50930),b=t(40771),v=t(85072),$=t.n(v),A=t(97825),w=t.n(A),k=t(77659),x=t.n(k),_=t(55056),C=t.n(_),z=t(10540),E=t.n(z),D=t(41113),M=t.n(D),S=t(61888),I={};I.styleTagTransform=M(),I.setAttributes=C(),I.insert=x().bind(null,"head"),I.domAPI=w(),I.insertStyleElement=E(),$()(S.A,I);const T=S.A&&S.A.locals?S.A.locals:void 0,q=function(e){var n=e.medication,t=e.editAction;return a().createElement(r.FAs,{className:T.medicationTile},a().createElement("p",{className:T.medicationName},a().createElement("strong",null,(0,c.Q0)(n))),t&&a().createElement(b.ff,{onClick:t}))};var B=t(10452),O={};O.styleTagTransform=M(),O.setAttributes=C(),O.insert=x().bind(null,"head"),O.domAPI=w(),O.insertStyleElement=E(),$()(B.A,O);const R=B.A&&B.A.locals?B.A.locals:void 0;function N(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,i=new Array(n);t<n;t++)i[t]=e[t];return i}function j(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function F(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},i=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),i.forEach((function(n){j(e,n,t[n])}))}return e}function G(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):function(e){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n.push.apply(n,t)}return n}(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})),e}function P(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 i,a,o=[],r=!0,s=!1;try{for(t=t.call(e);!(r=(i=t.next()).done)&&(o.push(i.value),!n||o.length!==n);r=!0);}catch(e){s=!0,a=e}finally{try{r||null==t.return||t.return()}finally{if(s)throw a}}return o}}(e,n)||function(e,n){if(e){if("string"==typeof e)return N(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)?N(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 U=function(e){var n,t,l,d,u,m,b,v,$,A,w,k,x,_,C,z,E,D,M,S,I,T,B,O,N=e.medicationDispense,j=e.updateMedicationDispense,U=e.quantityRemaining,W=e.quantityDispensed,Q=(0,o.useTranslation)().t,L=(0,s.useConfig)(),H=(0,s.useSession)(),Y=P((0,i.useState)(!1),2),K=Y[0],V=Y[1],Z=P((0,i.useState)([]),2),J=Z[0],X=Z[1],ee=P((0,i.useState)([]),2),ne=ee[0],te=ee[1],ie=P((0,i.useState)(N.quantity.value),2),ae=ie[0],oe=(ie[1],P((0,i.useState)(!1),2)),re=oe[0],se=oe[1],le=L.dispenseBehavior.allowModifyingPrescription,ce=(0,f.E)().orderConfigObject,pe=(0,f.ij)(L.valueSets.substitutionType.uuid).substitutionTypeValueSet,de=(0,f.Sj)(L.valueSets.substitutionReason.uuid).substitutionReasonValueSet,ue=(0,f.u9)(L.dispenserProviderRoles),fe=(0,g.uc)(N.authorizingPrescription?N.authorizingPrescription[0].reference:null,L.refreshInterval).medicationRequest,ge=(0,g.IQ)(fe?fe.encounter.reference:null).prescriptionDate,me=(0,i.useMemo)((function(){return ce?{drugRoutes:ce.drugRoutes.map((function(e){return{id:e.uuid,text:e.display}})),drugDosingUnits:ce.drugDosingUnits.map((function(e){return{id:e.uuid,text:e.display}})),drugDispensingUnits:ce.drugDispensingUnits.map((function(e){return{id:e.uuid,text:e.display}})),orderFrequencies:ce.orderFrequencies.map((function(e){return{id:e.uuid,text:e.display}}))}:{drugRoutes:[],drugDosingUnits:[],drugDispensingUnits:[],orderFrequencies:[]}}),[ce]),ye=me.drugRoutes,he=me.drugDosingUnits,be=me.drugDispensingUnits,ve=me.orderFrequencies;(0,i.useEffect)((function(){var e,n=[];if(null==pe||null===(e=pe.compose)||void 0===e?void 0:e.include){var t,i=pe.compose.include.find((function(e){return!e.system}));i&&(null===(t=i.concept)||void 0===t||t.forEach((function(e){return n.push({id:e.code,text:e.display})}))),n.sort((function(e,n){return e.text.localeCompare(n.text)}))}X(n)}),[pe]),(0,i.useEffect)((function(){var e,n=[];if(null==de||null===(e=de.compose)||void 0===e?void 0:e.include){var t,i=de.compose.include.find((function(e){return!e.system}));i&&(null===(t=i.concept)||void 0===t||t.forEach((function(e){return n.push({id:e.code,text:e.display})}))),n.sort((function(e,n){return e.text.localeCompare(n.text)}))}te(n)}),[de]);var $e,Ae,we,ke=(0,c.M$)(null===(t=(0,c.H_)(N))||void 0===t||null===(n=t.medicationCodeableConcept)||void 0===n?void 0:n.coding),xe=function(e,n){var t=(0,p.Ay)(e||!n?null:"".concat(s.fhirBaseUrl,"/").concat(n),s.openmrsFetch).data;return{medicationCodeableConceptUuid:t?(0,c.M$)(t.data.code.coding):null}}(ke,null===(l=(0,c.H_)(N).medicationReference)||void 0===l?void 0:l.reference).medicationCodeableConceptUuid,_e=($e=ke||xe||null,we=(0,p.Ay)($e?(0,c.bP)($e):null,s.openmrsFetch).data,(null==we||null===(Ae=we.data)||void 0===Ae?void 0:Ae.entry)?{medicationFormulations:we.data.entry.map((function(e){return e.resource}))}:{}).medicationFormulations,Ce=(null==fe||null===(d=fe.medicationReference)||void 0===d?void 0:d.reference)&&(null==N||null===(u=N.medicationReference)||void 0===u?void 0:u.reference)&&fe.medicationReference.reference!=N.medicationReference.reference,ze=N.substitution;(0,i.useEffect)((function(){if(Ce){if(!ze.wasSubstituted){var e=G(F({},ze),{wasSubstituted:!0});j({substitution:e})}}else ze!=f.CG&&j({substitution:f.CG})}),[Ce,ze,j]),(0,i.useEffect)((function(){se((null==H?void 0:H.user)&&(0,s.userHasAccess)(h.py,H.user))}),[H]);var Ee=(0,i.useMemo)((function(){var e,n,t,i,a,o,r;return(null==N||null===(t=N.performer)||void 0===t||null===(n=t[0])||void 0===n||null===(e=n.actor)||void 0===e?void 0:e.reference)?null==ue?void 0:ue.find((function(e){return e.uuid===N.performer[0].actor.reference.split("/")[1]})):(null==H||null===(i=H.currentProvider)||void 0===i?void 0:i.uuid)?{uuid:H.currentProvider.uuid,person:{display:null!==(r=null==H||null===(o=H.user)||void 0===o||null===(a=o.person)||void 0===a?void 0:a.display)&&void 0!==r?r:""}}:void 0}),[null==N?void 0:N.performer,ue,null==H||null===(m=H.currentProvider)||void 0===m?void 0:m.uuid,null==H||null===(v=H.user)||void 0===v||null===(b=v.person)||void 0===b?void 0:b.display]);return(0,i.useEffect)((function(){(null==Ee?void 0:Ee.uuid)&&j({performer:[{actor:{reference:"Practitioner/".concat(Ee.uuid)}}]})}),[Ee,j]),a().createElement("div",{className:R.medicationDispenseReviewContainer},a().createElement(r.BJc,{gap:5},K?a().createElement(s.ResponsiveWrapper,null,a().createElement(r.msM,{id:"medicationFormulation",items:_e,itemToString:function(e){return(0,c.Qz)(e)},initialSelectedItem:F({},null==_e?void 0:_e.find((function(e){var n;return e.id===(null===(n=N.medicationReference)||void 0===n?void 0:n.reference.split("/")[1])}))),titleText:Q("medicationFormulation","Medication Formulation"),label:Q("medicationFormulation","Medication Formulation"),onChange:function(e){var n=e.selectedItem;j({medicationCodeableConcept:void 0,medicationReference:{reference:"Medication/"+(null==n?void 0:n.id),display:(0,c.Qz)(n)}}),V(!1)}})):a().createElement(q,{medication:(0,c.H_)(N),editAction:re&&le?function(){return V(!0)}:null}),Ce&&a().createElement("div",{className:R.dispenseDetailsContainer},a().createElement(s.ResponsiveWrapper,null,a().createElement(r.a32,{className:R.substitutionType,id:"substitutionType",items:J,titleText:Q("substitutionType","Type of substitution"),itemToString:function(e){return null==e?void 0:e.text},initialSelectedItem:{id:null===(A=N.substitution.type)||void 0===A||null===($=A.coding[0])||void 0===$?void 0:$.code,text:null===(w=N.substitution.type)||void 0===w?void 0:w.text},onChange:function(e){var n=e.selectedItem;j({substitution:G(F({},N.substitution),{type:{coding:[{code:null==n?void 0:n.id}]}})})}}))),Ce&&a().createElement("div",{className:R.dispenseDetailsContainer},a().createElement(s.ResponsiveWrapper,null,a().createElement(r.a32,{className:R.substitutionReason,id:"substitutionReason",items:ne,titleText:Q("substitutionReason","Reason for substitution"),itemToString:function(e){return null==e?void 0:e.text},initialSelectedItem:{id:null===(x=N.substitution.reason[0])||void 0===x||null===(k=x.coding[0])||void 0===k?void 0:k.code,text:null===(_=N.substitution.reason[0])||void 0===_?void 0:_.text},onChange:function(e){var n=e.selectedItem;j({substitution:G(F({},N.substitution),{reason:[{coding:[{code:null==n?void 0:n.id}]}]})})}}))),a().createElement(s.ResponsiveWrapper,null,a().createElement("div",null,a().createElement("p",{className:R.quantitySummary},Q("quantityPrescribed","Quantity Prescribed"),": ",ae),a().createElement("p",{className:R.quantitySummary},Q("quantityDispensed","Quantity Dispensed"),": ",W),L.dispenseBehavior.restrictTotalQuantityDispensed?a().createElement("p",{className:R.quantitySummary},Q("quantityRemaining","Quantity Remaining to Dispense"),": ",U):null)),a().createElement("div",{className:R.dispenseDetailsContainer},a().createElement(r.Q7x,{allowEmpty:!0,value:N.quantity.value,disabled:!re,hideSteppers:!0,id:"quantity",invalidText:Q("numberIsNotValid","Number is not valid"),label:a().createElement("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"}},Q("quantity","Quantity")),min:0,max:L.dispenseBehavior.restrictTotalQuantityDispensed?U:void 0,onChange:function(e,n){j({quantity:G(F({},N.quantity),{value:n.value?parseFloat(n.value.toString()):0})})}}),a().createElement(s.ResponsiveWrapper,null,a().createElement(r.a32,{id:"quantityUnits",disabled:!re||!le,items:be,titleText:Q("drugDispensingUnit","Dispensing unit"),itemToString:function(e){return null==e?void 0:e.text},initialSelectedItem:{id:N.quantity.code,text:N.quantity.unit},onChange:function(e){var n=e.selectedItem;j({quantity:{value:N.quantity.value,code:null==n?void 0:n.id}})},required:!0}))),a().createElement("div",{className:R.dispenseDetailsContainer},a().createElement(r.Q7x,{allowEmpty:!1,disabled:!re||!le,hideSteppers:!0,id:"dosingQuantity",invalidText:Q("numberIsNotValid","Number is not valid"),min:0,label:Q("dose","Dose"),value:N.dosageInstruction[0].doseAndRate[0].doseQuantity.value,onChange:function(e,n){j({dosageInstruction:[G(F({},N.dosageInstruction[0]),{doseAndRate:[G(F({},N.dosageInstruction[0].doseAndRate[0]),{doseQuantity:G(F({},N.dosageInstruction[0].doseAndRate[0].doseQuantity),{value:n.value?parseFloat(n.value.toString()):0})})]})]})}}),a().createElement(s.ResponsiveWrapper,null,a().createElement(r.a32,{id:"dosingUnits",disabled:!re||!le,items:he,titleText:Q("doseUnit","Dose unit"),itemToString:function(e){return null==e?void 0:e.text},initialSelectedItem:{id:null===(C=N.dosageInstruction[0].doseAndRate[0].doseQuantity)||void 0===C?void 0:C.code,text:null===(z=N.dosageInstruction[0].doseAndRate[0].doseQuantity)||void 0===z?void 0:z.unit},onChange:function(e){var n,t=e.selectedItem;j({dosageInstruction:[G(F({},N.dosageInstruction[0]),{doseAndRate:[{doseQuantity:{value:null===(n=N.dosageInstruction[0].doseAndRate[0].doseQuantity)||void 0===n?void 0:n.value,code:null==t?void 0:t.id}}]})]})},required:!0})),a().createElement(s.ResponsiveWrapper,null,a().createElement(r.a32,{id:"editRoute",disabled:!re||!le,items:ye,initialSelectedItem:{id:null===(D=N.dosageInstruction[0].route)||void 0===D||null===(E=D.coding[0])||void 0===E?void 0:E.code,text:null===(M=N.dosageInstruction[0].route)||void 0===M?void 0:M.text},titleText:Q("route","Route"),itemToString:function(e){return null==e?void 0:e.text},onChange:function(e){var n=e.selectedItem;j({dosageInstruction:[G(F({},N.dosageInstruction[0]),{route:{coding:[{code:null==n?void 0:n.id}]}})]})},required:!0}))),a().createElement(s.ResponsiveWrapper,null,a().createElement(r.a32,{id:"frequency",disabled:!re||!le,items:ve,initialSelectedItem:{id:null===(T=N.dosageInstruction[0].timing)||void 0===T||null===(I=T.code)||void 0===I||null===(S=I.coding[0])||void 0===S?void 0:S.code,text:null===(O=N.dosageInstruction[0].timing)||void 0===O||null===(B=O.code)||void 0===B?void 0:B.text},titleText:Q("frequency","Frequency"),itemToString:function(e){return null==e?void 0:e.text},onChange:function(e){var n=e.selectedItem;j({dosageInstruction:[G(F({},N.dosageInstruction[0]),{timing:G(F({},N.dosageInstruction[0].timing),{code:{coding:[{code:null==n?void 0:n.id}]}})})]})},required:!0})),a().createElement(r.fs1,{labelText:Q("patientInstructions","Patient instructions"),value:N.dosageInstruction[0].text,maxLength:65535,onChange:function(e){j({dosageInstruction:[G(F({},N.dosageInstruction[0]),{text:e.target.value})]})}}),a().createElement(s.OpenmrsDatePicker,{id:"dispenseDate",labelText:Q("dispenseDate","Date of Dispense"),minDate:ge?y()(ge).startOf("day").toDate():null,maxDate:y()().toDate(),onChange:function(e){var n=N.whenHandedOver?y()(N.whenHandedOver):null,t=y()(e);j({whenHandedOver:(null==n?void 0:n.isSame(t,"day"))?n.toISOString():t.toISOString()})},value:y()(N.whenHandedOver).toDate()}),ue&&a().createElement(s.ResponsiveWrapper,null,a().createElement(r.a32,{id:"dispense