How to use visit method in unexpected

Best JavaScript code snippet using unexpected

his_jhcis.model.js

Source:his_jhcis.model.js Github

copy

Full Screen

1"use strict";2Object.defineProperty(exports, "__esModule", { value: true });3exports.PccHisJhcisModel = void 0;4const dbName = process.env.HIS_DB_NAME;5const maxLimit = 500;6class PccHisJhcisModel {7 check() {8 return true;9 }10 getTableName(knex) {11 return knex12 .select('TABLE_NAME')13 .from('information_schema.tables')14 .where('TABLE_SCHEMA', '=', dbName);15 }16 getService(db, hn, date) {17 return db('visit')18 .select('pid', 'pid as hn', 'visitno', 'visitdate as date', 'timestart as time')19 .select(db.raw("case when LOCATE('/', pressure) then SUBSTR(pressure,1,LOCATE('/', pressure)-1) else '' end as bp_systolic"))20 .select(db.raw("case when LOCATE('/', pressure) then SUBSTR(pressure,LOCATE('/', pressure)+1) else '' end as bp_diastolic"))21 .select('pulse as pr', 'respri as rr', 'weight', 'height', 'waist', 'temperature as tem')22 .where('pid', "=", hn)23 .where('visitdate', "=", date)24 .limit(maxLimit);25 }26 getServiceByHn(db, hn, cid, date = '', visitno = '') {27 if (!hn && !cid)28 return null;29 let searchType = 'visit.pid';30 let searchValue = hn;31 let where = {};32 if (cid) {33 let searchType = 'person.idcard';34 let searchValue = cid;35 }36 if (date) {37 where.visitdate = date;38 }39 if (visitno) {40 where.visitno = visitno;41 }42 return db('visit')43 .leftJoin('person', 'visit.pid', 'person.pid')44 .leftJoin('chospital', 'visit.pcucode', 'chospital.hoscode')45 .select('visit.pcucode as hospcode', 'visit.*', 'visit.pid as hn', 'visit.visitdate as date', 'visit.visitdate as date_serv', 'visit.timestart as time')46 .select(db.raw("case when LOCATE('/', pressure) then SUBSTR(pressure,1,LOCATE('/', pressure)-1) else '' end as bp_systolic"))47 .select(db.raw("case when LOCATE('/', pressure) then SUBSTR(pressure,LOCATE('/', pressure)+1) else '' end as bp_diastolic"))48 .select('pulse as pr', 'respri as rr', 'temperature as tem', 'visit.bmilevel as bmi', 'visit.rightcode as pttype', 'visit.hosmain as hospmain', 'visit.hossub as hospsub', 'chospital.hosname as hospname')49 .where(searchType, searchValue)50 .where(where)51 .limit(maxLimit);52 }53 getDiagnosisByHn(db, pid) {54 return db('visitdiag as dx')55 .innerJoin('visit', 'dx.visitno', 'visit.visitno')56 .leftJoin('cdisease as lib', 'dx.diagcode', 'lib.diseasecode')57 .leftJoin('chospital', 'visit.pcucode', 'chospital.hoscode')58 .select('dx.*', 'dx.pcucode as hospcode', 'chospital.hosname as hospname', 'lib.diseasename as diagname', 'lib.diseasenamethai as diagnamethai', 'visit.visitdate as date_serv', 'visit.timestart as time_serv')59 .where('visit.pid', "=", pid)60 .orderBy('visit.visitdate', 'desc')61 .orderBy('visit.timestart', 'desc');62 }63 getDiagnosis(db, visitNo) {64 return db('visitdiag as dx')65 .innerJoin('visit', 'dx.visitno', 'visit.visitno')66 .leftJoin('cdisease as lib', 'dx.diagcode', 'lib.diseasecode')67 .leftJoin('chospital', 'visit.pcucode', 'chospital.hoscode')68 .select('dx.*', 'dx.pcucode as hospcode', 'chospital.hosname as hospname', 'lib.diseasename as diagname', 'lib.diseasenamethai as diagnamethai', 'visit.visitdate as date_serv', 'visit.timestart as time_serv')69 .where('dx.visitno', "=", visitNo)70 .orderBy('visit.visitdate', 'desc')71 .orderBy('visit.timestart', 'desc')72 .orderBy('dx.dxtype');73 }74 getDrug(db, visitNo) {75 return db('visitdrug as drug')76 .innerJoin('visit', 'drug.visitno', 'visit.visitno')77 .leftJoin('cdrug as lib', 'drug.drugcode', 'lib.drugcode')78 .leftJoin('chospital', 'visit.pcucode', 'chospital.hoscode')79 .select('drug.*', 'drug.pcucode as hospcode', 'chospital.hosname as hospname', 'lib.drugname', 'visit.visitdate as date_serv', 'visit.timestart as time_serv', 'lib.pack', 'lib.unitsell as unit_sell', 'lib.unitusage as unit_use', 'lib.cost', 'lib.sell as price', 'lib.drugcaution as caution', 'lib.drugcode24 as code24', 'lib.tcode', 'lib.tmtcode as tmt', 'lib.drugproperties as comment')80 .where('drug.visitno', "=", visitNo)81 .where('lib.drugtype', "=", '01')82 .orderBy('visit.visitdate', 'desc')83 .orderBy('visit.timestart', 'desc');84 }85 getDrugByHn(db, pid) {86 return db('visitdrug as drug')87 .innerJoin('visit', 'drug.visitno', 'visit.visitno')88 .leftJoin('cdrug as lib', 'drug.drugcode', 'lib.drugcode')89 .leftJoin('chospital', 'visit.pcucode', 'chospital.hoscode')90 .select('drug.*', 'drug.pcucode as hospcode', 'chospital.hosname as hospname', 'lib.drugname', 'visit.visitdate as date_serv', 'visit.timestart as time_serv', 'lib.pack', 'lib.unitsell as unit', 'lib.unitusage as unit_use', 'lib.cost', 'lib.sell as price', 'lib.drugcaution as caution', 'lib.drugcode24 as code24', 'lib.tcode', 'lib.tmtcode as tmt', 'lib.drugproperties as comment')91 .where('visit.pid', "=", pid)92 .where('lib.drugtype', "=", '01')93 .orderBy('visit.visitdate', 'desc')94 .orderBy('visit.timestart', 'desc');95 }96 getAnc(db, visitNo) {97 return db('visitanc as anc')98 .leftJoin('visit', 'anc.visitno', 'visit.visitno')99 .leftJoin('chospital', 'visit.pcucodeperson', 'chospital.hoscode')100 .select('anc.*', 'anc.pcucodeperson as hospcode', 'chospital.hosname as hospname', 'visit.visitdate as date_serv', 'visit.timestart as time_serv')101 .where('anc.visitno', "=", visitNo)102 .orderBy('anc.datecheck', 'desc')103 .orderBy('visit.visitdate', 'desc');104 }105 getAncByHn(db, pid) {106 return db('visitanc as anc')107 .leftJoin('visit', 'anc.visitno', 'visit.visitno')108 .leftJoin('chospital', 'visit.pcucodeperson', 'chospital.hoscode')109 .select('anc.*', 'anc.pcucodeperson as hospcode', 'chospital.hosname as hospname', 'visit.visitdate as date_serv', 'visit.timestart as time_serv')110 .where('visit.pid', "=", pid)111 .orderBy('anc.datecheck', 'desc')112 .orderBy('visit.visitdate', 'desc');113 }114 getEpi(db, visitNo) {115 return db('visitepi as epi')116 .leftJoin('visit', 'epi.visitno', 'visit.visitno')117 .leftJoin('chospital', 'visit.pcucodeperson', 'chospital.hoscode')118 .leftJoin('cvaccinegroup as lib', 'epi.vaccinecode', 'lib.vaccode')119 .select('epi.*', 'epi.pcucodeperson as hospcode', 'chospital.hosname as hospname', 'visit.visitdate as date_serv', 'visit.timestart as time_serv', 'lib.vacname')120 .where('epi.visitno', "=", visitNo)121 .orderBy('epi.dateepi', 'desc');122 }123 getEpiByHn(db, pid) {124 return db('visitepi as epi')125 .innerJoin('person', 'epi.pid', 'person.pid')126 .leftJoin('visit', 'epi.visitno', 'visit.visitno')127 .leftJoin('chospital', 'visit.pcucodeperson', 'chospital.hoscode')128 .leftJoin('cvaccinegroup as lib', 'epi.vaccinecode', 'lib.vaccode')129 .select('epi.*', 'epi.pcucodeperson as hospcode', 'chospital.hosname as hospname', 'visit.visitdate as date_serv', 'visit.timestart as time_serv', 'lib.vacname')130 .where('person.pid', "=", pid)131 .orderBy('epi.dateepi', 'desc');132 }133 getFp(db, visitNo) {134 return db('visitfp as fp')135 .innerJoin('person', 'fp.pid', 'person.pid')136 .leftJoin('visit', 'fp.visitno', 'visit.visitno')137 .leftJoin('chospital', 'visit.pcucodeperson', 'chospital.hoscode')138 .join('cdrug', function () {139 this.on('fp.fpcode', '=', 'cdrug.drugcode');140 })141 .select('fp.*', 'fp.pcucodeperson as hospcode', 'chospital.hosname as hospname', 'visit.visitdate as date_serv', 'visit.timestart as time_serv', 'cdrug.drugname')142 .where('fp.visitno', "=", visitNo)143 .where('cdrug.drugtype', "=", '04')144 .orderBy('fp.datefp', 'desc');145 }146 getFpByHn(db, pid) {147 return db('visitfp as fp')148 .innerJoin('person', 'fp.pid', 'person.pid')149 .innerJoin('visit', 'fp.visitno', 'visit.visitno')150 .leftJoin('chospital', 'visit.pcucodeperson', 'chospital.hoscode')151 .join('cdrug', function () {152 this.on('fp.fpcode', '=', 'cdrug.drugcode');153 })154 .select('fp.*', 'fp.pcucodeperson as hospcode', 'chospital.hosname as hospname', 'visit.visitdate as date_serv', 'visit.timestart as time_serv', 'cdrug.drugname')155 .where('person.pid', "=", pid)156 .where('cdrug.drugtype', "=", '04')157 .orderBy('fp.datefp', 'desc');158 }159 getNutrition(db, visitNo) {160 return db('visitnutrition as nutrition')161 .innerJoin('visit', 'nutrition.visitno', 'visit.visitno')162 .innerJoin('person', 'visit.pid', 'person.pid')163 .leftJoin('chospital', 'visit.pcucode', 'chospital.hoscode')164 .select('nutrition.*', 'nutrition.pcucode as hospcode', 'chospital.hosname as hospname', 'visit.visitdate as date_serv', 'visit.timestart as time_serv')165 .where('nutrition.visitno', "=", visitNo)166 .orderBy('visit.visitdate', 'desc')167 .orderBy('visit.timestart', 'desc');168 }169 getNutritionByHn(db, pid) {170 return db('visitnutrition as nutrition')171 .innerJoin('visit', 'nutrition.visitno', 'visit.visitno')172 .innerJoin('person', 'visit.pid', 'person.pid')173 .leftJoin('chospital', 'visit.pcucode', 'chospital.hoscode')174 .select('nutrition.*', 'nutrition.pcucode as hospcode', 'chospital.hosname as hospname', 'visit.visitdate as date_serv', 'visit.timestart as time_serv')175 .where('visit.pid', "=", pid)176 .orderBy('visit.visitdate', 'desc')177 .orderBy('visit.timestart', 'desc');178 }179 getDrugAllergy(db, pid, cid) {180 if (!pid && !cid)181 return null;182 let where = 'alg.drugcode!=""';183 if (pid) {184 where += ` and alg.pid="${pid}" `;185 }186 if (cid) {187 where += ` and person.idcard="${cid}" `;188 }189 return db('personalergic as alg')190 .innerJoin('person', 'alg.pid', 'person.pid')191 .leftJoin('chospital', 'alg.pcucodeperson', 'chospital.hoscode')192 .leftJoin('cdrugallergysymtom as lib', 'alg.symptom', 'lib.symtomcode')193 .join('cdrug', function () {194 this.on('alg.drugcode', '=', 'cdrug.drugcode');195 })196 .select('alg.*', 'alg.pcucodeperson as hospcode', 'chospital.hosname as hospname', 'cdrug.drugname', 'person.idcard', 'lib.symtomname', 'lib.icd10tm')197 .whereRaw(db.raw(where))198 .where('cdrug.drugtype', "=", '01')199 .orderBy('person.fname')200 .orderBy('person.lname')201 .limit(maxLimit);202 }203 getChronic(db, pid, cid) {204 if (!pid && !cid)205 return null;206 let where = 'chronic.chroniccode!=""';207 if (pid) {208 where += ` and chronic.pid="${pid}" `;209 }210 if (cid) {211 where += ` and person.idcard="${cid}" `;212 }213 return db('personchronic as chronic')214 .innerJoin('person', 'chronic.pid', 'person.pid')215 .leftJoin('cdisease as icd', 'chronic.chroniccode', 'icd.diseasecode')216 .leftJoin('chospital', 'chronic.pcucodeperson', 'chospital.hoscode')217 .select('chronic.*', 'chronic.pcucodeperson as hospcode', 'chospital.hosname as hospname')218 .select('icd.diseasename as dxname', 'icd.diseasenamethai as dxthai')219 .whereRaw(db.raw(where))220 .limit(maxLimit);221 }222 getLabResult(db, columnName, searchNo) {223 return [];224 }225 libDrug(db, searchType, searchValue) {226 return db('cdrug')227 .where(searchType, 'like', '%' + searchValue + '%')228 .where('drugtype', "=", '01')229 .limit(maxLimit);230 }231 getPerson(db, columnName, searchText) {232 columnName = columnName === 'cid' ? 'idcard' : columnName;233 columnName = columnName === 'hn' ? 'pid' : columnName;234 return db('person')235 .leftJoin('ctitle', 'person.prename', 'ctitle.titlecode')236 .select('pid as hn', 'idcard as cid', 'prename', 'ctitle.titlename', 'fname', 'lname', 'birth as dob', 'sex', 'hnomoi as address', 'mumoi as moo', 'roadmoi as road', 'provcodemoi as province', 'distcodemoi as district', 'subdistcodemoi as subdistrict', 'telephoneperson as tel', 'postcodemoi as zip', 'occupa as occupation')237 .select(db.raw('concat(provcodemoi, distcodemoi, subdistcodemoi) as addcode'))238 .where(columnName, "=", searchText);239 }240 getProcedureOpd(knex, columnName, searchNo, hospCode) {241 return knex242 .select('*')243 .from('procedure_opd')244 .where(columnName, "=", searchNo);245 }246 getChargeOpd(knex, columnName, searchNo, hospCode) {247 return knex248 .select('*')249 .from('charge_opd')250 .where(columnName, "=", searchNo);251 }252 getDrugOpd(knex, columnName, searchNo, hospCode) {253 return knex254 .select('*')255 .from('drug_opd')256 .where(columnName, "=", searchNo);257 }258 getAdmission(knex, columnName, searchNo, hospCode) {259 return knex260 .select('*')261 .from('admission')262 .where(columnName, "=", searchNo);263 }264 getDiagnosisIpd(knex, columnName, searchNo, hospCode) {265 return knex266 .select('*')267 .from('diagnosis_ipd')268 .where(columnName, "=", searchNo);269 }270 getProcedureIpd(knex, columnName, searchNo, hospCode) {271 return knex272 .select('*')273 .from('procedure_ipd')274 .where(columnName, "=", searchNo);275 }276 getChargeIpd(knex, columnName, searchNo, hospCode) {277 return knex278 .select('*')279 .from('charge_ipd')280 .where(columnName, "=", searchNo);281 }282 getDrugIpd(knex, columnName, searchNo, hospCode) {283 return knex284 .select('*')285 .from('drug_ipd')286 .where(columnName, "=", searchNo);287 }288 getAccident(knex, columnName, searchNo, hospCode) {289 return knex290 .select('*')291 .from('accident')292 .where(columnName, "=", searchNo);293 }294 getAppointment(knex, columnName, searchNo, hospCode) {295 return knex296 .select('*')297 .from('appointment')298 .where(columnName, "=", searchNo);299 }300 getData(knex, tableName, columnName, searchNo, hospCode) {301 return knex302 .select('*')303 .from(tableName)304 .where(columnName, "=", searchNo)305 .limit(5000);306 }307}...

