patient.repo.js 888 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /**
  2. * 患者数据。
  3. *
  4. * author: Sand
  5. * since: 2016/11/18
  6. */
  7. "use strict";
  8. var wlyyDb = require('./database/wlyy.db');
  9. exports.isPatientCode = function (code, handler) {
  10. var sql = "select count(*) c from wlyy_patient where code = '" + code + "'";
  11. wlyyDb.execQuery({
  12. "sql": sql,
  13. "args": [],
  14. "handler": handler
  15. });
  16. };
  17. exports.getPatientOpenid = function (code, handler) {
  18. var sql = "select openid from wlyy_patient where code = ? ";
  19. wlyyDb.execQuery({
  20. "sql": sql,
  21. "args": [code],
  22. "handler": handler
  23. });
  24. };
  25. exports.getPatientDoctorConsult = function (patient, doctor, handler) {
  26. var sql = "select * from wlyy_consult_team where patient = ? and doctor = ? and status = 0 and del = '1' ";
  27. wlyyDb.execQuery({
  28. "sql": sql,
  29. "args": [patient, doctor],
  30. "handler": handler
  31. });
  32. };