npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

fairstay-eligibility-checks

v0.1.0

Published

Eligibility for nursing-home residents: stale or missing checks, inactive or ending coverage, Medicare Part A benefit days running out, missing or short qualifying hospital stays, late admissions after the hospital stay and Medicaid renewals coming due.

Readme

Fairstay Eligibility Checks (fairstay-eligibility-checks)

Checks eligibility for every nursing-home resident in the building: missing or stale checks, inactive or ended coverage still on the census, coverage ending soon, Medicare Part A benefit days running out, missing or short qualifying hospital stays, admissions more than 30 days after the hospital, and Medicaid renewals due. Resident identifiers are masked before results reach the model.

Fairstay Eligibility Checks never logs in to payer or state portals; staff run the checks.

Fairstay ver 1 · Billing and revenue cycle · MIT · Node 20 or newer · local files only · resident and staff identifiers masked before results reach the model · built on fairstay-core

npx -y fairstay-eligibility-checks demo
npx -y fairstay-eligibility-checks mcp --root ./facility-files

What the sample data shows

Fictional: Riverbend Care Center residents and made-up payers marked "(fictional)". As of 2026-03-02 the planted problems are: Part A days running out (R202: 12 earlier days + 83 this stay), a 2-day qualifying stay, a late admission and a stale check (R203), Medicaid coverage that ended but is still on the census and a renewal due (R204), a "Not eligible" result (R205), managed care coverage ending (R206, waiver recorded), and no eligibility check at all (R209). A discharged resident (R208) and a private-pay resident (R207) are skipped.

A demo run

npx -y fairstay-eligibility-checks demo runs the agent on the fictional files in fixtures/ in a temporary folder. Captured output:

Fairstay Eligibility Checks demo (fictional home, residents, staff and vendors)

▶ Check eligibility for everyone in the building on 2 March 2026
  status: executed  decision: allow
  8 resident(s) in the building on 2026-03-02; 9 finding(s): coverage_ended 1, inactive 1, short_qualifying_stay 1, late_admission 1, no_check 1, stale_check 1, benefit_ending 1, coverage_ending 1, renewal_due 1.
    coverage_ended         Lone Star Medicaid (fictional) coverage ended 2026-02-28, but the census still has this payer.
    inactive               The last check (2026-02-28) says Lone Star Medicaid (fictional) coverage is not active.
    short_qualifying_stay  Hospital stay 2026-01-12 to 2026-01-14 is 2 inpatient day(s); Part A SNF coverage needs at least 3 (discharge day not counted).
    late_admission         Admitted 37 days after the hospital discharge; Part A SNF coverage usually needs admission within 30 days.
    no_check               No eligibility check on file for Lone Star Medicaid (fictional).
    stale_check            Last eligibility check 51 days ago (2026-01-10); the limit is 45 days.
    benefit_ending         5 Medicare Part A day(s) left in the benefit period (12 earlier + 83 this stay).
    coverage_ending        Gulf Coast Advantage HMO (fictional) coverage ends 2026-03-12 (10 days).
    renewal_due            Medicaid renewal due 2026-04-10 (39 days).

▶ Write the business office work list (French page)
  status: executed  decision: allow
  Resident eligibility work list written: 8 resident(s) in the building on 2026-03-02; 9 finding(s): coverage_ended 1, inactive 1, short_qualifying_stay 1, late_admission 1, no_check 1, stale_check 1, benefit_ending 1, coverage_ending 1, renewal_due 1. Files: evergreen-out/eligibility/eligibility.csv, evergreen-out/eligibility/eligibility.html.

▶ Teach a plan that waives the 3-day stay
  status: executed  decision: allow
  Stored MEM-b31b5b8fd8c3 as waiting. It changes nothing until a named person accepts it with eligibility_accept_learning (id "MEM-b31b5b8fd8c3", decision "accept").

▶ Agent tries to log in to the state portal
  status: blocked  decision: block
  reason: Fairstay Eligibility Checks never logs in to payer or state portals; staff run the checks.

Tools