Full Screen

Full Screen

rem-visit-status-test.ssr.js

Source:rem-visit-status-test.ssr.js Github

copy

Full Screen

1'use strict';function _defineProperty(obj, key, value) {2 if (key in obj) {3 Object.defineProperty(obj, key, {4 value: value,5 enumerable: true,6 configurable: true,7 writable: true8 });9 } else {10 obj[key] = value;11 }12 return obj;13}14function _slicedToArray(arr, i) {15 return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();16}17function _arrayWithHoles(arr) {18 if (Array.isArray(arr)) return arr;19}20function _iterableToArrayLimit(arr, i) {21 if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;22 var _arr = [];23 var _n = true;24 var _d = false;25 var _e = undefined;26 try {27 for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {28 _arr.push(_s.value);29 if (i && _arr.length === i) break;30 }31 } catch (err) {32 _d = true;33 _e = err;34 } finally {35 try {36 if (!_n && _i["return"] != null) _i["return"]();37 } finally {38 if (_d) throw _e;39 }40 }41 return _arr;42}43function _unsupportedIterableToArray(o, minLen) {44 if (!o) return;45 if (typeof o === "string") return _arrayLikeToArray(o, minLen);46 var n = Object.prototype.toString.call(o).slice(8, -1);47 if (n === "Object" && o.constructor) n = o.constructor.name;48 if (n === "Map" || n === "Set") return Array.from(o);49 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);50}51function _arrayLikeToArray(arr, len) {52 if (len == null || len > arr.length) len = arr.length;53 for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];54 return arr2;55}56function _nonIterableRest() {57 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");58}//59//60//61//62//63//64//65//66//67//68//69//70//71//72//73//74//75//76//77//78//79//80//81//82//83//84//85var script = {86 name: "VisitBoxProgress",87 data: function data() {88 return {};89 },90 props: {91 name: {92 required: true93 },94 completedValue: {95 required: false96 },97 totalValue: {98 required: false99 },100 fontSize: {101 type: String102 },103 progress: {104 required: false105 },106 boxColor: {107 default: false108 },109 progressBarColor: {110 default: '#ffffff',111 required: false112 },113 tooltipText: {114 type: String,115 default: ''116 },117 SmallBox: {118 type: Boolean,119 default: false120 },121 FontSizeValue: {122 type: String123 },124 DummyFontSize: {125 type: Boolean,126 default: false127 },128 active: {129 type: Boolean,130 default: false131 }132 },133 computed: {134 defaultBoxColor: function defaultBoxColor() {135 if (!this.boxColor) {136 var _ref;137 return _ref = {138 backgroundColor: 'rgb(238,91,77)',139 backgroundImage: '-moz-linear-gradient( 108deg, rgb(247,157,154) 0%, rgb(243,124,116) 62%, rgb(238,91,77) 100%)'140 }, _defineProperty(_ref, "backgroundImage", // eslint-disable-line141 '-webkit-linear-gradient( 108deg, rgb(247,157,154) 0%, rgb(243,124,116) 62%, rgb(238,91,77) 100%)'), _defineProperty(_ref, "backgroundImage", // eslint-disable-line142 '-ms-linear-gradient( 108deg, rgb(247,157,154) 0%, rgb(243,124,116) 62%, rgb(238,91,77) 100%)'), _defineProperty(_ref, "backgroundImage", // eslint-disable-line143 'linear-gradient( 108deg, rgb(247,157,154) 0%, rgb(243,124,116) 62%, rgb(238,91,77) 100%)'), _ref;144 } else {145 return this.boxColor;146 }147 }148 },149 mounted: function mounted() {150 var vm = this;151 this.$root.$on('bv::tooltip::show', function (bvEvent) {152 vm.$nextTick(function () {153 jQuery('.b-tooltip-' + vm._uid + ' > .tooltip-inner').css('background-color', vm.defaultBoxColor.backgroundColor);154 jQuery('.b-tooltip-' + vm._uid + ' > .arrow').css('border-top-color', vm.defaultBoxColor.backgroundColor);155 jQuery('.b-tooltip-' + vm._uid + ' > .arrow').css('border-bottom-color', vm.defaultBoxColor.backgroundColor);156 });157 });158 }159};function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {160 if (typeof shadowMode !== 'boolean') {161 createInjectorSSR = createInjector;162 createInjector = shadowMode;163 shadowMode = false;164 }165 // Vue.extend constructor export interop.166 const options = typeof script === 'function' ? script.options : script;167 // render functions168 if (template && template.render) {169 options.render = template.render;170 options.staticRenderFns = template.staticRenderFns;171 options._compiled = true;172 // functional template173 if (isFunctionalTemplate) {174 options.functional = true;175 }176 }177 // scopedId178 if (scopeId) {179 options._scopeId = scopeId;180 }181 let hook;182 if (moduleIdentifier) {183 // server build184 hook = function (context) {185 // 2.3 injection186 context =187 context || // cached call188 (this.$vnode && this.$vnode.ssrContext) || // stateful189 (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional190 // 2.2 with runInNewContext: true191 if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {192 context = __VUE_SSR_CONTEXT__;193 }194 // inject component styles195 if (style) {196 style.call(this, createInjectorSSR(context));197 }198 // register component module identifier for async chunk inference199 if (context && context._registeredComponents) {200 context._registeredComponents.add(moduleIdentifier);201 }202 };203 // used by ssr in case component is cached and beforeCreate204 // never gets called205 options._ssrRegister = hook;206 }207 else if (style) {208 hook = shadowMode209 ? function (context) {210 style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot));211 }212 : function (context) {213 style.call(this, createInjector(context));214 };215 }216 if (hook) {217 if (options.functional) {218 // register for functional component in vue file219 const originalRender = options.render;220 options.render = function renderWithStyleInjection(h, context) {221 hook.call(context);222 return originalRender(h, context);223 };224 }225 else {226 // inject component registration as beforeCreate hook227 const existing = options.beforeCreate;228 options.beforeCreate = existing ? [].concat(existing, hook) : [hook];229 }230 }231 return script;232}function createInjectorSSR(context) {233 if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {234 context = __VUE_SSR_CONTEXT__;235 }236 if (!context)237 return () => { };238 if (!('styles' in context)) {239 context._styles = context._styles || {};240 Object.defineProperty(context, 'styles', {241 enumerable: true,242 get: () => context._renderStyles(context._styles)243 });244 context._renderStyles = context._renderStyles || renderStyles;245 }246 return (id, style) => addStyle(id, style, context);247}248function addStyle(id, css, context) {249 const group = css.media || 'default' ;250 const style = context._styles[group] || (context._styles[group] = { ids: [], css: '' });251 if (!style.ids.includes(id)) {252 style.media = css.media;253 style.ids.push(id);254 let code = css.source;255 style.css += code + '\n';256 }257}258function renderStyles(styles) {259 let css = '';260 for (const key in styles) {261 const style = styles[key];262 css +=263 '<style data-vue-ssr-id="' +264 Array.from(style.ids).join(' ') +265 '"' +266 (style.media ? ' media="' + style.media + '"' : '') +267 '>' +268 style.css +269 '</style>';270 }271 return css;272}/* script */273var __vue_script__ = script;274/* template */275var __vue_render__ = function __vue_render__() {276 var _vm = this;277 var _h = _vm.$createElement;278 var _c = _vm._self._c || _h;279 return _c('div', {280 staticClass: "visitStatusWrapper",281 class: {282 'small-box': _vm.SmallBox283 }284 }, [_vm._ssrNode("<div" + _vm._ssrClass("VisitBoxContent", {285 'active': _vm.active286 }) + _vm._ssrStyle(null, _vm.defaultBoxColor, null) + ">", "</div>", [_vm._ssrNode("<div class=\"text-center\"><div class=\"VisitTitle\"" + _vm._ssrStyle(null, {287 paddingTop: _vm.progress != null ? '20px' : '30px'288 }, null) + "><span>" + _vm._s(_vm.name) + "</span></div> <div class=\"VisitNumber\"" + _vm._ssrStyle(null, {289 top: _vm.progress != null ? '-7px' : '6px'290 }, null) + "><h1" + _vm._ssrClass("Number", {291 'text-3d': !_vm.SmallBox,292 'DummyFontSize': _vm.DummyFontSize293 }) + _vm._ssrStyle(null, {294 'font-size': _vm.fontSize ? _vm.fontSize : null,295 fontSize: _vm.FontSizeValue296 }, null) + ">" + _vm._ssrEscape("\n " + _vm._s(_vm.completedValue) + "\n ") + (_vm.totalValue ? "<span>" + _vm._ssrEscape("/ " + _vm._s(_vm.totalValue)) + "</span>" : "<!---->") + "</h1></div></div> <div style=\"clear: both\"></div> "), _vm._t("default"), _vm._ssrNode(" "), _vm.progress != null ? _vm._ssrNode("<div class=\"VisitProgress col-sm-12\">", "</div>", [_vm._ssrNode("<div class=\"left\">", "</div>", [_c('b-progress', {297 attrs: {298 "max": 100,299 "height": "1.5rem"300 }301 }, [_c('b-progress-bar', {302 style: {303 backgroundColor: _vm.progressBarColor304 },305 attrs: {306 "value": _vm._f("nullToZero")(_vm.progress)307 }308 })], 1)], 1), _vm._ssrNode(" <div class=\"right\">" + _vm._ssrEscape(_vm._s(_vm.progress) + "%") + "</div>")], 2) : _vm._e()], 2)]);309};310var __vue_staticRenderFns__ = [];311/* style */312var __vue_inject_styles__ = function __vue_inject_styles__(inject) {313 if (!inject) return;314 inject("data-v-ef19cb9c_0", {315 source: ".visitStatusWrapper{position:relative}.visitStatusWrapper .VisitBoxContent{position:relative;border-radius:3px;min-height:150px;box-shadow:0 0 14px 0 rgba(0,0,0,.25);color:#fff;padding:0 10px 25px 10px;font-family:Avenir-Black}.visitStatusWrapper .VisitBoxContent .VisitTitle{justify-content:flex-start}.visitStatusWrapper .VisitBoxContent .VisitNumber{text-align:center}.visitStatusWrapper .VisitBoxContent .VisitTitle{padding:20px 0 0 0;min-height:50px;font-size:13px;opacity:.7}.visitStatusWrapper .VisitBoxContent .VisitTitle span{font-family:inherit}.visitStatusWrapper .VisitBoxContent .VisitNumber{position:relative;top:-7px;margin-bottom:15px}.visitStatusWrapper .VisitBoxContent .VisitNumber .Number{font-family:Avenir-Black;color:#fff;font-size:50px}.visitStatusWrapper .VisitBoxContent .VisitNumber .Number span{font-size:26px;color:#fff;opacity:.7;font-family:Avenir-Black}.visitStatusWrapper .VisitBoxContent .VisitNumber .Number.DummyFontSize{margin-bottom:25px;font-size:25px!important}.visitStatusWrapper .VisitBoxContent .text-3d{text-shadow:0 1px 0 #c9cfce,0 2px 0 #bcc2c2,0 3px 0 #afb6b6,0 4px 0 #a4adac,0 5px 0 #9fa8a7,0 6px 0 #99a3a2,0 7px 0 #97a1a0,0 8px 0 #949e9d,0 0 5px rgba(0,0,0,.05),0 1px 3px rgba(0,0,0,.2),0 3px 5px rgba(0,0,0,.2),0 5px 10px rgba(0,0,0,.2),0 10px 10px rgba(0,0,0,.2),0 20px 20px rgba(0,0,0,.3)}.visitStatusWrapper .VisitBoxContent .VisitProgress{width:100%}.visitStatusWrapper .VisitBoxContent .VisitProgress .progress{height:6px!important;border-radius:5px;background:rgba(0,0,0,.2);overflow:visible}.visitStatusWrapper .VisitBoxContent .VisitProgress .progress .progress-bar{box-shadow:0 4px 4px 0 rgba(0,0,0,.25);margin-top:-1px;height:7px;border-radius:5px}.visitStatusWrapper .VisitBoxContent .VisitProgress .left{float:left;width:calc(100% - 55px)}.visitStatusWrapper .VisitBoxContent .VisitProgress .right{font-size:12px;font-family:Avenir-Black;float:right;width:55px;text-align:right;position:relative;top:-5px}.visitStatusWrapper .VisitBoxContent.BluePass{background:0 0!important;box-shadow:inset 0 0 10px 0 #9c9ef1;border:2px solid rgba(255,255,255,.19);border-radius:3px}.visitStatusWrapper .VisitBoxContent.BluePass .TwoNumber{color:#508eba!important}.visitStatusWrapper .tooltip-inner span strong{font-family:'Avenir-Black !important;'}.visitStatusWrapper .tooltip-text{position:absolute;right:5px;top:0;z-index:1;display:block;padding:10px}.visitStatusWrapper .tooltip-text i{color:rgba(255,255,255,.6);font-size:18px}.visitStatusWrapper .tooltip-text i:hover{color:#fff}.visitStatusWrapper.small-box .VisitBoxContent{min-height:110px!important;padding-bottom:0!important}.visitStatusWrapper.small-box .VisitBoxContent .VisitTitle{padding-top:10px!important}.visitStatusWrapper.small-box .VisitBoxContent .VisitNumber{margin-bottom:10px}.visitStatusWrapper.small-box .VisitBoxContent .VisitNumber .Number{font-size:36px;margin-bottom:0!important;line-height:.8em}.visitStatusWrapper.small-box .VisitBoxContent .VisitNumber .Number span{font-size:20px}.active{border:2px solid #fff!important}",316 map: undefined,317 media: undefined318 }), inject("data-v-ef19cb9c_1", {319 source: ".tooltip arrow:before{border-top-color:inherit;border-bottom-color:inherit}",320 map: undefined,321 media: undefined322 });323};324/* scoped */325var __vue_scope_id__ = undefined;326/* module identifier */327var __vue_module_identifier__ = "data-v-ef19cb9c";328/* functional template */329var __vue_is_functional_template__ = false;330/* style inject shadow dom */331var __vue_component__ = /*#__PURE__*/normalizeComponent({332 render: __vue_render__,333 staticRenderFns: __vue_staticRenderFns__334}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, createInjectorSSR, undefined);// Import vue component335// IIFE injects install function into component, allowing component336// to be registered via Vue.use() as well as Vue.component(),337var component = /*#__PURE__*/(function () {338 // Get component instance339 var installable = __vue_component__; // Attach install function executed by Vue.use()340 installable.install = function (Vue) {341 Vue.component('RemVisitStatusTest', installable);342 };343 return installable;344})(); // It's possible to expose named exports when writing components that can345// also be used as directives, etc. - eg. import { RollupDemoDirective } from 'rollup-demo';346// export const RollupDemoDirective = directive;347var namedExports=/*#__PURE__*/Object.freeze({__proto__:null,'default': component});// only expose one global var, with named exports exposed as properties of348// that global var (eg. plugin.namedExport)349Object.entries(namedExports).forEach(function (_ref) {350 var _ref2 = _slicedToArray(_ref, 2),351 exportName = _ref2[0],352 exported = _ref2[1];353 if (exportName !== 'default') component[exportName] = exported;...

