25 lines
595 B
JavaScript
25 lines
595 B
JavaScript
const {initPool} = require("./db") ;
|
|
|
|
class ServiceHanlderClass {
|
|
async getData(){
|
|
|
|
const pool = await initPool();
|
|
try {
|
|
|
|
const result = await pool.request().query("EXEC TDP.dbo.SP_ListFullPatientStatus01 ");
|
|
|
|
// await pool.close();
|
|
// pool=null;
|
|
// console.log('closed')
|
|
return result;
|
|
|
|
} catch (error) {
|
|
console.log(error)
|
|
throw new Error(error)
|
|
}
|
|
}
|
|
}
|
|
|
|
const ServiceHandler = new ServiceHanlderClass();
|
|
|
|
module.exports = ServiceHandler; |