(feat) O3-2510: Should be able to launch Add Drug Order workspace from a form#95
Conversation
…t receiving any parameters.
| this.label = options.label || ''; | ||
| this.buttonLabel = options.buttonLabel || ''; | ||
| this.workspaceName = options.workspaceName || 'order-basket'; | ||
| this.controlType = AfeControlType.AfeFormControl; |
There was a problem hiding this comment.
I have no idea what this line does or if it is needed.
There was a problem hiding this comment.
I think it's to ensure this code does the right thing. Technically, this should probably be AfeControlType.None because I can't see why we need validators of value calculators on a button, but if it works, 🤷.
There was a problem hiding this comment.
Oops, I missed this comment
| @Input() public workspaceName: string; | ||
|
|
||
| public handleClick() { | ||
| if (!window['_openmrs_esm_patient_common_lib']) { |
There was a problem hiding this comment.
Should these checks go somewhere where they will run at form load time, rather than when clicked? onInit or something?
There was a problem hiding this comment.
Maybe do a one-time check the first time toWorkspaceLauncher() is called; that way, we're still only checking on forms that are using this component, but the check is done during the render cycle?
|
@brandones , is there a way to open directly the drug order screen, not the "drug + lab" order basket? |
|
It supports sending to any workspace; Screencast.from.2023-10-29.18-19-05.mp4Screencast.from.2023-10-29.18-26-10.mp4 |

Requirements
Summary
This creates a new question type that renders a button that opens whatever workspace is configured.
Screenshots
Screencast.from.2023-10-25.14-01-15.mp4
Related Issue
https://issues.openmrs.org/browse/O3-2510
Other
Depends on openmrs/openmrs-esm-patient-chart#1430