Full Screen

Full Screen

his_hospitalos.model.js

Source:his_hospitalos.model.js Github

copy

Full Screen

1"use strict";2Object.defineProperty(exports, "__esModule", { value: true });3exports.HisHospitalOsModel = void 0;4const dbName = process.env.HIS_DB_NAME;5const maxLimit = 100;6class HisHospitalOsModel {7 getTableName(knex) {8 return knex9 .select('table_name')10 .from('information_schema.tables')11 .where('table_catalog', '=', dbName);12 }13 testConnect(db) {14 return db('t_patient').select('patient_hn').limit(1);15 }16 getPerson(knex, columnName, searchText) {17 columnName = columnName == 'hn' ? 'patient.patient_hn' : columnName;18 columnName = columnName == 'cid' ? 'patient.patient_pid' : columnName;19 return knex20 .select('patient.patient_hn as hn', 'patient.patient_pid as cid', 'f_patient_prefix.patient_prefix_description as prename', 'patient.patient_firstname as fname', 'patient.patient_lastname as lname', 'patient.f_sex_id as sex', 'patient.patient_moo as moo', 'patient.patient_road as road', 'patient.patient_house as address', 'patient.patient_phone_number as tel', 'patient.patient_tambon as addcode')21 .select(knex.raw(`'' as zip, concat(to_number(substr(patient.patient_birthday,1,4),'9999')-543 ,'-',substr(patient.patient_birthday,6)) as dob, CASE WHEN f_patient_occupation.r_rp1853_occupation_id IN ('001') THEN '07' 22 WHEN f_patient_occupation.r_rp1853_occupation_id IN ('002') THEN '14'23 WHEN f_patient_occupation.r_rp1853_occupation_id IN ('003') THEN '06' 24 WHEN f_patient_occupation.r_rp1853_occupation_id IN ('004') THEN '01' 25 WHEN f_patient_occupation.r_rp1853_occupation_id IN ('005') THEN '03' 26 WHEN f_patient_occupation.r_rp1853_occupation_id IN ('006') THEN '99' 27 WHEN f_patient_occupation.r_rp1853_occupation_id IN ('007') THEN '02' 28 WHEN f_patient_occupation.r_rp1853_occupation_id IN ('008') THEN '12' 29 WHEN f_patient_occupation.r_rp1853_occupation_id IN ('009') THEN '99' 30 WHEN f_patient_occupation.r_rp1853_occupation_id IN ('010') THEN '99' 31 WHEN f_patient_occupation.r_rp1853_occupation_id IN ('012') THEN '07' 32 WHEN f_patient_occupation.r_rp1853_occupation_id IN ('013') THEN '09' 33 WHEN f_patient_occupation.r_rp1853_occupation_id IN ('014') THEN '19' 34 WHEN f_patient_occupation.r_rp1853_occupation_id IN ('015') THEN '08' 35 WHEN f_patient_occupation.r_rp1853_occupation_id IN ('900','901') THEN '99' ELSE 'N' END AS occupation`))36 .from('t_patient as patient')37 .leftJoin('f_patient_prefix', 'f_patient_prefix.f_patient_prefix_id', 'patient.f_patient_prefix_id')38 .leftJoin('f_patient_occupation', 'patient.f_patient_occupation_id', 'f_patient_occupation.f_patient_occupation_id')39 .orderBy('patient.patient_tambon')40 .where(columnName, "=", searchText);41 }42 getOpdService(knex, hn, date, columnName = '', searchText = '') {43 columnName = columnName == 'visitNo' || columnName == 'vn' ? 't_visit.visit_vn' : columnName;44 let where = {};45 if (hn)46 where['t_visit.visit_hn'] = hn;47 if (columnName && searchText)48 where[columnName] = searchText;49 return knex50 .select('t_visit.visit_hn as hn', 't_visit.visit_vn as visitno ', 't_accident.accident_time as time')51 .select(knex.raw(` concat(to_number(substr(t_accident.accident_date,1,4),'9999')-543 ,'-',substr(t_accident.accident_date,6),' ',t_accident.accident_time,':00') as adate ,52 53 cast(substring(t_visit_vital_sign.visit_vital_sign_blood_presure,1,(position('/' in t_visit_vital_sign.visit_vital_sign_blood_presure)-1)) as numeric) as bp_systolic , 54 cast(substring(t_visit_vital_sign.visit_vital_sign_blood_presure,(position('/' in t_visit_vital_sign.visit_vital_sign_blood_presure)+1)) as numeric) as bp_diastolic ,55 t_visit_vital_sign.visit_vital_sign_heart_rate as pr , 56 t_visit_vital_sign.visit_vital_sign_respiratory_rate as rr , 57 concat(to_number(substr(t_accident.accident_to_hos_date,1,4),'9999')-54358 ,'-',substr(t_accident.accident_to_hos_date,6)) as hdate , 59 t_accident.accident_to_hos_time as htime ,60 t_accident.accident_moo as mooban,61 t_accident.accident_road_name as apointname,62 substr(t_accident.f_address_id_accident_tambon,5,2) as atumbon,63 substr(t_accident.f_address_id_accident_amphur,3,2) as aampur,64 substr(t_accident.f_address_id_accident_changwat,1,2) as aplace,65 CASE t_accident.accident_emergency_type WHEN '0' THEN '6'66 WHEN '1' THEN '5'67 WHEN '2' THEN '3'68 WHEN '3' THEN '2'69 WHEN '4' THEN '1'70 WHEN '5' THEN '4'71 ELSE 'N' END as cause_t,72 t_accident.f_accident_symptom_eye_id as eye , 73 t_accident.f_accident_symptom_speak_id as verbal ,74 t_accident.f_accident_symptom_movement_id as motor , 75 CASE WHEN t_accident.accident_accident_type IN ('V') THEN '1' WHEN t_accident.accident_accident_type IN ('00') THEN 'N' ELSE '2' END as cause ,76 CASE WHEN t_accident.f_accident_place_id IN ('1') THEN '1'77 WHEN t_accident.f_accident_place_id IN ('2','3') THEN '7'78 WHEN t_accident.f_accident_place_id IN ('4') THEN '6'79 WHEN t_accident.f_accident_place_id IN ('5') THEN '4'80 WHEN t_accident.f_accident_place_id IN ('6') THEN '8'81 WHEN t_accident.f_accident_place_id IN ('7','8') THEN '5'82 WHEN t_accident.f_accident_place_id IN ('9','10','11','98') THEN '9' 83 ELSE 'N' END as apoint , 84 CASE WHEN t_accident.f_accident_patient_vechicle_type_id IN ('0') THEN 'N' 85 WHEN t_accident.f_accident_patient_vechicle_type_id IN ('2') THEN '01' 86 WHEN t_accident.f_accident_patient_vechicle_type_id IN ('3') THEN '02' 87 WHEN t_accident.f_accident_patient_vechicle_type_id IN ('4') THEN '04' 88 WHEN t_accident.f_accident_patient_vechicle_type_id IN ('5') THEN '05' 89 WHEN t_accident.f_accident_patient_vechicle_type_id IN ('6') THEN '06' 90 WHEN t_accident.f_accident_patient_vechicle_type_id IN ('7','9') THEN '08' 91 WHEN t_accident.f_accident_patient_vechicle_type_id IN ('8') THEN '09' 92 WHEN t_accident.f_accident_patient_vechicle_type_id IN ('10') THEN '03' 93 WHEN t_accident.f_accident_patient_vechicle_type_id IN ('11') THEN '17' 94 WHEN t_accident.f_accident_patient_vechicle_type_id IN ('12') THEN '16' 95 WHEN t_accident.f_accident_patient_vechicle_type_id IN ('13') THEN '11' 96 WHEN t_accident.f_accident_patient_vechicle_type_id IN ('14') THEN '18' 97 WHEN t_accident.f_accident_patient_vechicle_type_id IN ('15','16') THEN '14' 98 WHEN t_accident.f_accident_patient_vechicle_type_id IN ('17') THEN '13' 99 ELSE '99' END as injt ,100 CASE WHEN t_visit.f_visit_service_type_id IN ('3') THEN '3' 101 WHEN t_visit.f_visit_service_type_id IN ('1','2','4') THEN '2' ELSE '' END AS pmi,102 CASE WHEN substr(t_accident.f_accident_visit_type_id,1,1) IN ('1') THEN '0' 103 WHEN substr(t_accident.f_accident_visit_type_id,1,1) IN ('2','3','4','5') THEN '3'104 WHEN substr(t_accident.f_accident_visit_type_id,1,1) IN ('9') THEN 'N' ELSE '9' END AS atohosp,105 CASE WHEN t_accident.accident_airway = '1' THEN '1' 106 WHEN t_accident.accident_airway = '2' THEN '0'107 WHEN t_accident.accident_airway = '3' THEN '3'108 ELSE '0' END as airway ,109 CASE WHEN t_accident.accident_alcohol IN ('1') THEN '1' ELSE '0' END as risk1 ,110 '0' as risk2 ,111 CASE WHEN t_accident.f_accident_protection_type_id IN ('1') THEN '0' 112 WHEN t_accident.f_accident_protection_type_id IN ('2') THEN '1' ELSE 'N' END as risk3 ,113 CASE WHEN t_accident.f_accident_protection_type_id IN ('1') THEN '0' 114 WHEN t_accident.f_accident_protection_type_id IN ('2') THEN '1' ELSE 'N' END as risk4 ,115 CASE WHEN t_accident.accident_stopbleed = '1' THEN '1'116 WHEN t_accident.accident_stopbleed = '2' THEN '0'117 WHEN t_accident.accident_stopbleed = '3' THEN '3' 118 ELSE '0' END as blood ,119 CASE WHEN substr(t_accident.accident_splint,1,1) IN ('1') THEN '1'120 WHEN substr(t_accident.accident_splint,1,1) IN ('2') THEN '0'121 WHEN substr(t_accident.accident_splint,1,1) IN ('3') THEN '3'122 ELSE '0' END as splintc ,123 CASE WHEN t_accident.accident_splint = '1' THEN '1' 124 WHEN t_accident.accident_splint = '2' THEN '0'125 WHEN t_accident.accident_splint = '3' THEN '3'126 ELSE '0' END AS splint,127 CASE WHEN t_accident.accident_fluid = '1' THEN '1'128 WHEN t_accident.accident_fluid = '2' THEN '0'129 WHEN t_accident.accident_fluid = '3' THEN '3'130 ELSE '3' END as iv,131 to_timestamp(CASE WHEN t_visit.f_visit_type_id = '1' then t_accident.accident_staff_record_date_time else t_visit.visit_financial_discharge_time end ,'YYYY-mm-dd HH24:MI:SS') - INTERVAL '543 years' as disc_date_er,132 CASE WHEN t_visit.f_visit_opd_discharge_status_id IN ('51') THEN '2' 133 WHEN t_visit.f_visit_opd_discharge_status_id IN ('52') THEN '6' 134 WHEN t_visit.f_visit_opd_discharge_status_id IN ('54') THEN '3' 135 WHEN t_visit.f_visit_opd_discharge_status_id IN ('55') THEN '1' 136 WHEN LENGTH(t_visit.f_visit_ipd_discharge_status_id)>0 THEN '7' 137 ELSE '' END AS staer ,138 CASE WHEN t_visit.f_visit_ipd_discharge_type_id in ('1') THEN '1'139 WHEN t_visit.f_visit_ipd_discharge_type_id in ('4') THEN '2'140 WHEN t_visit.f_visit_ipd_discharge_type_id in ('2') THEN '3'141 WHEN t_visit.f_visit_ipd_discharge_type_id in ('3') THEN '4'142 WHEN t_visit.f_visit_ipd_discharge_type_id in ('8','9') THEN '5'143 WHEN t_visit.f_visit_ipd_discharge_type_id in ('5','6') THEN '6' ELSE '' END AS staward144 `))145 .from('t_visit')146 .leftJoin(`t_accident`, 't_accident.t_visit_id', 't_visit.t_visit_id')147 .leftJoin(`t_visit_vital_sign`, 't_visit_vital_sign.t_visit_id', 't_visit.t_visit_id')148 .leftJoin('t_visit_service', 't_visit_service.t_visit_id', 't_visit.t_visit_id')149 .where(where)150 .whereRaw(`concat(to_number(substr(t_accident.accident_to_hos_date,1,4),'9999')-543151 ,'-',substr(t_accident.accident_to_hos_date,6)) = ?`, [date])152 .limit(maxLimit);153 }154 getDiagnosisOpd(knex, visitno) {155 return knex156 .select('t_visit.visit_vn as visitno', 't_accident.icd10_number as diagcode')157 .from('t_accident')158 .innerJoin('t_visit', 't_accident.t_visit_id', 't_visit.t_visit_id')159 .where('t_visit.visit_vn', "=", visitno);160 }161 getProcedureOpd(knex, columnName, searchNo, hospCode) {162 return knex163 .select('*')164 .from('procedure_opd')165 .where(columnName, "=", searchNo);166 }167 getChargeOpd(knex, columnName, searchNo, hospCode) {168 return knex169 .select('*')170 .from('charge_opd')171 .where(columnName, "=", searchNo);172 }173 getDrugOpd(knex, columnName, searchNo, hospCode) {174 return knex175 .select('*')176 .from('drug_opd')177 .where(columnName, "=", searchNo);178 }179 getAdmission(knex, columnName, searchNo, hospCode) {180 return knex181 .select('*')182 .from('admission')183 .where(columnName, "=", searchNo);184 }185 getDiagnosisIpd(knex, columnName, searchNo, hospCode) {186 return knex187 .select('*')188 .from('diagnosis_ipd')189 .where(columnName, "=", searchNo);190 }191 getProcedureIpd(knex, columnName, searchNo, hospCode) {192 return knex193 .select('*')194 .from('procedure_ipd')195 .where(columnName, "=", searchNo);196 }197 getChargeIpd(knex, columnName, searchNo, hospCode) {198 return knex199 .select('*')200 .from('charge_ipd')201 .where(columnName, "=", searchNo);202 }203 getDrugIpd(knex, columnName, searchNo, hospCode) {204 return knex205 .select('*')206 .from('drug_ipd')207 .where(columnName, "=", searchNo);208 }209 getAccident(knex, visitno) {210 return knex211 .select('er_regist.vn', 'ovst.hn', 'ovst.vstdate as adate', 'ovst.vsttime as atime', 'er_nursing_detail.accident_person_type_id', 'er_nursing_detail.accident_belt_type_id as belt', 'opdscreen.bps as bp1', 'opdscreen.bpd as bp2', 'er_nursing_detail.gcs_e as e', 'er_nursing_detail.gcs_v as v', 'er_nursing_detail.gcs_m as m')212 .from('er_regist')213 .leftJoin(`ovst`, function () { this.on('ovst.vn', '=', 'er_regist.vn'); })214 .leftJoin(`patient`, function () { this.on('patient.hn', '=', 'ovst.hn'); })215 .leftJoin(`er_nursing_detail`, function () { this.on('er_nursing_detail.vn', '=', 'ovst.vn'); })216 .leftJoin(`opdscreen`, function () { this.on('opdscreen.hn', '=', 'ovst.hn'); })217 .where('er_regist.vn', "=", visitno);218 }219 getAppointment(knex, columnName, searchNo, hospCode) {220 return knex221 .select('*')222 .from('appointment')223 .where(columnName, "=", searchNo);224 }225 getData(knex, tableName, columnName, searchNo, hospCode) {226 return knex227 .select('*')228 .from(tableName)229 .where(columnName, "=", searchNo)230 .limit(5000);231 }232}...

Full Screen

Full Screen

rem-visit-status-test.esm.js

Source:rem-visit-status-test.esm.js Github

copy

Full Screen

1//2//3//4//5//6//7//8//9//10//11//12//13//14//15//16//17//18//19//20//21//22//23//24//25//26//27//28var script = {29 name: "VisitBoxProgress",30 data() {31 return {};32 },33 props: {34 name: {35 required: true36 },37 completedValue: {38 required: false39 },40 totalValue: {41 required: false42 },43 fontSize: {44 type: String45 },46 progress: {47 required: false48 },49 boxColor: {50 default: false51 },52 progressBarColor: {53 default: '#ffffff',54 required: false55 },56 tooltipText: {57 type: String,58 default: ''59 },60 SmallBox: {61 type: Boolean,62 default: false63 },64 FontSizeValue: {65 type: String66 },67 DummyFontSize: {68 type: Boolean,69 default: false70 },71 active: {72 type: Boolean,73 default: false74 }75 },76 computed: {77 defaultBoxColor() {78 if (!this.boxColor) {79 return {80 backgroundColor: 'rgb(238,91,77)',81 backgroundImage: '-moz-linear-gradient( 108deg, rgb(247,157,154) 0%, rgb(243,124,116) 62%, rgb(238,91,77) 100%)',82 backgroundImage: // eslint-disable-line83 '-webkit-linear-gradient( 108deg, rgb(247,157,154) 0%, rgb(243,124,116) 62%, rgb(238,91,77) 100%)',84 backgroundImage: // eslint-disable-line85 '-ms-linear-gradient( 108deg, rgb(247,157,154) 0%, rgb(243,124,116) 62%, rgb(238,91,77) 100%)',86 backgroundImage: // eslint-disable-line87 'linear-gradient( 108deg, rgb(247,157,154) 0%, rgb(243,124,116) 62%, rgb(238,91,77) 100%)'88 };89 } else {90 return this.boxColor;91 }92 }93 },94 mounted() {95 let vm = this;96 this.$root.$on('bv::tooltip::show', bvEvent => {97 vm.$nextTick(function () {98 jQuery('.b-tooltip-' + vm._uid + ' > .tooltip-inner').css('background-color', vm.defaultBoxColor.backgroundColor);99 jQuery('.b-tooltip-' + vm._uid + ' > .arrow').css('border-top-color', vm.defaultBoxColor.backgroundColor);100 jQuery('.b-tooltip-' + vm._uid + ' > .arrow').css('border-bottom-color', vm.defaultBoxColor.backgroundColor);101 });102 });103 }104};105function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {106 if (typeof shadowMode !== 'boolean') {107 createInjectorSSR = createInjector;108 createInjector = shadowMode;109 shadowMode = false;110 }111 // Vue.extend constructor export interop.112 const options = typeof script === 'function' ? script.options : script;113 // render functions114 if (template && template.render) {115 options.render = template.render;116 options.staticRenderFns = template.staticRenderFns;117 options._compiled = true;118 // functional template119 if (isFunctionalTemplate) {120 options.functional = true;121 }122 }123 // scopedId124 if (scopeId) {125 options._scopeId = scopeId;126 }127 let hook;128 if (moduleIdentifier) {129 // server build130 hook = function (context) {131 // 2.3 injection132 context =133 context || // cached call134 (this.$vnode && this.$vnode.ssrContext) || // stateful135 (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional136 // 2.2 with runInNewContext: true137 if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {138 context = __VUE_SSR_CONTEXT__;139 }140 // inject component styles141 if (style) {142 style.call(this, createInjectorSSR(context));143 }144 // register component module identifier for async chunk inference145 if (context && context._registeredComponents) {146 context._registeredComponents.add(moduleIdentifier);147 }148 };149 // used by ssr in case component is cached and beforeCreate150 // never gets called151 options._ssrRegister = hook;152 }153 else if (style) {154 hook = shadowMode155 ? function (context) {156 style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot));157 }158 : function (context) {159 style.call(this, createInjector(context));160 };161 }162 if (hook) {163 if (options.functional) {164 // register for functional component in vue file165 const originalRender = options.render;166 options.render = function renderWithStyleInjection(h, context) {167 hook.call(context);168 return originalRender(h, context);169 };170 }171 else {172 // inject component registration as beforeCreate hook173 const existing = options.beforeCreate;174 options.beforeCreate = existing ? [].concat(existing, hook) : [hook];175 }176 }177 return script;178}179const isOldIE = typeof navigator !== 'undefined' &&180 /msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());181function createInjector(context) {182 return (id, style) => addStyle(id, style);183}184let HEAD;185const styles = {};186function addStyle(id, css) {187 const group = isOldIE ? css.media || 'default' : id;188 const style = styles[group] || (styles[group] = { ids: new Set(), styles: [] });189 if (!style.ids.has(id)) {190 style.ids.add(id);191 let code = css.source;192 if (css.map) {193 // https://developer.chrome.com/devtools/docs/javascript-debugging194 // this makes source maps inside style tags work properly in Chrome195 code += '\n/*# sourceURL=' + css.map.sources[0] + ' */';196 // http://stackoverflow.com/a/26603875197 code +=198 '\n/*# sourceMappingURL=data:application/json;base64,' +199 btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) +200 ' */';201 }202 if (!style.element) {203 style.element = document.createElement('style');204 style.element.type = 'text/css';205 if (css.media)206 style.element.setAttribute('media', css.media);207 if (HEAD === undefined) {208 HEAD = document.head || document.getElementsByTagName('head')[0];209 }210 HEAD.appendChild(style.element);211 }212 if ('styleSheet' in style.element) {213 style.styles.push(code);214 style.element.styleSheet.cssText = style.styles215 .filter(Boolean)216 .join('\n');217 }218 else {219 const index = style.ids.size - 1;220 const textNode = document.createTextNode(code);221 const nodes = style.element.childNodes;222 if (nodes[index])223 style.element.removeChild(nodes[index]);224 if (nodes.length)225 style.element.insertBefore(textNode, nodes[index]);226 else227 style.element.appendChild(textNode);228 }229 }230}231/* script */232const __vue_script__ = script;233/* template */234var __vue_render__ = function () {235 var _vm = this;236 var _h = _vm.$createElement;237 var _c = _vm._self._c || _h;238 return _c('div', {239 staticClass: "visitStatusWrapper",240 class: {241 'small-box': _vm.SmallBox242 }243 }, [_c('div', {244 staticClass: "VisitBoxContent",245 class: {246 'active': _vm.active247 },248 style: _vm.defaultBoxColor249 }, [_c('div', {250 staticClass: "text-center"251 }, [_c('div', {252 staticClass: "VisitTitle",253 style: {254 paddingTop: _vm.progress != null ? '20px' : '30px'255 }256 }, [_c('span', {257 domProps: {258 "innerHTML": _vm._s(_vm.name)259 }260 })]), _vm._v(" "), _c('div', {261 staticClass: "VisitNumber",262 style: {263 top: _vm.progress != null ? '-7px' : '6px'264 }265 }, [_c('h1', {266 staticClass: "Number",267 class: {268 'text-3d': !_vm.SmallBox,269 'DummyFontSize': _vm.DummyFontSize270 },271 style: {272 'font-size': _vm.fontSize ? _vm.fontSize : null,273 fontSize: _vm.FontSizeValue274 }275 }, [_vm._v("\n " + _vm._s(_vm.completedValue) + "\n "), _vm.totalValue ? _c('span', [_vm._v("/ " + _vm._s(_vm.totalValue))]) : _vm._e()])])]), _vm._v(" "), _c('div', {276 staticStyle: {277 "clear": "both"278 }279 }), _vm._v(" "), _vm._t("default"), _vm._v(" "), _vm.progress != null ? _c('div', {280 staticClass: "VisitProgress col-sm-12"281 }, [_c('div', {282 staticClass: "left"283 }, [_c('b-progress', {284 attrs: {285 "max": 100,286 "height": "1.5rem"287 }288 }, [_c('b-progress-bar', {289 style: {290 backgroundColor: _vm.progressBarColor291 },292 attrs: {293 "value": _vm._f("nullToZero")(_vm.progress)294 }295 })], 1)], 1), _vm._v(" "), _c('div', {296 staticClass: "right"297 }, [_vm._v(_vm._s(_vm.progress) + "%")])]) : _vm._e()], 2)]);298};299var __vue_staticRenderFns__ = [];300/* style */301const __vue_inject_styles__ = function (inject) {302 if (!inject) return;303 inject("data-v-ef19cb9c_0", {304 source: ".visitStatusWrapper{position:relative}.visitStatusWrapper .VisitBoxContent{position:relative;border-radius:3px;min-height:150px;box-shadow:0 0 14px 0 rgba(0,0,0,.25);color:#fff;padding:0 10px 25px 10px;font-family:Avenir-Black}.visitStatusWrapper .VisitBoxContent .VisitTitle{justify-content:flex-start}.visitStatusWrapper .VisitBoxContent .VisitNumber{text-align:center}.visitStatusWrapper .VisitBoxContent .VisitTitle{padding:20px 0 0 0;min-height:50px;font-size:13px;opacity:.7}.visitStatusWrapper .VisitBoxContent .VisitTitle span{font-family:inherit}.visitStatusWrapper .VisitBoxContent .VisitNumber{position:relative;top:-7px;margin-bottom:15px}.visitStatusWrapper .VisitBoxContent .VisitNumber .Number{font-family:Avenir-Black;color:#fff;font-size:50px}.visitStatusWrapper .VisitBoxContent .VisitNumber .Number span{font-size:26px;color:#fff;opacity:.7;font-family:Avenir-Black}.visitStatusWrapper .VisitBoxContent .VisitNumber .Number.DummyFontSize{margin-bottom:25px;font-size:25px!important}.visitStatusWrapper .VisitBoxContent .text-3d{text-shadow:0 1px 0 #c9cfce,0 2px 0 #bcc2c2,0 3px 0 #afb6b6,0 4px 0 #a4adac,0 5px 0 #9fa8a7,0 6px 0 #99a3a2,0 7px 0 #97a1a0,0 8px 0 #949e9d,0 0 5px rgba(0,0,0,.05),0 1px 3px rgba(0,0,0,.2),0 3px 5px rgba(0,0,0,.2),0 5px 10px rgba(0,0,0,.2),0 10px 10px rgba(0,0,0,.2),0 20px 20px rgba(0,0,0,.3)}.visitStatusWrapper .VisitBoxContent .VisitProgress{width:100%}.visitStatusWrapper .VisitBoxContent .VisitProgress .progress{height:6px!important;border-radius:5px;background:rgba(0,0,0,.2);overflow:visible}.visitStatusWrapper .VisitBoxContent .VisitProgress .progress .progress-bar{box-shadow:0 4px 4px 0 rgba(0,0,0,.25);margin-top:-1px;height:7px;border-radius:5px}.visitStatusWrapper .VisitBoxContent .VisitProgress .left{float:left;width:calc(100% - 55px)}.visitStatusWrapper .VisitBoxContent .VisitProgress .right{font-size:12px;font-family:Avenir-Black;float:right;width:55px;text-align:right;position:relative;top:-5px}.visitStatusWrapper .VisitBoxContent.BluePass{background:0 0!important;box-shadow:inset 0 0 10px 0 #9c9ef1;border:2px solid rgba(255,255,255,.19);border-radius:3px}.visitStatusWrapper .VisitBoxContent.BluePass .TwoNumber{color:#508eba!important}.visitStatusWrapper .tooltip-inner span strong{font-family:'Avenir-Black !important;'}.visitStatusWrapper .tooltip-text{position:absolute;right:5px;top:0;z-index:1;display:block;padding:10px}.visitStatusWrapper .tooltip-text i{color:rgba(255,255,255,.6);font-size:18px}.visitStatusWrapper .tooltip-text i:hover{color:#fff}.visitStatusWrapper.small-box .VisitBoxContent{min-height:110px!important;padding-bottom:0!important}.visitStatusWrapper.small-box .VisitBoxContent .VisitTitle{padding-top:10px!important}.visitStatusWrapper.small-box .VisitBoxContent .VisitNumber{margin-bottom:10px}.visitStatusWrapper.small-box .VisitBoxContent .VisitNumber .Number{font-size:36px;margin-bottom:0!important;line-height:.8em}.visitStatusWrapper.small-box .VisitBoxContent .VisitNumber .Number span{font-size:20px}.active{border:2px solid #fff!important}",305 map: undefined,306 media: undefined307 }), inject("data-v-ef19cb9c_1", {308 source: ".tooltip arrow:before{border-top-color:inherit;border-bottom-color:inherit}",309 map: undefined,310 media: undefined311 });312};313/* scoped */314const __vue_scope_id__ = undefined;315/* module identifier */316const __vue_module_identifier__ = undefined;317/* functional template */318const __vue_is_functional_template__ = false;319/* style inject SSR */320/* style inject shadow dom */321const __vue_component__ = /*#__PURE__*/normalizeComponent({322 render: __vue_render__,323 staticRenderFns: __vue_staticRenderFns__324}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, createInjector, undefined, undefined);325// Import vue component326// IIFE injects install function into component, allowing component327// to be registered via Vue.use() as well as Vue.component(),328var entry_esm = /*#__PURE__*/(() => {329 // Get component instance330 const installable = __vue_component__; // Attach install function executed by Vue.use()331 installable.install = Vue => {332 Vue.component('RemVisitStatusTest', installable);333 };334 return installable;335})(); // It's possible to expose named exports when writing components that can336// also be used as directives, etc. - eg. import { RollupDemoDirective } from 'rollup-demo';337// export const RollupDemoDirective = directive;...

