123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- /**
- * 患者库。
- *
- * author: Sand
- * since: 2016/11/18
- */
- "use strict";
- var ImDb = require('./db/im.db');
- class PatientRepo {
- constructor() {
- }
- static findOne(patientId, handler){
- ImDb.execQuery({
- "sql": "select id, name, sex, birthdate, avatar from patients where id = ? ",
- "args": [patientId],
- "handler": handler
- });
- }
- static findPatientOpenId(code, handler) {
- var sql = "select openid from patients where id = ? ";
- ImDb.execQuery({
- "sql": sql,
- "args": [code],
- "handler": handler
- });
- }
- // TODO: 不能直接访问三师库
- static getPatientDoctorConsult(patient, doctor, handler) {
- var sql = "select * from wlyy_consult_team where patient = ? and doctor = ? and status = 0 and del = '1' ";
- ImDb.execQuery({
- "sql": sql,
- "args": [patient, doctor],
- "handler": handler
- });
- };
- }
- module.exports = PatientRepo;
|