re = /^[A-Z\d]\d/m
str = '# It\'s hard to find authoratative notes
01 = Auto accident — the date of an auto accident
02 = No-fault insurance involved, including auto accident/other — the date of an accident where the state has applicable no-fault liability laws, (i.e., legal basis for settlement without admission or proof of guilt)
03 = Accident/tort liability — the date of an accident resulting from a third party\'s action that may involve a civil court process in an attempt to require payment by the third party, other than no-fault liability
04 = Accident/employment related — the date of an accident relating to the patient\'s employment
05 = Other accident — the date of an accident not described by the codes 01 thru 04
06 = Crime victim — code indicating the date on which a medical condition resulted from alleged criminal action committed by one or more parties
07 = Reserved for national assignment
08 = Reserved for national assignment
11 = Onset of symptoms/illness — the date the patient first became aware of symptoms/illness
12 = Date of onset for a chronically dependent individual — code indicates the date the patient/bene became a chronically dependent individual
13 = Reserved for national assignment
14 = Reserved for national assignment
15 = Reserved for national assignment
16 = Reserved for national assignment
17 = Date outpatient occupational therapy plan established or last reviewed — code indicating the date an occupational therapy plan was established or last reviewed
18 = Date of retirement (patient/bene) — code indicates the date of retirement for the patient/bene
19 = Date of retirement spouse — code indicates the date of retirement for the patient\'s spouse
20 = Guarantee of payment began — the date on which the provider began claiming Medicare payment under the guarantee of payment provision
21 = UR notice received — code indicating the date of receipt by the hospital and SNF of the UR committee\'s finding that the admission or future stay was not medically necessary
22 = Active care ended — the date on which a covered level of care ended in a SNF or general hospital, or date active care ended in a psychiatric or tuberculosis hospital or date on which patient was released on a trial basis from a residential facility. Code is not required if code "21" is used
23 = Payer only — date of cancellation of hospice benefits — the date the RHHI cancelled the hospice benefit. (eff. 10/2000). NOTE: This will be different than the revocation of the hospice benefit by beneficiaries
24 = Date insurance denied — the date the insurer\'s denial of coverage was received by a higher priority payer
25 = Date benefits terminated by primary payer — the date on which coverage (including worker\'s compensation benefits or no-fault coverage) is no longer available to the patient
26 = Date skilled nursing facility (SNF) bed available — the date on which a SNF bed became available to a hospital inpatient who required only SNF level of care
27 = Date of hospice certification or re-certification — code indicates the date of certification or recertification of the hospice benefit period, beginning with the first two initial benefit periods of 90 days each and the subsequent 60-day benefit periods. (eff. 9/2001)
27 = Date home health plan established or last reviewed — code indicating the date a home health plan of treatment was established or last reviewed. (Obsolete) not used by hospital unless owner of facility
28 = Date comprehensive outpatient rehabilitation plan established or last reviewed — code indicating the date a comprehensive outpatient rehabilitation plan was established or last reviewed. Not used by hospital unless owner of facility
29 = Date OPT plan established or last reviewed — the date a plan of treatment was established for outpatient physical therapy. Not used by hospital unless owner of facility
30 = Date speech pathology plan treatment established or last reviewed — the date a speech pathology plan of treatment was established or last reviewed. Not used by hospital unless owner of facility
31 = Date bene notified of intent to bill (accommodations) — the date of the notice provided to the patient by the hospital stating that he no longer required a covered level of IP care
32 = Date bene notified of intent to bill (procedures or treatment) — the date of the notice provided to the patient by the hospital stating requested care (diagnostic procedures or treatments) is not considered reasonable or necessary
33 = First day of the Medicare coordination period for ESRD bene — during which Medicare benefits are secondary to benefits payable under an EGHP. Required only for ESRD beneficiaries
34 = Date of election of extended care facilities — the date the guest elected to receive extended care services (used by Religious Nonmedical Health Care Institutions only)
35 = Date treatment started for physical therapy — code indicates the date services were initiated by the billing provider for physical therapy
36 = Date of discharge for the IP hospital stay when patient received a transplant procedure — hospital is billing for immunosuppressive drugs
37 = The date of discharge for the IP hospital stay when patient received a non-covered transplant procedure — hospital is billing for immunosuppressive drugs
38 = Date treatment started for home IV therapy — date the patient was first treated in his home for IV therapy
39 = Date discharged on a continuous course of IV therapy — date the patient was discharged from the hospital on a continuous course of IV therapy
40 = Scheduled date of admission — the date on which a patient will be admitted as an inpatient to the hospital. (This code may only be used on an outpatient claim.)
41 = Date of first test for pre-admission testing — the date on which the first outpatient diagnostic test was performed as part of a pre-admission testing (PAT) program. This code may only be used if a date of admission was scheduled prior to the administration of the test(s). (eff. 10/2001)
42 = Date of discharge/termination of hospice care — for the final bill for hospice care. Date patient revoked hospice election
43 = Scheduled date of canceled surgery — date which ambulatory surgery was scheduled. (eff. 9/2001)
44 = Date treatment started for occupational therapy — code indicates the date services were initiated by the billing provider for occupational therapy
45 = Date treatment started for speech therapy — code indicates the date services were initiated by the billing provider for speech therapy
46 = Date treatment started for cardiac rehabilitation — code indicates the date services were initiated by the billing provider for cardiac rehabilitation
47 = Date cost outlier status begins — code indicates that this is the first day the cost outlier threshold is reached. For Medicare purposes, a bene must have regular coinsurance and/or lifetime reserve days available beginning on this date to allow coverage of additional daily charges for the purpose of making cost outlier payments. (eff. 9/2001)
48 = Payer only — not currently used by Medicare
49 = Payer only — original Notice of Election (NOE) receipt date
50–55 = Reserved for state assignment
56 = Hospice — incorrect date of hospice notification of election (NOE). This code indicates the date of certification or recertification of the hospice benefit period, which has been corrected (the corrected date appears in the record for occurrence code = 26). (eff. 1/2018)
57–60 = Reserved for state assignment
61 = Hospital discharge date (HHA only) (eff. 1/2020)
62 = Other institutional discharge date (HHA only) (eff. 1/2020)
A1 = Birthdate, insured A — the birthdate of the individual in whose name the insurance is carried
A2 = Effective date, insured A policy — code indicating the first date insurance is in force
A3 = Benefits exhausted — code indicating the last date for which benefits are available and after which no payment can be made to payer A
A4 = Split bill date — date patient became eligible due to medically needy spend down (sometimes referred to as "split bill date")
B1 = Birthdate, insured B — the birthdate of the individual in whose name the insurance is carried
B2 = Effective date, insured B policy — code indicating the first date insurance is in force
B3 = Benefits exhausted — code indicating the last date for which benefits are available and after which no payment can be made to payer B
C1 = Birthdate, insured C — the birthdate of the individual in whose name the insurance is carried
C2 = Effective date, insured C policy — a code indicating the first date insurance is in force
C3 = Benefits exhausted — code indicating the last date for which benefits are available and after which no payment can be made to payer C'
# Print the match result
str.scan(re) do |match|
puts match.to_s
end
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Ruby, please visit: http://ruby-doc.org/core-2.2.0/Regexp.html