Full Screen

Full Screen

his_ezhosp.model.js

Source:his_ezhosp.model.js Github

copy

Full Screen

1"use strict";2Object.defineProperty(exports, "__esModule", { value: true });3exports.PccHisEzhospModel = void 0;4const moment = require("moment");5const dbName = process.env.HIS_DB_NAME;6const hospCode = process.env.HOSPCODE;7const backwardService = moment().locale('th').subtract(3, 'year').format('YYYY-MM-DD');8const maxLimit = 500;9class PccHisEzhospModel {10 getTableName(knex) {11 return knex12 .select('TABLE_NAME')13 .from('information_schema.tables')14 .where('TABLE_SCHEMA', '=', dbName);15 }16 getPerson(db, columnName, searchText) {17 columnName = columnName === 'idcard' ? 'no_card' : columnName;18 columnName = columnName === 'cid' ? 'no_card' : columnName;19 columnName = columnName === 'pid' ? 'hn' : columnName;20 return db('patient')21 .select(db.raw(`(select hcode from sys_hospital limit 1) as hospcode22 ,(select hname from sys_hospital limit 1) as hospname`))23 .select('patient.hn', 'patient.hn as pid', 'patient.no_card as cid', 'patient.no_card as idcard', 'patient.title as prename', 'patient.name as fname', 'patient.surname as lname', 'patient.birth', 'patient.birth as dob', 'patient.sex', 'patient.address', 'patient.blood as bloodgroup', 'patient.moo', 'patient.road', 'patient.tel', 'patient.zip', 'patient.nation', 'patient.race', 'patient.ethnic as religion', 'patient.marry as mstatus', 'occupa as occupation', 'patient.add as addcode')24 .where(columnName, "=", searchText);25 }26 getPersonByName(db, fname, lname) {27 let where = 'hn!=""';28 if (fname) {29 where += ` and name like "${fname}%" `;30 }31 if (lname) {32 where += ` and surname like "${lname}%" `;33 }34 return db('patient')35 .select(db.raw(`(select hcode from sys_hospital limit 1) as hospcode36 ,(select hname from sys_hospital limit 1) as hospname`))37 .select('patient.hn', 'patient.hn as pid', 'patient.no_card as cid', 'patient.no_card as idcard', 'patient.title as prename', 'patient.name as fname', 'patient.surname as lname', 'patient.birth', 'patient.birth as dob', 'patient.sex', 'patient.address', 'patient.blood as bloodgroup', 'patient.moo', 'patient.road', 'patient.tel', 'patient.zip', 'patient.nation', 'patient.race', 'patient.ethnic as religion', 'patient.marry as mstatus', 'occupa as occupation', 'patient.add as addcode')38 .whereRaw(db.raw(where));39 }40 getService(db, hn, date) {41 let where = { hn };42 if (date) {43 where.date = date;44 }45 return db('opd_visit as visit')46 .leftJoin('opd_vs as vs', 'visit.vn', 'vs.vn')47 .leftJoin('patient', 'visit.hn', 'patient.hn')48 .leftJoin('lib_pttype as p', 'visit.pttype', 'p.code')49 .leftJoin('lib_clinic as clinic', 'visit.dep', 'clinic.code')50 .leftJoin('lib_dr as dr', 'visit.dr', 'dr.code')51 .select(db.raw(`(select hcode from sys_hospital limit 1) as hospcode52 ,(select hname from sys_hospital limit 1) as hospname`))53 .select('patient.no_card as idcard', 'visit.hn as pid', 'visit.hn', 'visit.vn as visitno', 'visit.date', 'visit.date as date_serv', 'visit.time_reg as time', 'visit.time as time_serv', 'vs.time_vs', 'visit.dep as clinic', 'clinic.clinic as clinic_name', 'visit.pttype', 'p.text as pttype_text', 'visit.hospmain', 'visit.hospsub', 'patient.tel', 'vs.bp as bp_systolic', 'vs.bp1 as bp_diastolic', 'vs.weigh as weight', 'vs.high as height', 'vs.bmi', 'vs.puls as pr', 'vs.rr', 'vs.t as temperature', 'vs.t as tem', 'vs.waistline as waist', 'vs.cc', 'vs.pi', 'vs.nurse_ph as ph', 'visit.dr as provider')54 .select(db.raw(`concat(dr.title, dr.fname, ' ', dr.lname) as provider_name`))55 .where(where)56 .whereNotIn('visit.status', [8, 20])57 .where('visit.date', '>', backwardService)58 .orderBy('visit.date', 'desc')59 .limit(maxLimit);60 }61 getServiceByHn(db, hn, cid) {62 if (!hn && !cid)63 return null;64 let searchType = 'visit.hn';65 let searchValue = hn;66 if (cid) {67 let searchType = 'patient.no_card';68 let searchValue = cid;69 }70 return db('opd_visit as visit')71 .leftJoin('opd_vs as vs', 'visit.vn', 'vs.vn')72 .leftJoin('patient', 'visit.hn', 'patient.hn')73 .leftJoin('lib_pttype as p', 'visit.pttype', 'p.code')74 .leftJoin('lib_clinic as clinic', 'visit.dep', 'clinic.code')75 .leftJoin('lib_dr as dr', 'visit.dr', 'dr.code')76 .select(db.raw(`(select hcode from sys_hospital limit 1) as hospcode77 ,(select hname from sys_hospital limit 1) as hospname`))78 .select('patient.no_card as idcard', 'visit.hn as pid', 'visit.hn', 'visit.vn as visitno', 'visit.date', 'visit.date as visitdate', 'visit.time_reg as time', 'visit.time as timestart', 'vs.time_vs', 'visit.dep as clinic', 'clinic.clinic as clinic_name', 'visit.pttype', 'p.text as pttype_text', 'visit.hospmain', 'visit.hospsub', 'vs.bp as bp_systolic', 'vs.bp1 as bp_diastolic', 'vs.weigh as weight', 'vs.high as height', 'vs.bmi', 'vs.puls as pr', 'vs.rr', 'vs.t as temperature', 'vs.t as tem', 'vs.waistline as waist', 'vs.cc', 'vs.pi', 'vs.nurse_ph as ph', 'visit.dr as provider')79 .select(db.raw(`concat(dr.title, dr.fname, ' ', dr.lname) as provider_name`))80 .where(searchType, searchValue)81 .whereNotIn('visit.status', [8, 20])82 .where('visit.date', '>', backwardService)83 .orderBy('visit.date', 'desc')84 .limit(maxLimit);85 }86 getDiagnosisByHn(db, pid) {87 return db('opd_dx as dx')88 .innerJoin('opd_visit as visit', 'dx.vn', 'visit.vn')89 .leftJoin('lib_icd10 as lib', 'dx.diag', 'lib.code')90 .select(db.raw(`(select hcode from sys_hospital limit 1) as hospcode91 ,(select hname from sys_hospital limit 1) as hospname`))92 .select('dx.*', 'dx.diag as diagcode', 'lib.desc as diagname', 'lib.short_thi as diagnamethai', 'visit.date as date_serv', 'visit.time as time_serv')93 .where('visit.hn', "=", pid)94 .whereNotIn('visit.status', [8, 20])95 .orderBy('visit.date', 'desc')96 .orderBy('visit.time', 'desc');97 }98 getDiagnosis(db, visitNo) {99 return db('view_opd_dx')100 .select('*')101 .select(db.raw(`(select hcode from sys_hospital limit 1) as hospcode102 ,(select hname from sys_hospital limit 1) as hospname`))103 .select('diag as diagcode', 'desc as diagname', 'short_thi as diagnamethai', 'date as date_serv', 'time as time_serv')104 .where('vn', "=", visitNo)105 .whereNotIn('status', [8, 20])106 .orderBy('date', 'desc')107 .orderBy('time', 'desc');108 }109 getDrug(db, visitNo) {110 return db('view_pharmacy_opd_drug_item as drug')111 .select('*')112 .select(db.raw(`'${hospCode}' as hospcode`))113 .select(db.raw(`(select hcode from sys_hospital limit 1) as hospcode114 ,(select hname from sys_hospital limit 1) as hospname`))115 .select(db.raw(`concat(methodname,' ', no_use ,' ', unit_use, ' ', freqname, ' ', timesname) as dose`))116 .where('vn', "=", visitNo)117 .whereNotIn('visit_status', [8, 20])118 .whereNotIn('drugcode', ['ZZZZZZ', 'POST', 'PREFILL', 'ZTP1'])119 .orderBy('date_serv', 'desc')120 .orderBy('time_serv', 'desc');121 }122 getDrugByHn(db, pid) {123 return db('view_pharmacy_opd_drug_item as drug')124 .innerJoin('visit', 'drug.vn', 'visit.vn')125 .select(db.raw(`(select hcode from sys_hospital limit 1) as hospcode126 ,(select hname from sys_hospital limit 1) as hospname`))127 .select('drug.*', 'visit.vn', 'visit.vn as visitno', 'visit.date as date_serv', 'visit.time as time_serv', 'drug.caution as comment')128 .select(db.raw(`concat(drug.methodname,' ', drug.no_use ,' ', drug.unit_use, ' ', drug.freqname, ' ', drug.timesname) as dose`))129 .where('visit.hn', "=", pid)130 .whereNotIn('visit.status', [8, 20])131 .orderBy('visit.date', 'desc')132 .orderBy('visit.time', 'desc');133 }134 getAnc(db, visitNo) {135 return [];136 }137 getAncByHn(db, pid) {138 return [];139 }140 getEpi(db, visitNo) {141 return [];142 }143 getEpiByHn(db, pid) {144 return [];145 }146 getFp(db, visitNo) {147 return [];148 }149 getFpByHn(db, pid) {150 return [];151 }152 getNutrition(db, visitNo) {153 return [];154 }155 getNutritionByHn(db, pid) {156 return [];157 }158 getDrugAllergy(db, pid, cid) {159 return [];160 }161 getChronic(db, pid, cid) {162 return [];163 }164 getLabResult(db, columnName, searchNo) {165 columnName = columnName.toUpperCase() === 'VISITNO' ? 'result.vn' : columnName;166 columnName = columnName === 'pid' ? 'result.hn' : columnName;167 const backwardService = moment().locale('th').subtract(1, 'year').format('YYYY-MM-DD');168 return db('hospdata.view_lab_result as result')169 .select('*')170 .select(db.raw(`(select hcode from sys_hospital limit 1) as hospcode171 ,(select hname from sys_hospital limit 1) as hospname`))172 .select(db.raw('"LAB" as TYPEINVEST'))173 .select(db.raw('CONCAT(result.date," ",result.time) as DATETIME_INVEST'))174 .select('result.hn as PID', 'result.vn as SEQ', 'result.no_card as cid', 'an as AN', 'result.type_result as LH', 'result.lab_code as LOCALCODE', 'result.icdcm as INVESTCODE', 'result.lab_name as INVESTNAME', 'result.result as INVESTVALUE', 'result.unit as UNIT', 'result.result_obj as INVESTRESULT', 'result.minresult as NORMAL_MIN', 'result.maxresult as NORMAL_MAX', 'result.date_result as DATETIME_REPORT')175 .select(db.raw('CONCAT(result.date," ",result.time) as D_UPDATE'))176 .where(columnName, "=", searchNo)177 .where('result.date_result', '>', backwardService)178 .orderBy('result.date_result', 'desc')179 .limit(maxLimit);180 }181 libDrug(db, searchType, searchValue) {182 return db('pharmacy_inventory as drug')183 .select('drug.*', 'drug.unit_use as unitusage', 'drug.price as sellcaldrugstore', 'drug.paytype as chargeitem', 'drug.last_tmt as drugflag')184 .where(searchType, 'like', '%' + searchValue + '%')185 .limit(maxLimit);186 }187 getProcedureOpd(knex, columnName, searchNo, hospCode) {188 return knex189 .select('*')190 .from('procedure_opd')191 .where(columnName, "=", searchNo);192 }193 getChargeOpd(knex, columnName, searchNo, hospCode) {194 return knex195 .select('*')196 .from('charge_opd')197 .where(columnName, "=", searchNo);198 }199 getDrugOpd(knex, columnName, searchNo, hospCode) {200 return knex201 .select('*')202 .from('drug_opd')203 .where(columnName, "=", searchNo);204 }205 getAdmission(knex, columnName, searchNo, hospCode) {206 return knex207 .select('*')208 .from('admission')209 .where(columnName, "=", searchNo);210 }211 getDiagnosisIpd(knex, columnName, searchNo, hospCode) {212 return knex213 .select('*')214 .from('diagnosis_ipd')215 .where(columnName, "=", searchNo);216 }217 getProcedureIpd(knex, columnName, searchNo, hospCode) {218 return knex219 .select('*')220 .from('procedure_ipd')221 .where(columnName, "=", searchNo);222 }223 getChargeIpd(knex, columnName, searchNo, hospCode) {224 return knex225 .select('*')226 .from('charge_ipd')227 .where(columnName, "=", searchNo);228 }229 getDrugIpd(knex, columnName, searchNo, hospCode) {230 return knex231 .select('*')232 .from('drug_ipd')233 .where(columnName, "=", searchNo);234 }235 getAccident(knex, columnName, searchNo, hospCode) {236 return knex237 .select('*')238 .from('accident')239 .where(columnName, "=", searchNo);240 }241 getAppointment(knex, columnName, searchNo, hospCode) {242 return knex243 .select('*')244 .from('appointment')245 .where(columnName, "=", searchNo);246 }247 getData(knex, tableName, columnName, searchNo, hospCode) {248 return knex249 .select('*')250 .from(tableName)251 .where(columnName, "=", searchNo)252 .limit(5000);253 }254}...

