Skip to content

Instantly share code, notes, and snippets.

@Kvit
Last active May 26, 2020 16:15
Show Gist options
  • Select an option

  • Save Kvit/c5f42003f515649187cf11b9272f1e22 to your computer and use it in GitHub Desktop.

Select an option

Save Kvit/c5f42003f515649187cf11b9272f1e22 to your computer and use it in GitHub Desktop.
Pseudo Billing Rules
global.ruleArea = ORDER
// basic rules
if (orderPayer == INSURANCE_PAYER ) { billTo = PRIMARY_INSURANCE; priceList = PRICE_INSURANCE }
if (orderPayer == CLIENT) { billTo = CLIENT , priceList = LookupPriceList (CLIENT) }
if (orderPayer == PATIENT) { billTo = PATIENT , priceList = PRICE_SELF_PAY }
if (orderPayer == null) stop (404, "Payer Not Found", @biller)
// client rules
if (orderClient $in [...] ) billTo = CLIENT
// client - payer rules
if (orderClient $in [MDL,...] and orderPayer $in [BCBS] ) billTo = CLIENT
if (orderClient $in [...] and orderPayer $in [Medicare, Medicaid] ) billTo = PRIMARY_INSURANCE
// client - line of busness - payer
if (orderClient $in [...] and orderTest $not $in [CYTO, PATH,...] ) stop (402, "Contract / Price Not Found")
if (orderClient $in [...] and orderTest $in [PATH,...] and orderPayer $in [BCBS] ) billTo = CLIENT
// etc.. more scope conditions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment