View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Λόρδος Σπύρος Δεναξάς > Medical-NHSNumber > Medical::NHSNumber



Annotate this POD


Open  0
View/Report Bugs
Module Version: 0.04   Source  


Medical::NHSNumber - Check if an NHS number is valid


Version 0.04


Everyone registered with the NHS in England and Wales has their own unique NHS number. The NHS number enables health care professionals in the UK to obtain, link and index electronic health records for an individual across a multiple sources of clinical information.

Given a new-style NHS number, returns true if the number is valid and false if the number appears to be invalid.

    use Medical::NHSNumber;

    my $nhs_no = '1234561234';
    my $rv = Medical::NHSNumber::is_valid( $nhs_no );

The validation is performed using the Modulus 11 algorith. More details on the exact implementation followed can be found on the NHS Connecting for Health website at

Additional information on Modulus 11 can also be found on this HP site

Please note, this module will only check the validity of new style NHS numbers i.e. ten digit numbers. There are over 21 different formats for older styles of NHS numbers which currently, this module does not support. If you do happen to know the specifics for the older versions and would like to tell me, I would be more than happy to incorporate some logic for them.



Given a new-style NHS number, returns true if the number is valid and false if the number appears to be invalid.

     my $rv = Medical::NHSNumber::is_valid( $nhs_no );


Dr Spiros Denaxas, <s.denaxas at>


Please report any bugs or feature requests to bug-medical-nhsnumber at, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


You can find documentation for this module with the perldoc command.

    perldoc Medical::NHSNumber

You can also look for information at:


Copyright 2009 Dr Spiros Denaxas.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See for more information.

syntax highlighting: