Skip to content

#48 Uses the chain-of-command pattern in motorLevel.ts - #52

Merged
EddieMachete merged 3 commits into
masterfrom
48-motor-level-refactor
Feb 25, 2026
Merged

#48 Uses the chain-of-command pattern in motorLevel.ts#52
EddieMachete merged 3 commits into
masterfrom
48-motor-level-refactor

Conversation

@EddieMachete

Copy link
Copy Markdown
Contributor

Closes #48

@EddieMachete EddieMachete self-assigned this Feb 25, 2026
@EddieMachete EddieMachete added the enhancement New feature or request label Feb 25, 2026
@EddieMachete
EddieMachete requested a review from Copilot February 25, 2026 17:34
@EddieMachete
EddieMachete marked this pull request as ready for review February 25, 2026 17:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the motor level determination algorithm in motorLevel.ts to use a chain-of-command pattern, making the algorithm more transparent, testable, and educational. The refactor preserves all existing behavior while adding comprehensive documentation and step-by-step execution capabilities.

Changes:

  • Refactored motorLevel.ts to use a step-based, chain-of-command architecture with explicit state management
  • Added generator function motorLevelSteps() for step-by-step algorithm execution
  • Added comprehensive clinical documentation (README.md) and technical architecture documentation
  • Expanded test suite with 200+ new tests covering the step-based implementation

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/en.ts Added 24 new translation keys for motor level step descriptions and actions
src/classification/neurologicalLevels/motorLevel.ts Refactored to chain-of-command pattern with state management, step handlers, and generator function
src/classification/neurologicalLevels/motorLevel.spec.ts Added comprehensive tests for step-based implementation, generator, and edge cases
src/classification/neurologicalLevels/README.md Added 584-line clinical documentation explaining motor/sensory levels and step-based architecture
docs/motorLevel-architecture.md Added technical architecture documentation describing the step-based design

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/classification/neurologicalLevels/motorLevel.ts
Comment thread docs/motorLevel-architecture.md Outdated
Comment thread src/classification/neurologicalLevels/motorLevel.spec.ts
@EddieMachete
EddieMachete merged commit 2c10d31 into master Feb 25, 2026
2 checks passed
@EddieMachete
EddieMachete deleted the 48-motor-level-refactor branch February 25, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Motor level refactor

2 participants