news2

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2025 License: MIT Imports: 1 Imported by: 0

README

NEWS2

A Go package for calculating National Early Warning Score 2 (NEWS2) based on patient vital signs.

Features

Calculates NEWS2 scores from respiratory rate, oxygen saturation, systolic blood pressure, pulse, temperature, consciousness level, and oxygen supplementation.

NOTE: This was not designed for use in any systems where any reliability or safe operation is needed. This package is used as part of my workflow to create and manage simulation cases. I cannot provide any guarantee of the stability, reliability or accuracy of this code.

Usage

import "github.com/kscarlett/news2"

vitals := news2.VitalSigns{
    RespRate:           18,
    OxygenSat:          95,
    SystolicBP:         120,
    Pulse:              80,
    Temp:               36.8,
    ConsciousnessLevel: news2.Alert,
    OnOxygen:           false,
}

score := news2.CalculateScore(vitals, true) // true for Scale 1, false for Scale 2

Reference

This package implements the NEWS2 scoring system as described by the Royal College of Physicians (2017).
Source: Royal College of Physicians. National Early Warning Score (NEWS) 2: Standardising the assessment of acute-illness severity in the NHS. London: RCP, 2017.

License

MIT License

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateScore

func CalculateScore(v VitalSigns, scale1 bool) int

CalculateScore computes the NEWS2 score from vital signs.

Types

type ConsciousnessLevel

type ConsciousnessLevel int

ConsciousnessLevel represents the level of consciousness using ACVPU.

const (
	Alert ConsciousnessLevel = iota
	Confused
	Voice
	Pain
	Unresponsive
)

func (ConsciousnessLevel) String

func (c ConsciousnessLevel) String() string

String returns the string representation of the ConsciousnessLevel. Returns "Unknown" if the level is not recognized.

type VitalSigns

type VitalSigns struct {
	RespRate           int
	OxygenSat          int
	SystolicBP         int
	Pulse              int
	Temp               float64
	ConsciousnessLevel ConsciousnessLevel
	OnOxygen           bool
}

VitalSigns holds the input data for NEWS2 scoring.

func (VitalSigns) String

func (v VitalSigns) String() string

String returns a string representation of the VitalSigns struct. It formats the vital signs in a human-readable way.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL