diff --git a/scripts/constants.ts b/scripts/constants.ts index 77b3db04..b13617d7 100644 --- a/scripts/constants.ts +++ b/scripts/constants.ts @@ -392,3 +392,27 @@ export const QUALITY_DEFAULT_VALUES = { isSevenPointCapRemoved: false, sevenPointCapRemoved: [] }; + +export const QUALITY_DEFAULT_PROGRAMS = [ + 'mips', + 'pcf', +]; + +export const COST_DEFAULT_PROGRAMS = [ + 'mips', + 'app1', +]; + +export const IA_DEFAULT_PROGRAMS = [ + 'mips', + 'app1', + 'appPlus', + 'pcf', +]; + +export const PI_DEFAULT_PROGRAMS = [ + 'mips', + 'app1', + 'appPlus', + 'pcf', +]; diff --git a/scripts/measures/lib/measures-lib.spec.ts b/scripts/measures/lib/measures-lib.spec.ts index 642de241..0d2755d3 100644 --- a/scripts/measures/lib/measures-lib.spec.ts +++ b/scripts/measures/lib/measures-lib.spec.ts @@ -268,6 +268,12 @@ describe('#update-measures-util', () => { category: 'ia', weight: 'high', subcategoryId: 'populationManagement', + allowedPrograms: [ + 'mips', + 'app1', + 'appPlus', + 'pcf', + ], }); }); @@ -290,6 +296,12 @@ describe('#update-measures-util', () => { substitutes: ['PI_PPHI_2'], exclusion: ['PI_EP_1', 'PI_EP_32'], measureSets: [], + allowedPrograms: [ + 'mips', + 'app1', + 'appPlus', + 'pcf', + ], }); }); diff --git a/scripts/measures/lib/measures-lib.ts b/scripts/measures/lib/measures-lib.ts index 0496a3ef..976f8154 100644 --- a/scripts/measures/lib/measures-lib.ts +++ b/scripts/measures/lib/measures-lib.ts @@ -14,27 +14,21 @@ import { info, warning } from '../../logger'; import { MeasuresChange } from '../lib/validate-change-requests'; import { DataValidationError } from '../../errors'; import { + COST_DEFAULT_PROGRAMS, COST_DEFAULT_VALUES, COST_MEASURES_ORDER, + IA_DEFAULT_PROGRAMS, IA_DEFAULT_VALUES, IA_MEASURES_ORDER, + PI_DEFAULT_PROGRAMS, PI_DEFAULT_VALUES, PI_MEASURES_ORDER, QCDR_MEASURES_ORDER, + QUALITY_DEFAULT_PROGRAMS, QUALITY_DEFAULT_VALUES, QUALITY_MEASURES_ORDER } from '../../constants'; -const QUALITY_DEFAULT_PROGRAMS = [ - 'mips', - 'pcf', -]; - -const COST_DEFAULT_PROGRAMS = [ - 'mips', - 'app1', -]; - /** * Adds the change file csv to the array in changes.meta.json. * This allows us to track which files are new and which have already been ingested. @@ -132,6 +126,7 @@ export function addMeasure(change: MeasuresChange, measuresJson: any) { measuresJson.splice(index + 1, 0, orderFields({ ...IA_DEFAULT_VALUES, ...change, + allowedPrograms: IA_DEFAULT_PROGRAMS, })); break; } @@ -140,7 +135,8 @@ export function addMeasure(change: MeasuresChange, measuresJson: any) { measuresJson.splice(index + 1, 0, orderFields({ ...PI_DEFAULT_VALUES, ...change, - preprod + preprod, + allowedPrograms: PI_DEFAULT_PROGRAMS, })); break; }