Full Screen

Full Screen

his_jhcis.js

Source:his_jhcis.js Github

copy

Full Screen

1"use strict";2Object.defineProperty(exports, "__esModule", { value: true });3exports.HisJhcisModel = void 0;4const maxLimit = 250;5const hcode = process.env.HOSPCODE;6const dbName = process.env.HIS_DB_NAME;7const dbClient = process.env.HIS_DB_CLIENT;8class HisJhcisModel {9 check() {10 return true;11 }12 getTableName(db, dbName = process.env.HIS_DB_NAME) {13 return db('information_schema.tables')14 .select('TABLE_NAME')15 .where('TABLE_SCHEMA', '=', dbName);16 }17 getReferOut(db, date, hospCode = hcode) {18 return db('visit')19 .leftJoin('person', 'visit.pid', 'person.pid')20 .select('visit.pcucode as HOSPCODE', 'visit.refertohos as HOSP_DESTINATION', 'visit.numberrefer as REFERID')21 .select(db.raw(`concat(visit.pcucode,'-',visit.numberrefer) as REFERID_PROVINCE`))22 .select('visit.pid as PID', 'person.idcard as CID', 'visit.visitno as SEQ', 'person.prename', 'person.fname', 'person.lname', 'person.birth as dob', 'person.sex', 'visit.symptoms as CHIEFCOMP', 'visit.vitalcheck as PI', 'visit.symptomsco as PH', 'visit.healthsuggest1 as PHYSICALEXAM', 'visit.diagnote as DIAGLAST', 'visit.receivefromhos as HOSPCODE_ORIGIN')23 .select(db.raw(`concat(visit.visitdate,' ',visit.timestart) as DATETIME_SERV`))24 .select(db.raw(`concat(visit.visitdate,' ',visit.timeend) as DATETIME_REFER`))25 .select(db.raw(`case when isnull(visit.refertohos) then '' when visit.refer='06' then '3' else '1' end as CAUSEOUT`))26 .select(db.raw(`'5' as EMERGENCY`))27 .select(db.raw(`'1' as PTYPE`))28 .select(db.raw(`'99' as PTYPEDIS`))29 .select(db.raw(`'1' as referout_type`))30 .select(db.raw(`concat(visit.visitdate,' ', visit.timeend) as D_UPDATE`))31 .where('visit.visitdate', date)32 .whereRaw('!isnull(visit.numberrefer)')33 .whereRaw('!isnull(refertohos)')34 .orderBy('visit.visitdate')35 .limit(maxLimit);36 }37 getReferHistory(db, columnName, searchNo, hospCode = hcode) {38 columnName = columnName === 'visitNo' ? 'visit.visitno' : columnName;39 columnName = columnName === 'hn' ? 'visit.pid' : columnName;40 columnName = columnName === 'cid' ? 'person.idcard' : columnName;41 columnName = columnName === 'referid' ? 'visit.numberrefer' : columnName;42 return db('visit')43 .leftJoin('person', 'visit.pid', 'person.pid')44 .select('visit.pcucode as HOSPCODE', 'visit.refertohos as HOSP_DESTINATION', 'visit.numberrefer as REFERID')45 .select(db.raw(`concat(visit.pcucode,'-',visit.numberrefer) as REFERID_PROVINCE`))46 .select('visit.pid as PID', 'person.idcard as CID', 'visit.visitno as SEQ', 'person.prename', 'person.fname', 'person.lname', 'person.birth as dob', 'person.sex', 'visit.symptoms as CHIEFCOMP', 'visit.vitalcheck as PI', 'visit.symptomsco as PH', 'visit.healthsuggest1 as PHYSICALEXAM', 'visit.diagnote as DIAGLAST', 'visit.receivefromhos as HOSPCODE_ORIGIN')47 .select(db.raw(`concat(visit.visitdate,' ',visit.timestart) as DATETIME_SERV`))48 .select(db.raw(`concat(visit.visitdate,' ',visit.timeend) as DATETIME_REFER`))49 .select(db.raw(`case when isnull(visit.refertohos) then '' when visit.refer='06' then '3' else '1' end as CAUSEOUT`))50 .select(db.raw(`'5' as EMERGENCY`))51 .select(db.raw(`'1' as PTYPE`))52 .select(db.raw(`'99' as PTYPEDIS`))53 .select(db.raw(`'1' as referout_type`))54 .select(db.raw(`concat(visit.visitdate,' ', visit.timeend) as D_UPDATE`))55 .where(columnName, "=", searchNo)56 .whereRaw('!isnull(visit.numberrefer)')57 .whereRaw('!isnull(refertohos)')58 .orderBy('visit.visitdate')59 .limit(maxLimit);60 }61 getPerson(db, columnName, searchText, hospCode = hcode) {62 columnName = columnName === 'hn' ? 'pid' : columnName;63 columnName = columnName === 'cid' ? 'idcard' : columnName;64 return db('person')65 .select('person.pcucodeperson as HOSPCODE', 'person.pid as PID', 'person.pid as HN', 'person.idcard as CID', 'person.prename as PRENAME', 'person.fname as NAME', 'person.fname as FNAME', 'person.lname as LNAME', 'person.birth as BIRTH', 'person.sex as SEX', 'person.marystatus as MSTATUS', 'person.occupa as OCCUPATION_OLD', 'person.fatherid as FATHER', 'person.motherid as MOTHER', 'person.educate as EDUCATION', 'person.nation as NATION', 'person.origin as RACE', 'person.religion as RELIGION', 'person.bloodgroup as ABOGROUP', 'person.bloodrh as RHGROUP', 'person.telephoneperson as TELEPHONE', 'person.mobile as MOBILE', 'person.datestart as MOVEIN', 'person.dateexpire as DISCHARGE', 'person.dateupdate as D_UPDATE')66 .where(columnName, "=", searchText)67 .limit(maxLimit);68 }69 getAddress(db, columnName, searchNo, hospCode = hcode) {70 columnName = columnName === 'cid' ? 'person.idcard' : columnName;71 columnName = columnName === 'hn' ? 'pid' : columnName;72 return db('person')73 .select(db.raw('"' + hcode + '" as hospcode'))74 .select('pcucodeperson as HOSPCODE', 'pid as PID', 'hnomoi as HOUSENO', 'mumoi as VILLAGE', 'roadmoi as ROAD', 'subdistcodemoi as TAMBON', 'distcodemoi as AMPUR', 'provcodemoi as CHANGWAT', 'postcodemoi as ZIP', 'telephoneperson as TELEPHONE', 'mobile as MOBILE', 'person.idcard as CID')75 .select(db.raw(`'1' as ADDRESSTYPE`))76 .where(columnName, "=", searchNo)77 .limit(maxLimit);78 }79 getService(db, columnName, searchText, hospCode = hcode) {80 columnName = columnName === 'visitNo' ? 'visit.visitno' : columnName;81 columnName = columnName === 'hn' ? 'visit.pid' : columnName;82 columnName = columnName === 'cid' ? 'person.idcard' : columnName;83 columnName = columnName === 'date_serv' ? 'visit.visitdate' : columnName;84 return db('visit')85 .leftJoin('person', 'visit.pid', 'person.pid')86 .leftJoin('cright', 'visit.rightcode', 'cright.rightcode')87 .select('visit.pcucode as HOSPCODE', 'visit.pid as PID', 'visit.pid as HN', 'person.idcard as CID', 'visit.visitno as SEQ', 'visit.visitdate as DATE_SERV', 'visit.rightcode', 'cright.mapright as INSTYPE', 'visit.rightno as INSID', 'visit.hosmain as MAIN', 'visit.hosmain as HMAIN', 'visit.hossub as SUB', 'visit.hossub as HSUB', 'visit.symptoms as CHIEFCOMP', 'visit.vitalcheck as PRESENTILLNESS', 'visit.symptomsco as PASTHISTORY', 'visit.healthsuggest1 as PHYSICALEXAM', 'visit.weight as WEIGHT', 'visit.height as HEIGHT', 'visit.weight as temperature', 'visit.pulse as PR', 'visit.respri as RR', 'visit.waist as WAIST', 'visit.money1 as PRICE', 'visit.receivefromhos as REFERINHOSP', 'visit.refertohos as REFEROUTHOSP')88 .select(db.raw(`REPLACE(visit.timestart, ':', '') as TIME_SERV`))89 .select(db.raw(`case when isnull(visit.refertohos) then '' when visit.refer='06' then '3' else '1' end as CAUSEOUT`))90 .select(db.raw(`case when isnull(visit.receivefromhos) then '1' else '3' end as TYPEIN`))91 .select(db.raw(`case when LOCATE('/', visit.pressure)>0 then substr(visit.pressure,1,LOCATE('/', visit.pressure)-1) else '' end as SBP`))92 .select(db.raw(`case when LOCATE('/', visit.pressure)>0 then substr(visit.pressure,LOCATE('/', visit.pressure)+1) else '' end as DBP`))93 .select(db.raw(`'1' as LOCATION`))94 .select(db.raw(`'1' as SERVPLACE`))95 .select(db.raw(`concat(visit.visitdate,' ', visit.timestart) as D_UPDATE`))96 .where(columnName, searchText)97 .orderBy('visit.visitdate', 'desc')98 .limit(maxLimit);99 }100 getDiagnosisOpd(db, visitno, hospCode = hcode) {101 return db('visitdiag as dx')102 .leftJoin('visit', 'dx.visitno', 'visit.visitno')103 .leftJoin('person', 'visit.pid', 'person.pid')104 .select('dx.pcucode as HOSPCODE', 'dx.visitno as SEQ', 'visit.pid as PID', 'person.idcard as CID', 'dx.clinic as CLINIC', 'dx.dxtype as DIAGTYPE', 'dx.doctordiag as PROVIDER', 'visit.visitdate as DATE_SERV', 'dx.dateupdate as D_UPDATE')105 .select(db.raw(`REPLACE(dx.diagcode, '.', '') as DIAGCODE`))106 .select(db.raw(' "IT" as codeset'))107 .where('dx.visitno', visitno)108 .orderBy('dx.dxtype')109 .limit(maxLimit);110 }111 getProcedureOpd(db, visitno, hospCode = hcode) {112 return [];113 }114 getChargeOpd(db, visitNo, hospCode = hcode) {115 return [];116 }117 getLabRequest(db, columnName, searchNo, hospCode = hcode) {118 columnName = columnName === 'visitNo' ? 'visitno' : columnName;119 columnName = columnName === 'hn' ? 'pid' : columnName;120 return [];121 }122 getLabResult(db, columnName, searchNo, hospCode = hcode) {123 columnName = columnName === 'visitNo' ? 'vn' : columnName;124 return [];125 }126 getDrugOpd(db, visitNo, hospCode = hcode) {127 return db('visitdrug as drug')128 .leftJoin('visit', 'drug.visitno', 'visit.visitno')129 .leftJoin('person', 'visit.pid', 'person.pid')130 .leftJoin('cdrug', 'drug.drugcode', 'cdrug.drugcode')131 .leftJoin('cdrugunitsell', 'cdrug.unitsell', 'cdrugunitsell.unitsellcode')132 .select('drug.pcucode as HOSPCODE', 'drug.visitno as SEQ', 'visit.pid as PID', 'person.idcard as CID', 'visit.visitdate as DATE_SERV', 'drug.clinic as CLINIC', 'drug.drugcode', 'drug.unit as AMOUNT', 'cdrug.unitsell as UNIT', 'cdrugunitsell.unitsellname as UNIT_PACKING', 'cdrug.drugname as DNAME', 'drug.realprice as DRUGPRICE', 'drug.costprice as DRUGCOST', 'drug.dose as drug_usage', 'cdrug.drugproperties as caution', 'cdrug.drugcode24 as DIDSTD', 'cdrug.drugcode24 as DID', 'cdrug.tmtcode as DID_TMT', 'drug.doctor1 as PROVIDER', 'drug.dateupdate as D_UPDATE')133 .where('drug.visitno', visitNo)134 .where('cdrug.drugtype', '01')135 .limit(maxLimit);136 }137 getAdmission(db, columnName, searchNo, hospCode = hcode) {138 return [];139 }140 getDiagnosisIpd(db, columnName, searchNo, hospCode = hcode) {141 columnName = columnName === 'visitNo' ? 'vn' : columnName;142 return [];143 }144 getProcedureIpd(db, an, hospCode = hcode) {145 return [];146 }147 getChargeIpd(db, an, hospCode = hcode) {148 return [];149 }150 getDrugIpd(db, an, hospCode = hcode) {151 return [];152 }153 getAccident(db, visitNo, hospCode = hcode) {154 return [];155 }156 getDrugAllergy(db, hn, hospCode = hcode) {157 return [];158 }159 getAppointment(db, visitNo, hospCode = hcode) {160 return [];161 }162 getClinicalRefer(db, referNo, hospCode = hcode) {163 return [];164 }165 getInvestigationRefer(db, referNo, hospCode = hcode) {166 return [];167 }168 getCareRefer(db, referNo, hospCode = hcode) {169 return [];170 }171 getReferResult(db, hospDestination, referNo, hospCode = hcode) {172 return [];173 }174 getData(db, tableName, columnName, searchNo, hospCode = hcode) {175 return db(tableName)176 .select(db.raw('"' + hcode + '" as hospcode'))177 .select('*')178 .where(columnName, "=", searchNo)179 .limit(maxLimit);180 }181}...

Full Screen

Full Screen

ParseTreeVisitor.js

Source:ParseTreeVisitor.js Github

copy

Full Screen

...15// from trees.json16// Do not edit!17export class ParseTreeVisitor {18 visitAny(tree) {19 tree && tree.visit(this);20 }21 visit(tree) {22 this.visitAny(tree);23 }24 visitList(list) {25 if (list) {26 for (var i = 0; i < list.length; i++) {27 this.visitAny(list[i]);28 }29 }30 }31 visitStateMachine(tree) {32 throw Error('State machines should not live outside of the GeneratorTransformer.');33 }34 visitAnnotation(tree) {35 this.visitAny(tree.name);...

Full Screen

Full Screen

analyze-scope.js

Source:analyze-scope.js Github

copy

Full Screen

...68 callback = options;69 options = { processRightHandNodes: false };70 }71 const visitor = new PatternVisitor(this.options, node, callback);72 visitor.visit(node);73 // Process the right hand nodes recursively.74 if (options.processRightHandNodes) {75 visitor.rightHandNodes.forEach(this.visit, this);76 }77 }78 // inherits.79 visitClass(node) {80 // Decorators.81 this._visitArray(node.decorators);82 // Flow type parameters.83 const typeParamScope = this._nestTypeParamScope(node);84 // Flow super types.85 this._visitTypeAnnotation(node.implements);86 this._visitTypeAnnotation(87 node.superTypeParameters && node.superTypeParameters.params88 );89 // Basic.90 super.visitClass(node);91 // Close the type parameter scope.92 if (typeParamScope) {93 this.close(node);94 }95 }96 // inherits.97 visitFunction(node) {98 const typeParamScope = this._nestTypeParamScope(node);99 // Flow return types.100 this._checkIdentifierOrVisit(node.returnType);101 // Basic.102 super.visitFunction(node);103 // Close the type parameter scope.104 if (typeParamScope) {105 this.close(node);106 }107 }108 // inherits.109 visitProperty(node) {110 if (node.value && node.value.type === "TypeCastExpression") {111 this._visitTypeAnnotation(node.value);112 }113 this._visitArray(node.decorators);114 super.visitProperty(node);115 }116 InterfaceDeclaration(node) {117 this._createScopeVariable(node, node.id);118 const typeParamScope = this._nestTypeParamScope(node);119 // TODO: Handle mixins120 this._visitArray(node.extends);121 this.visit(node.body);122 if (typeParamScope) {123 this.close(node);124 }125 }126 EnumDeclaration(node) {127 this._createScopeVariable(node, node.id);128 }129 TypeAlias(node) {130 this._createScopeVariable(node, node.id);131 const typeParamScope = this._nestTypeParamScope(node);132 this.visit(node.right);133 if (typeParamScope) {134 this.close(node);135 }136 }137 ClassProperty(node) {138 this._visitClassProperty(node);139 }140 ClassPrivateProperty(node) {141 this._visitClassProperty(node);142 }143 DeclareModule(node) {144 this._visitDeclareX(node);145 }146 DeclareFunction(node) {147 this._visitDeclareX(node);148 }149 DeclareVariable(node) {150 this._visitDeclareX(node);151 }152 DeclareClass(node) {153 this._visitDeclareX(node);154 }155 // visit OptionalMemberExpression as a MemberExpression.156 OptionalMemberExpression(node) {157 super.MemberExpression(node);158 }159 _visitClassProperty(node) {160 this._visitTypeAnnotation(node.typeAnnotation);161 this.visitProperty(node);162 }163 _visitDeclareX(node) {164 if (node.id) {165 this._createScopeVariable(node, node.id);166 }167 const typeParamScope = this._nestTypeParamScope(node);168 if (typeParamScope) {169 this.close(node);170 }171 }172 _createScopeVariable(node, name) {173 this.currentScope().variableScope.__define(174 name,175 new Definition("Variable", name, node, null, null, null)176 );177 }178 _nestTypeParamScope(node) {179 if (!node.typeParameters) {180 return null;181 }182 const parentScope = this.scopeManager.__currentScope;183 const scope = new escope.Scope(184 this.scopeManager,185 "type-parameters",186 parentScope,187 node,188 false189 );190 this.scopeManager.__nestScope(scope);191 for (let j = 0; j < node.typeParameters.params.length; j++) {192 const name = node.typeParameters.params[j];193 scope.__define(name, new Definition("TypeParameter", name, name));194 if (name.typeAnnotation) {195 this._checkIdentifierOrVisit(name);196 }197 }198 scope.__define = function() {199 return parentScope.__define.apply(parentScope, arguments);200 };201 return scope;202 }203 _visitTypeAnnotation(node) {204 if (!node) {205 return;206 }207 if (Array.isArray(node)) {208 node.forEach(this._visitTypeAnnotation, this);209 return;210 }211 // get property to check (params, id, etc...)212 const visitorValues = visitorKeysMap[node.type];213 if (!visitorValues) {214 return;215 }216 // can have multiple properties217 for (let i = 0; i < visitorValues.length; i++) {218 const visitorValue = visitorValues[i];219 const propertyType = propertyTypes[visitorValue];220 const nodeProperty = node[visitorValue];221 // check if property or type is defined222 if (propertyType == null || nodeProperty == null) {223 continue;224 }225 if (propertyType.type === "loop") {226 for (let j = 0; j < nodeProperty.length; j++) {227 if (Array.isArray(propertyType.values)) {228 for (let k = 0; k < propertyType.values.length; k++) {229 const loopPropertyNode = nodeProperty[j][propertyType.values[k]];230 if (loopPropertyNode) {231 this._checkIdentifierOrVisit(loopPropertyNode);232 }233 }234 } else {235 this._checkIdentifierOrVisit(nodeProperty[j]);236 }237 }238 } else if (propertyType.type === "single") {239 this._checkIdentifierOrVisit(nodeProperty);240 } else if (propertyType.type === "typeAnnotation") {241 this._visitTypeAnnotation(node.typeAnnotation);242 } else if (propertyType.type === "typeParameters") {243 for (let l = 0; l < node.typeParameters.params.length; l++) {244 this._checkIdentifierOrVisit(node.typeParameters.params[l]);245 }246 } else if (propertyType.type === "id") {247 if (node.id.type === "Identifier") {248 this._checkIdentifierOrVisit(node.id);249 } else {250 this._visitTypeAnnotation(node.id);251 }252 }253 }254 }255 _checkIdentifierOrVisit(node) {256 if (node && node.typeAnnotation) {257 this._visitTypeAnnotation(node.typeAnnotation);258 } else if (node && node.type === "Identifier") {259 this.visit(node);260 } else {261 this._visitTypeAnnotation(node);262 }263 }264 _visitArray(nodeList) {265 if (nodeList) {266 for (const node of nodeList) {267 this.visit(node);268 }269 }270 }271}272module.exports = function(ast, parserOptions) {273 const options = {274 ignoreEval: true,275 optimistic: false,276 directive: false,277 nodejsScope:278 ast.sourceType === "script" &&279 (parserOptions.ecmaFeatures &&280 parserOptions.ecmaFeatures.globalReturn) === true,281 impliedStrict: false,282 sourceType: ast.sourceType,283 ecmaVersion: parserOptions.ecmaVersion || 2018,284 fallback,285 };286 options.childVisitorKeys = childVisitorKeys;287 const scopeManager = new escope.ScopeManager(options);288 const referencer = new Referencer(options, scopeManager);289 referencer.visit(ast);290 return scopeManager;...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1const React = require('react');2const unexpected = require('unexpected');3const unexpectedReact = require('unexpected-react');4const unexpectedSinon = require('unexpected-sinon');5const sinon = require('sinon');6const { visit, expect } = unexpected.clone().use(unexpectedReact).use(unexpectedSinon);7const TestComponent = () => {8 const [count, setCount] = React.useState(0);9 const onButtonClick = () => setCount(count + 1);10 return (11 <button data-testid="button" onClick={onButtonClick}>12 {count}13 );14};15describe('TestComponent', () => {16 it('should increase the count on button click', () => {17 const spy = sinon.spy();18 visit(<TestComponent />, 'click', '[data-testid="button"]', spy);19 expect(spy, 'was called');20 });21});22Error: Unexpected call to visit() with arguments:23Expected visit() to be called with the arguments:24visit(<TestComponent />, 'click', '[data-testid="button"]', spy);25Error: Unexpected call to visit() with arguments:26Expected visit() to be called with the arguments:27visit(<TestComponent />, 'click', '[data-testid="button"]', spy);28Error: Unexpected call to visit() with arguments:29Expected visit() to be called with the arguments:30visit(<TestComponent />, 'click', '[data-testid="button"]', spy);31Error: Unexpected call to visit() with arguments:32Expected visit() to be called with the arguments:

