{"id":19267106,"url":"https://github.com/sellorm/nhsnumber","last_synced_at":"2025-04-21T19:32:42.707Z","repository":{"id":45596058,"uuid":"207879267","full_name":"sellorm/nhsnumber","owner":"sellorm","description":"An R package to work with NHS numbers and their checksums","archived":false,"fork":false,"pushed_at":"2021-12-29T13:10:16.000Z","size":49,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-25T00:34:17.528Z","etag":null,"topics":["nhs","r","r-pkg"],"latest_commit_sha":null,"homepage":"https://nhsnumber.sellorm.com/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sellorm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-11T18:25:23.000Z","updated_at":"2024-06-03T10:00:16.000Z","dependencies_parsed_at":"2022-08-24T11:10:22.134Z","dependency_job_id":null,"html_url":"https://github.com/sellorm/nhsnumber","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sellorm%2Fnhsnumber","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sellorm%2Fnhsnumber/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sellorm%2Fnhsnumber/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sellorm%2Fnhsnumber/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sellorm","download_url":"https://codeload.github.com/sellorm/nhsnumber/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223876458,"owners_count":17218389,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nhs","r","r-pkg"],"created_at":"2024-11-09T20:10:26.969Z","updated_at":"2024-11-09T20:10:27.478Z","avatar_url":"https://github.com/sellorm.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# nhsnumber\n\n\u003c!-- badges: start --\u003e\n[![CRAN status](https://www.r-pkg.org/badges/version/nhsnumber)](https://CRAN.R-project.org/package=nhsnumber)\n[![R-CMD-check](https://github.com/sellorm/nhsnumber/workflows/R-CMD-check/badge.svg)](https://github.com/sellorm/nhsnumber/actions?query=workflow%3AR-CMD-check)\n[![codecov](https://codecov.io/gh/sellorm/nhsnumber/branch/master/graph/badge.svg?token=UUKS3SYQ0B)](https://app.codecov.io/gh/sellorm/nhsnumber)\n[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)\n\u003c!-- badges: end --\u003e\n\nThe goal of nhsnumber is to provide some simple functions for working with NHS numbers in R.\n\n## NHS Number Overview\n\nNHS numbers are issued to patients of the NHS in the UK.\n\nThe number consists of 9 digits and a single digit checksum.\n\nFor more information, please see the [NHS number Wikipedia article](https://en.wikipedia.org/wiki/NHS_number) on the subject.\n\n## Installation\n\nYou can install the released version of nhsnumber from [CRAN](https://cran.r-project.org/package=nhsnumber) with:\n\n``` r\ninstall.packages(\"nhsnumber\")\n```\n\nYou can install the development version of nhsnumber from [GitHub](https://github.com/sellorm/nhsnumber) with:\n\n``` r\ndevtools::install_github(\"sellorm/nhsnumber\")\n```\n\n## Example\n\nThe `is_valid` function takes a vector of NHS numbers and returns TRUE or FALSE depending on whether the checksum is successfully validated.\n\n``` r\nx \u003c- c(9876543210, 1234567890, 1234567881)\nnhsnumber::is_valid(x)\n```\n\nWhich returns:\n\n```\nTRUE FALSE  TRUE\n```\n\nIt's also possible to generate the checksums using the `get_checksum` function. This function uses the 9 core digits and returns either the checksum on its own, or the full 10 digit number.\n\n``` r\nnhsnumber::get_checksum(123456788)\n```\n\nwhich returns:\n\n```\n1\n```\n\nor with the full output:\n\n``` r\nnhsnumber::get_checksum(123456788, full_output = TRUE)\n```\n\nWhich returns:\n\n```\n1234567881\n```\n\nSome number combinations are invalid and these will throw an error, for example:\n\n``` r\nnhsnumber::get_checksum(123456789)\n```\n\nWhich results in this:\n\n```\nError in nhsnumber::get_checksum(123456789) : Input sequence is invalid\n           Checksum was 10 which is not permissable\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsellorm%2Fnhsnumber","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsellorm%2Fnhsnumber","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsellorm%2Fnhsnumber/lists"}