Ë
    Ã?Æi„  ã                  óX   — d Z ddlmZ ddl­ ddlmZmZ dd„Zdd„Zdd„Z	dd„Z
ddd	„Zy
)a  NHS (United Kingdom National Health Service patient identifier).

The NHS number is used by the NHS (National Health Service) and its partners
to uniquely identify patients. The number is used in England, Wales and the
Isle of Man. The number is assigned at birth and consists of 10 digits where
the final digit is a check digit.

More information:

* https://en.wikipedia.org/wiki/NHS_number
* https://www.nhs.uk/using-the-nhs/about-the-nhs/what-is-an-nhs-number/
* https://digital.nhs.uk/article/301/NHS-Number
* https://www.datadictionary.nhs.uk/data_dictionary/attributes/n/nhs/nhs_number_de.asp

>>> validate('943-476-5870')
'9434765870'
>>> validate('9434765871')  # invalid check digit
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> format('9434765870')
'943 476 5870'
é    )Úannotations)Ú*)ÚcleanÚisdigitsc                ó6   — t        | d«      j                  «       S )zˆConvert the number to the minimal representation. This strips the
    number of any valid separators and removes surrounding whitespace.z -)r   Ústrip©Únumbers    úT/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/gb/nhs.pyÚcompactr   2   s   € ô �˜Ó×$Ñ$Ó&Ð&ó    c                óR   — t        d„ t        t        | «      d«      D «       «      dz  S )zzCalculate the checksum. The checksum is only used for the 9 digits
    of the number and the result can either be 0 or 42.c              3  ó>   K  — | ]  \  }}|t        |«      z  –— Œ y ­w)N)Úint)Ú.0ÚiÚns      r   ú	<genexpr>zchecksum.<locals>.<genexpr>;   s   è ø€ ÒE™d˜a ˆq”3�q“6�zÑEùs   ‚é   é   )ÚsumÚ	enumerateÚreversedr	   s    r   Úchecksumr   8   s&   € ô ÑE¤i´¸Ó0@À!Ó&DÔEÓEÈÑJÐJr   c                ó¦   — t        | «      } t        | «      s
t        «       ‚t        | «      dk7  r
t	        «       ‚t        | «      dk7  r
t        «       ‚| S )zICheck if the number is valid. This checks the length and check
    digit.é
   r   )r   r   ÚInvalidFormatÚlenÚInvalidLengthr   ÚInvalidChecksumr	   s    r   Úvalidater!   >   sL   € ô �V‹_€FÜ�FÔÜ‹oÐÜ
ˆ6ƒ{�bÒÜ‹oÐÜ�Ó˜1ÒÜÓÐØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)zCheck if the number is valid.F)Úboolr!   ÚValidationErrorr	   s    r   Úis_validr%   K   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c                óR   — t        | «      } |j                  | dd | dd | dd f«      S )z8Reformat the number to the standard presentation format.r   é   é   N)r   Újoin)r
   Ú	separators     r   Úformatr+   S   s3   € ä�V‹_€FØ�>‰>˜6 ! A˜;¨¨q°¨°V¸A¸B°ZÐ@ÓAÐAr   N)r
   ÚstrÚreturnr,   )r
   r,   r-   r   )r
   r,   r-   r#   )ú )r
   r,   r*   r,   r-   r,   )Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚstdnum.utilr   r   r   r   r!   r%   r+   © r   r   ú<module>r4      s0   ðñ(õ0 #ä ß 'ó'óKó
óõBr   