Skip to content

Commit

Permalink
fix(review): rm ancient logVisit functionality
Browse files Browse the repository at this point in the history
This commit removes the logVisit functionality accidentally re-introduced
in a failed rebase.  The `logVisit` functionality has been superseded
by patient checkins.
  • Loading branch information
jniles committed Jun 13, 2016
1 parent 1d4f528 commit ef077b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 31 deletions.
8 changes: 4 additions & 4 deletions server/controllers/medical/patients/checkin.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @module medical/patients/checkin
*
*
* @description
* This controller is responsible for the Patient Check In feature, this allows a hospital to track when returning
* patients visit the hospital.
Expand All @@ -13,7 +13,7 @@
* @requires lib/topic
* @requires lib/errors/BadRequest
*/
'use strict'
'use strict';

const uuid = require('node-uuid');

Expand Down Expand Up @@ -51,7 +51,7 @@ function list(req, res, next) {
`
SELECT
BUID(patient_uuid) as patient_uuid, start_date, end_date, user_id, username
FROM patient_visit
FROM patient_visit
JOIN user on patient_visit.user_id = user.id
WHERE patient_uuid = ?
ORDER BY start_date DESC
Expand Down Expand Up @@ -90,7 +90,7 @@ function create(req, res, next) {
res.status(201).json({
uuid : patientUuid
});

// public patient change (checkin) event
topic.publish(topic.channels.MEDICAL, {
event: topic.events.UPDATE,
Expand Down
27 changes: 0 additions & 27 deletions server/controllers/medical/patients/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ exports.find = find;
// check if a hospital file number is assigned to any patients
exports.hospitalNumberExists = hospitalNumberExists;

// log patient visit
exports.visit = visit;

/** @todo discuss if these should be handled by the entity APIs or by patients. */
exports.billingServices = billingServices;
exports.subsidies = subsidies;
Expand Down Expand Up @@ -284,30 +281,6 @@ function hospitalNumberExists(req, res, next) {
.done();
}

function visit(req, res, next) {
var visitData = req.body;

logVisit(visitData, req.session.user.id)
.then(function (result) {

// Assign patient ID as confirmation
result.uuid = visitData.uuid;

res.status(200).send(result);
})
.catch(next)
.done();
}

/**
* @function logVisit
*/
function logVisit(patientData, userId) {
let visitId = db.bid(uuid.v4());
let sql =
'INSERT INTO patient_visit (uuid, patient_uuid, registered_by) VALUES (?);';
return db.exec(sql, [[visitId, db.bid(patientData.uuid), userId]]);
}

/**
* @method find
Expand Down

0 comments on commit ef077b4

Please sign in to comment.