Skip to content

Commit e66ae98

Browse files
As per PR # 83 review comments, it is updated.
1 parent a1a82e6 commit e66ae98

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

docs/utility-guides/NHSNumberTools.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ common functionality that may apply to many services in relation to NHS Number m
88
- [Utility Guide: NHS Number Tools](#utility-guide-nhs-number-tools)
99
- [Table of Contents](#table-of-contents)
1010
- [Using the NHS Number Tools class](#using-the-nhs-number-tools-class)
11-
- [`_nhs_number_checks()`: If the input is not numeric or not 10 digits, it raises a NHSNumberToolsException()](#_nhs_number_checks-if-the-input-is-not-numeric-or-not-10-digits-it-raises-a-nhsnumbertoolsexception)
11+
- [`_nhs_number_checks()`: Checks if the NHS number is valid](#_nhs_number_checks-checks-if-the-nhs-number-is-valid)
1212
- [Required Arguments](#required-arguments)
1313
- [Raises](#raises)
1414
- [`spaced_nhs_number()`: Return Spaced NHS Number](#spaced_nhs_number-return-spaced-nhs-number)
@@ -21,19 +21,13 @@ You can initialise the NHS Number Tools class by using the following code in you
2121

2222
from utils.nhs_number_tools import NHSNumberTools
2323

24-
## `_nhs_number_checks()`: If the input is not numeric or not 10 digits, it raises a NHSNumberToolsException()
24+
## `_nhs_number_checks()`: Checks if the NHS number is valid
2525

26-
The `_nhs_number_checks()` method does basic checks on NHS number values provided and raises an exception if the number is not valid:
26+
The `_nhs_number_checks()` method does basic checks on NHS number value provided and raises an exception if the number is not valid:
2727

28-
# Args nhs_number (str): The NHS number to check
29-
if not nhs_number.isnumeric():
30-
raise NHSNumberToolsException(
31-
"The NHS number provided ({}) is not numeric.".format(nhs_number)
32-
)
33-
if len(nhs_number) != 10:
34-
raise NHSNumberToolsException(
35-
"The NHS number provided ({}) is not 10 digits.".format(nhs_number)
36-
)
28+
from utils.nhs_number_tools import NHSNumberTools
29+
incorrect_nhs_no = "A23456789"
30+
NHSNumberTools._nhs_number_checks(incorrect_nhs_no)
3731

3832
### Required Arguments
3933

0 commit comments

Comments
 (0)