Skip to content

Commit

Permalink
Rebuild NHS HA codes
Browse files Browse the repository at this point in the history
  • Loading branch information
cblanc committed Mar 3, 2019
1 parent aa6e15e commit 4be996b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions data/nhsHa.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"S08000015": "Ayrshire and Arran",
"S08000016": "Borders",
"S08000017": "Dumfries and Galloway",
"S08000018": "Fife",
"S08000019": "Forth Valley",
"S08000020": "Grampian",
"S08000021": "Greater Glasgow and Clyde",
Expand All @@ -25,14 +24,15 @@
"S08000024": "Lothian",
"S08000025": "Orkney",
"S08000026": "Shetland",
"S08000027": "Tayside",
"S08000028": "Western Isles",
"S08000029": "Fife",
"S08000030": "Tayside",
"W11000023": "Betsi Cadwaladr University Health Board",
"W11000024": "Powys Teaching Health Board",
"W11000025": "Hywel Dda University Health Board",
"W11000026": "Abertawe Bro Morgannwg University Health Board",
"W11000027": "Cwm Taf University Health Board",
"W11000028": "Aneurin Bevan University Health Board",
"W11000029": "Cardiff and Vale University Health Board",
"ZB001": "ZB001"
"ZB001": "Health & Social Care Board"
}
22 changes: 11 additions & 11 deletions data/scripts/nhsHa.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";

const {extract} = require("./index");
const { extract } = require("./index");

/**
* @module DataParser/nhsHa
Expand All @@ -16,20 +16,20 @@ const CODE_OFFSET = 0;
const VALUE_OFFSET = 2;

const transform = row => {
const code = row[CODE_OFFSET];
const value = row[VALUE_OFFSET];
if (code === "HLTHAUCD") return []; // Escape if header
return [code, value];
const code = row[CODE_OFFSET];
const value = row[VALUE_OFFSET];
if (value === "HLTHAUNM") return []; // Escape if header
return [code, value];
};

const parseOptions = { relax_column_count: true };
const parseOptions = { delimiter: "," };

const configs = [
{
file: "HLTHAU names and codes UK as at 12_16 (OSHLTHAU).txt",
transform,
parseOptions
}
{
file: "HLTHAU names and codes UK as at 12_18 (OSHLTHAU).csv",
transform,
parseOptions,
},
];

extract({ configs });

0 comments on commit 4be996b

Please sign in to comment.