Skip to content

Checks strings against the New Zealand Ministry of Health NHI Validation Routine

License

Notifications You must be signed in to change notification settings

James-Ansley/rust-nhi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NHI

Checks strings against the New Zealand Ministry of Health NHI Validation Routine. Supports the old and new NHI number formats specified in HISO 10046:2023.

Install

cargo add nhi

Docs

Example

NHI values can be validated with the is_nhi function, or parsed to NHI structs:

use nhi::{is_nhi, NHI};

fn main() {
    let nhi_str = "zac5361";

    assert_eq!(is_nhi(nhi_str), true);
    
    let nhi: NHI = nhi_str.parse().unwrap();
    assert_eq!(nhi.as_str(), nhi_str.to_uppercase());
}

More examples are available in the docs.

See Also

About

Checks strings against the New Zealand Ministry of Health NHI Validation Routine

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages