@imedx/ics-imedx-chromely-plugin-index-examine
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -1,200 +0,337 @@ | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. All rights reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use | ||
this file except in compliance with the License. You may obtain a copy of the | ||
License at http://www.apache.org/licenses/LICENSE-2.0 | ||
import icsChromelyRequest from '@icreate/ics-chromely-js-sdk'; | ||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED | ||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, | ||
MERCHANTABLITY OR NON-INFRINGEMENT. | ||
var IndexExamine = /** @class */ (function () { | ||
function IndexExamine() { | ||
} | ||
IndexExamine.OperateEx = function (url, data) { | ||
// let opts = | ||
return icsChromelyRequest.function({ | ||
url: "LocalIndex/" + url, | ||
method: 'GET', | ||
data: data | ||
}); | ||
}; | ||
IndexExamine.use = function (_a) { | ||
var request = _a.request; | ||
this.Request = request; | ||
}; | ||
// public static isChromely = icsChromelyRequest.isChromely | ||
/** | ||
* | ||
* @param indexId: 索引id | ||
* @param category:分类 | ||
* @param keys:关键字 | ||
* @returns 成功:{code: 200, data, message: 'ok'} | ||
*/ | ||
IndexExamine.query = function (indexId, category, keys) { | ||
return this.OperateEx('Query', { indexId: indexId, category: category, keys: keys }); | ||
}; | ||
/** | ||
* | ||
* @param indexId: 索引id | ||
* @param category:分类 | ||
* @param keys:关键字 | ||
* @param like:模糊匹配字段 | ||
* @param exact:精确匹配字段和值 | ||
* @returns 成功:{code: 200, data, message: 'ok'} | ||
*/ | ||
IndexExamine.queryByServer = function (indexId, category, keys, like, exact) { | ||
return this.Request({ | ||
url: 'system/index/query', | ||
method: 'post', | ||
data: { | ||
index: indexId, | ||
category: category, | ||
keys: keys, | ||
like: like, | ||
exact: exact | ||
} | ||
}).then(function (res) { | ||
return Promise.resolve(res.data); | ||
}); | ||
}; | ||
/** | ||
* | ||
* @param indexId: 索引id | ||
* @param pageIndex:page索引 | ||
* @param pageSize:page尺寸 | ||
* @param category:分类 | ||
* @param keys:关键字 | ||
* @returns 成功:{code: 200, data, message: 'ok'} | ||
*/ | ||
IndexExamine.page = function (indexId, pageIndex, pageSize, category, keys) { | ||
return this.OperateEx('Page', { | ||
indexId: indexId, | ||
pageIndex: pageIndex, | ||
pageSize: pageSize, | ||
category: category, | ||
keys: keys | ||
}); | ||
}; | ||
/** | ||
* | ||
* @param indexId: 索引id | ||
* @param pageIndex:page索引 | ||
* @param pageSize:page尺寸 | ||
* @param category:分类 | ||
* @param keys:关键字 | ||
* @param like:模糊匹配字段 | ||
* @param exact:精确匹配字段和值 | ||
* @returns 成功:{code: 200, data, message: 'ok'} | ||
*/ | ||
IndexExamine.pageByServer = function (indexId, pageIndex, pageSize, category, keys, like, exact) { | ||
return this.Request({ | ||
url: 'system/index/page', | ||
method: 'post', | ||
data: { | ||
index: indexId, | ||
pageIndex: pageIndex, | ||
pageSize: pageSize, | ||
category: category, | ||
keys: keys, | ||
like: like, | ||
exact: exact | ||
} | ||
}).then(function (res) { | ||
return Promise.resolve(res.data); | ||
}); | ||
}; | ||
return IndexExamine; | ||
}()); | ||
See the Apache Version 2.0 License for specific language governing permissions | ||
and limitations under the License. | ||
***************************************************************************** */ | ||
/** | ||
* 将特殊字符进行转义 | ||
* @param keys 关键字 | ||
* @returns | ||
*/ | ||
function escapeSpecialCharacters(keys) { | ||
var escapedQuery = keys.replace(/([+\-!():{}\[\]^"~*?\\])/g, '\\$1'); | ||
return escapedQuery; | ||
} | ||
var __assign = function() { | ||
__assign = Object.assign || function __assign(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; | ||
/* | ||
* @Author: 陶慧灵 | ||
* @Date: 2022-10-21 09:20:20 | ||
* @LastEditors: wenbei421 346972930@qq.com | ||
* @LastEditTime: 2022-10-25 15:08:19 | ||
* @Descripttion: | ||
* @FilePath: \src\index-examine.ts | ||
*/ | ||
var DictIndex = /** @class */ (function () { | ||
function DictIndex() { | ||
} | ||
/** | ||
* | ||
* @param category:分类,例如DICT_SEX、DICT_NATION | ||
* @param keys:关键字 | ||
* @returns 成功返回结果 | ||
*/ | ||
DictIndex.query = function (category, keys) { | ||
if (keys === void 0) { keys = ''; } | ||
if (icsChromelyRequest.isChromely) { | ||
return IndexExamine.query('DictionaryIndex', category, escapeSpecialCharacters(keys)); | ||
} | ||
return t; | ||
else { | ||
return IndexExamine.queryByServer('DictionaryIndex', category, keys, this.like, this.exact); | ||
} | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
/** | ||
* 分页查询索引 | ||
* @param indexId: 索引id | ||
* @param pageIndex:page索引 | ||
* @param pageSize:page尺寸 | ||
* @param category:分类,例如DICT_SEX、DICT_NATION | ||
* @param keys:关键字 | ||
* @returns 成功返回结果 | ||
*/ | ||
DictIndex.page = function (pageIndex, pageSize, category, keys) { | ||
if (keys === void 0) { keys = ''; } | ||
if (icsChromelyRequest.isChromely) { | ||
return IndexExamine.page('DictionaryIndex', pageIndex, pageSize, category, escapeSpecialCharacters(keys)); | ||
} | ||
else { | ||
return IndexExamine.pageByServer('DictionaryIndex', pageIndex, pageSize, category, keys, this.like, this.exact); | ||
} | ||
}; | ||
DictIndex.like = ['ID', 'NAME', 'SPELL_CODE', 'STROKE_CODE']; | ||
DictIndex.exact = {}; | ||
return DictIndex; | ||
}()); | ||
function __awaiter(thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
} | ||
function __generator(thisArg, body) { | ||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
function verb(n) { return function (v) { return step([n, v]); }; } | ||
function step(op) { | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
if (y = 0, t) op = [op[0] & 2, t.value]; | ||
switch (op[0]) { | ||
case 0: case 1: t = op; break; | ||
case 4: _.label++; return { value: op[1], done: false }; | ||
case 5: _.label++; y = op[1]; op = [0]; continue; | ||
case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
default: | ||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
if (t[2]) _.ops.pop(); | ||
_.trys.pop(); continue; | ||
} | ||
op = body.call(thisArg, _); | ||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
var Icd10Index = /** @class */ (function () { | ||
function Icd10Index() { | ||
} | ||
} | ||
/** | ||
* 查询icd10诊断 | ||
* @param keys:关键字 | ||
* @param category 诊断类别 11:疾病诊断 12:损伤中毒原因 13:肿瘤形态学(对应病案首页病理诊断) | ||
* @returns 成功返回结果 | ||
*/ | ||
Icd10Index.query = function (category, keys) { | ||
if (keys === void 0) { keys = ''; } | ||
if (icsChromelyRequest.isChromely) { | ||
return IndexExamine.query('Icd10Index', category, this.QueryCondition(category, escapeSpecialCharacters(keys))); | ||
} | ||
else { | ||
return IndexExamine.queryByServer('Icd10Index', category, keys, this.like, {}); | ||
} | ||
}; | ||
/** | ||
* 分页查询索引 | ||
* @param indexId: 索引id | ||
* @param pageIndex:page索引 | ||
* @param pageSize:page尺寸 | ||
* @param category 诊断类别 11:疾病诊断 12:损伤中毒原因 13:肿瘤形态学(对应病案首页病理诊断) | ||
* @param keys:关键字 | ||
* @returns 成功返回结果 | ||
*/ | ||
Icd10Index.page = function (pageIndex, pageSize, category, keys) { | ||
if (keys === void 0) { keys = ''; } | ||
if (icsChromelyRequest.isChromely) { | ||
return IndexExamine.page('Icd10Index', pageIndex, pageSize, category, this.QueryCondition(category, escapeSpecialCharacters(keys))); | ||
} | ||
else { | ||
return IndexExamine.pageByServer('Icd10Index', pageIndex, pageSize, category, keys, this.like, {}); | ||
} | ||
}; | ||
/** | ||
* 查询条件组装 | ||
* @param keys | ||
* @returns | ||
*/ | ||
Icd10Index.QueryCondition = function (category, keys) { | ||
return "(id:*" + keys + "* OR name:\"*" + keys + "*\" OR spellCode:*" + keys + "* OR strokeCode:*" + keys + "*)"; | ||
}; | ||
Icd10Index.like = ['ID', 'NAME', 'SPELL_CODE', 'STROKE_CODE']; | ||
return Icd10Index; | ||
}()); | ||
var InterceptorManage = /** @class */ (function () { | ||
function InterceptorManage() { | ||
// 拦截器 | ||
this.interceptors = []; | ||
/* | ||
* @Author: 陶慧灵 | ||
* @Date: 2022-10-21 09:20:20 | ||
* @LastEditors: wenbei421 346972930@qq.com | ||
* @LastEditTime: 2022-10-28 13:04:22 | ||
* @Descripttion: | ||
* @FilePath: \src\index-examine.ts | ||
*/ | ||
var IcdTcmIndex = /** @class */ (function () { | ||
function IcdTcmIndex() { | ||
} | ||
InterceptorManage.prototype.use = function (resolved, rejected) { | ||
this.interceptors.push({ | ||
resolved: resolved, | ||
rejected: rejected | ||
}); | ||
return this.interceptors.length - 1; | ||
/** | ||
* | ||
* @param category:分类,例如DICT_SEX、DICT_NATION | ||
* @param keys:关键字 | ||
* @returns 成功返回结果 | ||
*/ | ||
IcdTcmIndex.query = function (category, keys) { | ||
if (keys === void 0) { keys = ''; } | ||
if (icsChromelyRequest.isChromely) { | ||
return IndexExamine.query('IcdTcmIndex', category, escapeSpecialCharacters(keys)); | ||
} | ||
else { | ||
return IndexExamine.queryByServer('IcdTcmIndex', category, keys, this.like, {}); | ||
} | ||
}; | ||
InterceptorManage.prototype.eject = function (id) { | ||
if (this.interceptors[id]) { | ||
this.interceptors[id] = null; | ||
/** | ||
* 分页查询索引 | ||
* @param indexId: 索引id | ||
* @param pageIndex:page索引 | ||
* @param pageSize:page尺寸 | ||
* @param category:分类,例如DICT_SEX、DICT_NATION | ||
* @param keys:关键字 | ||
* @returns 成功返回结果 | ||
*/ | ||
IcdTcmIndex.page = function (pageIndex, pageSize, category, keys) { | ||
if (keys === void 0) { keys = ''; } | ||
if (icsChromelyRequest.isChromely) { | ||
return IndexExamine.page('IcdTcmIndex', pageIndex, pageSize, category, escapeSpecialCharacters(keys)); | ||
} | ||
else { | ||
return IndexExamine.pageByServer('IcdTcmIndex', pageIndex, pageSize, category, keys, this.like, {}); | ||
} | ||
}; | ||
return InterceptorManage; | ||
IcdTcmIndex.like = ['ID', 'NAME', 'SPELL_CODE', 'STROKE_CODE']; | ||
return IcdTcmIndex; | ||
}()); | ||
var IcsChromelyClient = /** @class */ (function () { | ||
function IcsChromelyClient(_a) { | ||
var _this = this; | ||
var _b = _a === void 0 ? {} : _a, _c = _b.headers, headers = _c === void 0 ? {} : _c, fetch = _b.fetch; | ||
this._baseCommandUrl = 'http://command.com/'; | ||
this._baseAjaxUrl = 'http://icreate.com/'; | ||
this.headers = __assign({}, headers); | ||
this.fetch = fetch || window.fetch.bind(window); | ||
this.interceptors = { | ||
request: new InterceptorManage(), | ||
response: new InterceptorManage() | ||
}; | ||
this.interceptors.response.use(function (response) { | ||
var _a; | ||
// console.log(response) | ||
if (response.code === 200) { | ||
return Promise.resolve(response.data); | ||
} | ||
else { | ||
(_a = _this.errorFn) === null || _a === void 0 ? void 0 : _a.call(_this, response); | ||
return Promise.reject(response); | ||
} | ||
}); | ||
/* | ||
* @Author: 陶慧灵 | ||
* @Date: 2022-10-21 09:20:20 | ||
* @LastEditors: wenbei421 346972930@qq.com | ||
* @LastEditTime: 2022-11-17 14:46:33 | ||
* @Descripttion: | ||
* @FilePath: \src\sys-area-index-examine.ts | ||
*/ | ||
var SysAreaIndex = /** @class */ (function () { | ||
function SysAreaIndex() { | ||
} | ||
IcsChromelyClient.prototype.errorFn = function (response) { }; | ||
IcsChromelyClient.prototype.command = function (opts) { | ||
var link = document.createElement('a'); | ||
var params = []; | ||
for (var key in opts.data) { | ||
params.push(key + '=' + opts.data[key]); | ||
/** | ||
* 查询行政区划 | ||
* @param category:分类,父行政区划编码 | ||
* @param keys:关键字 | ||
* @param rank:行政级别1~5,默认5 | ||
* @returns 成功返回结果 | ||
*/ | ||
SysAreaIndex.query = function (category, keys, rank) { | ||
if (keys === void 0) { keys = ''; } | ||
if (rank === void 0) { rank = 5; } | ||
if (icsChromelyRequest.isChromely) { | ||
return IndexExamine.query('SysAreaIndex', '', this.QueryCondition(escapeSpecialCharacters(keys), rank, category)); | ||
} | ||
link.href = "" + this._baseCommandUrl + opts.url + (params.length > 0 ? "?" + params.join('&') : ''); | ||
document.body.appendChild(link); | ||
link.click(); | ||
document.body.removeChild(link); | ||
else { | ||
return IndexExamine.queryByServer('SysAreaIndex', '', keys, this.like, { | ||
PID: category, | ||
RANK: rank //范围查询 3 => <= 3 | ||
}); | ||
} | ||
}; | ||
IcsChromelyClient.prototype.function = function (opts) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var chain, promise, _a, resolved, rejected; | ||
var _this = this; | ||
return __generator(this, function (_b) { | ||
this.headers['Content-Type'] = this.headers['Content-Type'] || 'application/json'; | ||
chain = [ | ||
{ | ||
resolved: function (config) { | ||
var _a, _b; | ||
var options = __assign(__assign({}, opts), config); | ||
if (((_a = opts === null || opts === void 0 ? void 0 : opts.method) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === 'GET' || ((_b = opts === null || opts === void 0 ? void 0 : opts.method) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === 'HEAD') { | ||
var params = []; | ||
for (var key in opts.data) { | ||
params.push(key + '=' + opts.data[key]); | ||
} | ||
opts.url = opts.url + (params.length > 0 ? "?" + params.join('&') : ''); | ||
} | ||
else { | ||
options.body = JSON.stringify(opts.data); | ||
// options = { ...options, body: JSON.stringify(opts.data) } | ||
} | ||
var res = config | ||
.fetch("" + config._baseAjaxUrl + opts.url, options) | ||
.then(function (res) { return __awaiter(_this, void 0, void 0, function () { | ||
var data, _a, _b, error, body; | ||
return __generator(this, function (_c) { | ||
switch (_c.label) { | ||
case 0: | ||
if (!res.ok) return [3 /*break*/, 2]; | ||
_b = (_a = JSON).parse; | ||
return [4 /*yield*/, res.text()]; | ||
case 1: | ||
data = _b.apply(_a, [_c.sent()]); | ||
return [2 /*return*/, data]; | ||
case 2: | ||
error = null; | ||
return [4 /*yield*/, res.text()]; | ||
case 3: | ||
body = _c.sent(); | ||
try { | ||
error = JSON.parse(body); | ||
} | ||
catch (_d) { | ||
error = { | ||
message: body | ||
}; | ||
} | ||
return [2 /*return*/, Promise.reject(error)]; | ||
} | ||
}); | ||
}); }); | ||
return res; | ||
}, | ||
rejected: undefined | ||
} | ||
]; | ||
// 拦截器加入执行链 | ||
this.interceptors.request.interceptors.forEach(function (interceptor) { | ||
if (interceptor !== null) { | ||
chain.unshift(interceptor); | ||
} | ||
}); | ||
this.interceptors.response.interceptors.forEach(function (interceptor) { | ||
if (interceptor !== null) { | ||
chain.push(interceptor); | ||
} | ||
}); | ||
promise = Promise.resolve(__assign({}, this)); | ||
while (chain.length) { | ||
_a = chain.shift(), resolved = _a.resolved, rejected = _a.rejected; | ||
promise = promise.then(resolved, rejected); | ||
} | ||
return [2 /*return*/, promise]; | ||
/** | ||
* 分页查询行政区划 | ||
* @param indexId: 索引id | ||
* @param pageIndex:page索引 | ||
* @param pageSize:page尺寸 | ||
* @param category:分类,父行政区划编码 | ||
* @param keys:关键字 | ||
* @param rank:行政级别1~5,默认5 | ||
* @returns 成功返回结果 | ||
*/ | ||
SysAreaIndex.page = function (pageIndex, pageSize, category, keys, rank) { | ||
if (keys === void 0) { keys = ''; } | ||
if (rank === void 0) { rank = 5; } | ||
if (icsChromelyRequest.isChromely) { | ||
return IndexExamine.page('SysAreaIndex', pageIndex, pageSize, '', this.QueryCondition(escapeSpecialCharacters(keys), rank, category)); | ||
} | ||
else { | ||
return IndexExamine.pageByServer('SysAreaIndex', pageIndex, pageSize, '', keys, this.like, { | ||
PID: category, | ||
RANK: rank //范围查询 3 => <= 3 | ||
}); | ||
}); | ||
} | ||
}; | ||
return IcsChromelyClient; | ||
/** | ||
* 查询条件组装 | ||
* @param keys | ||
* name:*安* spellCode:*安* strokeCode:*安* | ||
* http://icreate.com/LocalIndex/Page?indexId=SysAreaIndex&pageIndex=0&pageSize=10&category=&keys=name:*安* spellCode:*安* strokeCode:*安* | ||
* http://icreate.com/LocalIndex/Page?indexId=SysAreaIndex&pageIndex=0&pageSize=10&category=&keys=name:*安* spellCode:*安* strokeCode:*安* +rank:[1 TO 3] | ||
* http://icreate.com/LocalIndex/Page?indexId=SysAreaIndex&pageIndex=0&pageSize=10&category=34*&keys=name:*安* spellCode:*安* strokeCode:*安* +rank:[1 TO 3] | ||
* @returns | ||
*/ | ||
SysAreaIndex.QueryCondition = function (keys, rank, category) { | ||
// (name:"*安徽*" OR fullSpellCode:"*安徽*") AND pid:34* AND rank:[1 TO 3] | ||
var condition = []; | ||
if (keys.trim()) { | ||
condition.push("(fullName:\"*" + keys + "*\" OR fullSpellCode:*" + keys + "* OR fullStrokeCode:*" + keys + "*)"); | ||
} | ||
if (category.trim()) { | ||
condition.push("pid:" + category); | ||
} | ||
if (rank !== 5) { | ||
condition.push("rank:[1 TO " + rank + "]"); | ||
} | ||
return condition.join(' AND '); | ||
}; | ||
SysAreaIndex.like = ['FULL_NAME', 'FULL_SPELL_CODE', 'FULL_STROKE_CODE']; | ||
return SysAreaIndex; | ||
}()); | ||
var icsChromelyRequest = new IcsChromelyClient(); | ||
@@ -204,53 +341,218 @@ /* | ||
* @Date: 2022-10-21 09:20:20 | ||
* @LastEditors: 陶慧灵 | ||
* @LastEditTime: 2022-10-21 11:19:49 | ||
* @LastEditors: wenbei421 346972930@qq.com | ||
* @LastEditTime: 2022-10-25 15:08:15 | ||
* @Descripttion: | ||
* @FilePath: \src\index-examine.ts | ||
*/ | ||
var IndexExamine = /** @class */ (function () { | ||
function IndexExamine() { | ||
var Icd9cm3Index = /** @class */ (function () { | ||
function Icd9cm3Index() { | ||
} | ||
IndexExamine.OperateEx = function (url, data) { | ||
// let opts = | ||
return icsChromelyRequest.function({ | ||
url: "LocalIndex/" + url, | ||
method: 'GET', | ||
data: data | ||
}); | ||
/** | ||
* 查询icd10诊断 | ||
* @param category 诊断类别 1:治疗性操作 2:诊断性操作 3:手术 不传则查全部 | ||
* @param keys:关键字 | ||
* @param tcmOperation 中医操作 true:是 false:否 | ||
* @returns 成功返回结果 | ||
*/ | ||
Icd9cm3Index.query = function (category, keys, tcmOperation) { | ||
if (keys === void 0) { keys = ''; } | ||
if (tcmOperation === void 0) { tcmOperation = false; } | ||
if (icsChromelyRequest.isChromely) { | ||
return IndexExamine.query('Icd9cm3Index', category, this.QueryCondition(category, escapeSpecialCharacters(keys), tcmOperation)); | ||
} | ||
else { | ||
return IndexExamine.queryByServer('Icd9cm3Index', category, keys, this.like, { | ||
TCM_OPERATION_FLAG: tcmOperation ? 1 : 0 | ||
}); | ||
} | ||
}; | ||
/** | ||
* | ||
* 分页查询索引 | ||
* @param indexId: 索引id | ||
* @param categroy:分类 | ||
* @param pageIndex:page索引 | ||
* @param pageSize:page尺寸 | ||
* @param category 诊断类别 1:治疗性操作 2:诊断性操作;3:手术 | ||
* @param keys:关键字 | ||
* @returns 成功:{code: 200, data, message: 'ok'} | ||
* @param tcmOperation 中医操作 true:是 false:否 | ||
* @returns 成功返回结果 | ||
*/ | ||
IndexExamine.query = function (indexId, categroy, keys) { | ||
return this.OperateEx('Query', { indexId: indexId, categroy: categroy, keys: keys }); | ||
Icd9cm3Index.page = function (pageIndex, pageSize, category, keys, tcmOperation) { | ||
if (keys === void 0) { keys = ''; } | ||
if (tcmOperation === void 0) { tcmOperation = false; } | ||
if (icsChromelyRequest.isChromely) { | ||
return IndexExamine.page('Icd9cm3Index', pageIndex, pageSize, category, this.QueryCondition(category, escapeSpecialCharacters(keys), tcmOperation)); | ||
} | ||
else { | ||
return IndexExamine.pageByServer('Icd9cm3Index', pageIndex, pageSize, category, keys, this.like, { | ||
TCM_OPERATION_FLAG: tcmOperation ? 1 : 0 | ||
}); | ||
} | ||
}; | ||
/** | ||
* | ||
* 查询条件组装 | ||
* @param keys | ||
* @returns | ||
*/ | ||
Icd9cm3Index.QueryCondition = function (category, keys, tcmOperation) { | ||
var conditions = []; | ||
if (keys.trim()) { | ||
conditions.push("(id:\"*" + keys + "*\" OR name:\"*" + keys + "*\" OR spellCode:*" + keys + "* OR strokeCode:*" + keys + "*)"); | ||
} | ||
if (tcmOperation) { | ||
conditions.push("tcmOperationFlag:1"); | ||
} | ||
else { | ||
conditions.push("tcmOperationFlag:0"); | ||
} | ||
return conditions.join(' AND '); | ||
}; | ||
Icd9cm3Index.like = ['ID', 'NAME', 'SPELL_CODE', 'STROKE_CODE']; | ||
return Icd9cm3Index; | ||
}()); | ||
var DictDrugBaseIndex = /** @class */ (function () { | ||
function DictDrugBaseIndex() { | ||
} | ||
/** | ||
* 查询药品基础目录 | ||
* @param category:分类,药品分类 | ||
* @param keys:关键字 | ||
* @returns 成功返回结果 | ||
*/ | ||
DictDrugBaseIndex.query = function (category, keys) { | ||
if (keys === void 0) { keys = ''; } | ||
if (icsChromelyRequest.isChromely) { | ||
return IndexExamine.query('DictDrugBaseIndex', '', this.QueryCondition(escapeSpecialCharacters(keys), category)); | ||
} | ||
else { | ||
return IndexExamine.queryByServer('DictDrugBaseIndex', category, keys, this.like, this.exact); | ||
} | ||
}; | ||
/** | ||
* 分页查询药品基础目录 | ||
* @param indexId: 索引id | ||
* @param pageIndex:page索引 | ||
* @param pageSize:page尺寸 | ||
* @param categroy:分类 | ||
* @param category:分类,药品分类 | ||
* @param keys:关键字 | ||
* @returns 成功:{code: 200, data, message: 'ok'} | ||
* @returns 成功返回结果 | ||
*/ | ||
IndexExamine.page = function (indexId, pageIndex, pageSize, categroy, keys) { | ||
return this.OperateEx('Page', { indexId: indexId, pageIndex: pageIndex, pageSize: pageSize, categroy: categroy, keys: keys }); | ||
DictDrugBaseIndex.page = function (pageIndex, pageSize, category, keys) { | ||
if (keys === void 0) { keys = ''; } | ||
if (icsChromelyRequest.isChromely) { | ||
return IndexExamine.page('DictDrugBaseIndex', pageIndex, pageSize, '', this.QueryCondition(escapeSpecialCharacters(keys), category)); | ||
} | ||
else { | ||
return IndexExamine.pageByServer('DictDrugBaseIndex', pageIndex, pageSize, category, keys, this.like, this.exact); | ||
} | ||
}; | ||
return IndexExamine; | ||
/** | ||
* 查询条件组装 | ||
* @param keys | ||
* @param category | ||
* @returns | ||
*/ | ||
DictDrugBaseIndex.QueryCondition = function (keys, category) { | ||
var condition = []; | ||
if (keys.trim()) { | ||
condition.push("(id:*" + keys + "* OR name:\"*" + keys + "*\" OR alias:\"*" + keys + "*\" OR spellCode:*" + keys + "* OR strokeCode:*" + keys + "*)"); | ||
} | ||
if (category.trim()) { | ||
condition.push("category:" + category); | ||
} | ||
return condition.join(' AND '); | ||
}; | ||
DictDrugBaseIndex.like = ['ID', 'NAME', 'ALIAS', 'SPELL_CODE', 'STROKE_CODE']; | ||
DictDrugBaseIndex.exact = {}; | ||
return DictDrugBaseIndex; | ||
}()); | ||
var DictDrugPharmacologyIndex = /** @class */ (function () { | ||
function DictDrugPharmacologyIndex() { | ||
} | ||
/** | ||
* 查询药理分类 | ||
* @param parentId,父ID | ||
* @param skinTestCategory 皮试分类 | ||
* @param keys:关键字 | ||
* @returns 成功返回结果 | ||
*/ | ||
DictDrugPharmacologyIndex.query = function (parentId, skinTestCategory, keys) { | ||
if (keys === void 0) { keys = ''; } | ||
if (icsChromelyRequest.isChromely) { | ||
return IndexExamine.query('DictDrugPharmacologyIndex', '', this.QueryCondition(escapeSpecialCharacters(keys), skinTestCategory, parentId)); | ||
} | ||
else { | ||
return IndexExamine.queryByServer('DictDrugPharmacologyIndex', '', keys, this.like, { | ||
PARENT_ID: parentId, | ||
SKIN_TEST_CATEGORY: skinTestCategory | ||
}); | ||
} | ||
}; | ||
/** | ||
* 分页查询药品基础目录 | ||
* @param indexId: 索引id | ||
* @param pageIndex:page索引 | ||
* @param pageSize:page尺寸 | ||
* @param parentId,父ID | ||
* @param skinTestCategory 皮试分类 | ||
* @param keys:关键字 | ||
* @returns 成功返回结果 | ||
*/ | ||
DictDrugPharmacologyIndex.page = function (pageIndex, pageSize, parentId, skinTestCategory, keys) { | ||
if (keys === void 0) { keys = ''; } | ||
if (icsChromelyRequest.isChromely) { | ||
return IndexExamine.page('DictDrugPharmacologyIndex', pageIndex, pageSize, '', this.QueryCondition(escapeSpecialCharacters(keys), skinTestCategory, parentId)); | ||
} | ||
else { | ||
return IndexExamine.pageByServer('DictDrugPharmacologyIndex', pageIndex, pageSize, '', keys, this.like, { | ||
PARENT_ID: parentId, | ||
SKIN_TEST_CATEGORY: skinTestCategory | ||
}); | ||
} | ||
}; | ||
/** | ||
* 查询条件组装 | ||
* @param keys | ||
* @param category | ||
* @returns | ||
*/ | ||
DictDrugPharmacologyIndex.QueryCondition = function (keys, skinTestCategory, parentId) { | ||
var condition = []; | ||
if (keys.trim()) { | ||
condition.push("(id:*" + keys + "* OR name:\"*" + keys + "*\" OR spellCode:*" + keys + "* OR strokeCode:*" + keys + "*)"); | ||
} | ||
if (skinTestCategory.trim()) { | ||
condition.push("skinTestCategory:" + skinTestCategory); | ||
} | ||
if (parentId.trim()) { | ||
condition.push("parentId:" + parentId); | ||
} | ||
return condition.join(' AND '); | ||
}; | ||
DictDrugPharmacologyIndex.like = ['ID', 'NAME', 'SPELL_CODE', 'STROKE_CODE']; | ||
return DictDrugPharmacologyIndex; | ||
}()); | ||
/* | ||
* @Author: 陶慧灵 | ||
* @Date: 2022-10-21 09:01:18 | ||
* @LastEditors: 陶慧灵 | ||
* @LastEditTime: 2022-10-21 10:36:19 | ||
* @LastEditors: wenbei421 346972930@qq.com | ||
* @LastEditTime: 2022-11-17 14:48:32 | ||
* @Descripttion: | ||
* @FilePath: \src\ics-imedx-chromely-plugin-index-examine.ts | ||
*/ | ||
var icsImedxChromelyPluginIndexExamine = { | ||
IndexExamine: IndexExamine, | ||
DictIndex: DictIndex, | ||
Icd10Index: Icd10Index, | ||
IcdTcmIndex: IcdTcmIndex, | ||
SysAreaIndex: SysAreaIndex, | ||
Icd9cm3Index: Icd9cm3Index, | ||
DictDrugBaseIndex: DictDrugBaseIndex, | ||
DictDrugPharmacologyIndex: DictDrugPharmacologyIndex | ||
}; | ||
// export { IndexExamine, DictIndex, Icd10Index, IcdTcmIndex, SysAreaIndex, Icd9cm3Index, DictDrugBaseIndex , DictDrugPharmacologyIndex} | ||
export default IndexExamine; | ||
export default icsImedxChromelyPluginIndexExamine; | ||
//# sourceMappingURL=ics-imedx-chromely-plugin-index-examine.es5.js.map |
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : | ||
typeof define === 'function' && define.amd ? define(factory) : | ||
(global.icsImedxChromelyPluginIndexExamine = factory()); | ||
}(this, (function () { 'use strict'; | ||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@icreate/ics-chromely-js-sdk')) : | ||
typeof define === 'function' && define.amd ? define(['@icreate/ics-chromely-js-sdk'], factory) : | ||
(global.icsImedxChromelyPluginIndexExamine = factory(global.icsChromelyRequest)); | ||
}(this, (function (icsChromelyRequest) { 'use strict'; | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. All rights reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use | ||
this file except in compliance with the License. You may obtain a copy of the | ||
License at http://www.apache.org/licenses/LICENSE-2.0 | ||
icsChromelyRequest = icsChromelyRequest && icsChromelyRequest.hasOwnProperty('default') ? icsChromelyRequest['default'] : icsChromelyRequest; | ||
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED | ||
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, | ||
MERCHANTABLITY OR NON-INFRINGEMENT. | ||
var IndexExamine = /** @class */ (function () { | ||
function IndexExamine() { | ||
} | ||
IndexExamine.OperateEx = function (url, data) { | ||
// let opts = | ||
return icsChromelyRequest.function({ | ||
url: "LocalIndex/" + url, | ||
method: 'GET', | ||
data: data | ||
}); | ||
}; | ||
IndexExamine.use = function (_a) { | ||
var request = _a.request; | ||
this.Request = request; | ||
}; | ||
// public static isChromely = icsChromelyRequest.isChromely | ||
/** | ||
* | ||
* @param indexId: 索引id | ||
* @param category:分类 | ||
* @param keys:关键字 | ||
* @returns 成功:{code: 200, data, message: 'ok'} | ||
*/ | ||
IndexExamine.query = function (indexId, category, keys) { | ||
return this.OperateEx('Query', { indexId: indexId, category: category, keys: keys }); | ||
}; | ||
/** | ||
* | ||
* @param indexId: 索引id | ||
* @param category:分类 | ||
* @param keys:关键字 | ||
* @param like:模糊匹配字段 | ||
* @param exact:精确匹配字段和值 | ||
* @returns 成功:{code: 200, data, message: 'ok'} | ||
*/ | ||
IndexExamine.queryByServer = function (indexId, category, keys, like, exact) { | ||
return this.Request({ | ||
url: 'system/index/query', | ||
method: 'post', | ||
data: { | ||
index: indexId, | ||
category: category, | ||
keys: keys, | ||
like: like, | ||
exact: exact | ||
} | ||
}).then(function (res) { | ||
return Promise.resolve(res.data); | ||
}); | ||
}; | ||
/** | ||
* | ||
* @param indexId: 索引id | ||
* @param pageIndex:page索引 | ||
* @param pageSize:page尺寸 | ||
* @param category:分类 | ||
* @param keys:关键字 | ||
* @returns 成功:{code: 200, data, message: 'ok'} | ||
*/ | ||
IndexExamine.page = function (indexId, pageIndex, pageSize, category, keys) { | ||
return this.OperateEx('Page', { | ||
indexId: indexId, | ||
pageIndex: pageIndex, | ||
pageSize: pageSize, | ||
category: category, | ||
keys: keys | ||
}); | ||
}; | ||
/** | ||
* | ||
* @param indexId: 索引id | ||
* @param pageIndex:page索引 | ||
* @param pageSize:page尺寸 | ||
* @param category:分类 | ||
* @param keys:关键字 | ||
* @param like:模糊匹配字段 | ||
* @param exact:精确匹配字段和值 | ||
* @returns 成功:{code: 200, data, message: 'ok'} | ||
*/ | ||
IndexExamine.pageByServer = function (indexId, pageIndex, pageSize, category, keys, like, exact) { | ||
return this.Request({ | ||
url: 'system/index/page', | ||
method: 'post', | ||
data: { | ||
index: indexId, | ||
pageIndex: pageIndex, | ||
pageSize: pageSize, | ||
category: category, | ||
keys: keys, | ||
like: like, | ||
exact: exact | ||
} | ||
}).then(function (res) { | ||
return Promise.resolve(res.data); | ||
}); | ||
}; | ||
return IndexExamine; | ||
}()); | ||
See the Apache Version 2.0 License for specific language governing permissions | ||
and limitations under the License. | ||
***************************************************************************** */ | ||
/** | ||
* 将特殊字符进行转义 | ||
* @param keys 关键字 | ||
* @returns | ||
*/ | ||
function escapeSpecialCharacters(keys) { | ||
var escapedQuery = keys.replace(/([+\-!():{}\[\]^"~*?\\])/g, '\\$1'); | ||
return escapedQuery; | ||
} | ||
var __assign = function() { | ||
__assign = Object.assign || function __assign(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
/* | ||
* @Author: 陶慧灵 | ||
* @Date: 2022-10-21 09:20:20 | ||
* @LastEditors: wenbei421 346972930@qq.com | ||
* @LastEditTime: 2022-10-25 15:08:19 | ||
* @Descripttion: | ||
* @FilePath: \src\index-examine.ts | ||
*/ | ||
var DictIndex = /** @class */ (function () { | ||
function DictIndex() { | ||
} | ||
/** | ||
* | ||
* @param category:分类,例如DICT_SEX、DICT_NATION | ||
* @param keys:关键字 | ||
* @returns 成功返回结果 | ||
*/ | ||
DictIndex.query = function (category, keys) { | ||
if (keys === void 0) { keys = ''; } | ||
if (icsChromelyRequest.isChromely) { | ||
return IndexExamine.query('DictionaryIndex', category, escapeSpecialCharacters(keys)); | ||
} | ||
else { | ||
return IndexExamine.queryByServer('DictionaryIndex', category, keys, this.like, this.exact); | ||
} | ||
}; | ||
/** | ||
* 分页查询索引 | ||
* @param indexId: 索引id | ||
* @param pageIndex:page索引 | ||
* @param pageSize:page尺寸 | ||
* @param category:分类,例如DICT_SEX、DICT_NATION | ||
* @param keys:关键字 | ||
* @returns 成功返回结果 | ||
*/ | ||
DictIndex.page = function (pageIndex, pageSize, category, keys) { | ||
if (keys === void 0) { keys = ''; } | ||
if (icsChromelyRequest.isChromely) { | ||
return IndexExamine.page('DictionaryIndex', pageIndex, pageSize, category, escapeSpecialCharacters(keys)); | ||
} | ||
else { | ||
return IndexExamine.pageByServer('DictionaryIndex', pageIndex, pageSize, category, keys, this.like, this.exact); | ||
} | ||
}; | ||
DictIndex.like = ['ID', 'NAME', 'SPELL_CODE', 'STROKE_CODE']; | ||
DictIndex.exact = {}; | ||
return DictIndex; | ||
}()); | ||
function __awaiter(thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
} | ||
var Icd10Index = /** @class */ (function () { | ||
function Icd10Index() { | ||
} | ||
/** | ||
* 查询icd10诊断 | ||
* @param keys:关键字 | ||
* @param category 诊断类别 11:疾病诊断 12:损伤中毒原因 13:肿瘤形态学(对应病案首页病理诊断) | ||
* @returns 成功返回结果 | ||
*/ | ||
Icd10Index.query = function (category, keys) { | ||
if (keys === void 0) { keys = ''; } | ||
if (icsChromelyRequest.isChromely) { | ||
return IndexExamine.query('Icd10Index', category, this.QueryCondition(category, escapeSpecialCharacters(keys))); | ||
} | ||
else { | ||
return IndexExamine.queryByServer('Icd10Index', category, keys, this.like, {}); | ||
} | ||
}; | ||
/** | ||
* 分页查询索引 | ||
* @param indexId: 索引id | ||
* @param pageIndex:page索引 | ||
* @param pageSize:page尺寸 | ||
* @param category 诊断类别 11:疾病诊断 12:损伤中毒原因 13:肿瘤形态学(对应病案首页病理诊断) | ||
* @param keys:关键字 | ||
* @returns 成功返回结果 | ||
*/ | ||
Icd10Index.page = function (pageIndex, pageSize, category, keys) { | ||
if (keys === void 0) { keys = ''; } | ||
if (icsChromelyRequest.isChromely) { | ||
return IndexExamine.page('Icd10Index', pageIndex, pageSize, category, this.QueryCondition(category, escapeSpecialCharacters(keys))); | ||
} | ||
else { | ||
return IndexExamine.pageByServer('Icd10Index', pageIndex, pageSize, category, keys, this.like, {}); | ||
} | ||
}; | ||
/** | ||
* 查询条件组装 | ||
* @param keys | ||
* @returns | ||
*/ | ||
Icd10Index.QueryCondition = function (category, keys) { | ||
return "(id:*" + keys + "* OR name:\"*" + keys + "*\" OR spellCode:*" + keys + "* OR strokeCode:*" + keys + "*)"; | ||
}; | ||
Icd10Index.like = ['ID', 'NAME', 'SPELL_CODE', 'STROKE_CODE']; | ||
return Icd10Index; | ||
}()); | ||
function __generator(thisArg, body) { | ||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
function verb(n) { return function (v) { return step([n, v]); }; } | ||
function step(op) { | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
if (y = 0, t) op = [op[0] & 2, t.value]; | ||
switch (op[0]) { | ||
case 0: case 1: t = op; break; | ||
case 4: _.label++; return { value: op[1], done: false }; | ||
case 5: _.label++; y = op[1]; op = [0]; continue; | ||
case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
default: | ||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
if (t[2]) _.ops.pop(); | ||
_.trys.pop(); continue; | ||
} | ||
op = body.call(thisArg, _); | ||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
} | ||
} | ||
/* | ||
* @Author: 陶慧灵 | ||
* @Date: 2022-10-21 09:20:20 | ||
* @LastEditors: wenbei421 346972930@qq.com | ||
* @LastEditTime: 2022-10-28 13:04:22 | ||
* @Descripttion: | ||
* @FilePath: \src\index-examine.ts | ||
*/ | ||
var IcdTcmIndex = /** @class */ (function () { | ||
function IcdTcmIndex() { | ||
} | ||
/** | ||
* | ||
* @param category:分类,例如DICT_SEX、DICT_NATION | ||
* @param keys:关键字 | ||
* @returns 成功返回结果 | ||
*/ | ||
IcdTcmIndex.query = function (category, keys) { | ||
if (keys === void 0) { keys = ''; } | ||
if (icsChromelyRequest.isChromely) { | ||
return IndexExamine.query('IcdTcmIndex', category, escapeSpecialCharacters(keys)); | ||
} | ||
else { | ||
return IndexExamine.queryByServer('IcdTcmIndex', category, keys, this.like, {}); | ||
} | ||
}; | ||
/** | ||
* 分页查询索引 | ||
* @param indexId: 索引id | ||
* @param pageIndex:page索引 | ||
* @param pageSize:page尺寸 | ||
* @param category:分类,例如DICT_SEX、DICT_NATION | ||
* @param keys:关键字 | ||
* @returns 成功返回结果 | ||
*/ | ||
IcdTcmIndex.page = function (pageIndex, pageSize, category, keys) { | ||
if (keys === void 0) { keys = ''; } | ||
if (icsChromelyRequest.isChromely) { | ||
return IndexExamine.page('IcdTcmIndex', pageIndex, pageSize, category, escapeSpecialCharacters(keys)); | ||
} | ||
else { | ||
return IndexExamine.pageByServer('IcdTcmIndex', pageIndex, pageSize, category, keys, this.like, {}); | ||
} | ||
}; | ||
IcdTcmIndex.like = ['ID', 'NAME', 'SPELL_CODE', 'STROKE_CODE']; | ||
return IcdTcmIndex; | ||
}()); | ||
var InterceptorManage = /** @class */ (function () { | ||
function InterceptorManage() { | ||
// 拦截器 | ||
this.interceptors = []; | ||
} | ||
InterceptorManage.prototype.use = function (resolved, rejected) { | ||
this.interceptors.push({ | ||
resolved: resolved, | ||
rejected: rejected | ||
}); | ||
return this.interceptors.length - 1; | ||
}; | ||
InterceptorManage.prototype.eject = function (id) { | ||
if (this.interceptors[id]) { | ||
this.interceptors[id] = null; | ||
} | ||
}; | ||
return InterceptorManage; | ||
}()); | ||
/* | ||
* @Author: 陶慧灵 | ||
* @Date: 2022-10-21 09:20:20 | ||
* @LastEditors: wenbei421 346972930@qq.com | ||
* @LastEditTime: 2022-11-17 14:46:33 | ||
* @Descripttion: | ||
* @FilePath: \src\sys-area-index-examine.ts | ||
*/ | ||
var SysAreaIndex = /** @class */ (function () { | ||
function SysAreaIndex() { | ||
} | ||
/** | ||
* 查询行政区划 | ||
* @param category:分类,父行政区划编码 | ||
* @param keys:关键字 | ||
* @param rank:行政级别1~5,默认5 | ||
* @returns 成功返回结果 | ||
*/ | ||
SysAreaIndex.query = function (category, keys, rank) { | ||
if (keys === void 0) { keys = ''; } | ||
if (rank === void 0) { rank = 5; } | ||
if (icsChromelyRequest.isChromely) { | ||
return IndexExamine.query('SysAreaIndex', '', this.QueryCondition(escapeSpecialCharacters(keys), rank, category)); | ||
} | ||
else { | ||
return IndexExamine.queryByServer('SysAreaIndex', '', keys, this.like, { | ||
PID: category, | ||
RANK: rank //范围查询 3 => <= 3 | ||
}); | ||
} | ||
}; | ||
/** | ||
* 分页查询行政区划 | ||
* @param indexId: 索引id | ||
* @param pageIndex:page索引 | ||
* @param pageSize:page尺寸 | ||
* @param category:分类,父行政区划编码 | ||
* @param keys:关键字 | ||
* @param rank:行政级别1~5,默认5 | ||
* @returns 成功返回结果 | ||
*/ | ||
SysAreaIndex.page = function (pageIndex, pageSize, category, keys, rank) { | ||
if (keys === void 0) { keys = ''; } | ||
if (rank === void 0) { rank = 5; } | ||
if (icsChromelyRequest.isChromely) { | ||
return IndexExamine.page('SysAreaIndex', pageIndex, pageSize, '', this.QueryCondition(escapeSpecialCharacters(keys), rank, category)); | ||
} | ||
else { | ||
return IndexExamine.pageByServer('SysAreaIndex', pageIndex, pageSize, '', keys, this.like, { | ||
PID: category, | ||
RANK: rank //范围查询 3 => <= 3 | ||
}); | ||
} | ||
}; | ||
/** | ||
* 查询条件组装 | ||
* @param keys | ||
* name:*安* spellCode:*安* strokeCode:*安* | ||
* http://icreate.com/LocalIndex/Page?indexId=SysAreaIndex&pageIndex=0&pageSize=10&category=&keys=name:*安* spellCode:*安* strokeCode:*安* | ||
* http://icreate.com/LocalIndex/Page?indexId=SysAreaIndex&pageIndex=0&pageSize=10&category=&keys=name:*安* spellCode:*安* strokeCode:*安* +rank:[1 TO 3] | ||
* http://icreate.com/LocalIndex/Page?indexId=SysAreaIndex&pageIndex=0&pageSize=10&category=34*&keys=name:*安* spellCode:*安* strokeCode:*安* +rank:[1 TO 3] | ||
* @returns | ||
*/ | ||
SysAreaIndex.QueryCondition = function (keys, rank, category) { | ||
// (name:"*安徽*" OR fullSpellCode:"*安徽*") AND pid:34* AND rank:[1 TO 3] | ||
var condition = []; | ||
if (keys.trim()) { | ||
condition.push("(fullName:\"*" + keys + "*\" OR fullSpellCode:*" + keys + "* OR fullStrokeCode:*" + keys + "*)"); | ||
} | ||
if (category.trim()) { | ||
condition.push("pid:" + category); | ||
} | ||
if (rank !== 5) { | ||
condition.push("rank:[1 TO " + rank + "]"); | ||
} | ||
return condition.join(' AND '); | ||
}; | ||
SysAreaIndex.like = ['FULL_NAME', 'FULL_SPELL_CODE', 'FULL_STROKE_CODE']; | ||
return SysAreaIndex; | ||
}()); | ||
var IcsChromelyClient = /** @class */ (function () { | ||
function IcsChromelyClient(_a) { | ||
var _this = this; | ||
var _b = _a === void 0 ? {} : _a, _c = _b.headers, headers = _c === void 0 ? {} : _c, fetch = _b.fetch; | ||
this._baseCommandUrl = 'http://command.com/'; | ||
this._baseAjaxUrl = 'http://icreate.com/'; | ||
this.headers = __assign({}, headers); | ||
this.fetch = fetch || window.fetch.bind(window); | ||
this.interceptors = { | ||
request: new InterceptorManage(), | ||
response: new InterceptorManage() | ||
}; | ||
this.interceptors.response.use(function (response) { | ||
var _a; | ||
// console.log(response) | ||
if (response.code === 200) { | ||
return Promise.resolve(response.data); | ||
} | ||
else { | ||
(_a = _this.errorFn) === null || _a === void 0 ? void 0 : _a.call(_this, response); | ||
return Promise.reject(response); | ||
} | ||
}); | ||
} | ||
IcsChromelyClient.prototype.errorFn = function (response) { }; | ||
IcsChromelyClient.prototype.command = function (opts) { | ||
var link = document.createElement('a'); | ||
var params = []; | ||
for (var key in opts.data) { | ||
params.push(key + '=' + opts.data[key]); | ||
} | ||
link.href = "" + this._baseCommandUrl + opts.url + (params.length > 0 ? "?" + params.join('&') : ''); | ||
document.body.appendChild(link); | ||
link.click(); | ||
document.body.removeChild(link); | ||
}; | ||
IcsChromelyClient.prototype.function = function (opts) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var chain, promise, _a, resolved, rejected; | ||
var _this = this; | ||
return __generator(this, function (_b) { | ||
this.headers['Content-Type'] = this.headers['Content-Type'] || 'application/json'; | ||
chain = [ | ||
{ | ||
resolved: function (config) { | ||
var _a, _b; | ||
var options = __assign(__assign({}, opts), config); | ||
if (((_a = opts === null || opts === void 0 ? void 0 : opts.method) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === 'GET' || ((_b = opts === null || opts === void 0 ? void 0 : opts.method) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === 'HEAD') { | ||
var params = []; | ||
for (var key in opts.data) { | ||
params.push(key + '=' + opts.data[key]); | ||
} | ||
opts.url = opts.url + (params.length > 0 ? "?" + params.join('&') : ''); | ||
} | ||
else { | ||
options.body = JSON.stringify(opts.data); | ||
// options = { ...options, body: JSON.stringify(opts.data) } | ||
} | ||
var res = config | ||
.fetch("" + config._baseAjaxUrl + opts.url, options) | ||
.then(function (res) { return __awaiter(_this, void 0, void 0, function () { | ||
var data, _a, _b, error, body; | ||
return __generator(this, function (_c) { | ||
switch (_c.label) { | ||
case 0: | ||
if (!res.ok) return [3 /*break*/, 2]; | ||
_b = (_a = JSON).parse; | ||
return [4 /*yield*/, res.text()]; | ||
case 1: | ||
data = _b.apply(_a, [_c.sent()]); | ||
return [2 /*return*/, data]; | ||
case 2: | ||
error = null; | ||
return [4 /*yield*/, res.text()]; | ||
case 3: | ||
body = _c.sent(); | ||
try { | ||
error = JSON.parse(body); | ||
} | ||
catch (_d) { | ||
error = { | ||
message: body | ||
}; | ||
} | ||
return [2 /*return*/, Promise.reject(error)]; | ||
} | ||
}); | ||
}); }); | ||
return res; | ||
}, | ||
rejected: undefined | ||
} | ||
]; | ||
// 拦截器加入执行链 | ||
this.interceptors.request.interceptors.forEach(function (interceptor) { | ||
if (interceptor !== null) { | ||
chain.unshift(interceptor); | ||
} | ||
}); | ||
this.interceptors.response.interceptors.forEach(function (interceptor) { | ||
if (interceptor !== null) { | ||
chain.push(interceptor); | ||
} | ||
}); | ||
promise = Promise.resolve(__assign({}, this)); | ||
while (chain.length) { | ||
_a = chain.shift(), resolved = _a.resolved, rejected = _a.rejected; | ||
promise = promise.then(resolved, rejected); | ||
} | ||
return [2 /*return*/, promise]; | ||
}); | ||
}); | ||
}; | ||
return IcsChromelyClient; | ||
}()); | ||
var icsChromelyRequest = new IcsChromelyClient(); | ||
/* | ||
* @Author: 陶慧灵 | ||
* @Date: 2022-10-21 09:20:20 | ||
* @LastEditors: wenbei421 346972930@qq.com | ||
* @LastEditTime: 2022-10-25 15:08:15 | ||
* @Descripttion: | ||
* @FilePath: \src\index-examine.ts | ||
*/ | ||
var Icd9cm3Index = /** @class */ (function () { | ||
function Icd9cm3Index() { | ||
} | ||
/** | ||
* 查询icd10诊断 | ||
* @param category 诊断类别 1:治疗性操作 2:诊断性操作 3:手术 不传则查全部 | ||
* @param keys:关键字 | ||
* @param tcmOperation 中医操作 true:是 false:否 | ||
* @returns 成功返回结果 | ||
*/ | ||
Icd9cm3Index.query = function (category, keys, tcmOperation) { | ||
if (keys === void 0) { keys = ''; } | ||
if (tcmOperation === void 0) { tcmOperation = false; } | ||
if (icsChromelyRequest.isChromely) { | ||
return IndexExamine.query('Icd9cm3Index', category, this.QueryCondition(category, escapeSpecialCharacters(keys), tcmOperation)); | ||
} | ||
else { | ||
return IndexExamine.queryByServer('Icd9cm3Index', category, keys, this.like, { | ||
TCM_OPERATION_FLAG: tcmOperation ? 1 : 0 | ||
}); | ||
} | ||
}; | ||
/** | ||
* 分页查询索引 | ||
* @param indexId: 索引id | ||
* @param pageIndex:page索引 | ||
* @param pageSize:page尺寸 | ||
* @param category 诊断类别 1:治疗性操作 2:诊断性操作;3:手术 | ||
* @param keys:关键字 | ||
* @param tcmOperation 中医操作 true:是 false:否 | ||
* @returns 成功返回结果 | ||
*/ | ||
Icd9cm3Index.page = function (pageIndex, pageSize, category, keys, tcmOperation) { | ||
if (keys === void 0) { keys = ''; } | ||
if (tcmOperation === void 0) { tcmOperation = false; } | ||
if (icsChromelyRequest.isChromely) { | ||
return IndexExamine.page('Icd9cm3Index', pageIndex, pageSize, category, this.QueryCondition(category, escapeSpecialCharacters(keys), tcmOperation)); | ||
} | ||
else { | ||
return IndexExamine.pageByServer('Icd9cm3Index', pageIndex, pageSize, category, keys, this.like, { | ||
TCM_OPERATION_FLAG: tcmOperation ? 1 : 0 | ||
}); | ||
} | ||
}; | ||
/** | ||
* 查询条件组装 | ||
* @param keys | ||
* @returns | ||
*/ | ||
Icd9cm3Index.QueryCondition = function (category, keys, tcmOperation) { | ||
var conditions = []; | ||
if (keys.trim()) { | ||
conditions.push("(id:\"*" + keys + "*\" OR name:\"*" + keys + "*\" OR spellCode:*" + keys + "* OR strokeCode:*" + keys + "*)"); | ||
} | ||
if (tcmOperation) { | ||
conditions.push("tcmOperationFlag:1"); | ||
} | ||
else { | ||
conditions.push("tcmOperationFlag:0"); | ||
} | ||
return conditions.join(' AND '); | ||
}; | ||
Icd9cm3Index.like = ['ID', 'NAME', 'SPELL_CODE', 'STROKE_CODE']; | ||
return Icd9cm3Index; | ||
}()); | ||
/* | ||
* @Author: 陶慧灵 | ||
* @Date: 2022-10-21 09:20:20 | ||
* @LastEditors: 陶慧灵 | ||
* @LastEditTime: 2022-10-21 11:19:49 | ||
* @Descripttion: | ||
* @FilePath: \src\index-examine.ts | ||
*/ | ||
var IndexExamine = /** @class */ (function () { | ||
function IndexExamine() { | ||
} | ||
IndexExamine.OperateEx = function (url, data) { | ||
// let opts = | ||
return icsChromelyRequest.function({ | ||
url: "LocalIndex/" + url, | ||
method: 'GET', | ||
data: data | ||
}); | ||
}; | ||
/** | ||
* | ||
* @param indexId: 索引id | ||
* @param categroy:分类 | ||
* @param keys:关键字 | ||
* @returns 成功:{code: 200, data, message: 'ok'} | ||
*/ | ||
IndexExamine.query = function (indexId, categroy, keys) { | ||
return this.OperateEx('Query', { indexId: indexId, categroy: categroy, keys: keys }); | ||
}; | ||
/** | ||
* | ||
* @param indexId: 索引id | ||
* @param pageIndex:page索引 | ||
* @param pageSize:page尺寸 | ||
* @param categroy:分类 | ||
* @param keys:关键字 | ||
* @returns 成功:{code: 200, data, message: 'ok'} | ||
*/ | ||
IndexExamine.page = function (indexId, pageIndex, pageSize, categroy, keys) { | ||
return this.OperateEx('Page', { indexId: indexId, pageIndex: pageIndex, pageSize: pageSize, categroy: categroy, keys: keys }); | ||
}; | ||
return IndexExamine; | ||
}()); | ||
var DictDrugBaseIndex = /** @class */ (function () { | ||
function DictDrugBaseIndex() { | ||
} | ||
/** | ||
* 查询药品基础目录 | ||
* @param category:分类,药品分类 | ||
* @param keys:关键字 | ||
* @returns 成功返回结果 | ||
*/ | ||
DictDrugBaseIndex.query = function (category, keys) { | ||
if (keys === void 0) { keys = ''; } | ||
if (icsChromelyRequest.isChromely) { | ||
return IndexExamine.query('DictDrugBaseIndex', '', this.QueryCondition(escapeSpecialCharacters(keys), category)); | ||
} | ||
else { | ||
return IndexExamine.queryByServer('DictDrugBaseIndex', category, keys, this.like, this.exact); | ||
} | ||
}; | ||
/** | ||
* 分页查询药品基础目录 | ||
* @param indexId: 索引id | ||
* @param pageIndex:page索引 | ||
* @param pageSize:page尺寸 | ||
* @param category:分类,药品分类 | ||
* @param keys:关键字 | ||
* @returns 成功返回结果 | ||
*/ | ||
DictDrugBaseIndex.page = function (pageIndex, pageSize, category, keys) { | ||
if (keys === void 0) { keys = ''; } | ||
if (icsChromelyRequest.isChromely) { | ||
return IndexExamine.page('DictDrugBaseIndex', pageIndex, pageSize, '', this.QueryCondition(escapeSpecialCharacters(keys), category)); | ||
} | ||
else { | ||
return IndexExamine.pageByServer('DictDrugBaseIndex', pageIndex, pageSize, category, keys, this.like, this.exact); | ||
} | ||
}; | ||
/** | ||
* 查询条件组装 | ||
* @param keys | ||
* @param category | ||
* @returns | ||
*/ | ||
DictDrugBaseIndex.QueryCondition = function (keys, category) { | ||
var condition = []; | ||
if (keys.trim()) { | ||
condition.push("(id:*" + keys + "* OR name:\"*" + keys + "*\" OR alias:\"*" + keys + "*\" OR spellCode:*" + keys + "* OR strokeCode:*" + keys + "*)"); | ||
} | ||
if (category.trim()) { | ||
condition.push("category:" + category); | ||
} | ||
return condition.join(' AND '); | ||
}; | ||
DictDrugBaseIndex.like = ['ID', 'NAME', 'ALIAS', 'SPELL_CODE', 'STROKE_CODE']; | ||
DictDrugBaseIndex.exact = {}; | ||
return DictDrugBaseIndex; | ||
}()); | ||
/* | ||
* @Author: 陶慧灵 | ||
* @Date: 2022-10-21 09:01:18 | ||
* @LastEditors: 陶慧灵 | ||
* @LastEditTime: 2022-10-21 10:36:19 | ||
* @Descripttion: | ||
* @FilePath: \src\ics-imedx-chromely-plugin-index-examine.ts | ||
*/ | ||
var DictDrugPharmacologyIndex = /** @class */ (function () { | ||
function DictDrugPharmacologyIndex() { | ||
} | ||
/** | ||
* 查询药理分类 | ||
* @param parentId,父ID | ||
* @param skinTestCategory 皮试分类 | ||
* @param keys:关键字 | ||
* @returns 成功返回结果 | ||
*/ | ||
DictDrugPharmacologyIndex.query = function (parentId, skinTestCategory, keys) { | ||
if (keys === void 0) { keys = ''; } | ||
if (icsChromelyRequest.isChromely) { | ||
return IndexExamine.query('DictDrugPharmacologyIndex', '', this.QueryCondition(escapeSpecialCharacters(keys), skinTestCategory, parentId)); | ||
} | ||
else { | ||
return IndexExamine.queryByServer('DictDrugPharmacologyIndex', '', keys, this.like, { | ||
PARENT_ID: parentId, | ||
SKIN_TEST_CATEGORY: skinTestCategory | ||
}); | ||
} | ||
}; | ||
/** | ||
* 分页查询药品基础目录 | ||
* @param indexId: 索引id | ||
* @param pageIndex:page索引 | ||
* @param pageSize:page尺寸 | ||
* @param parentId,父ID | ||
* @param skinTestCategory 皮试分类 | ||
* @param keys:关键字 | ||
* @returns 成功返回结果 | ||
*/ | ||
DictDrugPharmacologyIndex.page = function (pageIndex, pageSize, parentId, skinTestCategory, keys) { | ||
if (keys === void 0) { keys = ''; } | ||
if (icsChromelyRequest.isChromely) { | ||
return IndexExamine.page('DictDrugPharmacologyIndex', pageIndex, pageSize, '', this.QueryCondition(escapeSpecialCharacters(keys), skinTestCategory, parentId)); | ||
} | ||
else { | ||
return IndexExamine.pageByServer('DictDrugPharmacologyIndex', pageIndex, pageSize, '', keys, this.like, { | ||
PARENT_ID: parentId, | ||
SKIN_TEST_CATEGORY: skinTestCategory | ||
}); | ||
} | ||
}; | ||
/** | ||
* 查询条件组装 | ||
* @param keys | ||
* @param category | ||
* @returns | ||
*/ | ||
DictDrugPharmacologyIndex.QueryCondition = function (keys, skinTestCategory, parentId) { | ||
var condition = []; | ||
if (keys.trim()) { | ||
condition.push("(id:*" + keys + "* OR name:\"*" + keys + "*\" OR spellCode:*" + keys + "* OR strokeCode:*" + keys + "*)"); | ||
} | ||
if (skinTestCategory.trim()) { | ||
condition.push("skinTestCategory:" + skinTestCategory); | ||
} | ||
if (parentId.trim()) { | ||
condition.push("parentId:" + parentId); | ||
} | ||
return condition.join(' AND '); | ||
}; | ||
DictDrugPharmacologyIndex.like = ['ID', 'NAME', 'SPELL_CODE', 'STROKE_CODE']; | ||
return DictDrugPharmacologyIndex; | ||
}()); | ||
return IndexExamine; | ||
/* | ||
* @Author: 陶慧灵 | ||
* @Date: 2022-10-21 09:01:18 | ||
* @LastEditors: wenbei421 346972930@qq.com | ||
* @LastEditTime: 2022-11-17 14:48:32 | ||
* @Descripttion: | ||
* @FilePath: \src\ics-imedx-chromely-plugin-index-examine.ts | ||
*/ | ||
var icsImedxChromelyPluginIndexExamine = { | ||
IndexExamine: IndexExamine, | ||
DictIndex: DictIndex, | ||
Icd10Index: Icd10Index, | ||
IcdTcmIndex: IcdTcmIndex, | ||
SysAreaIndex: SysAreaIndex, | ||
Icd9cm3Index: Icd9cm3Index, | ||
DictDrugBaseIndex: DictDrugBaseIndex, | ||
DictDrugPharmacologyIndex: DictDrugPharmacologyIndex | ||
}; | ||
// export { IndexExamine, DictIndex, Icd10Index, IcdTcmIndex, SysAreaIndex, Icd9cm3Index, DictDrugBaseIndex , DictDrugPharmacologyIndex} | ||
return icsImedxChromelyPluginIndexExamine; | ||
}))); | ||
//# sourceMappingURL=ics-imedx-chromely-plugin-index-examine.umd.js.map |
@@ -6,4 +6,4 @@ "use strict"; | ||
* @Date: 2022-10-21 09:01:18 | ||
* @LastEditors: 陶慧灵 | ||
* @LastEditTime: 2022-10-21 10:36:19 | ||
* @LastEditors: wenbei421 346972930@qq.com | ||
* @LastEditTime: 2022-11-17 14:48:32 | ||
* @Descripttion: | ||
@@ -13,3 +13,20 @@ * @FilePath: \src\ics-imedx-chromely-plugin-index-examine.ts | ||
var index_examine_1 = require("./index-examine"); | ||
exports.default = index_examine_1.default; | ||
var dict_index_examine_1 = require("./dict-index-examine"); | ||
var icd10_index_examine_1 = require("./icd10-index-examine"); | ||
var icdtcm_index_examine_1 = require("./icdtcm-index-examine"); | ||
var sys_area_index_examine_1 = require("./sys-area-index-examine"); | ||
var icd9_cm3_index_examine_1 = require("./icd9-cm3-index-examine"); | ||
var dict_drug_base_index_examine_1 = require("./dict-drug-base-index-examine"); | ||
var dict_drug_pharmacology_index_examine_1 = require("./dict-drug-pharmacology-index-examine"); | ||
exports.default = { | ||
IndexExamine: index_examine_1.default, | ||
DictIndex: dict_index_examine_1.default, | ||
Icd10Index: icd10_index_examine_1.default, | ||
IcdTcmIndex: icdtcm_index_examine_1.default, | ||
SysAreaIndex: sys_area_index_examine_1.default, | ||
Icd9cm3Index: icd9_cm3_index_examine_1.default, | ||
DictDrugBaseIndex: dict_drug_base_index_examine_1.default, | ||
DictDrugPharmacologyIndex: dict_drug_pharmacology_index_examine_1.default | ||
}; | ||
// export { IndexExamine, DictIndex, Icd10Index, IcdTcmIndex, SysAreaIndex, Icd9cm3Index, DictDrugBaseIndex , DictDrugPharmacologyIndex} | ||
//# sourceMappingURL=ics-imedx-chromely-plugin-index-examine.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/* | ||
* @Author: 陶慧灵 | ||
* @Date: 2022-10-21 09:20:20 | ||
* @LastEditors: 陶慧灵 | ||
* @LastEditTime: 2022-10-21 11:19:49 | ||
* @Descripttion: | ||
* @FilePath: \src\index-examine.ts | ||
*/ | ||
var ics_chromely_js_sdk_1 = require("@icreate/ics-chromely-js-sdk"); | ||
@@ -23,11 +15,16 @@ var IndexExamine = /** @class */ (function () { | ||
}; | ||
IndexExamine.use = function (_a) { | ||
var request = _a.request; | ||
this.Request = request; | ||
}; | ||
// public static isChromely = icsChromelyRequest.isChromely | ||
/** | ||
* | ||
* @param indexId: 索引id | ||
* @param categroy:分类 | ||
* @param category:分类 | ||
* @param keys:关键字 | ||
* @returns 成功:{code: 200, data, message: 'ok'} | ||
*/ | ||
IndexExamine.query = function (indexId, categroy, keys) { | ||
return this.OperateEx('Query', { indexId: indexId, categroy: categroy, keys: keys }); | ||
IndexExamine.query = function (indexId, category, keys) { | ||
return this.OperateEx('Query', { indexId: indexId, category: category, keys: keys }); | ||
}; | ||
@@ -37,11 +34,69 @@ /** | ||
* @param indexId: 索引id | ||
* @param category:分类 | ||
* @param keys:关键字 | ||
* @param like:模糊匹配字段 | ||
* @param exact:精确匹配字段和值 | ||
* @returns 成功:{code: 200, data, message: 'ok'} | ||
*/ | ||
IndexExamine.queryByServer = function (indexId, category, keys, like, exact) { | ||
return this.Request({ | ||
url: 'system/index/query', | ||
method: 'post', | ||
data: { | ||
index: indexId, | ||
category: category, | ||
keys: keys, | ||
like: like, | ||
exact: exact | ||
} | ||
}).then(function (res) { | ||
return Promise.resolve(res.data); | ||
}); | ||
}; | ||
/** | ||
* | ||
* @param indexId: 索引id | ||
* @param pageIndex:page索引 | ||
* @param pageSize:page尺寸 | ||
* @param categroy:分类 | ||
* @param category:分类 | ||
* @param keys:关键字 | ||
* @returns 成功:{code: 200, data, message: 'ok'} | ||
*/ | ||
IndexExamine.page = function (indexId, pageIndex, pageSize, categroy, keys) { | ||
return this.OperateEx('Page', { indexId: indexId, pageIndex: pageIndex, pageSize: pageSize, categroy: categroy, keys: keys }); | ||
IndexExamine.page = function (indexId, pageIndex, pageSize, category, keys) { | ||
return this.OperateEx('Page', { | ||
indexId: indexId, | ||
pageIndex: pageIndex, | ||
pageSize: pageSize, | ||
category: category, | ||
keys: keys | ||
}); | ||
}; | ||
/** | ||
* | ||
* @param indexId: 索引id | ||
* @param pageIndex:page索引 | ||
* @param pageSize:page尺寸 | ||
* @param category:分类 | ||
* @param keys:关键字 | ||
* @param like:模糊匹配字段 | ||
* @param exact:精确匹配字段和值 | ||
* @returns 成功:{code: 200, data, message: 'ok'} | ||
*/ | ||
IndexExamine.pageByServer = function (indexId, pageIndex, pageSize, category, keys, like, exact) { | ||
return this.Request({ | ||
url: 'system/index/page', | ||
method: 'post', | ||
data: { | ||
index: indexId, | ||
pageIndex: pageIndex, | ||
pageSize: pageSize, | ||
category: category, | ||
keys: keys, | ||
like: like, | ||
exact: exact | ||
} | ||
}).then(function (res) { | ||
return Promise.resolve(res.data); | ||
}); | ||
}; | ||
return IndexExamine; | ||
@@ -48,0 +103,0 @@ }()); |
import IndexExamine from './index-examine'; | ||
export default IndexExamine; | ||
import DictIndex from './dict-index-examine'; | ||
import Icd10Index from './icd10-index-examine'; | ||
import IcdTcmIndex from './icdtcm-index-examine'; | ||
import SysAreaIndex from './sys-area-index-examine'; | ||
import Icd9cm3Index from './icd9-cm3-index-examine'; | ||
import DictDrugBaseIndex from './dict-drug-base-index-examine'; | ||
import DictDrugPharmacologyIndex from './dict-drug-pharmacology-index-examine'; | ||
declare const _default: { | ||
IndexExamine: typeof IndexExamine; | ||
DictIndex: typeof DictIndex; | ||
Icd10Index: typeof Icd10Index; | ||
IcdTcmIndex: typeof IcdTcmIndex; | ||
SysAreaIndex: typeof SysAreaIndex; | ||
Icd9cm3Index: typeof Icd9cm3Index; | ||
DictDrugBaseIndex: typeof DictDrugBaseIndex; | ||
DictDrugPharmacologyIndex: typeof DictDrugPharmacologyIndex; | ||
}; | ||
export default _default; |
export default class IndexExamine { | ||
private static OperateEx; | ||
/** | ||
* 传过来的axios实例 | ||
*/ | ||
private static Request; | ||
static use({ request }: { | ||
request: any; | ||
}): void; | ||
/** | ||
* | ||
* @param indexId: 索引id | ||
* @param categroy:分类 | ||
* @param category:分类 | ||
* @param keys:关键字 | ||
* @returns 成功:{code: 200, data, message: 'ok'} | ||
*/ | ||
static query(indexId: string, categroy: string, keys: string): Promise<any>; | ||
static query(indexId: string, category: string | Array<string>, keys: string): Promise<any>; | ||
/** | ||
* | ||
* @param indexId: 索引id | ||
* @param category:分类 | ||
* @param keys:关键字 | ||
* @param like:模糊匹配字段 | ||
* @param exact:精确匹配字段和值 | ||
* @returns 成功:{code: 200, data, message: 'ok'} | ||
*/ | ||
static queryByServer(indexId: string, category: string | Array<string>, keys: string, like: Array<string>, exact: object): Promise<any>; | ||
/** | ||
* | ||
* @param indexId: 索引id | ||
* @param pageIndex:page索引 | ||
* @param pageSize:page尺寸 | ||
* @param categroy:分类 | ||
* @param category:分类 | ||
* @param keys:关键字 | ||
* @returns 成功:{code: 200, data, message: 'ok'} | ||
*/ | ||
static page(indexId: string, pageIndex: number, pageSize: number, categroy: string, keys: string): Promise<any>; | ||
static page(indexId: string, pageIndex: number, pageSize: number, category: string, keys: string): Promise<any>; | ||
/** | ||
* | ||
* @param indexId: 索引id | ||
* @param pageIndex:page索引 | ||
* @param pageSize:page尺寸 | ||
* @param category:分类 | ||
* @param keys:关键字 | ||
* @param like:模糊匹配字段 | ||
* @param exact:精确匹配字段和值 | ||
* @returns 成功:{code: 200, data, message: 'ok'} | ||
*/ | ||
static pageByServer(indexId: string, pageIndex: number, pageSize: number, category: string, keys: string, like: Array<string>, exact: object): Promise<any>; | ||
} |
{ | ||
"name": "@imedx/ics-imedx-chromely-plugin-index-examine", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "", | ||
@@ -121,4 +121,5 @@ "keywords": [], | ||
"dependencies": { | ||
"@icreate/ics-chromely-js-sdk": "^0.0.4" | ||
"@icreate/ics-chromely-js-sdk": "^0.0.7-beat.2", | ||
"@imedx/ics-imedx-chromely-plugin-index-examine": "^0.0.1-beta.27" | ||
} | ||
} |
196
README.md
@@ -7,4 +7,4 @@ ### 引入 | ||
### 使用方法 | ||
> query | ||
### 通用索引调用方法 | ||
> query 查询索引 | ||
```javascript | ||
@@ -14,10 +14,10 @@ /** | ||
* @param indexId: 索引id | ||
* @param categroy:分类 | ||
* @param category:分类 | ||
* @param keys:关键字 | ||
* @returns 成功:{code: 200, data, message: 'ok'} | ||
*/ | ||
IndexExamine.query(indexId, categroy, keys) | ||
IndexExamine.query(indexId, category, keys) | ||
``` | ||
> page | ||
> page 分页查询索引 | ||
```javascript | ||
@@ -29,7 +29,189 @@ /** | ||
* @param pageSize:page尺寸 | ||
* @param categroy:分类 | ||
* @param category:分类 | ||
* @param keys:关键字 | ||
* @returns 成功:{code: 200, data, message: 'ok'} | ||
*/ | ||
IndexExamine.page(indexId, pageIndex, pageSize, categroy, keys) | ||
IndexExamine.page(indexId, pageIndex, pageSize, category, keys) | ||
``` | ||
### 字典索引调用方法 | ||
```javascript | ||
import { DictIndex } from '@imedx/ics-imedx-chromely-plugin-index-examine' | ||
``` | ||
> query 查询索引 | ||
```javascript | ||
/** | ||
* 查询字典索引 | ||
* @param category:分类,例如DICT_SEX、DICT_NATION,支持数组 ['DICT_SEX','DICT_NATION'] | ||
* @param keys:关键字 | ||
* @returns 成功返回结果,如果category是数组则返回{"DICT_SEX":[{},{}],"DICT_NATION":[{},{}]} | ||
*/ | ||
DictIndex.query(category: string|string[], keys: string = ''):Promise<any> | ||
``` | ||
> page 分页查询索引 | ||
```javascript | ||
/** | ||
* 分页查询索引 | ||
* @param pageIndex:page索引 | ||
* @param pageSize:page尺寸 | ||
* @param category:分类,例如DICT_SEX、DICT_NATION | ||
* @param keys:关键字 | ||
* @returns 成功返回结果 | ||
*/ | ||
DictIndex.page( | ||
pageIndex: number, | ||
pageSize: number, | ||
category: string, | ||
keys: string = '' | ||
): Promise<any> | ||
``` | ||
### ICD10诊断索引调用方法 | ||
```javascript | ||
import { Icd10Index } from '@imedx/ics-imedx-chromely-plugin-index-examine' | ||
``` | ||
> query 查询索引 | ||
```javascript | ||
/** | ||
* 查询icd10诊断 | ||
* @param keys:关键字 | ||
* @param category 诊断类别 11:疾病诊断 12:损伤中毒原因 13:肿瘤形态学(对应病案首页病理诊断) | ||
* @returns 成功返回结果 | ||
*/ | ||
Icd10Index.query(category: string, keys: string = ''):Promise<any> | ||
``` | ||
> page 分页查询索引 | ||
```javascript | ||
/** | ||
* 分页查询索引 | ||
* @param pageIndex:page索引 | ||
* @param pageSize:page尺寸 | ||
* @param keys:关键字 | ||
* @param category 诊断类别 11:疾病诊断 12:损伤中毒原因 13:肿瘤形态学(对应病案首页病理诊断) | ||
* @returns 成功返回结果 | ||
*/ | ||
Icd10Index.page( | ||
pageIndex: number, | ||
pageSize: number, | ||
category: string, | ||
keys: string = '' | ||
): Promise<any> | ||
``` | ||
### 中医诊断索引 | ||
```javascript | ||
import { IcdTcmIndex } from '@imedx/ics-imedx-chromely-plugin-index-examine' | ||
``` | ||
> query 查询索引 | ||
```javascript | ||
/** | ||
* 查询中医诊断索引 | ||
* @param category:分类,例如1 病,2 证,3 治 | ||
* @returns 成功返回结果 | ||
*/ | ||
IcdTcmIndex.query(category: string, keys: string = ''):Promise<any> | ||
``` | ||
> page 分页查询索引 | ||
```javascript | ||
/** | ||
* 分页查询索引 | ||
* @param pageIndex:page索引 | ||
* @param pageSize:page尺寸 | ||
* @param category:分类,例如1 病,2 证,3 治 | ||
* @param keys:关键字 | ||
* @returns 成功返回结果 | ||
*/ | ||
IcdTcmIndex.page( | ||
pageIndex: number, | ||
pageSize: number, | ||
category: string, | ||
keys: string = '' | ||
): Promise<any> | ||
``` | ||
### ICDCM3手术编码索引 | ||
```javascript | ||
import { Icd9cm3Index } from '@imedx/ics-imedx-chromely-plugin-index-examine' | ||
``` | ||
> query 查询索引 | ||
```javascript | ||
/** | ||
* 查询中医诊断索引 | ||
* @param category 诊断类别 1:治疗性操作 2:诊断性操作 3:手术 不传则查全部 | ||
* @param keys:关键字 | ||
* @param tcmOperation 中医操作 true:是 false:否 | ||
* @returns 成功返回结果 | ||
*/ | ||
Icd9cm3Index.query(category: string, keys: string = '', tcmOperation: boolean = false):Promise<any> | ||
``` | ||
> page 分页查询索引 | ||
```javascript | ||
/** | ||
* 分页查询索引 | ||
* @param pageIndex:page索引 | ||
* @param pageSize:page尺寸 | ||
* @param category 诊断类别 1:治疗性操作 2:诊断性操作 3:手术 不传则查全部 | ||
* @param keys:关键字 | ||
* @param tcmOperation 中医操作 true:是 false:否 | ||
* @returns 成功返回结果 | ||
*/ | ||
Icd9cm3Index.page( | ||
pageIndex: number, | ||
pageSize: number, | ||
category: string, | ||
keys: string = '', | ||
tcmOperation: boolean = false | ||
): Promise<any> | ||
``` | ||
### 行政区划索引 | ||
```javascript | ||
import { SysAreaIndex } from '@imedx/ics-imedx-chromely-plugin-index-examine' | ||
``` | ||
> query 查询索引 | ||
```javascript | ||
/** | ||
* 查询中医诊断索引 | ||
* @param category:分类,父行政区划编码 | ||
* @param keys:关键字 | ||
* @param rank:行政级别1~5,默认5 | ||
* @returns 成功返回结果 | ||
*/ | ||
SysAreaIndex.query(category: string, keys: string = '', rank: number = 5):Promise<any> | ||
``` | ||
> page 分页查询索引 | ||
```javascript | ||
/** | ||
* 分页查询索引 | ||
* @param pageIndex:page索引 | ||
* @param pageSize:page尺寸 | ||
* @param category:分类,分类,父行政区划编码 | ||
* @param keys:关键字 | ||
* @param rank:行政级别1~5,默认5 | ||
* @returns 成功返回结果 | ||
*/ | ||
SysAreaIndex.page( | ||
pageIndex: number, | ||
pageSize: number, | ||
category: string, | ||
keys: string = '', | ||
rank: number = 5 | ||
): Promise<any> | ||
``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
162377
40
0
1973
215
1
2
+ Added@imedx/ics-imedx-chromely-plugin-index-examine@^0.0.1-beta.27
+ Added@icreate/ics-chromely-js-sdk@0.0.7(transitive)
+ Added@imedx/ics-imedx-chromely-plugin-index-examine@0.0.1(transitive)