/** * Adds performance and eligibility options for claims-related measures. * * The source for this is a JSON file generated by /claims-related/scripts/single_source_to_json.py * See /claims-related/README.md for more information. */ import { Measure } from "../../../util/interfaces"; // these are the attributes we are interested in const attributes = [ 'eligibilityOptions', 'performanceOptions' ]; export function mergeClaimsRelatedData(measures: Measure[], claimsRelatedMeasures: any) { // now for each measure, add the attributes from the claims-related measures set measures.forEach(measure => { // if the measure is in claimsRelatedMeasures, we need to merge its attributes const claimsRelatedMeasure = claimsRelatedMeasures[measure.measureId]; if (claimsRelatedMeasure) { for (const attribute of attributes) { measure[attribute] = claimsRelatedMeasure[attribute]; } } }); };