123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486 |
- import {ref} from "vue";
- import {maZuiFangShi} from "@/api/public-api";
- import store from '@/store';
- import {listIsBlank, stringIsBlank} from "@/utils/blank-utils";
- import {getFundPayType, getMedChrgitmType} from "@/api/medical-insurance/si-setl-upload";
- import {getFormatDatetime} from "@/utils/date";
- const getRoles = store.state.user.info.roles
- export function shenHeQuanXian() {
- return getRoles.indexOf(1) > -1 || getRoles.indexOf(8) > -1
- }
- /**
- * 获取医保诊断
- * @param val 诊断编码
- * @returns {string} 返回名称
- */
- export function getsiDiagTypeName(val) {
- switch (val) {
- case "1":
- return "西医主要诊断"
- case "2":
- return "西医其他诊断"
- case "3":
- return "中医主要诊断"
- case "4":
- return "中医其他诊断"
- default:
- return "没有选择"
- }
- }
- /**
- * 判断这个人是否有申请了
- * @param val
- * @returns {string}
- */
- export function auditName(val) {
- switch (val.auditFlag) {
- case 0:
- return `<span style="color: #909399">${val.psnName}</span>`
- case 1:
- return `<span style="color: #67C23A">${val.psnName}</span>`
- case 2:
- return `<span style="color: #F56C6C">${val.psnName}</span>`
- case 3:
- return `<span style="color: #E6A23C">${val.psnName}</span>`
- default:
- return `${val.psnName}`
- }
- }
- export const qks = ref([
- {code: '0/0', name: '0/0'},
- {code: '1/3', name: 'Ⅰ/丙'},
- {code: '1/1', name: 'Ⅰ/甲'},
- {code: '1/2', name: 'Ⅰ/乙'},
- {code: '2/3', name: 'Ⅱ/丙'},
- {code: '2/1', name: 'Ⅱ/甲'},
- {code: '2/2', name: 'Ⅱ/乙'},
- {code: '3/3', name: 'Ⅲ/丙'},
- {code: '3/1', name: 'Ⅲ/甲'},
- {code: '3/2', name: 'Ⅲ/乙'}
- ])
- export const auditFlags = ref([
- {code: 0, name: '待审核'},
- {code: 1, name: '审核通过'},
- {code: 2, name: '驳回'},
- {code: 3, name: '正在审核'},
- {code: 4, name: '全部'},
- ])
- /**
- *
- * @param qkjb 切口级别
- * @param yhqk 愈合级别
- * @returns {string} 返回信息
- */
- export function qieKouName(qkjb, yhqk) {
- let code = qkjb + '/' + yhqk
- let name = ''
- qks.value.forEach(item => {
- if (item.code === code) {
- return name = item.name
- }
- })
- return name
- }
- /**
- *
- * @type {ToRef<*[]>} 麻醉数组
- */
- export const maZuiFangShis = ref([])
- /**
- * 远程获取麻醉方式
- */
- maZuiFangShi().then((res) => {
- maZuiFangShis.value = res
- })
- /**
- * 麻醉的名字
- * @param val code
- * @returns {string} 名称
- */
- export function maZuiName(val) {
- let name = '未知'
- maZuiFangShis.value.forEach(item => {
- if (item.code === val) {
- return name = item.name
- }
- })
- return name
- }
- /**
- * 医生默认可以默认选择的信息
- * @param arr 数组
- * @param notNode 不需要的 code
- * @returns {*[]} 返回科室
- */
- export function huoQuZhongKongChaXunTiaoJian(arr, notNode) {
- let data = []
- arr.forEach(item => {
- if (notNode.indexOf(item.code) === -1) {
- data.push(item.code)
- }
- })
- return data
- }
- /* 打印结算单的一些工具类 */
- export function brdyName(val) {
- if (stringIsBlank(val)) {
- return ""
- }
- let name = val.split("-")
- return `${name[0]}年${name[1]}月${name[2]}日`
- }
- /* 入院时间拆分 */
- export function getDateName(val) {
- if (stringIsBlank(val)) {
- return ""
- }
- let date = val.split(" ")[0].split("-")
- let times = val.split(" ")[1].split(":")
- return `${date[0]}年${date[1]}月${date[2]}日 ${times[0]}时`
- }
- // 手术时间拆分
- export function getShouShuShiJian(val) {
- let {oprnOprtBegntime, oprnOprtEndtime} = val
- let format = 'YYYY年MM月DD日 HH时mm分ss秒'
- return `${getFormatDatetime(oprnOprtBegntime, format)} 至 ${getFormatDatetime(oprnOprtEndtime, format)}`
- }
- // 麻醉时间
- export function getMaZuiShiJian(val) {
- let {anstBegntime, anstEndtime} = val
- let format = 'YYYY年MM月DD日 HH时mm分ss秒'
- return `${getFormatDatetime(anstBegntime, format)} 至 ${getFormatDatetime(anstEndtime, format)}`
- }
- // 颅内时间拆分
- export function luNeiShiJian(val) {
- if (stringIsBlank(val)) {
- return ""
- }
- let data = val.split("/")
- return ` ${data[0]}天 ${data[1]}小时 ${data[2]}分钟`
- }
- //结算时间计算
- export function nianYueRi(val) {
- if (stringIsBlank(val)) {
- return ' 年 月 日'
- }
- let date = val.split("-")
- return `${date[0]}年${date[1]}月${date[2]}日`
- }
- export function getAge(val) {
- if (stringIsBlank(val)) {
- return ""
- }
- return val.split('.')[0];
- }
- export function getAdmissCond(val) {
- switch (val) {
- case 1:
- return "有"
- case 2:
- return "临床未确定"
- case 3:
- return "情况不明"
- case 4:
- return "无"
- default:
- return ""
- }
- }
- export function getXiYiZhenDuan(val) {
- if (listIsBlank(val)) {
- return []
- }
- let diag = []
- val.forEach(item => {
- if (item.siDiagType === '1' || item.siDiagType === '2') {
- diag.push(item)
- }
- })
- if (listIsBlank(diag)) {
- return []
- }
- let zhuYao = []
- let ciYao = []
- diag.forEach(item => {
- if (item.siDiagType === '1' && zhuYao.length === 0) {
- zhuYao.push(item)
- } else {
- ciYao.push(item)
- }
- })
- return zhuYao.concat(ciYao)
- }
- export function getZhongYiZhenDuan(val) {
- if (listIsBlank(val)) {
- return []
- }
- let diag = []
- val.forEach(item => {
- if (item.siDiagType === '3' || item.siDiagType === '4') {
- diag.push(item)
- }
- })
- if (listIsBlank(diag)) {
- return []
- }
- let zhuYao = []
- let ciYao = []
- diag.forEach(item => {
- if (item.siDiagType === '3' && zhuYao.length === 0) {
- zhuYao.push(item)
- } else {
- ciYao.push(item)
- }
- })
- return zhuYao.concat(ciYao)
- }
- export function zhenDuanData(val) {
- let xiYiData = []
- let zhongYiData = []
- let obj = {disDiagComment: '', disDiag: '', admissCond: ''}
- // 只有当诊断全部为空的 时候才创建 9 个 空的数据
- if (listIsBlank(val)) {
- for (let i = 0; i < 9; i++) {
- xiYiData.push(obj)
- zhongYiData.push(obj)
- }
- }
- xiYiData = getXiYiZhenDuan(val)
- zhongYiData = getZhongYiZhenDuan(val)
- let maxLength = xiYiData.length > zhongYiData.length ? xiYiData.length : zhongYiData.length
- let newXiYiData = []
- let newZhongYiData = []
- if (maxLength < 2) {
- maxLength = 9
- }
- for (let i = 0; i < maxLength; i++) {
- if (i >= xiYiData.length) {
- newXiYiData.push(obj)
- } else {
- newXiYiData.push(xiYiData[i])
- }
- if (i >= zhongYiData.length) {
- newZhongYiData.push(obj)
- } else {
- newZhongYiData.push(zhongYiData[i])
- }
- }
- return zhenDuanHeBing(newXiYiData, newZhongYiData)
- }
- export function zhenDuanHeBing(xiYiZhenDuan, ZhongYiZhenDuan) {
- // 因为我在上面 保证了 两个诊断的长度完全一致 所以怎么循环都可以
- let data = []
- for (let i = 0; i < xiYiZhenDuan.length; i++) {
- data.push({
- xiYiDisDiag: xiYiZhenDuan[i].disDiag,
- xiYiDisDiagComment: xiYiZhenDuan[i].disDiagComment,
- xiYiAdmissCond: xiYiZhenDuan[i].admissCond,
- ZhongYiDisDiag: ZhongYiZhenDuan[i].disDiag,
- ZhongYiDiagComment: ZhongYiZhenDuan[i].disDiagComment,
- ZhongYiAdmissCond: ZhongYiZhenDuan[i].admissCond,
- })
- }
- return data
- }
- export function getShouShuData(val) {
- if (listIsBlank(val)) {
- let kong = []
- for (let i = 0; i < 3; i++) {
- kong.push({
- ssmc: '',
- ssbm: '',
- mzff: '',
- ssysName: '',
- ssys: '',
- mzysName: '',
- mzys: '',
- })
- }
- return kong
- }
- let zhuYaoShouShu = []
- let ciYaoShouShu = []
- val.forEach(item => {
- if (item.ssjb === 4 && zhuYaoShouShu.length === 0) {
- zhuYaoShouShu.push(item)
- } else {
- ciYaoShouShu.push(item)
- }
- })
- return zhuYaoShouShu.concat(ciYaoShouShu)
- }
- // 重症监护类型
- export function zhongZhenJianHu(val) {
- if (val === null) {
- val = []
- }
- let data = []
- if (listIsBlank(val)) {
- data.push({
- scsCutdWardType: '',
- scsCutdInpoolTime: '',
- scsCutdExitTime: '',
- scsCutdSumDura: '',
- })
- return data
- }
- val.forEach(item => {
- item.scsCutdInpoolTime = nianYueRiShiFen(item.scsCutdInpoolTime)
- item.scsCutdExitTime = nianYueRiShiFen(item.scsCutdExitTime)
- item.scsCutdSumDura = zhongZhenShiFenMiao(item.scsCutdSumDura)
- })
- return val
- }
- export function nianYueRiShiFen(val) {
- if (stringIsBlank(val)) {
- return ""
- }
- let date = val.split(" ")[0].split("-")
- let times = val.split(" ")[1].split(":")
- return `${date[0]}年${date[1]}月${date[2]}日${times[0]}时${times[1]}分`
- }
- export function zhongZhenShiFenMiao(val) {
- if (stringIsBlank(val)) {
- return ""
- }
- let times = val.split("/")
- return `${times[0]}时${times[1]}分${times[2]}秒`
- }
- // 获取费用类型
- export let medChrgitmType = []
- export let medChrgitmTypeMap = {}
- getMedChrgitmType().then((res) => {
- medChrgitmType = res
- medChrgitmType.forEach(item => {
- medChrgitmTypeMap[item.code] = {name: item.name}
- })
- })
- export function getMedChrgitmTypeData(val) {
- let data = []
- if (listIsBlank(val)) {
- medChrgitmType.forEach(item => {
- data.push({
- medChrgitm: item.name,
- amt: '',
- claaSumfee: '',
- clabAmt: '',
- fulamtOwnpayAmt: '',
- othAmt: '',
- })
- })
- data.push({
- medChrgitm: "合计",
- amt: 0,
- claaSumfee: 0,
- clabAmt: 0,
- fulamtOwnpayAmt: 0,
- othAmt: 0,
- })
- return data
- }
- val.sort(function (a, b) {
- return a.medChrgitm - b.medChrgitm
- })
- data = val
- return data
- }
- // 医保统筹支付
- export let fndPayTypeData = []
- export let fndPayTypeMap = {}
- getFundPayType().then(res => {
- fndPayTypeData = res
- fndPayTypeData.forEach(item => {
- fndPayTypeMap[item.code] = {code: item.code, name: item.name}
- })
- })
- export function fenLeiZhiFuLeiXing(val) {
- let obj = {}
- let qiTa = []
- let shuShiHua = ['310100', '330100', '390200', '320100', '610100', "370100"]
- for (let i = 0; i < shuShiHua.length; i++) {
- obj[shuShiHua[i]] = {
- fundPayType: shuShiHua[i],
- fundPayamt: "",
- }
- }
- val.forEach(item => {
- let name = fndPayTypeMap.hasOwnProperty(item.fundPayType)
- if (shuShiHua.indexOf(item.fundPayType) > -1) {
- obj[item.fundPayType] = {
- fundPayType: item.fundPayType,
- fundPayamt: item.fundPayamt,
- name: name ? fndPayTypeMap[item.fundPayType].name : ""
- }
- } else {
- qiTa.push({
- fundPayType: item.fundPayType,
- fundPayamt: item.fundPayamt,
- name: name ? fndPayTypeMap[item.fundPayType].name : "其他"
- })
- }
- })
- if (listIsBlank(qiTa)) {
- qiTa.push({
- fundPayType: "",
- fundPayamt: "",
- name: ""
- })
- }
- return {obj, qiTa}
- }
- export const outpatientChronicDisease = (list) => {
- let data = []
- if (listIsBlank(list)) {
- for (let i = 0; i < 6; i++) {
- data.push({
- diagCode: '',
- diagName: '',
- oprnOprtCode: '',
- oprnOprtName: '',
- })
- }
- } else {
- return list
- }
- return data
- }
|