| Tool | What it does | Policy | |---|---|---| | eligibility_check | List eligibility problems for the residents in the building on as_of, most urgent first. | runs | | eligibility_write_report | Write eligibility.csv (one row per item, with blank owner and decision columns) and eligibility.html into out_dir (default evergreen-out/eligibility). | runs | | eligibility_recall | Search this agent's own memory of the customer's setup: accepted facts (in use) and facts waiting for a person. | runs | | eligibility_learn | Propose one fact about the customer's setup for this agent to remember. | runs | | eligibility_accept_learning | A named person accepts or rejects a fact waiting in this agent's memory. | one named click, even in Auto (accept_learning) | | eligibility_retire_memory | A named person stops an accepted fact from applying. | one named click, even in Auto (accept_learning) | | eligibility_portal_login | Fairstay Eligibility Checks never logs in to payer or state portals; staff run the checks. | refused |

Any tool name not in this table is blocked, including names a model invents. Refused tools are listed so a model can see they exist and are refused.

eligibility_check arguments

| Argument | What it is | |---|---| | census (required) | Census export under --root: residents, payer and dates (the residents in the building on as_of are checked) | | eligibility (required) | Eligibility results under --root: resident, payer, status, date checked, coverage dates, Part A days used, Medicaid renewal date | | stays | Optional hospital stays under --root: resident, hospital admit and discharge, SNF admit, waiver | | rules | Optional rules JSON: stale_days, warn_days, renewal_warn_days | | as_of | Date to check on (YYYY-MM-DD, default today) | | status | Only items with this status | | limit | Most items to return to the model (the report file always has all of them) |

Columns it reads

Tables can be CSV, TSV, semicolon- or pipe-separated text, Excel .xlsx, JSON or JSONL. Columns are matched by the names below (any case and punctuation), and by their usual names in German, French, Spanish, Portuguese, Italian, Japanese, Chinese and Korean. Dates become YYYY-MM-DD. Columns marked masked hold resident or staff identifiers.

The PointClickCare, MatrixCare and American HealthTech style names were written from public help pages and general knowledge, not checked against real exports. Run npx fairstay-eligibility-checks inspect <file> (column names and shapes only, never values) and name any column it misses in remedy-sources.json.

Census (census)

| Column | Type | Read from | |---|---|---| | resident_id | text (masked) | Resident ID, Resident #, Resident Number, Res ID, Res #, MRN, Medical Record Number, Client ID | | resident_name | text (masked) | Resident, Resident Name, Name, Patient, Patient Name, Client Name, Resident Full Name | | facility | text | Facility, Facility Name, Building, Location, Fac, Center | | from (required) | date | From, Start, Start Date, Effective Date, Begin Date, From Date, Admit Date, Census Date | | to | date | To, End, End Date, Thru, Through, Thru Date, Through Date, To Date | | payer (required) | text | Payer, Payer Name, Primary Payer, Pay Source, Payer Source, Payor, Payor Name, Insurance | | payer_type | text | Payer Type, Payor Type, Payer Class, Payer Category, Pay Type | | level | text | Level, Level of Care, Care Level, Rate Type, Rate Level, Room Type, Accommodation, RUG | | bed_status | text | Bed Status, Status, Census Status, Action, Census Action, Leave Type | | room | text | Room, Room Bed, Bed, Room/Bed, Unit |

Eligibility results (eligibility)

| Column | Type | Read from | |---|---|---| | resident_id | text (masked) | Resident ID, Resident #, Resident Number, Res ID, Res #, MRN, Medical Record Number, Client ID | | resident_name | text (masked) | Resident, Resident Name, Name, Patient, Patient Name, Client Name, Resident Full Name | | payer (required) | text | Payer, Payer Name, Primary Payer, Pay Source, Payer Source, Payor, Payor Name, Insurance | | payer_type | text | Payer Type, Payor Type, Payer Class, Payer Category, Pay Type | | status | text | Status, Eligibility, Eligibility Status, Coverage Status, Result | | checked_on | date | Checked On, Verified On, Verification Date, Check Date, Date Checked, Last Verified | | coverage_from | date | Coverage From, Eligible From, Effective Date, Start | | coverage_to | date | Coverage To, Eligible To, Term Date, Termination Date, End | | part_a_days_used | number | Part A Days Used, SNF Days Used, Benefit Days Used, Days Used | | renewal_date | date | Renewal Date, Redetermination Date, Recertification Date, Review Date |

Hospital stays (stays)

| Column | Type | Read from | |---|---|---| | resident_id | text (masked) | Resident ID, Resident #, Resident Number, Res ID, Res #, MRN, Medical Record Number, Client ID | | resident_name | text (masked) | Resident, Resident Name, Name, Patient, Patient Name, Client Name, Resident Full Name | | hospital_admit (required) | date | Hospital Admit, Hospital Admission, Inpatient Admit, Acute Admit Date | | hospital_discharge (required) | date | Hospital Discharge, Inpatient Discharge, Acute Discharge Date | | snf_admit | date | SNF Admit, Admit Date, Admission Date, Facility Admit | | waiver | text | Waiver, 3 Day Waiver, Three Day Waiver, QHS Waiver |

Settings file (eligibility_rules)

A small JSON file you pass by path. A misspelled setting is refused by name rather than ignored, so a typo never silently changes a check.

| Setting | What it does | |---|---| | stale_days | A check older than this many days is stale (default 30) | | warn_days | Warn this many days before coverage or Part A days run out (default 14) | | renewal_warn_days | Warn this many days before a Medicaid renewal (default 60) |

Memory

eligibility_learn only proposes a fact; nothing changes until a named person accepts it with eligibility_accept_learning, which is one click even in Auto. Facts live in a hash-chained file under .remedy/memory/; if the chain does not verify, no fact is used. Credentials, personal identifiers and text that reads like instructions to an AI are refused.

| Kind | What an accepted fact does | |---|---| | qualifying_stay_waiver | notes the waiver on that payer's residents in results. Part A residents are still checked; it never removes a check. |

Install

Node 20 or newer. No other runtime dependencies besides fairstay-core and fairclaim-core.

{
  "mcpServers": {
    "fairstay-eligibility-checks": {
      "command": "npx",
      "args": [
        "-y",
        "fairstay-eligibility-checks",
        "mcp",
        "--root",
        "/path/to/facility-files"
      ]
    }
  }
}

Claude Code: claude mcp add fairstay-eligibility-checks -- npx -y fairstay-eligibility-checks mcp --root ., or use the plugin files in this folder.

CLI

fairstay-eligibility-checks tools                 # every tool, its policy and arguments
fairstay-eligibility-checks sources               # the columns each input is read from
fairstay-eligibility-checks inspect <file>        # how a file would be read (names and shapes, never values)
fairstay-eligibility-checks call eligibility_check '{"census":"<census>","eligibility":"<eligibility>"}'
fairstay-eligibility-checks eval                  # the private eval cases on the fictional fixtures
fairstay-eligibility-checks demo

Resident and staff data

Results go to an AI model, so identifiers are masked before they leave the agent: resident and staff names become stable pseudonyms such as PT-3f9a1c2e, record and account numbers become MRN-… or ACCT-…, and e-mails and phone numbers are removed, also inside free text. Report files written to disk keep real names because staff work from them: keep them in a folder only your staff can open. The shared tests check that no fictional identifier from the fixtures reaches any eval result, and the hostile-input check plants spreadsheet formulas, HTML and AI-aimed instructions in the data. This keeps PHI away from the model; it is not a HIPAA compliance determination. Your business associate agreements, access controls and policies still apply.

Limits

  • Reads only the files you give it. It does not log in to PointClickCare, MatrixCare, a payer portal, a bank, a state Medicaid portal or a payroll system.
  • Medicare, Medicaid and payroll rules are summarised from public material as of 2026 and the numbers are settings you supply; a billing, payroll or legal professional checks them before you rely on them.
  • Not legal, tax, accounting, clinical, reimbursement or HIPAA advice. A person decides what to bill, pay, appeal, file or send.
  • Every call is written to a hash-chained audit log under .remedy/ in the root. No network calls, no telemetry, no credentials. The bundled data is fictional.