@cc-openmrs/cc-esm-active-prescriptions 1.0.72 → 1.0.74
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/695.js +1 -1
- package/dist/openmrs-esm-patient-lists-app.js.buildmanifest.json +3 -3
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/prescription-form/prescription-form.component.tsx +49 -50
- package/src/prescription.store.tsx +0 -11
- package/src/prescriptions.service.ts +25 -18
package/dist/695.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see 695.js.LICENSE.txt */
|
|
2
|
-
"use strict";(globalThis.webpackChunk_cc_openmrs_cc_esm_active_prescriptions=globalThis.webpackChunk_cc_openmrs_cc_esm_active_prescriptions||[]).push([[695],{6052(e,n,t){t.d(n,{A:()=>l});var a=t(2996),i=t.n(a),r=t(159),o=t.n(r)()(i());o.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}.-cc-esm-active-prescriptions__root__medicationsList___sxtXB{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}.-cc-esm-active-prescriptions__root__medicationItem___YlIOL{display:flex;align-items:center;gap:.5rem;padding:.5rem;background-color:var(--cds-layer, #ffffff);border:1px solid var(--cds-border-subtle, #e0e0e0);border-radius:.25rem}.-cc-esm-active-prescriptions__root__medicationItem___YlIOL span{flex:1;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)}","",{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,CAGF,6DACE,eAAA,CACA,QAAA,CACA,SAAA,CACA,YAAA,CACA,qBAAA,CACA,SC1EW,CD6Eb,4DACE,YAAA,CACA,kBAAA,CACA,SChFW,CDiFX,aCjFW,CDkFX,0CAAA,CACA,kDAAA,CACA,oBCzFW,CD2FX,iEACE,MAAA,CEsvBA,wDAAA,CAAA,uDAAA,CAAA,2DAAA,CAAA,gEAAA",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\n.medicationsList {\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n flex-direction: column;\n gap: layout.$spacing-03;\n}\n\n.medicationItem {\n display: flex;\n align-items: center;\n gap: layout.$spacing-03;\n padding: layout.$spacing-03;\n background-color: var(--cds-layer, #ffffff);\n border: 1px solid var(--cds-border-subtle, #e0e0e0);\n border-radius: layout.$spacing-02;\n\n span {\n flex: 1;\n @include type.type-style('body-compact-01');\n }\n}\n\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:""}]),o.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",medicationsList:"-cc-esm-active-prescriptions__root__medicationsList___sxtXB",medicationItem:"-cc-esm-active-prescriptions__root__medicationItem___YlIOL"};const l=o},8349(e,n,t){t.r(n),t.d(n,{default:()=>K});var a=t(6072),i=t(7114),r=t(2076),o=t(7224);function l(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 s(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function c(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},a=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.forEach(function(n){s(e,n,t[n])})}return e}function p(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 u(e,n){if(e){if("string"==typeof e)return l(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)?l(e,n):void 0}}var d={orders:[],location:null,policyNumber:"",digitallySigned:!1,printRequested:!1,observations:""};function f(e,n){switch(n.type){case"ADD_ORDER":return p(c({},e),{orders:(t=e.orders,function(e){if(Array.isArray(e))return l(e)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||u(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([n.payload])});case"UPDATE_ORDER":return p(c({},e),{orders:e.orders.map(function(e,t){return t===n.index?n.payload:e})});case"REMOVE_ORDER":return p(c({},e),{orders:e.orders.filter(function(e,t){return t!==n.index})});case"SET_LOCATION":return p(c({},e),{location:n.payload});case"SET_POLICY_NUMBER":return p(c({},e),{policyNumber:n.payload});case"SET_DIGITALLY_SIGNED":return p(c({},e),{digitallySigned:n.payload});case"SET_PRINT_REQUESTED":return p(c({},e),{printRequested:n.payload});case"SET_OBSERVATIONS":return p(c({},e),{observations:n.payload});case"RESET":return d;default:return e}var t}var g=(0,a.createContext)(null);function y(e){var n,t,i=e.children,r=(n=(0,a.useReducer)(f,d),t=2,function(e){if(Array.isArray(e))return e}(n)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var a,i,r=[],o=!0,l=!1;try{for(t=t.call(e);!(o=(a=t.next()).done)&&(r.push(a.value),!n||r.length!==n);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==t.return||t.return()}finally{if(l)throw i}}return r}}(n,t)||u(n,t)||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.")}()),o=r[0],l=r[1];return a.createElement(g.Provider,{value:{state:o,dispatch:l}},i)}function h(){var e=(0,a.useContext)(g);if(!e)throw new Error("usePrescriptionStore must be used within PrescriptionProvider");return e}var m=t(3323);function b(e,n,t,a,i,r,o){try{var l=e[r](o),s=l.value}catch(e){return void t(e)}l.done?n(s):Promise.resolve(s).then(a,i)}function v(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 A=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,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(o,"next",{value:s(0)}),l(o,"throw",{value:s(1)}),l(o,"return",{value:s(2)}),"function"==typeof Symbol&&l(o,Symbol.iterator,{value:function(){return this}}),o;function s(l){return function(s){return function(l){if(t)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(r=0)),r;)try{if(t=1,a&&(i=2&l[0]?a.return:l[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,l[1])).done)return i;switch(a=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,a=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(!((i=(i=r.trys).length>0&&i[i.length-1])||6!==l[0]&&2!==l[0])){r=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){r.label=l[1];break}if(6===l[0]&&r.label<i[1]){r.label=i[1],i=l;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(l);break}i[2]&&r.ops.pop(),r.trys.pop();continue}l=n.call(e,r)}catch(e){l=[6,e],a=0}finally{t=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}}(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,i){var r=n.apply(e,t);function o(e){b(r,a,i,o,l,"next",e)}function l(e){b(r,a,i,o,l,"throw",e)}o(void 0)})})();var n}}],null&&v(n.prototype,null),t&&v(n,t),e}(),$=t(5072),_=t.n($),x=t(7825),w=t.n(x),C=t(7659),k=t.n(C),E=t(5056),z=t.n(E),S=t(540),T=t.n(S),D=t(1113),M=t.n(D),I=t(6052),O={};O.styleTagTransform=M(),O.setAttributes=z(),O.insert=k().bind(null,"head"),O.domAPI=w(),O.insertStyleElement=T(),_()(I.A,O);const N=I.A&&I.A.locals?I.A.locals:void 0;function P(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 L(e,n,t,a,i,r,o){try{var l=e[r](o),s=l.value}catch(e){return void t(e)}l.done?n(s):Promise.resolve(s).then(a,i)}function B(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,r=[],o=!0,l=!1;try{for(t=t.call(e);!(o=(a=t.next()).done)&&(r.push(a.value),!n||r.length!==n);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==t.return||t.return()}finally{if(l)throw i}}return r}}(e,n)||function(e,n){if(e){if("string"==typeof e)return P(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)?P(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 j=function(e){var n=e.patientUuid,t=e.patient,l=(0,r.useTranslation)().t,s=(0,i.useNavigate)(),c=h(),p=c.state,u=c.dispatch,d=B((0,a.useState)(0),2),f=d[0],g=d[1],y=B((0,a.useState)(!1),2),b=y[0],v=y[1],$=B((0,a.useState)(null),2),_=$[0],x=$[1],w=(0,o.useLocations)(),C=(0,a.useMemo)(function(){return null!=w?w:[]},[w]);return a.createElement("div",{className:N.workspace},a.createElement("div",{className:N.header},a.createElement("h2",null,l("activePrescriptionsWorkspaceTitle","Prescrições ativas")),a.createElement("p",{className:N.subtitle},l("activePrescriptionsHelper","Revise o contexto do paciente, escolha os detalhes da visita e adicione os medicamentos à prescrição."))),a.createElement("section",{className:N.section},a.createElement("p",{className:N.fieldLabel},l("visitTimingLabel","A visita é")),a.createElement(m.tUM,{selectedIndex:f,onChange:function(e){var n=e.selectedIndex;return g(n)}},a.createElement(m.wbY,{"aria-label":l("visitTimingLabel","A visita é")},a.createElement(m.ozo,null,l("visitTimingNew","Nova")),a.createElement(m.ozo,null,l("visitTimingPast","No passado"))),a.createElement(m.T2N,null,a.createElement(m.KpK,{className:N.tabContent},a.createElement("div",{className:N.fieldGroup},a.createElement(m.a32,{id:"visit-location",items:C,itemToString:function(e){var n;return null!==(n=null==e?void 0:e.display)&&void 0!==n?n:""},selectedItem:p.location,onChange:function(e){var n=e.selectedItem;return u({type:"SET_LOCATION",payload:null!=n?n:null})},placeholder:l("visitLocationPlaceholder","Selecione o local"),titleText:l("visitLocationHeading","Local da visita"),helperText:l("visitLocationHelper","Selecione onde a visita ocorrerá.")})),a.createElement("div",{className:N.fieldGroup},a.createElement(m.ksK,{id:"insurance-policy",labelText:l("insurancePolicyNumberLabel","Número da apólice (opcional)"),placeholder:l("insurancePolicyNumberPlaceholder","Digite o número da apólice"),value:p.policyNumber,onChange:function(e){return u({type:"SET_POLICY_NUMBER",payload:e.target.value})}})),a.createElement("div",{className:N.fieldGroup},a.createElement(m.Sc0,{id:"sign-prescription-checkbox",labelText:l("signPrescriptionLabel","Assinar digitalmente a prescrição"),checked:p.digitallySigned,onChange:function(e,n){var t=n.checked;return u({type:"SET_DIGITALLY_SIGNED",payload:t})}}),a.createElement(m.Sc0,{id:"print-prescription-checkbox",labelText:l("printPrescriptionLabel","Imprimir a prescrição"),checked:p.printRequested,onChange:function(e,n){var t=n.checked;return u({type:"SET_PRINT_REQUESTED",payload:t})}})),a.createElement("div",{className:N.fieldGroup},a.createElement(m.fs1,{id:"observations",labelText:l("observations","Observações"),placeholder:l("observationsPlaceholder","Observações da prescrição..."),value:p.observations,onChange:function(e){return u({type:"SET_OBSERVATIONS",payload:e.target.value})},rows:3})),a.createElement("div",{className:N.fieldGroup},a.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8}},a.createElement("h3",{style:{margin:0}},l("medicationsList","Medicamentos")),a.createElement(m.$nd,{size:"sm",hasIconOnly:!0,kind:"ghost",renderIcon:function(){return a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.createElement("path",{d:"M16 6V26",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),a.createElement("path",{d:"M6 16H26",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}))},iconDescription:l("addMedication","Adicionar medicamento"),onClick:function(){return s("/medications/new")}})),0===p.orders.length?a.createElement("p",null,l("noMedicationsAdded","Nenhum medicamento adicionado ainda.")):a.createElement("ul",{className:N.medicationsList},p.orders.map(function(e,n){return a.createElement("li",{key:n,className:N.medicationItem},a.createElement("span",null,a.createElement("b",null,e.drug.display)," — ",e.dosage," ",e.unit,e.route?" · ".concat(e.route):""," · ",e.frequency),a.createElement(m.$nd,{size:"sm",kind:"ghost",onClick:function(){return s("/medications/".concat(n,"/edit"))}},l("edit","Editar")),a.createElement(m.$nd,{size:"sm",kind:"danger--ghost",onClick:function(){return u({type:"REMOVE_ORDER",index:n})}},l("remove","Remover")))}))),_&&a.createElement(m.jeF,{lowContrast:!0,kind:"error",title:l("submitError","Erro ao salvar a prescrição."),subtitle:_,onCloseButtonClick:function(){return x(null)}}),a.createElement("div",{style:{display:"flex",gap:8,marginTop:16}},a.createElement(m.$nd,{kind:"primary",disabled:!n||!p.location||0===p.orders.length||b,onClick:function(){return(e=function(){var e,a,i,r,o,s,c;return function(e,n){var t,a,i,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(o,"next",{value:s(0)}),l(o,"throw",{value:s(1)}),l(o,"return",{value:s(2)}),"function"==typeof Symbol&&l(o,Symbol.iterator,{value:function(){return this}}),o;function s(l){return function(s){return function(l){if(t)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(r=0)),r;)try{if(t=1,a&&(i=2&l[0]?a.return:l[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,l[1])).done)return i;switch(a=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,a=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(!((i=(i=r.trys).length>0&&i[i.length-1])||6!==l[0]&&2!==l[0])){r=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){r.label=l[1];break}if(6===l[0]&&r.label<i[1]){r.label=i[1],i=l;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(l);break}i[2]&&r.ops.pop(),r.trys.pop();continue}l=n.call(e,r)}catch(e){l=[6,e],a=0}finally{t=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}}(this,function(d){switch(d.label){case 0:if(!n||!p.location||0===p.orders.length)return[2];v(!0),x(null),d.label=1;case 1:return d.trys.push([1,3,4,5]),o={patientUuid:n,patientName:(null==t||null===(i=t.name)||void 0===i?void 0:i[0])?"".concat(null===(r=t.name[0].given)||void 0===r?void 0:r.join(" ")," ").concat(t.name[0].family).trim():"",patientBirthDate:null!==(e=null==t?void 0:t.birthDate)&&void 0!==e?e:"",patientGender:null!==(a=null==t?void 0:t.gender)&&void 0!==a?a:"",providerUuid:"",providerName:"",locationUuid:p.location.uuid,locationName:p.location.display,policyNumber:p.policyNumber,orderUuids:p.orders.map(function(e){return e.drug.uuid}),digitallySigned:p.digitallySigned,printRequested:p.printRequested,observations:p.observations},[4,A.createPrescription(o)];case 2:return d.sent(),u({type:"RESET"}),[3,5];case 3:return s=d.sent(),x(null!==(c=null==s?void 0:s.message)&&void 0!==c?c:l("submitError","Erro ao salvar a prescrição.")),[3,5];case 4:return v(!1),[7];case 5:return[2]}})},function(){var n=this,t=arguments;return new Promise(function(a,i){var r=e.apply(n,t);function o(e){L(r,a,i,o,l,"next",e)}function l(e){L(r,a,i,o,l,"throw",e)}o(void 0)})})();var e}},b?a.createElement(m.OuH,{description:l("saving","Salvando...")}):l("createPrescriptionButtonLabel","Salvar Prescrição")))),a.createElement(m.KpK,{className:N.tabContent},a.createElement(m.jeF,{lowContrast:!0,kind:"info",title:l("inPastTabPlaceholderTitle","Receitas históricas em breve"),subtitle:l("inPastTabPlaceholderSubtitle","Volte para Nova para gerenciar medicamentos atuais.")}))))))};var R=t(9324);function q(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 F(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function G(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,r=[],o=!0,l=!1;try{for(t=t.call(e);!(o=(a=t.next()).done)&&(r.push(a.value),!n||r.length!==n);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==t.return||t.return()}finally{if(l)throw i}}return r}}(e,n)||function(e,n){if(e){if("string"==typeof e)return q(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)?q(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.")}()}var U=[{value:"mg"},{value:"ml"},{value:"g"},{value:"mcg"},{value:"comprimido(s)"}],W=[{value:"Oral"},{value:"Intravenoso (IV)"},{value:"Intramuscular (IM)"},{value:"Subcutâneo (SC)"},{value:"Tópico"},{value:"Inalatório"},{value:"Sublingual"}],Y=[{value:"1x ao dia"},{value:"2x ao dia"},{value:"3x ao dia"},{value:"4x ao dia"},{value:"6/6h"},{value:"8/8h"},{value:"12/12h"},{value:"Se necessário"}];const X=function(e){var n,t,i,l,s,c,p,u,d,f,g,y,h,b,v=e.initialData,A=e.onSave,$=e.onCancel,_=(0,r.useTranslation)().t,x=G((0,a.useState)(null!==(n=null==v||null===(b=v.drug)||void 0===b?void 0:b.name)&&void 0!==n?n:""),2),w=x[0],C=x[1],k=G((0,a.useState)(null!==(t=null==v?void 0:v.drug)&&void 0!==t?t:null),2),E=k[0],z=k[1],S=G((0,a.useState)(null!==(i=null==v?void 0:v.dosage)&&void 0!==i?i:""),2),T=S[0],D=S[1],M=G((0,a.useState)(null!==(l=null==v?void 0:v.unit)&&void 0!==l?l:""),2),I=M[0],O=M[1],N=G((0,a.useState)(null!==(s=null==v?void 0:v.route)&&void 0!==s?s:""),2),P=N[0],L=N[1],B=G((0,a.useState)(null!==(c=null==v?void 0:v.frequency)&&void 0!==c?c:""),2),j=B[0],q=B[1],X=G((0,a.useState)(null!==(p=null==v?void 0:v.patientInstructions)&&void 0!==p?p:""),2),V=X[0],K=X[1],Q=G((0,a.useState)(null!==(u=null==v?void 0:v.asNeeded)&&void 0!==u&&u),2),H=Q[0],J=Q[1],Z=G((0,a.useState)(null!==(d=null==v?void 0:v.asNeededCondition)&&void 0!==d?d:""),2),ee=Z[0],ne=Z[1],te=G((0,a.useState)(null!==(f=null==v?void 0:v.indication)&&void 0!==f?f:""),2),ae=te[0],ie=te[1],re=function(e){var n,t,a=(null==e?void 0:e.length)>=3?"".concat(o.restBaseUrl,"/drug?q=").concat(encodeURIComponent(e),"&v=custom:(uuid,name,display)&limit=10"):null,i=(0,R.Ay)(a,o.openmrsFetch),r=i.data,l=i.isValidating;return{drugs:null!==(n=null==r||null===(t=r.data)||void 0===t?void 0:t.results)&&void 0!==n?n:[],isLoading:l}}(w),oe=re.drugs,le=re.isLoading;return a.createElement("form",{onSubmit:function(e){e.preventDefault(),E&&T&&I&&j&&A({drug:E,dosage:T,unit:I,route:P,frequency:j,patientInstructions:V||void 0,asNeeded:H,asNeededCondition:H&&ee||void 0,indication:ae||void 0})},style:{display:"flex",flexDirection:"column",gap:"1rem"}},a.createElement(m.a32,{id:"drug-search",titleText:_("drugName","Medicamento"),placeholder:_("drugSearchPlaceholder","Digite para buscar (mín. 3 letras)..."),items:oe.map(function(e){return function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},a=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.forEach(function(n){F(e,n,t[n])})}return e}({id:e.uuid,label:e.display||e.name},e)}),itemToString:function(e){var n;return null!==(n=null==e?void 0:e.label)&&void 0!==n?n:""},selectedItem:E?{id:E.uuid,label:E.display}:null,onInputChange:function(e){C(e),e||z(null)},onChange:function(e){var n,t=e.selectedItem;t&&z({uuid:t.uuid,name:t.name,display:null!==(n=t.display)&&void 0!==n?n:t.name})},disabled:le,helperText:le?_("searching","Buscando..."):void 0}),a.createElement(m.ksK,{id:"dosage",labelText:_("dosage","Dose"),value:T,onChange:function(e){return D(e.target.value)},required:!0}),a.createElement(m.a32,{id:"unit",titleText:_("unit","Unidade"),items:U,itemToString:function(e){var n;return null!==(n=null==e?void 0:e.value)&&void 0!==n?n:""},selectedItem:null!==(g=U.find(function(e){return e.value===I}))&&void 0!==g?g:null,onChange:function(e){var n,t=e.selectedItem;return O(null!==(n=null==t?void 0:t.value)&&void 0!==n?n:"")}}),a.createElement(m.a32,{id:"route",titleText:_("route","Via de administração"),items:W,itemToString:function(e){var n;return null!==(n=null==e?void 0:e.value)&&void 0!==n?n:""},selectedItem:null!==(y=W.find(function(e){return e.value===P}))&&void 0!==y?y:null,onChange:function(e){var n,t=e.selectedItem;return L(null!==(n=null==t?void 0:t.value)&&void 0!==n?n:"")}}),a.createElement(m.a32,{id:"frequency",titleText:_("frequency","Frequência"),items:Y,itemToString:function(e){var n;return null!==(n=null==e?void 0:e.value)&&void 0!==n?n:""},selectedItem:null!==(h=Y.find(function(e){return e.value===j}))&&void 0!==h?h:null,onChange:function(e){var n,t=e.selectedItem;return q(null!==(n=null==t?void 0:t.value)&&void 0!==n?n:"")}}),a.createElement(m.ksK,{id:"patient-instructions",labelText:_("patientInstructions","Instruções ao paciente"),value:V,onChange:function(e){return K(e.target.value)}}),a.createElement(m.Sc0,{id:"as-needed",labelText:_("asNeeded","Tomar se necessário (P.R.N.)"),checked:H,onChange:function(e,n){var t=n.checked;return J(t)}}),H&&a.createElement(m.ksK,{id:"as-needed-condition",labelText:_("asNeededCondition","Motivo P.R.N."),value:ee,onChange:function(e){return ne(e.target.value)}}),a.createElement(m.ksK,{id:"indication",labelText:_("indication","Indicação"),value:ae,onChange:function(e){return ie(e.target.value)}}),a.createElement("div",{style:{display:"flex",gap:"0.5rem",marginTop:"0.5rem"}},a.createElement(m.$nd,{type:"submit",kind:"primary",disabled:!(E&&T&&I&&j)},_("saveMedication","Salvar medicamento")),a.createElement(m.$nd,{type:"button",kind:"secondary",onClick:$},_("cancel","Cancelar"))))},V=function(){var e=(0,i.useParams)().index,n=(0,i.useNavigate)(),t=(0,r.useTranslation)().t,o=h(),l=o.state,s=o.dispatch,c=void 0!==e?parseInt(e,10):null,p=null!==c?l.orders[c]:void 0;return a.createElement("div",{className:N.workspace},a.createElement("div",{className:N.header},a.createElement(m.$nd,{size:"sm",kind:"ghost",onClick:function(){return n("/")},renderIcon:function(){return a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.createElement("path",{d:"M20 6L10 16L20 26",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))}},t("backToPrescription","Voltar à prescrição")),a.createElement("h2",{style:{margin:0}},null!==c?t("editMedication","Editar medicamento"):t("addMedication","Adicionar medicamento"))),a.createElement(X,{initialData:p,onSave:function(e){s(null!==c?{type:"UPDATE_ORDER",index:c,payload:e}:{type:"ADD_ORDER",payload:e}),n("/")},onCancel:function(){return n("/")}}))},K=function(e){var n=e.patientUuid,t=e.patient,l=(0,r.useTranslation)().t;return a.createElement(y,null,a.createElement(i.MemoryRouter,null,a.createElement(o.Workspace2,{title:l("activePrescriptionsWorkspaceTitle","Prescrições ativas"),hasUnsavedChanges:!1},a.createElement(i.Routes,null,a.createElement(i.Route,{path:"/",element:a.createElement(j,{patientUuid:n,patient:t})}),a.createElement(i.Route,{path:"/medications/new",element:a.createElement(V,null)}),a.createElement(i.Route,{path:"/medications/:index/edit",element:a.createElement(V,null)})))))}},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},r=a.useState,o=a.useEffect,l=a.useLayoutEffect,s=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=r({inst:{value:t,getSnapshot:n}}),i=a[0].inst,p=a[1];return l(function(){i.value=t,i.getSnapshot=n,c(i)&&p({inst:i})},[e,t,n]),o(function(){return c(i)&&p({inst:i}),e(function(){c(i)&&p({inst:i})})},[e]),s(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([[695],{6052(e,n,t){t.d(n,{A:()=>l});var a=t(2996),i=t.n(a),r=t(159),o=t.n(r)()(i());o.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}.-cc-esm-active-prescriptions__root__medicationsList___sxtXB{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5rem}.-cc-esm-active-prescriptions__root__medicationItem___YlIOL{display:flex;align-items:center;gap:.5rem;padding:.5rem;background-color:var(--cds-layer, #ffffff);border:1px solid var(--cds-border-subtle, #e0e0e0);border-radius:.25rem}.-cc-esm-active-prescriptions__root__medicationItem___YlIOL span{flex:1;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)}","",{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,CAGF,6DACE,eAAA,CACA,QAAA,CACA,SAAA,CACA,YAAA,CACA,qBAAA,CACA,SC1EW,CD6Eb,4DACE,YAAA,CACA,kBAAA,CACA,SChFW,CDiFX,aCjFW,CDkFX,0CAAA,CACA,kDAAA,CACA,oBCzFW,CD2FX,iEACE,MAAA,CEsvBA,wDAAA,CAAA,uDAAA,CAAA,2DAAA,CAAA,gEAAA",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\n.medicationsList {\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n flex-direction: column;\n gap: layout.$spacing-03;\n}\n\n.medicationItem {\n display: flex;\n align-items: center;\n gap: layout.$spacing-03;\n padding: layout.$spacing-03;\n background-color: var(--cds-layer, #ffffff);\n border: 1px solid var(--cds-border-subtle, #e0e0e0);\n border-radius: layout.$spacing-02;\n\n span {\n flex: 1;\n @include type.type-style('body-compact-01');\n }\n}\n\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:""}]),o.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",medicationsList:"-cc-esm-active-prescriptions__root__medicationsList___sxtXB",medicationItem:"-cc-esm-active-prescriptions__root__medicationItem___YlIOL"};const l=o},8349(e,n,t){t.r(n),t.d(n,{default:()=>K});var a=t(6072),i=t(7114),r=t(2076),o=t(7224);function l(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 s(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function c(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},a=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.forEach(function(n){s(e,n,t[n])})}return e}function p(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 u(e,n){if(e){if("string"==typeof e)return l(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)?l(e,n):void 0}}var d={orders:[],digitallySigned:!1,printRequested:!1,observations:""};function f(e,n){switch(n.type){case"ADD_ORDER":return p(c({},e),{orders:(t=e.orders,function(e){if(Array.isArray(e))return l(e)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||u(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([n.payload])});case"UPDATE_ORDER":return p(c({},e),{orders:e.orders.map(function(e,t){return t===n.index?n.payload:e})});case"REMOVE_ORDER":return p(c({},e),{orders:e.orders.filter(function(e,t){return t!==n.index})});case"SET_DIGITALLY_SIGNED":return p(c({},e),{digitallySigned:n.payload});case"SET_PRINT_REQUESTED":return p(c({},e),{printRequested:n.payload});case"SET_OBSERVATIONS":return p(c({},e),{observations:n.payload});case"RESET":return d;default:return e}var t}var g=(0,a.createContext)(null);function y(e){var n,t,i=e.children,r=(n=(0,a.useReducer)(f,d),t=2,function(e){if(Array.isArray(e))return e}(n)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var a,i,r=[],o=!0,l=!1;try{for(t=t.call(e);!(o=(a=t.next()).done)&&(r.push(a.value),!n||r.length!==n);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==t.return||t.return()}finally{if(l)throw i}}return r}}(n,t)||u(n,t)||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.")}()),o=r[0],l=r[1];return a.createElement(g.Provider,{value:{state:o,dispatch:l}},i)}function h(){var e=(0,a.useContext)(g);if(!e)throw new Error("usePrescriptionStore must be used within PrescriptionProvider");return e}var m=t(3323);function b(e,n,t,a,i,r,o){try{var l=e[r](o),s=l.value}catch(e){return void t(e)}l.done?n(s):Promise.resolve(s).then(a,i)}function v(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 A=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,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(o,"next",{value:s(0)}),l(o,"throw",{value:s(1)}),l(o,"return",{value:s(2)}),"function"==typeof Symbol&&l(o,Symbol.iterator,{value:function(){return this}}),o;function s(l){return function(s){return function(l){if(t)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(r=0)),r;)try{if(t=1,a&&(i=2&l[0]?a.return:l[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,l[1])).done)return i;switch(a=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,a=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(!((i=(i=r.trys).length>0&&i[i.length-1])||6!==l[0]&&2!==l[0])){r=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){r.label=l[1];break}if(6===l[0]&&r.label<i[1]){r.label=i[1],i=l;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(l);break}i[2]&&r.ops.pop(),r.trys.pop();continue}l=n.call(e,r)}catch(e){l=[6,e],a=0}finally{t=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}}(this,function(n){return[2,fetch("/openmrs/ws/rest/v1/prescriptions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})]})},function(){var e=this,t=arguments;return new Promise(function(a,i){var r=n.apply(e,t);function o(e){b(r,a,i,o,l,"next",e)}function l(e){b(r,a,i,o,l,"throw",e)}o(void 0)})})();var n}}],null&&v(n.prototype,null),t&&v(n,t),e}(),$=t(5072),_=t.n($),x=t(7825),w=t.n(x),C=t(7659),k=t.n(C),E=t(5056),z=t.n(E),S=t(540),D=t.n(S),M=t(1113),T=t.n(M),I=t(6052),O={};O.styleTagTransform=T(),O.setAttributes=z(),O.insert=k().bind(null,"head"),O.domAPI=w(),O.insertStyleElement=D(),_()(I.A,O);const N=I.A&&I.A.locals?I.A.locals:void 0;function P(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 B(e,n,t,a,i,r,o){try{var l=e[r](o),s=l.value}catch(e){return void t(e)}l.done?n(s):Promise.resolve(s).then(a,i)}function j(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,r=[],o=!0,l=!1;try{for(t=t.call(e);!(o=(a=t.next()).done)&&(r.push(a.value),!n||r.length!==n);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==t.return||t.return()}finally{if(l)throw i}}return r}}(e,n)||function(e,n){if(e){if("string"==typeof e)return P(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)?P(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 L=function(e){var n,t,l,s,c,p,u,d,f=e.patientUuid,g=e.patient,y=(0,r.useTranslation)().t,b=(0,i.useNavigate)(),v=h(),$=v.state,_=v.dispatch,x=(0,o.useSession)(),w=(0,o.useVisit)(null!=f?f:"").activeVisit,C=null!==(n=null!==(t=null==w?void 0:w.location)&&void 0!==t?t:null==x?void 0:x.sessionLocation)&&void 0!==n?n:null,k=null!==(l=null==C?void 0:C.uuid)&&void 0!==l?l:"",E=null!==(s=null==C?void 0:C.display)&&void 0!==s?s:"",z=null!==(c=null==x||null===(u=x.currentProvider)||void 0===u?void 0:u.uuid)&&void 0!==c?c:"",S=null!==(p=null==x||null===(d=x.user)||void 0===d?void 0:d.display)&&void 0!==p?p:"",D=j((0,a.useState)(0),2),M=D[0],T=D[1],I=j((0,a.useState)(!1),2),O=I[0],P=I[1],L=j((0,a.useState)(null),2),q=L[0],R=L[1];console.log("[PrescriptionForm] canSubmit debug",{patientUuid:f,locationUuid:k,locationName:E,providerUuid:z,providerName:S,ordersCount:$.orders.length,isSubmitting:O,session:x,activeVisit:w});var F=Boolean(f)&&Boolean(k)&&Boolean(z)&&$.orders.length>0&&!O;return a.createElement("div",{className:N.workspace},a.createElement("div",{className:N.header},a.createElement("h2",null,y("activePrescriptionsWorkspaceTitle","Prescrições ativas")),a.createElement("p",{className:N.subtitle},y("activePrescriptionsHelper","Adicione os medicamentos e salve a prescrição."))),a.createElement("section",{className:N.section},a.createElement(m.tUM,{selectedIndex:M,onChange:function(e){var n=e.selectedIndex;return T(n)}},a.createElement(m.wbY,{"aria-label":y("visitTimingLabel","A visita é")},a.createElement(m.ozo,null,y("visitTimingNew","Nova")),a.createElement(m.ozo,null,y("visitTimingPast","No passado"))),a.createElement(m.T2N,null,a.createElement(m.KpK,{className:N.tabContent},a.createElement("div",{className:N.fieldGroup},a.createElement(m.Sc0,{id:"sign-prescription-checkbox",labelText:y("signPrescriptionLabel","Assinar digitalmente a prescrição"),checked:$.digitallySigned,onChange:function(e,n){var t=n.checked;return _({type:"SET_DIGITALLY_SIGNED",payload:t})}}),a.createElement(m.Sc0,{id:"print-prescription-checkbox",labelText:y("printPrescriptionLabel","Imprimir a prescrição"),checked:$.printRequested,onChange:function(e,n){var t=n.checked;return _({type:"SET_PRINT_REQUESTED",payload:t})}})),a.createElement("div",{className:N.fieldGroup},a.createElement(m.fs1,{id:"observations",labelText:y("observations","Observações"),placeholder:y("observationsPlaceholder","Observações da prescrição..."),value:$.observations,onChange:function(e){return _({type:"SET_OBSERVATIONS",payload:e.target.value})},rows:3})),a.createElement("div",{className:N.fieldGroup},a.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8}},a.createElement("h3",{style:{margin:0}},y("medicationsList","Medicamentos")),a.createElement(m.$nd,{size:"sm",hasIconOnly:!0,kind:"ghost",renderIcon:function(){return a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.createElement("path",{d:"M16 6V26",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),a.createElement("path",{d:"M6 16H26",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}))},iconDescription:y("addMedication","Adicionar medicamento"),onClick:function(){return b("/medications/new")}})),0===$.orders.length?a.createElement("p",null,y("noMedicationsAdded","Nenhum medicamento adicionado ainda.")):a.createElement("ul",{className:N.medicationsList},$.orders.map(function(e,n){return a.createElement("li",{key:n,className:N.medicationItem},a.createElement("span",null,a.createElement("b",null,e.drug.display)," — ",e.dosage," ",e.unit,e.route?" · ".concat(e.route):""," · ",e.frequency),a.createElement(m.$nd,{size:"sm",kind:"ghost",onClick:function(){return b("/medications/".concat(n,"/edit"))}},y("edit","Editar")),a.createElement(m.$nd,{size:"sm",kind:"danger--ghost",onClick:function(){return _({type:"REMOVE_ORDER",index:n})}},y("remove","Remover")))}))),q&&a.createElement(m.jeF,{lowContrast:!0,kind:"error",title:y("submitError","Erro ao salvar a prescrição."),subtitle:q,onCloseButtonClick:function(){return R(null)}}),a.createElement("div",{style:{display:"flex",gap:8,marginTop:16}},a.createElement(m.$nd,{kind:"primary",disabled:!F,onClick:function(){return(e=function(){var e,n,t,a,i,r,o;return function(e,n){var t,a,i,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(o,"next",{value:s(0)}),l(o,"throw",{value:s(1)}),l(o,"return",{value:s(2)}),"function"==typeof Symbol&&l(o,Symbol.iterator,{value:function(){return this}}),o;function s(l){return function(s){return function(l){if(t)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(r=0)),r;)try{if(t=1,a&&(i=2&l[0]?a.return:l[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,l[1])).done)return i;switch(a=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,a=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(!((i=(i=r.trys).length>0&&i[i.length-1])||6!==l[0]&&2!==l[0])){r=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){r.label=l[1];break}if(6===l[0]&&r.label<i[1]){r.label=i[1],i=l;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(l);break}i[2]&&r.ops.pop(),r.trys.pop();continue}l=n.call(e,r)}catch(e){l=[6,e],a=0}finally{t=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}}(this,function(l){switch(l.label){case 0:if(!F)return[2];P(!0),R(null),l.label=1;case 1:return l.trys.push([1,3,4,5]),i={patientUuid:f,patientName:(null==g||null===(t=g.name)||void 0===t?void 0:t[0])?"".concat(null===(a=g.name[0].given)||void 0===a?void 0:a.join(" ")," ").concat(g.name[0].family).trim():"",patientBirthDate:null!==(e=null==g?void 0:g.birthDate)&&void 0!==e?e:"",patientGender:null!==(n=null==g?void 0:g.gender)&&void 0!==n?n:"",providerUuid:z,providerName:S,locationUuid:k,locationName:E,digitallySigned:$.digitallySigned,printRequested:$.printRequested,observations:$.observations,orders:$.orders.map(function(e){return{drugUuid:e.drug.uuid,drugDisplay:e.drug.display,dosage:e.dosage,unit:e.unit,route:e.route,frequency:e.frequency,patientInstructions:e.patientInstructions,asNeeded:e.asNeeded,asNeededCondition:e.asNeededCondition,indication:e.indication}})},[4,A.createPrescription(i)];case 2:return l.sent(),_({type:"RESET"}),[3,5];case 3:return r=l.sent(),R(null!==(o=null==r?void 0:r.message)&&void 0!==o?o:y("submitError","Erro ao salvar a prescrição.")),[3,5];case 4:return P(!1),[7];case 5:return[2]}})},function(){var n=this,t=arguments;return new Promise(function(a,i){var r=e.apply(n,t);function o(e){B(r,a,i,o,l,"next",e)}function l(e){B(r,a,i,o,l,"throw",e)}o(void 0)})})();var e}},O?a.createElement(m.OuH,{description:y("saving","Salvando...")}):y("createPrescriptionButtonLabel","Salvar Prescrição")))),a.createElement(m.KpK,{className:N.tabContent},a.createElement(m.jeF,{lowContrast:!0,kind:"info",title:y("inPastTabPlaceholderTitle","Receitas históricas em breve"),subtitle:y("inPastTabPlaceholderSubtitle","Volte para Nova para gerenciar medicamentos atuais.")}))))))};var q=t(9324);function R(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 F(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function G(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,r=[],o=!0,l=!1;try{for(t=t.call(e);!(o=(a=t.next()).done)&&(r.push(a.value),!n||r.length!==n);o=!0);}catch(e){l=!0,i=e}finally{try{o||null==t.return||t.return()}finally{if(l)throw i}}return r}}(e,n)||function(e,n){if(e){if("string"==typeof e)return R(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)?R(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.")}()}var U=[{value:"mg"},{value:"ml"},{value:"g"},{value:"mcg"},{value:"comprimido(s)"}],W=[{value:"Oral"},{value:"Intravenoso (IV)"},{value:"Intramuscular (IM)"},{value:"Subcutâneo (SC)"},{value:"Tópico"},{value:"Inalatório"},{value:"Sublingual"}],Y=[{value:"1x ao dia"},{value:"2x ao dia"},{value:"3x ao dia"},{value:"4x ao dia"},{value:"6/6h"},{value:"8/8h"},{value:"12/12h"},{value:"Se necessário"}];const V=function(e){var n,t,i,l,s,c,p,u,d,f,g,y,h,b,v=e.initialData,A=e.onSave,$=e.onCancel,_=(0,r.useTranslation)().t,x=G((0,a.useState)(null!==(n=null==v||null===(b=v.drug)||void 0===b?void 0:b.name)&&void 0!==n?n:""),2),w=x[0],C=x[1],k=G((0,a.useState)(null!==(t=null==v?void 0:v.drug)&&void 0!==t?t:null),2),E=k[0],z=k[1],S=G((0,a.useState)(null!==(i=null==v?void 0:v.dosage)&&void 0!==i?i:""),2),D=S[0],M=S[1],T=G((0,a.useState)(null!==(l=null==v?void 0:v.unit)&&void 0!==l?l:""),2),I=T[0],O=T[1],N=G((0,a.useState)(null!==(s=null==v?void 0:v.route)&&void 0!==s?s:""),2),P=N[0],B=N[1],j=G((0,a.useState)(null!==(c=null==v?void 0:v.frequency)&&void 0!==c?c:""),2),L=j[0],R=j[1],V=G((0,a.useState)(null!==(p=null==v?void 0:v.patientInstructions)&&void 0!==p?p:""),2),X=V[0],K=V[1],Q=G((0,a.useState)(null!==(u=null==v?void 0:v.asNeeded)&&void 0!==u&&u),2),H=Q[0],J=Q[1],Z=G((0,a.useState)(null!==(d=null==v?void 0:v.asNeededCondition)&&void 0!==d?d:""),2),ee=Z[0],ne=Z[1],te=G((0,a.useState)(null!==(f=null==v?void 0:v.indication)&&void 0!==f?f:""),2),ae=te[0],ie=te[1],re=function(e){var n,t,a=(null==e?void 0:e.length)>=3?"".concat(o.restBaseUrl,"/drug?q=").concat(encodeURIComponent(e),"&v=custom:(uuid,name,display)&limit=10"):null,i=(0,q.Ay)(a,o.openmrsFetch),r=i.data,l=i.isValidating;return{drugs:null!==(n=null==r||null===(t=r.data)||void 0===t?void 0:t.results)&&void 0!==n?n:[],isLoading:l}}(w),oe=re.drugs,le=re.isLoading;return a.createElement("form",{onSubmit:function(e){e.preventDefault(),E&&D&&I&&L&&A({drug:E,dosage:D,unit:I,route:P,frequency:L,patientInstructions:X||void 0,asNeeded:H,asNeededCondition:H&&ee||void 0,indication:ae||void 0})},style:{display:"flex",flexDirection:"column",gap:"1rem"}},a.createElement(m.a32,{id:"drug-search",titleText:_("drugName","Medicamento"),placeholder:_("drugSearchPlaceholder","Digite para buscar (mín. 3 letras)..."),items:oe.map(function(e){return function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},a=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.forEach(function(n){F(e,n,t[n])})}return e}({id:e.uuid,label:e.display||e.name},e)}),itemToString:function(e){var n;return null!==(n=null==e?void 0:e.label)&&void 0!==n?n:""},selectedItem:E?{id:E.uuid,label:E.display}:null,onInputChange:function(e){C(e),e||z(null)},onChange:function(e){var n,t=e.selectedItem;t&&z({uuid:t.uuid,name:t.name,display:null!==(n=t.display)&&void 0!==n?n:t.name})},disabled:le,helperText:le?_("searching","Buscando..."):void 0}),a.createElement(m.ksK,{id:"dosage",labelText:_("dosage","Dose"),value:D,onChange:function(e){return M(e.target.value)},required:!0}),a.createElement(m.a32,{id:"unit",titleText:_("unit","Unidade"),items:U,itemToString:function(e){var n;return null!==(n=null==e?void 0:e.value)&&void 0!==n?n:""},selectedItem:null!==(g=U.find(function(e){return e.value===I}))&&void 0!==g?g:null,onChange:function(e){var n,t=e.selectedItem;return O(null!==(n=null==t?void 0:t.value)&&void 0!==n?n:"")}}),a.createElement(m.a32,{id:"route",titleText:_("route","Via de administração"),items:W,itemToString:function(e){var n;return null!==(n=null==e?void 0:e.value)&&void 0!==n?n:""},selectedItem:null!==(y=W.find(function(e){return e.value===P}))&&void 0!==y?y:null,onChange:function(e){var n,t=e.selectedItem;return B(null!==(n=null==t?void 0:t.value)&&void 0!==n?n:"")}}),a.createElement(m.a32,{id:"frequency",titleText:_("frequency","Frequência"),items:Y,itemToString:function(e){var n;return null!==(n=null==e?void 0:e.value)&&void 0!==n?n:""},selectedItem:null!==(h=Y.find(function(e){return e.value===L}))&&void 0!==h?h:null,onChange:function(e){var n,t=e.selectedItem;return R(null!==(n=null==t?void 0:t.value)&&void 0!==n?n:"")}}),a.createElement(m.ksK,{id:"patient-instructions",labelText:_("patientInstructions","Instruções ao paciente"),value:X,onChange:function(e){return K(e.target.value)}}),a.createElement(m.Sc0,{id:"as-needed",labelText:_("asNeeded","Tomar se necessário (P.R.N.)"),checked:H,onChange:function(e,n){var t=n.checked;return J(t)}}),H&&a.createElement(m.ksK,{id:"as-needed-condition",labelText:_("asNeededCondition","Motivo P.R.N."),value:ee,onChange:function(e){return ne(e.target.value)}}),a.createElement(m.ksK,{id:"indication",labelText:_("indication","Indicação"),value:ae,onChange:function(e){return ie(e.target.value)}}),a.createElement("div",{style:{display:"flex",gap:"0.5rem",marginTop:"0.5rem"}},a.createElement(m.$nd,{type:"submit",kind:"primary",disabled:!(E&&D&&I&&L)},_("saveMedication","Salvar medicamento")),a.createElement(m.$nd,{type:"button",kind:"secondary",onClick:$},_("cancel","Cancelar"))))},X=function(){var e=(0,i.useParams)().index,n=(0,i.useNavigate)(),t=(0,r.useTranslation)().t,o=h(),l=o.state,s=o.dispatch,c=void 0!==e?parseInt(e,10):null,p=null!==c?l.orders[c]:void 0;return a.createElement("div",{className:N.workspace},a.createElement("div",{className:N.header},a.createElement(m.$nd,{size:"sm",kind:"ghost",onClick:function(){return n("/")},renderIcon:function(){return a.createElement("svg",{width:"16",height:"16",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a.createElement("path",{d:"M20 6L10 16L20 26",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))}},t("backToPrescription","Voltar à prescrição")),a.createElement("h2",{style:{margin:0}},null!==c?t("editMedication","Editar medicamento"):t("addMedication","Adicionar medicamento"))),a.createElement(V,{initialData:p,onSave:function(e){s(null!==c?{type:"UPDATE_ORDER",index:c,payload:e}:{type:"ADD_ORDER",payload:e}),n("/")},onCancel:function(){return n("/")}}))},K=function(e){var n=e.patientUuid,t=e.patient,l=(0,r.useTranslation)().t;return a.createElement(y,null,a.createElement(i.MemoryRouter,null,a.createElement(o.Workspace2,{title:l("activePrescriptionsWorkspaceTitle","Prescrições ativas"),hasUnsavedChanges:!1},a.createElement(i.Routes,null,a.createElement(i.Route,{path:"/",element:a.createElement(L,{patientUuid:n,patient:t})}),a.createElement(i.Route,{path:"/medications/new",element:a.createElement(X,null)}),a.createElement(i.Route,{path:"/medications/:index/edit",element:a.createElement(X,null)})))))}},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},r=a.useState,o=a.useEffect,l=a.useLayoutEffect,s=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=r({inst:{value:t,getSnapshot:n}}),i=a[0].inst,p=a[1];return l(function(){i.value=t,i.getSnapshot=n,c(i)&&p({inst:i})},[e,t,n]),o(function(){return c(i)&&p({inst:i}),e(function(){c(i)&&p({inst:i})})},[e]),s(t),t};n.useSyncExternalStore=void 0!==a.useSyncExternalStore?a.useSyncExternalStore:p},9888(e,n,t){e.exports=t(8493)}}]);
|
|
@@ -669,9 +669,9 @@
|
|
|
669
669
|
"initial": false,
|
|
670
670
|
"entry": false,
|
|
671
671
|
"recorded": false,
|
|
672
|
-
"size":
|
|
672
|
+
"size": 88661,
|
|
673
673
|
"sizes": {
|
|
674
|
-
"javascript":
|
|
674
|
+
"javascript": 88661
|
|
675
675
|
},
|
|
676
676
|
"names": [],
|
|
677
677
|
"idHints": [],
|
|
@@ -685,7 +685,7 @@
|
|
|
685
685
|
"auxiliaryFiles": [
|
|
686
686
|
"695.js.map"
|
|
687
687
|
],
|
|
688
|
-
"hash": "
|
|
688
|
+
"hash": "f46ad66ba8878a01",
|
|
689
689
|
"childrenByOrder": {}
|
|
690
690
|
},
|
|
691
691
|
{
|
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":"blueBox","slot":"Boxes"}],"workspaces2":[{"name":"active-prescriptions-workspace","component":"root","window":"active-prescriptions-workspace"}],"workspaceWindows2":[{"name":"active-prescriptions-workspace","group":"patient-chart","icon":"prescriptionsActionButton","width":"wider","order":4}],"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":"blueBox","slot":"Boxes"}],"workspaces2":[{"name":"active-prescriptions-workspace","component":"root","window":"active-prescriptions-workspace"}],"workspaceWindows2":[{"name":"active-prescriptions-workspace","group":"patient-chart","icon":"prescriptionsActionButton","width":"wider","order":4}],"version":"1.0.74"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cc-openmrs/cc-esm-active-prescriptions",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.74",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"description": "An OpenMRS frontend module for managing patient lists in the Patient Chart",
|
|
6
6
|
"browser": "dist/openmrs-esm-patient-lists-app.js",
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
2
|
import { useNavigate } from 'react-router-dom';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import {
|
|
5
5
|
Button,
|
|
6
6
|
Checkbox,
|
|
7
|
-
ComboBox,
|
|
8
7
|
InlineLoading,
|
|
9
8
|
InlineNotification,
|
|
10
9
|
Tab,
|
|
@@ -13,9 +12,8 @@ import {
|
|
|
13
12
|
TabPanels,
|
|
14
13
|
Tabs,
|
|
15
14
|
TextArea,
|
|
16
|
-
TextInput,
|
|
17
15
|
} from '@carbon/react';
|
|
18
|
-
import {
|
|
16
|
+
import { useSession, useVisit } from '@openmrs/esm-framework';
|
|
19
17
|
import { PrescriptionService } from '../prescriptions.service';
|
|
20
18
|
import { usePrescriptionStore } from '../prescription.store';
|
|
21
19
|
import styles from '../root.scss';
|
|
@@ -34,36 +32,70 @@ const PrescriptionForm: React.FC<PrescriptionFormProps> = ({ patientUuid, patien
|
|
|
34
32
|
const navigate = useNavigate();
|
|
35
33
|
const { state, dispatch } = usePrescriptionStore();
|
|
36
34
|
|
|
35
|
+
const session = useSession();
|
|
36
|
+
const { activeVisit } = useVisit(patientUuid ?? '');
|
|
37
|
+
|
|
38
|
+
// Location: prefer the active visit's location, fall back to session location
|
|
39
|
+
const location = activeVisit?.location ?? session?.sessionLocation ?? null;
|
|
40
|
+
const locationUuid = location?.uuid ?? '';
|
|
41
|
+
const locationName = location?.display ?? '';
|
|
42
|
+
|
|
43
|
+
// Provider from session
|
|
44
|
+
const providerUuid = session?.currentProvider?.uuid ?? '';
|
|
45
|
+
const providerName = session?.user?.display ?? '';
|
|
46
|
+
|
|
37
47
|
const [activeTab, setActiveTab] = useState(0);
|
|
38
48
|
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
39
49
|
const [submitError, setSubmitError] = useState<string | null>(null);
|
|
40
50
|
|
|
41
|
-
|
|
42
|
-
|
|
51
|
+
console.log('[PrescriptionForm] canSubmit debug', {
|
|
52
|
+
patientUuid,
|
|
53
|
+
locationUuid,
|
|
54
|
+
locationName,
|
|
55
|
+
providerUuid,
|
|
56
|
+
providerName,
|
|
57
|
+
ordersCount: state.orders.length,
|
|
58
|
+
isSubmitting,
|
|
59
|
+
session,
|
|
60
|
+
activeVisit,
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
const canSubmit =
|
|
64
|
+
Boolean(patientUuid) && Boolean(locationUuid) && Boolean(providerUuid) && state.orders.length > 0 && !isSubmitting;
|
|
43
65
|
|
|
44
66
|
const handleSubmit = async () => {
|
|
45
|
-
if (!
|
|
67
|
+
if (!canSubmit) return;
|
|
46
68
|
setIsSubmitting(true);
|
|
47
69
|
setSubmitError(null);
|
|
48
70
|
try {
|
|
49
71
|
const payload = {
|
|
50
|
-
patientUuid
|
|
72
|
+
patientUuid: patientUuid!,
|
|
51
73
|
patientName: patient?.name?.[0]
|
|
52
74
|
? `${patient.name[0].given?.join(' ')} ${patient.name[0].family}`.trim()
|
|
53
75
|
: '',
|
|
54
76
|
patientBirthDate: patient?.birthDate ?? '',
|
|
55
77
|
patientGender: patient?.gender ?? '',
|
|
56
|
-
providerUuid
|
|
57
|
-
providerName
|
|
58
|
-
locationUuid
|
|
59
|
-
locationName
|
|
60
|
-
policyNumber: state.policyNumber,
|
|
61
|
-
orderUuids: state.orders.map((o) => o.drug.uuid),
|
|
78
|
+
providerUuid,
|
|
79
|
+
providerName,
|
|
80
|
+
locationUuid,
|
|
81
|
+
locationName,
|
|
62
82
|
digitallySigned: state.digitallySigned,
|
|
63
83
|
printRequested: state.printRequested,
|
|
64
84
|
observations: state.observations,
|
|
85
|
+
orders: state.orders.map((o) => ({
|
|
86
|
+
drugUuid: o.drug.uuid,
|
|
87
|
+
drugDisplay: o.drug.display,
|
|
88
|
+
dosage: o.dosage,
|
|
89
|
+
unit: o.unit,
|
|
90
|
+
route: o.route,
|
|
91
|
+
frequency: o.frequency,
|
|
92
|
+
patientInstructions: o.patientInstructions,
|
|
93
|
+
asNeeded: o.asNeeded,
|
|
94
|
+
asNeededCondition: o.asNeededCondition,
|
|
95
|
+
indication: o.indication,
|
|
96
|
+
})),
|
|
65
97
|
};
|
|
66
|
-
await PrescriptionService.createPrescription(payload
|
|
98
|
+
await PrescriptionService.createPrescription(payload);
|
|
67
99
|
dispatch({ type: 'RESET' });
|
|
68
100
|
} catch (e: any) {
|
|
69
101
|
setSubmitError(e?.message ?? t('submitError', 'Erro ao salvar a prescrição.'));
|
|
@@ -77,15 +109,11 @@ const PrescriptionForm: React.FC<PrescriptionFormProps> = ({ patientUuid, patien
|
|
|
77
109
|
<div className={styles.header}>
|
|
78
110
|
<h2>{t('activePrescriptionsWorkspaceTitle', 'Prescrições ativas')}</h2>
|
|
79
111
|
<p className={styles.subtitle}>
|
|
80
|
-
{t(
|
|
81
|
-
'activePrescriptionsHelper',
|
|
82
|
-
'Revise o contexto do paciente, escolha os detalhes da visita e adicione os medicamentos à prescrição.',
|
|
83
|
-
)}
|
|
112
|
+
{t('activePrescriptionsHelper', 'Adicione os medicamentos e salve a prescrição.')}
|
|
84
113
|
</p>
|
|
85
114
|
</div>
|
|
86
115
|
|
|
87
116
|
<section className={styles.section}>
|
|
88
|
-
<p className={styles.fieldLabel}>{t('visitTimingLabel', 'A visita é')}</p>
|
|
89
117
|
<Tabs selectedIndex={activeTab} onChange={({ selectedIndex }) => setActiveTab(selectedIndex)}>
|
|
90
118
|
<TabList aria-label={t('visitTimingLabel', 'A visita é')}>
|
|
91
119
|
<Tab>{t('visitTimingNew', 'Nova')}</Tab>
|
|
@@ -93,31 +121,6 @@ const PrescriptionForm: React.FC<PrescriptionFormProps> = ({ patientUuid, patien
|
|
|
93
121
|
</TabList>
|
|
94
122
|
<TabPanels>
|
|
95
123
|
<TabPanel className={styles.tabContent}>
|
|
96
|
-
<div className={styles.fieldGroup}>
|
|
97
|
-
<ComboBox
|
|
98
|
-
id="visit-location"
|
|
99
|
-
items={locationItems}
|
|
100
|
-
itemToString={(item) => item?.display ?? ''}
|
|
101
|
-
selectedItem={state.location}
|
|
102
|
-
onChange={({ selectedItem }) =>
|
|
103
|
-
dispatch({ type: 'SET_LOCATION', payload: (selectedItem as Location) ?? null })
|
|
104
|
-
}
|
|
105
|
-
placeholder={t('visitLocationPlaceholder', 'Selecione o local')}
|
|
106
|
-
titleText={t('visitLocationHeading', 'Local da visita')}
|
|
107
|
-
helperText={t('visitLocationHelper', 'Selecione onde a visita ocorrerá.')}
|
|
108
|
-
/>
|
|
109
|
-
</div>
|
|
110
|
-
|
|
111
|
-
<div className={styles.fieldGroup}>
|
|
112
|
-
<TextInput
|
|
113
|
-
id="insurance-policy"
|
|
114
|
-
labelText={t('insurancePolicyNumberLabel', 'Número da apólice (opcional)')}
|
|
115
|
-
placeholder={t('insurancePolicyNumberPlaceholder', 'Digite o número da apólice')}
|
|
116
|
-
value={state.policyNumber}
|
|
117
|
-
onChange={(e) => dispatch({ type: 'SET_POLICY_NUMBER', payload: e.target.value })}
|
|
118
|
-
/>
|
|
119
|
-
</div>
|
|
120
|
-
|
|
121
124
|
<div className={styles.fieldGroup}>
|
|
122
125
|
<Checkbox
|
|
123
126
|
id="sign-prescription-checkbox"
|
|
@@ -205,11 +208,7 @@ const PrescriptionForm: React.FC<PrescriptionFormProps> = ({ patientUuid, patien
|
|
|
205
208
|
)}
|
|
206
209
|
|
|
207
210
|
<div style={{ display: 'flex', gap: 8, marginTop: 16 }}>
|
|
208
|
-
<Button
|
|
209
|
-
kind="primary"
|
|
210
|
-
disabled={!patientUuid || !state.location || state.orders.length === 0 || isSubmitting}
|
|
211
|
-
onClick={handleSubmit}
|
|
212
|
-
>
|
|
211
|
+
<Button kind="primary" disabled={!canSubmit} onClick={handleSubmit}>
|
|
213
212
|
{isSubmitting ? (
|
|
214
213
|
<InlineLoading description={t('saving', 'Salvando...')} />
|
|
215
214
|
) : (
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import React, { createContext, useContext, useReducer } from 'react';
|
|
2
|
-
import type { Location } from '@openmrs/esm-framework';
|
|
3
2
|
import type { PrescriptionDrugItem } from './prescriptions-actions/add-drug-prescription/add-drug-prescription.component';
|
|
4
3
|
|
|
5
4
|
// ─── State ───────────────────────────────────────────────────────────────────
|
|
6
5
|
|
|
7
6
|
export interface PrescriptionState {
|
|
8
7
|
orders: PrescriptionDrugItem[];
|
|
9
|
-
location: Location | null;
|
|
10
|
-
policyNumber: string;
|
|
11
8
|
digitallySigned: boolean;
|
|
12
9
|
printRequested: boolean;
|
|
13
10
|
observations: string;
|
|
@@ -15,8 +12,6 @@ export interface PrescriptionState {
|
|
|
15
12
|
|
|
16
13
|
const initialState: PrescriptionState = {
|
|
17
14
|
orders: [],
|
|
18
|
-
location: null,
|
|
19
|
-
policyNumber: '',
|
|
20
15
|
digitallySigned: false,
|
|
21
16
|
printRequested: false,
|
|
22
17
|
observations: '',
|
|
@@ -28,8 +23,6 @@ export type PrescriptionAction =
|
|
|
28
23
|
| { type: 'ADD_ORDER'; payload: PrescriptionDrugItem }
|
|
29
24
|
| { type: 'UPDATE_ORDER'; index: number; payload: PrescriptionDrugItem }
|
|
30
25
|
| { type: 'REMOVE_ORDER'; index: number }
|
|
31
|
-
| { type: 'SET_LOCATION'; payload: Location | null }
|
|
32
|
-
| { type: 'SET_POLICY_NUMBER'; payload: string }
|
|
33
26
|
| { type: 'SET_DIGITALLY_SIGNED'; payload: boolean }
|
|
34
27
|
| { type: 'SET_PRINT_REQUESTED'; payload: boolean }
|
|
35
28
|
| { type: 'SET_OBSERVATIONS'; payload: string }
|
|
@@ -45,10 +38,6 @@ function prescriptionReducer(state: PrescriptionState, action: PrescriptionActio
|
|
|
45
38
|
return { ...state, orders: state.orders.map((o, i) => (i === action.index ? action.payload : o)) };
|
|
46
39
|
case 'REMOVE_ORDER':
|
|
47
40
|
return { ...state, orders: state.orders.filter((_, i) => i !== action.index) };
|
|
48
|
-
case 'SET_LOCATION':
|
|
49
|
-
return { ...state, location: action.payload };
|
|
50
|
-
case 'SET_POLICY_NUMBER':
|
|
51
|
-
return { ...state, policyNumber: action.payload };
|
|
52
41
|
case 'SET_DIGITALLY_SIGNED':
|
|
53
42
|
return { ...state, digitallySigned: action.payload };
|
|
54
43
|
case 'SET_PRINT_REQUESTED':
|
|
@@ -1,31 +1,37 @@
|
|
|
1
1
|
// prescription.service.ts
|
|
2
2
|
// Serviço para manipulação de prescrições e integração com backend
|
|
3
3
|
|
|
4
|
+
export interface PrescriptionOrderItem {
|
|
5
|
+
drugUuid: string;
|
|
6
|
+
drugDisplay: string;
|
|
7
|
+
dosage: string;
|
|
8
|
+
unit: string;
|
|
9
|
+
route: string;
|
|
10
|
+
frequency: string;
|
|
11
|
+
patientInstructions?: string;
|
|
12
|
+
asNeeded?: boolean;
|
|
13
|
+
asNeededCondition?: string;
|
|
14
|
+
indication?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
4
17
|
export interface PrescriptionPayload {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
name?: string;
|
|
14
|
-
};
|
|
15
|
-
location: {
|
|
16
|
-
uuid: string;
|
|
17
|
-
name?: string;
|
|
18
|
-
};
|
|
19
|
-
policyNumber?: string;
|
|
20
|
-
orderUuids: string[];
|
|
18
|
+
patientUuid: string;
|
|
19
|
+
patientName: string;
|
|
20
|
+
patientBirthDate: string;
|
|
21
|
+
patientGender: string;
|
|
22
|
+
providerUuid: string;
|
|
23
|
+
providerName: string;
|
|
24
|
+
locationUuid: string;
|
|
25
|
+
locationName: string;
|
|
21
26
|
digitallySigned: boolean;
|
|
22
27
|
printRequested: boolean;
|
|
28
|
+
observations: string;
|
|
29
|
+
orders: PrescriptionOrderItem[];
|
|
23
30
|
}
|
|
24
31
|
|
|
25
32
|
export class PrescriptionService {
|
|
26
33
|
static async createPrescription(payload: PrescriptionPayload): Promise<Response> {
|
|
27
|
-
|
|
28
|
-
const url = '/api/prescriptions';
|
|
34
|
+
const url = '/openmrs/ws/rest/v1/prescriptions';
|
|
29
35
|
return fetch(url, {
|
|
30
36
|
method: 'POST',
|
|
31
37
|
headers: {
|
|
@@ -35,3 +41,4 @@ export class PrescriptionService {
|
|
|
35
41
|
});
|
|
36
42
|
}
|
|
37
43
|
}
|
|
44
|
+
|