rax-medical/src/static-data/core.ts

110 lines
3.3 KiB
TypeScript
Raw Normal View History

2023-12-28 14:27:25 +08:00
import {getData, postData} from '@/axios/index'
2023-12-15 18:08:45 +08:00
export const getHospitalsData = () => {
2023-12-28 14:27:25 +08:00
const hospitals = [] as any
2023-12-15 18:08:45 +08:00
hospitals.push({ label: '北京朝阳医院', value: '北京朝阳医院' })
hospitals.push({ label: '北京朝阳医院1', value: '北京朝阳医院1' })
hospitals.push({ label: '北京朝阳医院2', value: '北京朝阳医院2' })
2023-12-28 14:27:25 +08:00
return new Promise((resolve, reject) => {
getData('/url', {}).then((res: any) => {
resolve(hospitals)
}).catch((err: any) => {
resolve(hospitals)
})
})
2023-12-14 18:29:40 +08:00
}
2023-12-15 18:08:45 +08:00
export const getPhoneAreasData = () => {
return ['中国 +86']
2023-12-19 09:47:27 +08:00
}
export const getDeptData = () => {
const depts = []
depts.push({ label: '神经外科', value: '神经外科' })
depts.push({ label: '心脏内科', value: '心脏内科' })
return depts
2023-12-21 11:58:50 +08:00
}
2023-12-26 17:11:15 +08:00
export const getMessageType = () => {
const type = []
type.push({ label: '通知', value: '通知' })
type.push({ label: '公告', value: '公告' })
return type
}
export const getLogType = () => {
const type = []
type.push({ label: '正常', value: '正常' })
type.push({ label: '异常', value: '异常' })
type.push({ label: '添加', value: '添加' })
type.push({ label: '删除', value: '删除' })
type.push({ label: '编辑', value: '编辑' })
return type
}
2023-12-24 16:15:33 +08:00
export const getusers = () => {
const user = []
while (user.length < 50) {
user.push({ name: '管理员' + user.length, code: 'admin' + user.length })
}
return user
}
// 病人名称数据
2023-12-21 11:58:50 +08:00
export const getPatients = () => {
const patients = []
while (patients.length < 10000) {
patients.push({ name: '张' + patients.length, code: 'BH' + patients.length })
}
return patients
}
2023-12-24 16:15:33 +08:00
2023-12-21 11:58:50 +08:00
export const getNarcotismWay = () => {
const narcotismWay = []
while (narcotismWay.length < 10) {
const str: string = '麻醉方式' + (narcotismWay.length + 1)
narcotismWay.push({label: str, value: str})
}
return narcotismWay
}
2023-12-24 16:15:33 +08:00
2023-12-21 11:58:50 +08:00
export const getFormTypes = () => {
const types = [
{name: '生命体征表单'},
{name: 'AI给药记录'},
{name: '医生给药记录'},
{name: '给药命令反馈'},
{name: '输药泵定时间反馈'},
{name: '术后信息表单'},
{name: '1生命体征表单'},
{name: '1AI给药记录'},
{name: '1医生给药记录'},
{name: '1给药命令反馈'},
{name: '1输药泵定时间反馈'},
{name: '1术后信息表单'},
{name: '2生命体征表单'},
{name: '2AI给药记录'},
{name: '2医生给药记录'},
{name: '2给药命令反馈'},
{name: '2输药泵定时间反馈'},
{name: '2术后信息表单'},
]
return types
}
export const getDataAlarmState = (value: number, key: string) => {
const alarms: any = {
BIS: { min: 40, max: 60 },
HR: { min: 50, max: 80 },
SBP: { min: 90, max: 120 },
DBP: { min: 60, max: 90 },
ST: { min: -0.2, max: 0.2 },
EtCO2: { min: 30, max: 45 }
}
const obj = alarms[key]
let res: 'min' | 'max' | '' = ''
if(obj) {
if(value < obj.min) res = 'min'
else if(value > obj.max) res = 'max'
}
return res
2023-12-15 18:08:45 +08:00
}