This package implements a Swift 4.1 version of the stroke pre-hospital triage model at https://github.com/namyaila/stroke, extended to allow comparisons of multiple primary stroke centers.
The StrokeModel package exposes the following classes:
StrokeModel, an encapsulating class that provides public functions for running the model
Inputs, a class containing all of the direct model inputs, and
Sex, an enum for patient sex (one of the model inputs)
StrokeCenter, an open class storing information about a stroke center under consideration, including travel time(s)
MultiRunResults, encapsulating model outputs, along with the struct
Strategydefining the possible triage decisions
Race, an enum namespace encapsulating several enums and the function
scoreFromfor use in computing the RACE score, and static functions
fromNIHSSfor converting between RACE and NIHSS.
The simplest way to run the model is to use the optional initializer
Inputs(sex: Sex, age: Int, race: Double, timeSinceSymptoms: Double, primaryTimes: [Double], transferTimes: [Double], comprehensiveTimes: [Double])
to generate model inputs (this will be
nil if and only if
transferTimes are different lengths) then create a model object via
StrokeModel(inputs) and run it using either
StrokeModel.runWithVariance. The results class exposes a
string property that summarizes results, along with various constants for more details.
The package was developed and tested on macOS, but should also run on Linux. In testing (on the Windows Subsystem for Linux), multithreading via Grand Central Dispatch worked only intermittently, so
runWithVariance includes a
useGCD argument that can revert all computations to a more stable but slower single-threaded mode which is safer on Linux. Tests on Linux do not use GCD.