@openmrs/esm-dispensing-app 1.0.0-pre.21 → 1.0.0-pre.28
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/24.js +1 -2
- package/dist/294.js +1 -2
- package/dist/296.js +1 -0
- package/dist/299.js +1 -0
- package/dist/382.js +2 -0
- package/dist/{680.js.LICENSE.txt → 382.js.LICENSE.txt} +24 -0
- package/dist/573.js +1 -0
- package/dist/574.js +1 -1
- package/dist/595.js +1 -2
- package/dist/781.js +1 -0
- package/dist/906.js +1 -2
- package/dist/978.js +1 -0
- package/dist/openmrs-esm-dispensing-app.js +1 -1
- package/dist/openmrs-esm-dispensing-app.js.buildmanifest.json +114 -70
- package/dist/openmrs-esm-dispensing-app.old +1 -2
- package/package.json +9 -5
- package/src/components/history-and-comments.component.tsx +30 -0
- package/src/components/history-and-comments.scss +26 -0
- package/src/components/medication-card.component.tsx +44 -0
- package/src/components/medication-card.scss +26 -0
- package/src/components/order-expanded.component.tsx +53 -0
- package/src/components/order-expanded.scss +57 -0
- package/src/components/patient-details.component.tsx +106 -0
- package/src/components/patient-details.scss +105 -0
- package/src/components/prescription-details.component.tsx +47 -0
- package/src/components/prescription-details.scss +56 -0
- package/src/constants.ts +3 -0
- package/src/dispensing-link.tsx +13 -0
- package/src/dispensing-tiles/dispensing-tile.component.tsx +45 -0
- package/src/dispensing-tiles/dispensing-tile.scss +39 -0
- package/src/dispensing-tiles/dispensing-tiles.component.tsx +42 -0
- package/src/dispensing-tiles/dispensing-tiles.resource.tsx +33 -0
- package/src/dispensing-tiles/dispensing-tiles.scss +12 -0
- package/src/dispensing.component.tsx +15 -0
- package/src/dispensing.scss +2 -2
- package/src/dispensing.test.tsx +1 -1
- package/src/index.ts +15 -32
- package/src/{medicationrequest/medicationrequest.resource.tsx → medication-request/medication-request.resource.tsx} +32 -3
- package/src/pharmacy-header/pharmacy-header.scss +2 -0
- package/src/pharmacy-header/pharmacy-illustration.component.tsx +22 -14
- package/src/prescriptions/prescription-tab-lists.component.tsx +139 -0
- package/src/prescriptions/prescriptions.scss +131 -0
- package/src/root.scss +51 -0
- package/src/types.ts +185 -0
- package/src/utils.ts +40 -0
- package/translations/en.json +7 -1
- package/dist/132.js +0 -2
- package/dist/132.js.map +0 -1
- package/dist/24.js.map +0 -1
- package/dist/294.js.map +0 -1
- package/dist/595.js.map +0 -1
- package/dist/613.js +0 -2
- package/dist/613.js.map +0 -1
- package/dist/680.js +0 -3
- package/dist/680.js.map +0 -1
- package/dist/70.js +0 -2
- package/dist/70.js.map +0 -1
- package/dist/906.js.map +0 -1
- package/dist/openmrs-esm-dispensing-app.js.map +0 -1
- package/src/dispensing.tsx +0 -64
package/src/utils.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { DosageInstruction } from "./types";
|
|
2
|
+
|
|
3
|
+
export function getDosage(strength: string, doseNumber: number) {
|
|
4
|
+
if (!strength || !doseNumber) {
|
|
5
|
+
return "";
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const i = strength.search(/\D/);
|
|
9
|
+
const strengthQuantity = +strength.substring(0, i);
|
|
10
|
+
|
|
11
|
+
const concentrationStartIndex = strength.search(/\//);
|
|
12
|
+
|
|
13
|
+
let strengthUnits = strength.substring(i);
|
|
14
|
+
|
|
15
|
+
if (concentrationStartIndex >= 0) {
|
|
16
|
+
strengthUnits = strength.substring(i, concentrationStartIndex);
|
|
17
|
+
const j = strength.substring(concentrationStartIndex + 1).search(/\D/);
|
|
18
|
+
const concentrationQuantity = +strength.substr(
|
|
19
|
+
concentrationStartIndex + 1,
|
|
20
|
+
j
|
|
21
|
+
);
|
|
22
|
+
const concentrationUnits = strength.substring(
|
|
23
|
+
concentrationStartIndex + 1 + j
|
|
24
|
+
);
|
|
25
|
+
return `${doseNumber} ${strengthUnits} (${
|
|
26
|
+
(doseNumber / strengthQuantity) * concentrationQuantity
|
|
27
|
+
} ${concentrationUnits})`;
|
|
28
|
+
} else {
|
|
29
|
+
return `${strengthQuantity * doseNumber} ${strengthUnits}`;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function getDosageInstruction(
|
|
34
|
+
dosageInstructions: Array<DosageInstruction>
|
|
35
|
+
) {
|
|
36
|
+
if (dosageInstructions.length > 0) {
|
|
37
|
+
return dosageInstructions[0];
|
|
38
|
+
}
|
|
39
|
+
return null;
|
|
40
|
+
}
|
package/translations/en.json
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dispensing": "Dispensing",
|
|
3
|
-
"appName": "Pharmacy"
|
|
3
|
+
"appName": "Pharmacy",
|
|
4
|
+
"prescriptionDetails": "Prescription details",
|
|
5
|
+
"historyComments": "History and comments",
|
|
6
|
+
"patientDetails": "Patient details",
|
|
7
|
+
"billing": "Billing",
|
|
8
|
+
"post": "Post",
|
|
9
|
+
"addItem": "Add item"
|
|
4
10
|
}
|
package/dist/132.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_openmrs_esm_dispensing_app=self.webpackChunk_openmrs_esm_dispensing_app||[]).push([[132],{8132:(e,n,s)=>{"use strict";s.r(n),s.d(n,{backendDependencies:()=>t,importTranslation:()=>p,setupOpenMRS:()=>a});var r=s(9075),i={appName:{_type:r.Type.String,_default:"Pharmacy"}},p=s(3979),t={fhir2:"^1.2.0","webservices.rest":"^2.2.0"};function a(){var e="@openmrs/esm-dispensing-app",n={featureName:"dispensing",moduleName:e};return(0,r.defineConfigSchema)(e,i),{pages:[{load:(0,r.getAsyncLifecycle)((function(){return Promise.all([s.e(680),s.e(365),s.e(613)]).then(s.bind(s,9505))}),n),route:"dispensing"}],extensions:[]}}},3979:(e,n,s)=>{var r={"./en.json":[3574,574]};function i(e){if(!s.o(r,e))return Promise.resolve().then((()=>{var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}));var n=r[e],i=n[0];return s.e(n[1]).then((()=>s(i)))}i.keys=()=>Object.keys(r),i.id=3979,e.exports=i}}]);
|
|
2
|
-
//# sourceMappingURL=132.js.map
|
package/dist/132.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"132.js","mappings":"4OAsBaA,EAAe,CAC1BC,QAAS,CACPC,MAAOC,EAAAA,KAAAA,OACPC,SAAU,aCVRC,EAAoBC,EAAAA,MAapBC,EAAsB,CAC1BC,MAAO,SACP,mBAAoB,UAetB,SAASC,IACP,IAAMC,EAAa,8BAEbC,EAAU,CACdC,YAAa,aACbF,WAAAA,GAKF,OAFAG,EAAAA,EAAAA,oBAAmBH,EAAYV,GAExB,CACLc,MAAO,CACL,CACEC,MAAMC,EAAAA,EAAAA,oBAAkB,W,OAAM,iEAAwBL,GACtDM,MAAO,eAGXC,WAAY,M,eC9DhB,IAAIC,EAAM,CACT,YAAa,CACZ,KACA,MAGF,SAASC,EAAoBC,GAC5B,IAAIC,EAAoBC,EAAEJ,EAAKE,GAC9B,OAAOG,QAAQC,UAAUC,MAAK,KAC7B,IAAIC,EAAI,IAAIC,MAAM,uBAAyBP,EAAM,KAEjD,MADAM,EAAEE,KAAO,mBACHF,KAIR,IAAIG,EAAMX,EAAIE,GAAMU,EAAKD,EAAI,GAC7B,OAAOR,EAAoBK,EAAEG,EAAI,IAAIJ,MAAK,IAClCJ,EAAoBS,KAG7BX,EAAoBY,KAAO,IAAOC,OAAOD,KAAKb,GAC9CC,EAAoBW,GAAK,KACzBG,EAAOC,QAAUf","sources":["webpack://@openmrs/esm-dispensing-app/./src/config-schema.ts","webpack://@openmrs/esm-dispensing-app/./src/index.ts","webpack://@openmrs/esm-dispensing-app/./translations/ lazy nonrecursive .json$"],"sourcesContent":["import { Type, validator } from \"@openmrs/esm-framework\";\n\n/**\n * This is the config schema. It expects a configuration object which\n * looks like this:\n *\n * ```json\n * { \"casualGreeting\": true, \"whoToGreet\": [\"Mom\"] }\n * ```\n *\n * In OpenMRS Microfrontends, all config parameters are optional. Thus,\n * all elements must have a reasonable default. A good default is one\n * that works well with the reference application.\n *\n * To understand the schema below, please read the configuration system\n * documentation:\n * https://openmrs.github.io/openmrs-esm-core/#/main/config\n * Note especially the section \"How do I make my module configurable?\"\n * https://openmrs.github.io/openmrs-esm-core/#/main/config?id=im-developing-an-esm-module-how-do-i-make-it-configurable\n * and the Schema Reference\n * https://openmrs.github.io/openmrs-esm-core/#/main/config?id=schema-reference\n */\nexport const configSchema = {\n appName: {\n _type: Type.String,\n _default: \"Pharmacy\",\n },\n};\n\nexport type PharmacyConfig = {\n appName: String;\n};\n","/**\n * This is the entrypoint file of the application. It communicates the\n * important features of this microfrontend to the app shell. It\n * connects the app shell to the React application(s) that make up this\n * microfrontend.\n */\n\nimport { getAsyncLifecycle, defineConfigSchema } from \"@openmrs/esm-framework\";\nimport { configSchema } from \"./config-schema\";\n\n/**\n * This tells the app shell how to obtain translation files: that they\n * are JSON files in the directory `../translations` (which you should\n * see in the directory structure).\n */\nconst importTranslation = require.context(\n \"../translations\",\n false,\n /.json$/,\n \"lazy\"\n);\n\n/**\n * This tells the app shell what versions of what OpenMRS backend modules\n * are expected. Warnings will appear if suitable modules are not\n * installed. The keys are the part of the module name after\n * `openmrs-module-`; e.g., `openmrs-module-fhir2` becomes `fhir2`.\n */\nconst backendDependencies = {\n fhir2: \"^1.2.0\",\n \"webservices.rest\": \"^2.2.0\",\n};\n\n/**\n * This function performs any setup that should happen at microfrontend\n * load-time (such as defining the config schema) and then returns an\n * object which describes how the React application(s) should be\n * rendered.\n *\n * In this example, our return object contains a single page definition.\n * It tells the app shell that the default export of `greeter.tsx`\n * should be rendered when the route matches `hello`. The full route\n * will be `openmrsSpaBase() + 'hello'`, which is usually\n * `/openmrs/spa/hello`.\n */\nfunction setupOpenMRS() {\n const moduleName = \"@openmrs/esm-dispensing-app\";\n\n const options = {\n featureName: \"dispensing\",\n moduleName,\n };\n\n defineConfigSchema(moduleName, configSchema);\n\n return {\n pages: [\n {\n load: getAsyncLifecycle(() => import(\"./dispensing\"), options),\n route: \"dispensing\",\n },\n ],\n extensions: [],\n };\n}\n\nexport { backendDependencies, importTranslation, setupOpenMRS };\n","var map = {\n\t\"./en.json\": [\n\t\t3574,\n\t\t574\n\t]\n};\nfunction webpackAsyncContext(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\treturn Promise.resolve().then(() => {\n\t\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\t\te.code = 'MODULE_NOT_FOUND';\n\t\t\tthrow e;\n\t\t});\n\t}\n\n\tvar ids = map[req], id = ids[0];\n\treturn __webpack_require__.e(ids[1]).then(() => {\n\t\treturn __webpack_require__(id);\n\t});\n}\nwebpackAsyncContext.keys = () => (Object.keys(map));\nwebpackAsyncContext.id = 3979;\nmodule.exports = webpackAsyncContext;"],"names":["configSchema","appName","_type","Type","_default","importTranslation","require","backendDependencies","fhir2","setupOpenMRS","moduleName","options","featureName","defineConfigSchema","pages","load","getAsyncLifecycle","route","extensions","map","webpackAsyncContext","req","__webpack_require__","o","Promise","resolve","then","e","Error","code","ids","id","keys","Object","module","exports"],"sourceRoot":""}
|