diff --git a/data/ccgs.json b/data/ccgs.json index 7b564848..9c3156b2 100644 --- a/data/ccgs.json +++ b/data/ccgs.json @@ -1,4 +1,8 @@ { + "CCG20CD": { + "ccg19cdh": "CCG20CDH", + "name": "CCG20NM" + }, "E38000001": { "ccg19cdh": "02N", "name": "NHS Airedale, Wharfedale and Craven" @@ -763,6 +767,78 @@ "ccg19cdh": "15N", "name": "NHS Devon" }, + "E38000231": { + "ccg19cdh": "92G", + "name": "NHS Bath and North East Somerset, Swindon and Wiltshire" + }, + "E38000232": { + "ccg19cdh": "36J", + "name": "NHS Bradford District and Craven" + }, + "E38000233": { + "ccg19cdh": "27D", + "name": "NHS Cheshire" + }, + "E38000234": { + "ccg19cdh": "84H", + "name": "NHS County Durham" + }, + "E38000235": { + "ccg19cdh": "97R", + "name": "NHS East Sussex" + }, + "E38000236": { + "ccg19cdh": "18C", + "name": "NHS Herefordshire and Worcestershire" + }, + "E38000237": { + "ccg19cdh": "91Q", + "name": "NHS Kent and Medway" + }, + "E38000238": { + "ccg19cdh": "71E", + "name": "NHS Lincolnshire" + }, + "E38000239": { + "ccg19cdh": "26A", + "name": "NHS Norfolk and Waveney" + }, + "E38000240": { + "ccg19cdh": "93C", + "name": "NHS North Central London" + }, + "E38000241": { + "ccg19cdh": "42D", + "name": "NHS North Yorkshire" + }, + "E38000242": { + "ccg19cdh": "78H", + "name": "NHS Northamptonshire" + }, + "E38000243": { + "ccg19cdh": "52R", + "name": "NHS Nottingham and Nottinghamshire" + }, + "E38000244": { + "ccg19cdh": "72Q", + "name": "NHS South East London" + }, + "E38000245": { + "ccg19cdh": "36L", + "name": "NHS South West London" + }, + "E38000246": { + "ccg19cdh": "92A", + "name": "NHS Surrey Heartlands" + }, + "E38000247": { + "ccg19cdh": "16C", + "name": "NHS Tees Valley" + }, + "E38000248": { + "ccg19cdh": "70F", + "name": "NHS West Sussex" + }, "M01000001": { "ccg19cdh": "YK1", "name": "Isle of Man" diff --git a/data/scripts/ccgs.js b/data/scripts/ccgs.js index 3234d9a5..4cbc7538 100644 --- a/data/scripts/ccgs.js +++ b/data/scripts/ccgs.js @@ -1,6 +1,6 @@ "use strict"; -const {extract, isPseudoCode} = require("./index"); +const { extract, isPseudoCode } = require("./index"); /** * @module DataParser/ccgs @@ -12,34 +12,44 @@ const {extract, isPseudoCode} = require("./index"); * - "CCG" suffix is dropped from values */ - const CODE_OFFSET = 0; const SECOND_CODE_OFFSET = 1; const VALUE_OFFSET = 2; const ccgRegex = /\sCCG$/; -const transform = row => { - const code = row[CODE_OFFSET]; +const transform = (row) => { + const code = row[CODE_OFFSET]; const second_code = row[SECOND_CODE_OFFSET]; - const value = row[VALUE_OFFSET]; - if (code === "CCG19CD") return []; // Escape if header - if (isPseudoCode(code)) return []; - return [code, { - "ccg19cdh": second_code, - "name": value.replace(ccgRegex, "").trim() - }]; + const value = row[VALUE_OFFSET]; + if (code === "CCG19CD") return []; // Escape if header + if (isPseudoCode(code)) return []; + return [ + code, + { + ccg19cdh: second_code, + name: value.replace(ccgRegex, "").trim(), + }, + ]; }; const configs = [ - { - file: "CCG names and codes UK as at 04_19.csv", - transform, - parseOptions: { - delimiter: ",", - }, - encoding: "utf8", - } + { + file: "CCG names and codes UK as at 04_19.csv", + transform, + parseOptions: { + delimiter: ",", + }, + encoding: "utf8", + }, + { + file: "CCG names and codes EN as at 04_20.csv", + transform, + parseOptions: { + delimiter: ",", + }, + encoding: "utf8", + }, ]; extract({ configs }); diff --git a/data/scripts/wards.js b/data/scripts/wards.js index 61235773..310f7254 100644 --- a/data/scripts/wards.js +++ b/data/scripts/wards.js @@ -11,7 +11,7 @@ const { extract } = require("./index"); const CODE_OFFSET = 0; const VALUE_OFFSET = 1; -const transform = row => { +const transform = (row) => { const code = row[CODE_OFFSET]; const value = row[VALUE_OFFSET]; if (code === "WD19CD") return []; // Escape if header