Rules Tags

Rules are described within each data-set block.

For example:

data-set "Accounts" {

cbase-input "/cbases/accounts.cbase"

source-rule "Account ID"

source-rule "Admit Date"

source-rule "Patient Type"

calc-rule "Inpatient Account" `value("Admit Date") != null and value("Patient Type") = "Inpatient"`

calc-rule "Admission" `value("Inpatient Account") and not value("Newborn Account")`

calc-rule "Newborn Account" `value("Inpatient Account") and value("Admit Type") = "Newborn"`

}

The following table describes the available sub-tags for data-set.

Tags Examples Notes

description

description "Provides the Account ID" Sub-tag for each rule block that allows you to enter a description for the rule.

definition

definition "ID associated with the customer account" Sub-tag for each rule block that allows you to enter a definition for the rule.
id id "86778315-5bc5-4701-afe0-27ab06e778ea" Sub-tag for each rule block with an automatically generated identifier.

source-rule

value("Discharge Date")

All columns in the data set are made available. Columns can be referenced without an explicit "source rule" in the script.

DI recommends that you allow automatic import of input columns or use setup-rule tags to explicitly define which columns should be imported instead of using source-rule tags.

calc-rule

calc-rule "Outpatient Account" `not value("Inpatient Account")`

Describes a Spectre expression to be evaluated on each record in the data set.

Properties—Available in version 7.1(27) and later

duration When set to True, indicates that the numeric measure displays as a time with the standard format hh:mm:ss.
format Specifies the format to use for the values.
label Specifies an alternative label for the measure. You can display this in DivePort using the $(MEASURE_LABEL) macro.
sort-by

Specifies that the table is sorted based on a value; typically a column name.

sort-by "<data column name>"

sort-natural Specifies that the table is sorted based on natural sort order.

lookup

lookup "Admitting Provider" {

date rule="Admit Date"

key "Admitting Provider ID"

lookup-rule "Admitting Provider"

lookup-rule "Admitting Provider Service"

}

lookup "Admit Facility" table="Facility"{

date rule="Census Date"

key "Facility Code" rule="Admit Facility Code"

key "Source System"

lookup-rule "Admit Facility Name" column="Facility Name" {

}

}

Code block for setting lookup rules, where you provide a name, date, key rules, and lookup-rule tags. The lookup-rule attribute matches one of the column names defined in the lookup table definition.
setup-rule

setup-rule "Color"

setup-rule "Language"

Specifies which data input columns are imported to the data set. If no setup-rules are specified, all data input columns are imported. Setup rules were introduced in version 7.1(13).

TIP: Setup rules differ from source rules only in that if any setup rules are present in a data set, any columns in the input that do not have associated setup rules will be dropped at build time.

table lookup "Admit Facility" table="Facility" Sub-tag for lookup that names a lookup table.

date rule

date rule="Admit Date" Sub-tag for lookup that describes which date rule to use.

key

key "Admitting Provider ID" Sub-tag for lookup that describes the column used for a key. One or more key tags are allowed.
rule key "Facility Code" rule="Admit Facility Code" Sub-tag for lookup that specifies a rule.

lookup-rule

lookup-rule "Admitting Provider"

Sub-tag for lookup that describes the lookup table column to bring into the data set.

Properties—Available in version 7.1(27) and later

duration When set to True, indicates that the numeric measure displays as a time with the standard format hh:mm:ss.
format Specifies the format to use for the values.
label Specifies an alternative label for the measure. You can display this in DivePort using the $(MEASURE_LABEL) macro.

flag-table

flag-table "Revenue Code Flags" {

key rule="Revenue Code"

date rule="Posting Date"

flag-rule "NICU Charges Key"

flag-rule "Rehabilitation Charges Key"

}

Code block for setting flag rules, where you define the flag table name, key and date rules, and one or more flag-rule tags.

key rule

key rule="Revenue Code" Sub-tag for flag-table that describes the one column used for a key.

date rule

date rule="Posting Date" Sub-tag for flag-table that describes which date rule to use.

flag-rule

flag-rule "NICU Charges Key"

Sub-tag for flag-table that describes the flag table column used.

Properties—Available in version 7.1(27) and later

duration When set to True, indicates that the numeric measure displays as a time with the standard format hh:mm:ss.
format Specifies the format to use for the values.
label Specifies an alternative label for the measure. You can display this in DivePort using the $(MEASURE_LABEL) macro.

link

link "Adjustments" {

key "Account ID"

link-rule "Total Adjustments" `sum(value("Transaction Amount"))`

}

Code block for setting link rules, where you define the link name, key column, and one or more link-rule tags.

target-data-set

target-data-set="Accounts" Optional sub-tag for link that names the target data set. Not required if the link name is the same as the desired target data set name.

key

key "Account ID" Sub-tag for link that describes the key column used to bring data into the data set.

target-rule

key "Account ID" target-rule="Accounts" Optional sub-tag for link that has the link use a rule from the target data set.

link-rule

link-rule "Total Adjustments" `sum(value("Transaction Amount"))` Sub-tag for link that can use a Spectre expression calculation, a filter or both to define the rule.

Properties—Available in version 7.1(27) and later

durationWhen set to True, indicates that the numeric measure displays as a time with the standard format hh:mm:ss.
formatSpecifies the format to use for the values.
labelSpecifies an alternative label for the measure. You can display this in DivePort using the $(MEASURE_LABEL) macro.

plugin

plugin "Concat" {

input "Input" data-set="Charges" {

column "Key" rule="Account ID"

column "String" rule="Revenue Description"

}

dimension "Key" rule="Account ID"

plugin-rule "All Revenue Descriptions" column="Concat" {

}

}

Code block for setting plugin rules, where you declare the plugin name, input data set and columns to bring in, output dimension, and provide a name for the results. See Factory Plugin Configuration File Overview.

input

input "Input" data-set="Charges"
Sub-tag for plugin that maps the input to a data set. The data-set tag is optional if the input and data set have the same name.

column

column "Key" rule="Account ID" Sub-tag for plugin that indicates which columns to bring into the plugin. The rule tag is optional if the column and the rule have the same name.

dimension

dimension "Key" rule="Account ID" Sub-tag for plugin that describes the output dimension. Can also take a rule tag.

plugin-rule

plugin-rule "All Revenue Descriptions" column="Concat" Sub-tag for plugin that provides a name for the plugin-rule resulting from the plugin execution.