nhs-number
National Health Service (NHS) number using Rust cargo implementation
https://github.com/gig-cymru-nhs-wales/nhs-number-using-rust
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (7.9%) to scientific vocabulary
Repository
National Health Service (NHS) number using Rust cargo implementation
Basic Info
- Host: GitHub
- Owner: GIG-Cymru-NHS-Wales
- Language: Rust
- Default Branch: main
- Size: 92.8 KB
Statistics
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
NHS Number
documentation • source • llms.txt • crate • email
A National Health Service (NHS) Number is a unique number allocated in a shared numbering scheme to registered users of the three public health services in England, Wales, and the Isle of Man.
The NHS Number is the key to the identification of patients, especially in delivering safe care across provider organisations, and is required in all new software deployed within the National Health Service (NHS) organizations.
References:
Syntax
The current system uses a ten-digit number in '3 3 4' format with the final digit being an error-detecting checksum. An example is 999 123 4560.
Ranges
Currently issued numbers are in these ranges:
300 000 000 to 399 999 999 (England)
400 000 000 to 499 999 999 (England, Wales, Isle of Man)
600 000 000 to 799 999 999 (England, Wales, Isle of Man)
Unavailable number ranges include:
320 000 001 to 399 999 999 (allocated to the Northern Irish system)
010 100 0000 to 311 299 9999 (used for CHI numbers in Scotland)
For test purposes, this range is valid but is guaranteed to never be issued:
- 999 000 0000 to 999 999 9999
Checksum
The checksum is calculated by multiplying each of the first nine digits by 11 minus its position. Using the number 943 476 5919 as an example:
The first digit is 9. This is multiplied by 10.
The second digit is 4. This is multiplied by 9.
And so on until the ninth digit (1) is multiplied by 2.
The result of this calculation is summed. In this example: (9×10) + (4×9) + (3×8) + (4×7) + (7×6) + (6×5) + (5×4) + (9×3) + (1×2) = 299.
The remainder when dividing this number by 11 is calculated, yielding a number in the range 0–10, which would be 2 in this case.
Finally, this number is subtracted from 11 to give the checksum in the range 1–11, in this case 9, which becomes the last digit of the NHS Number.
A checksum of 11 is represented by 0 in the final NHS Number. If the checksum is 10 then the number is not valid.
Examples
```rust use nhs_number::*; use std::str::FromStr;
// NHS Number that we can use for testing purposes let str = "999 123 4560";
// Create a new NHS Number by converting from a string. let nhsnumber = NHSNumber::fromstr(str).unwrap();
// Validate a NHS Number using the check digit algorithm. let valid: bool = nhsnumber.validatecheck_digit(); ```
Owner
- Name: GIG Cymru - NHS Wales
- Login: GIG-Cymru-NHS-Wales
- Kind: organization
- Repositories: 1
- Profile: https://github.com/GIG-Cymru-NHS-Wales
Citation (CITATION.cff)
cff-version: 1.2.0
title: NHS Number Rust crate
message: >-
If you use this work and you want to cite it,
then you can use the metadata from this file.
type: software
authors:
- given-names: Joel Parker
family-names: Henderson
email: joel.henderson@wales.nhs.uk
affiliation: wales.nhs.uk
orcid: 'https://orcid.org/0009-0000-4681-282X'
identifiers:
- type: url
value: 'https://github.com/gig-cymru-nhs-wales/nhs-number/'
description: NHS Number Rust crate
repository-code: 'https://github.com/gig-cymru-nhs-wales/nhs-number/'
abstract: >-
NHS Number Rust crate
license: See license file
GitHub Events
Total
- Watch event: 1
- Push event: 21
- Create event: 3
Last Year
- Watch event: 1
- Push event: 21
- Create event: 3
Packages
- Total packages: 1
-
Total downloads:
- cargo 3,221 total
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 8
- Total maintainers: 1
crates.io: nhs-number
National Health Service (NHS) number for NHS England, NHS Wales, NHS Isle of Man.
- Documentation: https://docs.rs/nhs-number/
- License: MIT OR Apache-2.0 OR GPL-2.0 OR GPL-3.0 OR BSD-3-Clause
-
Latest release: 0.3.0
published 8 months ago
Rankings
Maintainers (1)
Dependencies
- bitflags 2.9.0
- cfg-if 1.0.0
- getrandom 0.3.2
- libc 0.2.172
- ppv-lite86 0.2.21
- proc-macro2 1.0.95
- quote 1.0.40
- r-efi 5.2.0
- rand 0.9.1
- rand_chacha 0.9.0
- rand_core 0.9.3
- serde 1.0.219
- serde_derive 1.0.219
- syn 2.0.101
- unicode-ident 1.0.18
- wasi 0.14.2+wasi-0.2.4
- wit-bindgen-rt 0.39.0
- zerocopy 0.8.25
- zerocopy-derive 0.8.25