Spectre Measures Tags
A Spectre Measures script is defined using a measures tag with optional tags between open and close { } braces. This topic describes the tags that can be used within the measures code block. The tags are listed in alphabetical order, after the measures tag, in the following table.
Measures Tags
| Tags | Examples | Notes |
|---|---|---|
| measures |
measures { … } |
Defines the block for the Measures definition. |
| cbase-input |
data-set "targets" { cbase-input "/in/targets.cbase" rename-dimension "Year-Month Start" "Date" } |
Specifies a cBase as input to the data set. |
| cplan-input |
data-set "chrgs_all_cust_cplan" { cplan-input "/hospital_cplans/charges_dimcounts_cust.cplan" { filter `string(value("Posting Date")) != ""` } } |
Specifies a cPlan as input to the data set. NOTE: Calculations in the cPlan cannot be used by the measures script. |
| custom-property | custom-property "Use Percent Difference" "False" | Defines a new property for the measure. |
| data-set |
data-set "util_inpatient_ad" { input "/in/encounters.cbase" { filter `value("Patient Type") = "Inpatient" and notnull(value("Admit Date")) } } |
Names the data set and indicates which cBase to use for input. Dive input tags such as filter and lookup are allowed. Multiple sets can be defined for a single input. |
| dimension | dimension "Date"
dimension "Facility" dimension "Provider" |
Specifies the dimensions in the measures data. These dimensions are often found in multiple cBases under other names. |
|
dscolumn (Deprecated) |
related-measure "Target" `dscolumn("targets", "Total Admissions")` |
Specifies a data set and column to evaluate; requires that named column be a column in the cBase, not a calc. |
| label | measure "MEASUREKEY" `dscolumn("mydata", "Calc")` label = "Measure Label" | Defines a label to use in the clients. |
| measure |
measure "INPTCHRGS" `value("Inpatient Charges")` format="#,###,K" label="Inpatient Charges" { related-measure "Target" `dscolumn("targets", "Inpatient Charges")` } |
Defines the measurement. A value for the key is specified in all caps, followed by an expression using the dscolumn function. This measures function takes the data set name and the column name as arguments. You can also specify calculations involving other measures. |
| output | output "/measures/out" | Names the project folder where Spectre measures places the generated cPlans and cBases. |
| related-measure |
measure "IPOPRATIO" `measure("INPTCHRGS")/measure("OUTPTCHRGS")` format="#.0" label="IP OP Charge Ratio" { related-measure "Target" `dscolumn("targets", "IP OP Charge Ratio Numerator")/dscolumn("targets", "IP OP Charge Ratio Denominator")` } |
Names a measure that this measure depends on. Measures in one data set can depend on measures in another. Naming related measures helps the function process the data appropriately. |
| renamed-dimension |
data-set "chrgs_all" { input "/in/charges.cbase" rename-dimension "Service Date" "Date" rename-dimension "Facility Code" "Facility" } |
Indicates dimensions in the input to map to those dimensions declared in the current measures script. |
See also: