documentation for originating and committing a command#1143
Open
documentation for originating and committing a command#1143
Conversation
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
rmagier1
reviewed
Apr 16, 2026
| | Name | Type | Required | Default | Description | | ||
| |---|---|---|---|---| | ||
| | `commit` | `bool` | No | `False` | When `True`, the command is automatically committed after origination. This is a simpler alternative to returning separate `originate()` and `commit()` effects. **Note:** This only applies to command types that support the COMMIT action. Commands that do not support committing (Reason For Visit, Prescribe, Refill, Adjust Prescription, Refer, and Order commands) will ignore this parameter. See the [command type table](/sdk/effects/#commands) for which commands support COMMIT. | | ||
| | `line_number` | `int` | No | `-1` | The line number in the note where the command should be inserted. | |
Contributor
There was a problem hiding this comment.
Suggested change
| | `line_number` | `int` | No | `-1` | The line number in the note where the command should be inserted. | | |
| | `line_number` | `int` | No | `-1` | The line number in the note where the command should be inserted. By default the command will insert at the bottom of the note. | |
rmagier1
reviewed
Apr 16, 2026
Comment on lines
+474
to
+476
| ### Chaining Methods with a User-set UUID | ||
|
|
||
| The solution is to set the UUID in the plugin -- using a valid Version 4 UUID -- and pass it through to both the originate and commit actions. This is accomplished by manually setting the `command_uuid` before calling the methods: | ||
| If you need more control over the process — for example, to edit a command between origination and commit — you can chain separate effects by setting the `command_uuid` manually. This is necessary because the `originate` method executes asynchronously, so there is no way to get the `command_uuid` back from the originate action and use it for subsequent actions in the same operation. |
Contributor
There was a problem hiding this comment.
Maybe link (to this) or mention that questionnaires based commands need to do this specific chaining because originate does not add the answers. All other commands you can originate with the fields filled out.
rmagier1
reviewed
Apr 16, 2026
| | Action | Description | | ||
| |---|---| | ||
| | ORIGINATE | Create and open a new command in a note. | | ||
| | ORIGINATE | Create and open a new command in a note. Supports an optional `commit` flag to also commit the command in the same operation. | |
Contributor
There was a problem hiding this comment.
Suggested change
| | ORIGINATE | Create and open a new command in a note. Supports an optional `commit` flag to also commit the command in the same operation. | | |
| | ORIGINATE | Create and open a new command in a note. Supports an optional `commit` flag to also commit the command in the same operation if the command is commit-able via SDK. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Internal tracking: KOALA-4679