Skip to content

Commit

Permalink
remove bsn from write_patient_from_json
Browse files Browse the repository at this point in the history
  • Loading branch information
ace-dvm committed Dec 16, 2023
1 parent 6e359eb commit 5fe7243
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
7 changes: 0 additions & 7 deletions adfice.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,6 @@ function patientListOfInserts(patient_id, patient) {
'(patient_id, participant_number, birth_date, age, is_final) ' +
'VALUES (?,?,?,?,0)';
list_of_transactions.push([sql1, [patient_id, patient['participant_number'], patient['birth_date'], age]]);
let sql2 = '/* adfice.patientListOfInserts */ INSERT INTO etl_bsn_patient ' +
'(patient_id, bsn) ' +
"VALUES (?,?)";
list_of_transactions.push([sql2, [patient_id, patient['bsn']]]);
return list_of_transactions;
}

Expand All @@ -142,9 +138,6 @@ function patientListOfUpdates(patient_id, patient) {
'SET birth_date = ?, age = ?, is_final = 0 ' +
"WHERE patient_id = '" + patient_id + "'";
list_of_transactions.push([sql1, [patient['birth_date'], age]]);
let sql2 = '/* adfice.patientListOfUpdates */ UPDATE etl_bsn_patient ' +
"SET bsn = ? WHERE patient_id = '" + patient_id + "'";
list_of_transactions.push([sql2, [patient['bsn']]]);
return list_of_transactions;
}

Expand Down
8 changes: 2 additions & 6 deletions adfice.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1527,12 +1527,10 @@ test('test get patient table sql and params', async function() {
birth_date: '1930-01-01'
};
let list_of_inserts = adfice.patientListOfInserts(patient_id, patient, 100175);
expect(list_of_inserts.length).toBe(3);
expect(list_of_inserts.length).toBe(2);
expect(list_of_inserts[1][0]).toContain("INSERT INTO patient");
expect(list_of_inserts[1][0]).toContain("is_final) VALUES (?,?,?,?,0)");
expect(list_of_inserts[1][1].length).toBe(4);
expect(list_of_inserts[2][0]).toContain("INSERT INTO etl_bsn_patient");
expect(list_of_inserts[2][1].length).toBe(2);
});

test('test get patient table sql and params with nulls', async function() {
Expand All @@ -1544,12 +1542,10 @@ test('test get patient table sql and params with nulls', async function() {
birth_date: null
};
let list_of_inserts = adfice.patientListOfInserts(patient_id, patient, 100175);
expect(list_of_inserts.length).toBe(3);
expect(list_of_inserts.length).toBe(2);
expect(list_of_inserts[1][0]).toContain("INSERT INTO patient");
expect(list_of_inserts[1][0]).toContain("is_final) VALUES (?,?,?,?,0)");
expect(list_of_inserts[1][1].length).toBe(4);
expect(list_of_inserts[2][0]).toContain("INSERT INTO etl_bsn_patient");
expect(list_of_inserts[2][1].length).toBe(2);
});

test('test get med sql and params', async function() {
Expand Down

0 comments on commit 5fe7243

Please sign in to comment.