Full Screen

Using AI Code Generation

copy

Full Screen

1import React from 'react';2import { mount } from 'enzyme';3import { expect, use } from 'unexpected';4import unexpectedReact from 'unexpected-react';5use(unexpectedReact);6describe('test', () => {7 it('should render', () => {8 const wrapper = mount(<div>test</div>);9 expect(wrapper, 'to have rendered', <div>test</div>);10 });11});12import React from 'react';13import { mount } from 'enzyme';14import { expect, use } from 'unexpected';15import unexpectedReact from 'unexpected-react';16use(unexpectedReact);17describe('test2', () => {18 it('should render', () => {19 const wrapper = mount(<div>test2</div>);20 expect(wrapper, 'to have rendered', <div>test2</div>);21 });22});23{24 "scripts": {25 },26 "devDependencies": {27 }28}29 6 | import unexpectedReact from 'unexpected-react';30 7 | use(unexpectedReact);31 9 | describe('test', () => {32 10 | it('should render', () => {33 11 | const wrapper = mount(<div>test</div>);34 at Object.toHaveRendered (node_modules/unexpected-react/lib/unexpected-react.js:8:1)35import unexpectedReact from 'unexpected-react';36use(unexpectedReact);37describe('test', () => {38 it('should render', () => {39 const wrapper = mount(<div>test</div>);40 expect(wrapper, 'to have rendered', <div>test</div>);41 });42});43{

Full Screen

Using AI Code Generation

copy

Full Screen

1const expect = require('unexpected');2const { visit } = require('ast-types');3const { parse } = require('recast');4const { readFileSync } = require('fs');5const { join } = require('path');6const code = readFileSync(join(__dirname, 'code.js'), 'utf8');7const ast = parse(code);8visit(ast, {9 visitIdentifier(path) {10 console.log(path.value.name);11 this.traverse(path);12 }13});14const a = 1;15const b = 2;16const c = 3;

Full Screen

Using AI Code Generation

copy

Full Screen

1import React from 'react';2import { visit } from 'unexpected-react';3import { render } from 'react-dom';4import { expect } from 'unexpected';5import { createRenderer } from 'react-addons-test-utils';6import { create } from 'react-test-renderer';7import { shallow } from 'enzyme';8import { mount } from 'enzyme';9import { configure } from 'enzyme';10import Adapter from 'enzyme-adapter-react-16';11import { render as reactRender } from 'react-dom';12import { render as reactRenderToString } from 'react-dom/server';13configure({ adapter: new Adapter() });14const App = () => (15);16const renderWith = (renderer, callback) => {17 const container = document.createElement('div');18 renderer(<App />, container);19 callback(container);20};21const renderWithReactDom = callback => {22 renderWith(reactRender, callback);23};24const renderWithReactDomServer = callback => {25 renderWith(reactRenderToString, callback);26};27const renderWithEnzymeMount = callback => {28 renderWith(mount, callback);29};30const renderWithEnzymeShallow = callback => {31 renderWith(shallow, callback);32};33const renderWithReactTestRenderer = callback => {34 renderWith(create, callback);35};36const renderWithReactTestRendererCreateRenderer = callback => {37 renderWith(createRenderer, callback);38};39const renderWithUnexpectedReact = callback => {40 const renderer = createRenderer();41 renderer.render(<App />);42 callback(renderer.getRenderOutput());43};44describe('render', () => {45 it('renders with react-dom', () => {46 renderWithReactDom(container => {47 expect(container, 'to have rendered', <App />);48 });49 });50 it('renders with react-dom/server', () => {51 renderWithReactDomServer(container => {52 expect(container, 'to have rendered', <App />);53 });54 });55 it('renders with enzyme mount', () => {56 renderWithEnzymeMount(container => {57 expect(container, 'to have rendered', <App />);58 });59 });60 it('renders with enzyme shallow', () => {61 renderWithEnzymeShallow(container => {62 expect(container, 'to have rendered', <App />);63 });64 });65 it('

Full Screen

Using AI Code Generation

copy

Full Screen

1import React from 'react';2import { visit } from 'unexpected-react';3import { expect } from 'unexpected';4import HelloWorld from '../src/components/HelloWorld';5describe('HelloWorld', () => {6 it('should render a div with a class of "hello-world"', () => {7 return visit(<HelloWorld />, (component) => {8 expect(component, 'to have rendered', <div className="hello-world" />);9 });10 });11});

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run unexpected automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful