Skip to content

Swift implementation of "Optimization of Prehospital Triage of Patients with Suspected Ischemic Stroke"

License

Notifications You must be signed in to change notification settings

eschenfeldt/stroke-swift

Repository files navigation

StrokeModel

This package implements a Swift 4.2 version of the stroke pre-hospital triage model at https://github.com/aymannnn/stroke, extended to allow comparisons of multiple primary stroke centers.

API

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)
  • SingleRunResults and MultiRunResults, encapsulating model outputs, along with the struct Strategy defining the possible triage decisions
  • Race, an enum namespace encapsulating several enums and the function scoreFrom for use in computing the RACE score, and static functions toNIHSS and fromNIHSS for 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 primaryTimes and transferTimes are different lengths) then create a model object via StrokeModel(inputs) and run it using either StrokeModel.run or StrokeModel.runWithVariance. The results class exposes a string property that summarizes results, along with various constants for more details.

Linux support

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.

About

Swift implementation of "Optimization of Prehospital Triage of Patients with Suspected Ischemic Stroke"

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages