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-census-billing

v0.1.0

Published

Census against billing for nursing homes: days billed to the wrong payer, unbilled or over-billed days, leave days billed to a payer that does not pay bed holds, days after discharge, overlapping census rows and per-diem rates that differ from your rate t

Downloads

352

Readme

Fairstay Census Billing (fairstay-census-billing)

Compares the nursing-home census with what was billed, day by day: days billed to the wrong payer, census days not billed, days billed with no census, leave days billed to a payer that does not pay bed holds, duplicate days, overlapping census rows, levels and per-diem rates that differ from your rate table. Resident identifiers are masked before results reach the model.

Fairstay Census Billing never submits or voids claims; the billing office does. Fairstay Census Billing never changes the census in PointClickCare or any other system.

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-census-billing demo
npx -y fairstay-census-billing mcp --root ./facility-files

What the sample data shows

Fictional data only: Cedar Hollow Health and Rehab (a made-up 120-bed home), made-up residents, and made-up payers marked "(fictional)". Any likeness to real people is chance.

  • census-2026-02.csv: census rows (PointClickCare-style headers, not checked against a real export).
  • billing-2026-02.csv: billed claim lines for February 2026 with planted problems: unbilled days (R102), wrong payer (R103), hospital leave billed (R104), days after discharge (R105), a level mismatch (R106), overlapping census rows (R107), a duplicate line (R108) and a rate difference (R109).
  • rates.json: example per-diem rates. Real rates come from the home's contracts and state notices.

A demo run

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

Fairstay Census Billing demo (fictional home, residents and payers)

▶ Compare the February census with the billed days
  status: executed  decision: allow
  9 resident(s), 254 census days (240 billable), 258 billed days. 8 finding(s): wrong_payer 1, unbilled 1, billed_not_in_census 1, bed_hold_billed 1, duplicate_billed 1, census_overlap 1, level_mismatch 1, rate_mismatch 1. Revenue at risk 13738; billed without a census day 7593.5.
    wrong_payer            14 day(s)      9100  The census has Medicare A for 2026-02-01 to 2026-02-14; the days were billed to Lone Star Medicaid (fictional).
    unbilled                8 day(s)      1964  8 census day(s) with Lone Star Medicaid (fictional) (2026-02-21 to 2026-02-28) were not billed.
    billed_not_in_census    9 day(s)      3420  9 day(s) billed to Private Pay (2026-02-20 to 2026-02-28) are not on the census, after the resident's last census day.
    bed_hold_billed         3 day(s)     736.5  3 leave or hospital day(s) (2026-02-10 to 2026-02-12) were billed to Lone Star Medicaid (fictional), which is not on your bed-hold payer list.
    duplicate_billed       14 day(s)      3437  2026-02-15 to 2026-02-28 was billed more than once (Lone Star Medicaid (fictional)).
    census_overlap         11 day(s)         0  Two census rows cover 2026-02-18 to 2026-02-28: Lone Star Medicaid (fictional) and Medicare A.
    level_mismatch         28 day(s)      2520  The census level is L2 for 2026-02-01 to 2026-02-28; the claim has L3.
    rate_mismatch          28 day(s)       154  Billed 240 a day; the rate table has 245.5 for Lone Star Medicaid (fictional).

▶ Write the business office list (Spanish page)
  status: executed  decision: allow
  Census and billing reconciliation written: 9 resident(s), 254 census days (240 billable), 258 billed days. 8 finding(s): wrong_payer 1, unbilled 1, billed_not_in_census 1, bed_hold_billed 1, duplicate_billed 1, census_overlap 1, level_mismatch 1, rate_mismatch 1. Revenue at risk 13738; billed without a census day 7593.5. Files: evergreen-out/census/census.csv, evergreen-out/census/census.html.

▶ Teach a bed-hold payer from the state notice
  status: executed  decision: allow
  Stored MEM-05c5b044dac5 as waiting. It changes nothing until a named person accepts it with census_accept_learning (id "MEM-05c5b044dac5", decision "accept").

▶ Agent tries to submit a claim itself
  status: blocked  decision: block
  reason: Fairstay Census Billing never submits or voids claims; the billing office does.

Tools

| Tool | What it does | Policy | |---|---|---| | census_check | Compare the census and the billed days for a month (or start to end) and list each run of days that differs, with the dollars at risk. | runs | | census_write_report | Write census.csv (one row per item, with blank owner and decision columns) and census.html into out_dir (default evergreen-out/census). | runs | | census_recall | Search this agent's own memory of the customer's setup: accepted facts (in use) and facts waiting for a person. | runs | | census_learn | Propose one fact about the customer's setup for this agent to remember. | runs | | census_accept_learning | A named person accepts or rejects a fact waiting in this agent's memory. | one named click, even in Auto (accept_learning) | | census_retire_memory | A named person stops an accepted fact from applying. | one named click, even in Auto (accept_learning) | | claim_submit | Fairstay Census Billing never submits or voids claims; the billing office does. | refused | | census_update | Fairstay Census Billing never changes the census in PointClickCare or any other system. | 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.

census_check arguments

| Argument | What it is | |---|---| | census (required) | Census export under --root (CSV, Excel, JSON): one row per stretch of a stay with resident, payer, level, bed status, from and to (the to day is not counted) | | billing (required) | Billed days under --root: claim or invoice lines with resident, payer, service from and through (inclusive), days, level and amount | | rates | Optional rates JSON: per-diem rates by payer and level, and the payers that pay bed-hold days | | month | Month to check, YYYY-MM | | start | Start of the period (YYYY-MM-DD) if not a whole month | | end | End of the period, inclusive (YYYY-MM-DD) | | 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-census-billing 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 |

Billed days (billing)

| 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 | | claim_id | text | Claim, Claim ID, Claim #, Invoice, Invoice #, Batch | | 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 | | from (required) | date | From, Start, Start Date, Effective Date, Begin Date, From Date, Admit Date, Service From | | to | date | To, End, End Date, Thru, Through, Thru Date, Through Date, To Date | | days | number | Days, Units, Covered Days, Billed Days, Qty | | amount | amount | Amount, Charges, Billed Amount, Total Charges, Charge |

Settings file (census_rates)

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 | |---|---| | rates | Per-diem rates by payer (or payer type) and level | | bed_hold_payers | Payer names or payer types that pay leave and hospital (bed-hold) days |

Memory

census_learn only proposes a fact; nothing changes until a named person accepts it with census_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 | |---|---| | bed_hold_payer | treats that payer's leave and hospital days as billable, so they show as unbilled when missing and are not flagged when billed. |

Install

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

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

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

CLI

fairstay-census-billing tools                 # every tool, its policy and arguments
fairstay-census-billing sources               # the columns each input is read from
fairstay-census-billing inspect <file>        # how a file would be read (names and shapes, never values)
fairstay-census-billing call census_check '{"census":"<census>","billing":"<billing>"}'
fairstay-census-billing eval                  # the private eval cases on the fictional fixtures
fairstay-census-billing 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.