-
Notifications
You must be signed in to change notification settings - Fork 19
How to create new Shortcuts
Greg Quinn edited this page Oct 6, 2017
·
4 revisions
- Write determineText method that uses current context to return the value to insert
- Write getShortcutType method that returns the @ and the name of the shortcut in all lower case with no spaces or hyphens
- Write static getTriggers method that returns an array of trigger strings that will cause insertion of the value returned by determineText
Update ShortcutManager shortcuts list to include new shortcut. Key is the getShortcutType method result and the value is the shortcut’s class name
For Inserters (@ data inserters) that are a context, create a class XXXInserter that extends InserterShortcut
- Write isContext() method that returns true
- Write getValidShortcuts() method that returns an array of shortcut class names that are valid within the context created by this shortcut (so you may need to create these)
- Write determineText method that uses current context to return the value to insert or the list of possible values which the user will have to choose one of in a pop up
- Write getLabel() method that returns this.getText() which will make the context tabs and text in the editor all equal the value inserted (whether user selected or determined by the shortcut itself)
- Write getShortcutType method that returns the @ and the name of the shortcut in all lower case with no spaces or hyphens
- Write static getTriggers method that returns an array of trigger strings that will cause insertion of the value returned by determineText
Update ShortcutManager shortcuts list to include new shortcut. Key is the getShortcutType method result and the value is the shortcut’s class name
- Write constructor(onUpdate, ) where for #progression is named progression and optionally holds an instance of an SHR JSON object of the correct type. If no object is provided, a new one with empty values should be created (typically via static methods in Patient)
- Write initialize(contextManager, trigger) to call super.initialize(contextManager, trigger) and then get and store its parent context at this.parentContext
- Write getShortcutType method that returns the # and the name of the shortcut in all lower case with no spaces or hyphens
- Write getAsString() method that constructs the structured phrase based on the current values in the object
- Write getFormSpec() method that returns information necessary to create the react component for a form for entering required data to construct the associated structured phrase (used in slim mode only). A new form class which is a React component will have to be created within the forms package to support Slim mode.
- Write setAttributeValue(name, value, publishChanges) method. Define name strings for each data value needed for structured phrases and set the appropriate one to the provided value on the data object using Patient. If isContext() is true, should call this.updateContextStatus(). Should end by calling this.onUpdate(this) and if publishChanges is true, call this.notifyValueChangeHandlers(name).
- Write getAttributeValue(name) that can get the specified attribute off the data object and return it
- Write updatePatient method that can update the Patient with the data object. Often a variable to indicate whether the data object was newly created in the constructor or not is needed and then set to false after creating the new entry on the Patient.
- Write validateInCurrentContext(contextManager) which can verify that this context is valid based on the current overall context. An empty array means valid; otherwise, the array contains error strings.
- Write shouldBeInContext() method to return true if there are still valid shortcuts to be done based on the current state of this context
- Write getValidShortcuts() method that returns an array of shortcut class names that are valid within the context created by this shortcut (so you may need to create these)
- Write isContext() to return true
- Write getLabel() to just return getShortcutType()
- Write static getTriggers to return an array of trigger strings that cause this shortcut to be created
Update ShortcutManager shortcuts list to include new shortcut. Key is the getShortcutType method result and the value is the shortcut’s class name
For child Creators (# data creators), create a class XXXCreator that extends CreatorShortcut. Usually the parent’s name is in there (e.g., ProgressionStatusCreator)
- Write constructor(onUpdate, ) to just call super()
- Write initialize(contextManager, trigger) to call super.initialize(contextManager, trigger), set this.text = trigger, get and store its parent context at this.parentContext, call setAttributeValue on the parent context based on the attribute this child creator represents, and then addChild(this) on parentContext
- Write onBeforeDeleted() to call super.onBeforeDeleted() and if that returns true, clear the parent’s attribute value and removeChild(this) on the parent context.
- Write getText() to return this.text
- Write getShortcutType method that returns the # and the name of the shortcut in all lower case with no spaces or hyphens
- Write validateInCurrentContext(contextManager) which can verify that this context is valid based on the current overall context. An empty array means valid; otherwise, the array contains error strings.
- Write static getTriggers to return an array of trigger strings that cause this shortcut to be created. The array should include each possible enumerated value of the attribute this shortcut represents.
Update ShortcutManager shortcuts list to include new shortcut. Key is the getShortcutType method result and the value is the shortcut’s class name
- Make sure you test parsing of notes with the new structured phrase in it
- You can also paste text with the new structured phrase into the editor and make sure it recognizes it
- Add UI test cases for the phrase's form in slim mode
- Add back-end test cases for parsing the new phrase
- Add a new slide to docs/Structured Phrase Format Description.pptx
- Save the new slide as a PDF into public named after the structured phrase (e.g. diseaseStatusSheet.pdf)
Copyright © 2017 The MITRE Corporation | Approved for Public Release; Distribution Unlimited. Case Number 16‑1988
- Home
- About Flux Notes
- Active Treatment Summary Objects
- Data Standards for Breast Cancer
- Database decision
- Declarative Shortcut Format
- Demo Script
- Deployment Plan - Lite Mode
- Dragon Software Information and Troubleshooting
- Flux Notes Lite Demo Script
- How To Create New Shortcuts
- Interaction Between REACT.js Components in Flux
- JavaScript and HTML Code Style Guide
- Key Application Features
- Minimap Evaluation
- Naming Convention for Visual Components
- NLP Server: Provisioning and Troubleshooting
- Pre Release Testing Script
- Profiling and Performance
- Redux Implementation Guide
- Shorthand Context Problem
- Testing
- Third Party Libraries Changes
- Demo Scenarios -- (out of date)