Skip to content

Commit

Permalink
feat: add migration for localexceptioncips table data
Browse files Browse the repository at this point in the history
- Add SQL script to insert records into the localexceptioncips table for Passaic County.
- Add corresponding down script to remove the inserted records.
- Includes SOC, occupation, CIP codes, and descriptions for medical-related field:
29-2072 Medical Records Specialists
29-9021 Health Information Technologists and Medical Registrars
  • Loading branch information
ChelseaKR committed Jan 21, 2025
1 parent 16b32a5 commit 989ddc2
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
'use strict';

var dbm;
var type;
var seed;
var fs = require('fs');
var path = require('path');
var Promise;

/**
* We receive the dbmigrate dependency from dbmigrate initially.
* This enables us to not have to rely on NODE_PATH.
*/
exports.setup = function(options, seedLink) {
dbm = options.dbmigrate;
type = dbm.dataType;
seed = seedLink;
Promise = options.Promise;
};

exports.up = function(db) {
var filePath = path.join(__dirname, 'sqls', '20250121231229-njwe-2618-etpl-add-local-indemand-passaic-county-up.sql');
return new Promise( function( resolve, reject ) {
fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){
if (err) return reject(err);
console.log('received data: ' + data);

resolve(data);
});
})
.then(function(data) {
return db.runSql(data);
});
};

exports.down = function(db) {
var filePath = path.join(__dirname, 'sqls', '20250121231229-njwe-2618-etpl-add-local-indemand-passaic-county-down.sql');
return new Promise( function( resolve, reject ) {
fs.readFile(filePath, {encoding: 'utf-8'}, function(err,data){
if (err) return reject(err);
console.log('received data: ' + data);

resolve(data);
});
})
.then(function(data) {
return db.runSql(data);
});
};

exports._meta = {
"version": 1
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
delete from localexceptioncips where
(soc = '29-2072' and occupation = 'Medical Records Specialists' and county = 'PASSAIC' and cip = '51.0706' and cipdescription = 'Health Information/Medical Records Administration/Administrator.' and cipcode = '510706') or
(soc = '29-2072' and occupation = 'Medical Records Specialists' and county = 'PASSAIC' and cip = '51.0707' and cipdescription = 'Health Information/Medical Records Technology/Technician.' and cipcode = '510707') or
(soc = '29-2072' and occupation = 'Medical Records Specialists' and county = 'PASSAIC' and cip = '51.0713' and cipdescription = 'Medical Insurance Coding Specialist/Coder.' and cipcode = '510713') or
(soc = '29-2072' and occupation = 'Medical Records Specialists' and county = 'PASSAIC' and cip = '51.0721' and cipdescription = 'Disease Registry Data Management.' and cipcode = '510721') or
(soc = '29-9021' and occupation = 'Health Information Technologists and Medical Registrars' and county = 'PASSAIC' and cip = '51.0706' and cipdescription = 'Health Information/Medical Records Administration/Administrator.' and cipcode = '510706') or
(soc = '29-9021' and occupation = 'Health Information Technologists and Medical Registrars' and county = 'PASSAIC' and cip = '51.0707' and cipdescription = 'Health Information/Medical Records Technology/Technician.' and cipcode = '510707') or
(soc = '29-9021' and occupation = 'Health Information Technologists and Medical Registrars' and county = 'PASSAIC' and cip = '51.0713' and cipdescription = 'Medical Insurance Coding Specialist/Coder.' and cipcode = '510713') or
(soc = '29-9021' and occupation = 'Health Information Technologists and Medical Registrars' and county = 'PASSAIC' and cip = '51.0721' and cipdescription = 'Disease Registry Data Management.' and cipcode = '510721') or
(soc = '29-9021' and occupation = 'Health Information Technologists and Medical Registrars' and county = 'PASSAIC' and cip = '51.0723' and cipdescription = 'Healthcare Information Privacy Assurance and Security.' and cipcode = '510723') or
(soc = '29-9021' and occupation = 'Health Information Technologists and Medical Registrars' and county = 'PASSAIC' and cip = '51.2706' and cipdescription = 'Medical Informatics.' and cipcode = '512706');
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
insert into localexceptioncips (soc, occupation, county, cip, cipdescription, cipcode) values ('29-2072', 'Medical Records Specialists', 'PASSAIC', '51.0706', 'Health Information/Medical Records Administration/Administrator.', '510706');
insert into localexceptioncips (soc, occupation, county, cip, cipdescription, cipcode) values ('29-2072', 'Medical Records Specialists', 'PASSAIC', '51.0707', 'Health Information/Medical Records Technology/Technician.', '510707');
insert into localexceptioncips (soc, occupation, county, cip, cipdescription, cipcode) values ('29-2072', 'Medical Records Specialists', 'PASSAIC', '51.0713', 'Medical Insurance Coding Specialist/Coder.', '510713');
insert into localexceptioncips (soc, occupation, county, cip, cipdescription, cipcode) values ('29-2072', 'Medical Records Specialists', 'PASSAIC', '51.0721', 'Disease Registry Data Management.', '510721');
insert into localexceptioncips (soc, occupation, county, cip, cipdescription, cipcode) values ('29-9021', 'Health Information Technologists and Medical Registrars', 'PASSAIC', '51.0706', 'Health Information/Medical Records Administration/Administrator.', '510706');
insert into localexceptioncips (soc, occupation, county, cip, cipdescription, cipcode) values ('29-9021', 'Health Information Technologists and Medical Registrars', 'PASSAIC', '51.0707', 'Health Information/Medical Records Technology/Technician.', '510707');
insert into localexceptioncips (soc, occupation, county, cip, cipdescription, cipcode) values ('29-9021', 'Health Information Technologists and Medical Registrars', 'PASSAIC', '51.0713', 'Medical Insurance Coding Specialist/Coder.', '510713');
insert into localexceptioncips (soc, occupation, county, cip, cipdescription, cipcode) values ('29-9021', 'Health Information Technologists and Medical Registrars', 'PASSAIC', '51.0721', 'Disease Registry Data Management.', '510721');
insert into localexceptioncips (soc, occupation, county, cip, cipdescription, cipcode) values ('29-9021', 'Health Information Technologists and Medical Registrars', 'PASSAIC', '51.0723', 'Healthcare Information Privacy Assurance and Security.', '510723');
insert into localexceptioncips (soc, occupation, county, cip, cipdescription, cipcode) values ('29-9021', 'Health Information Technologists and Medical Registrars', 'PASSAIC', '51.2706', 'Medical Informatics.', '512706');

0 comments on commit 989ddc2

Please sign in to comment.