Trying to Add Print And Preview Component in order_entry_owa

Tags: #<Tag:0x00007f6008c55430> #<Tag:0x00007f6008c55318>

Hello There, I am trying to add print and preview functionality in order-entry-owa . But getting test related error when I try to build the app. I just started with order-entry-owa dont to how to add new functionality please help.

Here is the logs while building the app.

thanks

Which versions of node and npm do you have?

I have node #14.16.1 and npm #6.14.

Can you upgrade to the latest and build again?

1 Like

Ok let me upgrade and try, Thanks @dkayiwa .

It build successfully but there is no .zip file generated. I update npm 7.11 that is latest.

Which command did you run?

npm run build:prod and also tried npm run build:deploy

Can you share the build log via pastebin.com?

here the complete log NextGen@NGC MINGW64 /f/digimodules/openmrs-owa-orderentry (master)$ npm run - Pastebin.com

What happens if you try to run:

SET NODE_ENV="production" && npx webpack --progress --colors
1 Like

@atiq I’m not a dev, but as a product person I’m curious - what’s the goal of the print and preview function? E.g. are your users saying “our medication ordering workflows often still use paper to share the order with the pharmacy, so the clinician needs to be able to print their order, and preview it before officially printing it, so that they don’t waste paper if there is a mistake”? Is that the user story?

I just ask because hearing things like this helps us get a sense of the kinds of solutions users are needing on the ground :slight_smile:

1 Like

Thanks @grace for your response on this. Actually we have a trend of printed prescriptions or pharmacy order. People go to the pharmacy and ask for the order through showing the paper.

Thats why we need print functionality in this app. Actually you right with the user story as well.

Thank You,

1 Like

Thanks @ibacher for your reply. Actually tried All the option like build:deploy build:dev bhild:prod

But not getting .zip file. Also followed the steps from github repo. Created config.json with all the fields But unable to get the expected zip file.

@atiq The point of my suggestion was to try to break-up the SET command and the webpack command into two commands.

On *nix it’s possible to do NODE_ENV="production" npx webpack --progress --colors and the scope for the variable is set for the current execution.

set sets an environment variable on the Windows command line, but it essentially consumes the whole line, so SET NODE_ENV="production" webpack --progress --colors actually sets the environment variable NODE_ENV to the weird value "production" webpack --progress --colors. The && is a meta character for the command line that should actually split the line into two commands.

Avoiding these kinds of issues are why I advised these three solutions earlier.

Hello @ibacher actually I also make changes in package.json’s script property included SET before NODE_ENV but I will try it again. Thanks

Sure… if you change the script, just make sure it’s something like SET NODE_ENV="production" && webpack --progress --colors.

1 Like