如何验证澳大利亚医疗保险号码? [英] How do I validate an Australian Medicare number?

查看:57
本文介绍了如何验证澳大利亚医疗保险号码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一种在线表格,其中需要验证用户输入的Medicare编号.

I'm developing an online form in which user-entered Medicare numbers will need to be validated.

(我的具体问题涉及澳大利亚的Medicare号码,但我也很高兴获得有关美国的Medicare号码的答案.这个问题通常是关于Medicare号码的.)

(My specific problem concerns Australian Medicare numbers, but I'm happy for answers regarding American ones too. This question is about Medicare numbers in general.)

那我该怎么办?

(最好用Javascript或正则表达式来表示答案.)

(It would be good to have the answer in Javascript or a regex.)

推荐答案

Jeffrey Kemp(3月11日)提供的正则表达式将有助于验证允许的字符,但是下面的检查算法应足以验证数字是否符合医疗保险的规则.

The regex supplied by Jeffrey Kemp (March 11) would help to validate the allowed characters, but the check algorithm below should be enough to validate that the number conforms to Medicare's rules.

Medicare卡号包括:

The Medicare card number comprises:

  • 八位数;
  • 一个校验位(一位);和
  • 问题编号(一位数字).

注意:Medicare卡号的第一位数字应在2到6的范围内.

Note: the first digit of the Medicare card number should be in the range 2 to 6.

医疗保险卡号校验位计算

  1. 计算以下各项的总和:((数字1)+(数字2 * 3)+(数字3 * 7)+(数字4 * 9)+(数字5)+(数字6 * 3)+(数字7* 7)+(数字8 * 9))

其中数字1是医疗保险卡号的最高位数字,数字8是医疗保险卡号的最低位数字.

where digit 1 is the highest place value digit of the Medicare card number and digit 8 is the lowest place value digit of the Medicare card number.

示例:对于Medicare卡号"2123 45670 1",数字1为2,数字8为7.

Example: for Medicare card number '2123 45670 1', digit 1 is 2 and digit 8 is 7.

  1. 将计算出的总和除以10.
  2. 校验位是余数.

示例:对于Medicare卡号2123 4567.

Example: For Medicare card number 2123 4567.

  1. (2)+(1 * 3)+(2 * 7)+(3 * 9)+(4)+(5 * 3)+(6 * 7)+(7 * 9)= 170
  2. 将170除以10.余数为0.
  3. 此Medicare号码的校验位为0.

来源:在健康软件系统中使用医疗保健标识符-软件符合性要求,版本1.4",NEHTA,2011年3月5日

这篇关于如何验证澳大利亚医疗保险号码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