npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

isncsci

v2.0.6

Published

Algorithm designed to produce a spinal cord injury classification consistent with the International Standards for Neurological Classification of Spinal Cord Injury developed and maintained by the American Spinal Injury Association (ASIA)

Downloads

110

Readme

ISNCSCI Algorithm

This algorithm is designed to produce a spinal cord injury classification consistent with the International Standards for Neurological Classification of Spinal Cord Injury developed and maintained by the American Spinal Injury Association (ASIA).

Table of Contents

Import library

Using on a browser (unpkg)

<!-- using IIFE -->
<!-- defines ISNCSCI on window object -->
<script src="https://unpkg.com/isncsci/iife/ISNCSCI.min.js"></script>

<!-- using ES module -->
<script type="module">
  // using default import
  import ISNCSCI from "https://unpkg.com/isncsci/esm/ISNCSCI.min.js"
  // using named import
  import { ISNCSCI } from "https://unpkg.com/isncsci/esm/ISNCSCI.min.js"
</script>

Using in JavaScript projects

Install library using NPM

npm i isncsci

Then import the library in your project

Named import

// Recommended with typescript
import { ISNCSCI, Exam } from 'isncsci';

Default import

import ISNCSCI from 'isncsci';

CommonJS

const { ISNCSCI } = require("isncsci");
// or
const ISNCSCI = require("isncsci").ISNCSCI;

Usage

To get a classification and the totals, you just need pass an exam as a parameter while using the ISNCSCI constructor. Interface for exam parameter can be found below.

Below is an example in TypeScript:

// create exam
let exam: Exam = {
  deepAnalPressure: "Yes",
  voluntaryAnalContraction: "Yes",
  right: {
    lowestNonKeyMuscleWithMotorFunction: "C8",
    motor: {
      C5: "5",
      /* ... */
      S1: "2*",
    },
    lightTouch: {
      C2: "2",
      /* ... */
      S4_5: "1*",
    },
    pinPrick: {
      C2: "1**",
      /* ... */
      S4_5: "0",
    }
  },
  left: {
    motor: { /* ... */ },
    lightTouch: { /* ... */ },
    pinPrick: { /* ... */ },
  },
}

// get result
let result = new ISNCSCI(exam);

// output classification result
console.log(result.classification);

// output totals result
console.log(result.totals);

Interfaces

Following shows the interfaces associated to Exam used for ISNCSCI constructor.

interface Exam {
  right: ExamSide;
  left: ExamSide;
  voluntaryAnalContraction: BinaryObservation;
  deepAnalPressure: BinaryObservation;
}

interface ExamSide {
  motor: Motor;
  lightTouch: Sensory;
  pinPrick: Sensory;
  lowestNonKeyMuscleWithMotorFunction?: MotorLevel;
}

interface Motor {
  C5: MotorMuscleValue;
  C6: MotorMuscleValue;
  C7: MotorMuscleValue;
  C8: MotorMuscleValue;
  T1: MotorMuscleValue;
  L2: MotorMuscleValue;
  L3: MotorMuscleValue;
  L4: MotorMuscleValue;
  L5: MotorMuscleValue;
  S1: MotorMuscleValue;
}

interface Sensory {
  C2: SensoryPointValue;
  C3: SensoryPointValue;
  C4: SensoryPointValue;
  C5: SensoryPointValue;
  C6: SensoryPointValue;
  C7: SensoryPointValue;
  C8: SensoryPointValue;
  T1: SensoryPointValue;
  T2: SensoryPointValue;
  T3: SensoryPointValue;
  T4: SensoryPointValue;
  T5: SensoryPointValue;
  T6: SensoryPointValue;
  T7: SensoryPointValue;
  T8: SensoryPointValue;
  T9: SensoryPointValue;
  T10: SensoryPointValue;
  T11: SensoryPointValue;
  T12: SensoryPointValue;
  L1: SensoryPointValue;
  L2: SensoryPointValue;
  L3: SensoryPointValue;
  L4: SensoryPointValue;
  L5: SensoryPointValue;
  S1: SensoryPointValue;
  S2: SensoryPointValue;
  S3: SensoryPointValue;
  S4_5: SensoryPointValue;
}

Values

Here lists the valid values for interfaces above.

Tagged values represents impairment due to non-SCI injury. Single star (*) represents consider not normal for classification. Double star (**) represents consider normal for classification.

type BinaryObservation = 'Yes' | 'No' | 'NT';

type MotorLevel =
  'C5' | 'C6' | 'C7' | 'C8' | 'T1' |
  'L2' | 'L3' | 'L4' | 'L5' | 'S1';

type MotorMuscleValue =
  '0' | '1' | '2' | '3' | '4' | '5' |
  '0*' | '1*' | '2*' | '3*' | '4*' |
  '0**' | '1**' | '2**' | '3**' | '4**' |
  'NT' | 'NT*' | 'NT**';

type SensoryPointValue =
  '0' | '1' | '2' |
  '0*' | '1*' |
  '0**' | '1**' |
  'NT' | 'NT*' | 'NT**';

Demo

Demo files that can be used as examples are found in the demo folder.

You run *.spec.* tests using npx jest demo command. You can view the test for *.html file by opening it on any modern browser that supports ES modules.

  • demo/cjs.spec.js: demo using CommonJS syntax
  • demo/esm.spec.ts: demo using ES module and TypeScript syntax
  • demo/iife-and-esm.html: demo using ES module and IIFE on the browser