-
Notifications
You must be signed in to change notification settings - Fork 19
Updating Generated ES6 classes
The SHR ES6 Generator uses a "Class Registry" in order to minimize the effort needed for users to maintain their modifications across re-generations of the same spec. Rather than modifying the generated classes directly and having to reimplement those changes across re-generations of the spec, affected classes should instead be subclassed, and then added to the registry in the slot of the class they are subclassing.
The ClassRegistry class defines a map of [namespace][name] => class object, and is initialized in the init.js
file to avoid circular dependencies. In Flux, any "fix classes" will be stored in the src/model/fluxExtensions folder
. Each time the classes are re-generated these classes should be reviewed to ensure the modifications are still applicable. If a specific modification is no longer relevant, it should be removed and "unregistered" in init.js.
src/model/init.js
is the main entry point that initializes the SHR model classes. The function here is now also used to register the appropriate subclasses in the class registry:
function init() {
setObjectFactory(FluxObjectFactory);
ClassRegistry.initialize();
ClassRegistry.set('shr.base', 'Entry', EntryFix);
ClassRegistry.set('shr.encounter', 'Encounter', EncounterFix);
ClassRegistry.set('shr.core', 'Coding', CodingFix);
ClassRegistry.set('shr.core', 'CodeableConcept', CodeableConceptFix);
ClassRegistry.set('shr.base', 'Reason', ReasonFix);
ClassRegistry.set('shr.medication', 'MedicationRequested', MedicationRequestedFix);
}
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)