Browse Source

病例分析相关接口

master
aBin 4 years ago
parent
commit
11f797d7b0
  1. 10
      src/App.vue
  2. 130
      src/components/Echarts/Analysis.vue
  3. 2
      src/components/PatientInfo/PatientTable.vue
  4. 5
      src/config/api.js
  5. 13
      src/main.js
  6. 2
      src/plugins/ant-design-vue.js
  7. 1
      src/store/modules/home/actions.js
  8. 10
      src/store/modules/home/mutations.js
  9. 105
      src/views/CaseAnalysis/CaseAnalysis.vue
  10. 1
      src/views/CaseSearch/CaseSearch.vue
  11. 6
      src/views/PatientInfo/PatientInfo.vue
  12. 3
      src/views/SelectPatient/SelectPatient.vue

10
src/App.vue

@ -27,6 +27,7 @@ export default {
if (val.userId) {
const params = { userId: val.userId };
this.getUserId(params);
console.log('val.userId:' + val.userId);
}
},
},
@ -35,9 +36,10 @@ export default {
const userId = '1218763410024566784';
const params = { userId };
this.getUserId(params);
// this.getToken();
this.getHospitalId();
if (sessionStorage.getItem('patientId')) {
this.setPatientId(sessionStorage.getItem('patientId'));
if (localStorage.getItem('patientId')) {
this.setPatientId(localStorage.getItem('patientId'));
}
const that = this;
window.plugin = window.TallPlugin.init();
@ -45,14 +47,14 @@ export default {
// created created
// PT ididididuserId
window.plugin.created(function(props) {
that.setPtProps(props);
console.log('props: ', props);
that.setPtProps(props);
});
},
methods: {
...mapActions('home', ['getUserId']),
...mapMutations('home', ['setPtProps', 'setHospitalId', 'setPatientId']),
...mapMutations('home', ['setPtProps', 'setHospitalId', 'setPatientId', 'getToken']),
async getHospitalId() {
try {

130
src/components/Echarts/Analysis.vue

@ -0,0 +1,130 @@
<!--
* @Author: wally
* @email: 18603454788@163.com
* @Date: 2021-01-29 14:45:02
* @LastEditors: wally
* @LastEditTime: 2021-02-19 15:50:23
-->
<template>
<!-- <div>数据统计组件</div> -->
<div style="width: 100%; height: 500px" class="chart-box">
<div id="Analysis" style="height: 500px"></div>
</div>
</template>
<script>
import { HospitalComplete } from 'config/api';
export default {
name: 'Analysis',
props: {
lists: {
type: Object,
default: function() {
return {};
},
},
},
data() {
return {
// msg: 'Welcome to Your Vue.js App',
width: '',
height: '',
nameList: [], //
dataList: [],
series: [],
colorList: ['#5470C6', '#91CC75', '#FAC858', '#EE6666', '#73C0DE'],
};
},
watch: {
lists() {
this.nameList = [];
this.dataList = [];
this.series = [];
//
for (let i = 0; i < this.lists.selGroupNums.length; i++) {
// Y
this.nameList.push(this.lists.selGroupNums[i].name);
let arr = [];
//
for (let j = 0; j < this.lists.stringList.length; j++) {
// list
for (let k = 0; k < this.lists.selGroupNums[i].list.length; k++) {
// listcontent content value
if (this.lists.selGroupNums[i].list[k].content === this.lists.stringList[j]) {
let obj = {
name: this.lists.selGroupNums[i].list[k].content,
value: this.lists.selGroupNums[i].list[k].nums,
};
arr.push(obj);
break;
// list
} else if (k === this.lists.selGroupNums[i].list.length - 1) {
let obj = {
name: this.lists.stringList[i],
value: 0,
};
arr.push(obj);
break;
}
}
}
this.dataList.push(arr);
}
//
for (let i = 0; i < this.dataList[0].length; i++) {
let arr1 = [];
for (let k = 0; k < this.dataList.length; k++) {
arr1.push(this.dataList[k][i].value);
}
let obj = {
name: this.dataList[0][i].name,
type: 'bar',
stack: 'total',
label: { show: true },
itemStyle: { color: this.colorList[`${i % 5}`] },
emphasis: { focus: 'series' },
data: arr1,
};
this.series.push(obj);
}
this.drawLine();
console.log(this.dataList);
console.log(this.series);
},
},
mounted() {
this.drawLine();
},
methods: {
drawLine() {
// domecharts
let myChart = this.$echarts.init(document.getElementById('Analysis'));
//
var option = {
tooltip: {
trigger: 'axis',
axisPointer: {
//
type: 'shadow', // 线'line' | 'shadow'
},
},
legend: { data: this.lists.stringList },
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true,
},
xAxis: { type: 'value' },
yAxis: {
type: 'category',
data: this.nameList,
},
series: this.series,
};
myChart.setOption(option);
},
},
};
</script>
<style lang="stylus" scoped ></style>

2
src/components/PatientInfo/PatientTable.vue

@ -110,7 +110,7 @@ export default {
//
chooseItem(id) {
this.setPatientId(id);
sessionStorage.setItem('patientId', id);
localStorage.setItem('patientId', id);
},
handleTableChange(pagination) {

5
src/config/api.js

@ -23,8 +23,10 @@ export const upload = `${file}/upload`;
// 通过任务Id查询项目Id
export const getHId = params => axios.get(`${hospatil}/byProjectId?projectId=${params}`);
// 查询医院列表
export const getHList = params => axios.get(`${hospatil}/selHospatil`);
// 保存患者病例信息
export const saveCaseMes = params => axios.post(`${patient}/saveCaseMes`, params);
@ -43,6 +45,9 @@ export const selSearchCriteriaList = params => axios.post(`${patient}/selSearchC
// 试题相关接口:按code查看题目信息,code为空则查询全部
export const queryAll = params => axios.post(`${tcm}/question/query`, params);
// 查询所有得题目的类型和题目相关信息
export const queryQuestion = params => axios.get(`${tcm}/question/queryQuestion`);
// 查询所有对照组的信息
export const getQuery = params => axios.post(`${inpatient}/query`, params);

13
src/main.js

@ -19,6 +19,8 @@ import 'echarts-gl';
import 'echarts/map/js/province/shanxi.js'; //对应的省份
import './plugins/vue-quill-editor.js';
import VueDOMPurifyHTML from 'vue-dompurify-html';
// import { getUserId } from 'config/api-user';
// Vue.use(echarts);
Vue.use(VueDOMPurifyHTML);
Vue.prototype.$echarts = echarts;
@ -28,6 +30,17 @@ import moment from 'moment'; //导入文件
Vue.prototype.$moment = moment; //赋值使用
Vue.config.productionTip = false;
// router.beforeEach((to, from, next) => {
// const token = sessionStorage.getItem('anyringToken');
// if (token) {
// next();
// } else {
// const userId = '1218763410024566784';
// const params = { userId };
// getUserId(params).then(next());
// }
// });
window.vm = new Vue({
router,
store,

2
src/plugins/ant-design-vue.js

@ -39,6 +39,7 @@ import {
Card,
List,
Collapse,
Cascader,
} from 'ant-design-vue';
import { ConfigProvider } from 'ant-design-vue';
Vue.component(ConfigProvider.name, ConfigProvider);
@ -72,6 +73,7 @@ Vue.use(Spin);
Vue.use(Card);
Vue.use(List);
Vue.use(Collapse);
Vue.use(Cascader);
Vue.prototype.$message = message;
Vue.prototype.$notification = notification;

1
src/store/modules/home/actions.js

@ -16,6 +16,7 @@ const actions = {
if (code === 200) {
commit('sign', data.token);
commit('setUser', data);
console.log(data.token);
return data;
} else {
throw msg;

10
src/store/modules/home/mutations.js

@ -8,7 +8,15 @@ const mutations = {
state.anyringToken = token;
sessionStorage.setItem('anyringToken', token);
},
/**
* 设置token
* @param { object } state
* @param { string } token
*/
getToken(state, token) {
state.anyringToken = sessionStorage.getItem('anyringToken');
console.log('anyringToken' + sessionStorage.getItem('anyringToken'));
},
/**
* 设置user用户信息
* @param {object} state

105
src/views/CaseAnalysis/CaseAnalysis.vue

@ -1,7 +1,5 @@
<template>
<div class="flex-column">
<a-collapse v-model="activeKey">
<a-collapse-panel key="1" header="搜索条件">
<div>
<div class="d-flex flex-row flex-wrap">
<a-form :form="form1" class="d-flex flex-wrap align-center" layout="inline">
@ -23,12 +21,14 @@
</div>
</div>
<a-form :form="form">
<a-collapse v-model="activeKey">
<!-- 首先遍历整个data大数组 -->
<div v-for="(item, index) in list" :key="index">
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
<!-- 一级大标题 -->
<!-- <div v-for="(item, index) in list" :key="index"> -->
<a-collapse-panel v-for="(item, index) in list" :key="index.toString()" :header="item.name">
<!-- <a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol">
一级大标题
<h2>{{ item.name }}</h2>
</a-form-item>
</a-form-item> -->
<!-- 一级标题下的各种问题questionVos判断类型1-12展示不同需要填写的内容 -->
<div v-for="a in item.questionVos" :key="a.name">
<a-form-item :label-col="formItemLayout.labelCol" :wrapper-col="formItemLayout.wrapperCol" :label="a.question">
@ -521,11 +521,7 @@
style="height: 100px"
@change="onChange($event, h.type, h.id, h.recordId)"
/>
<a-radio-group
v-else-if="h.type === 3"
v-model="value"
@change="onChange($event, h.type, h.id, h.recordId)"
>
<a-radio-group v-else-if="h.type === 3" v-model="value" @change="onChange($event, h.type, h.id, h.recordId)">
<a-radio v-for="(b, c) in h.optionVos" :key="c" :style="radioStyle" :value="b.showValue">
{{ b.showValue }}
</a-radio>
@ -537,11 +533,7 @@
</a-col>
</a-row>
</a-checkbox-group>
<a-select
v-else-if="h.type === 5"
style="width: 120px"
@change="onChange($event, h.type, h.id, h.recordId)"
>
<a-select v-else-if="h.type === 5" style="width: 120px" @change="onChange($event, h.type, h.id, h.recordId)">
<a-select-option v-for="(b, c) in h.optionVos" :key="c" :value="b.showValue">
{{ b.showValue }}
</a-select-option>
@ -558,11 +550,7 @@
>
<a-button v-show="fileList.length === 0"> <a-icon type="upload" /> 点击上传 </a-button>
</a-upload>
<a-radio-group
v-else-if="h.type === 8"
v-model="value"
@change="onChange($event, h.type, h.id, h.recordId)"
>
<a-radio-group v-else-if="h.type === 8" v-model="value" @change="onChange($event, h.type, h.id, h.recordId)">
<a-radio-group @change="onChange($event, h.type, h.id, h.recordId)">
<a-radio v-for="(f, g) in h.optionVos" :key="g" :style="radioStyle" :value="f.showValue">
{{ f.showValue }}
@ -636,8 +624,7 @@
v-if="
contentList.find(item => {
return (
item.testQuestionsId === h.id &&
item.contents.find(content => content === `${b.showValue}`)
item.testQuestionsId === h.id && item.contents.find(content => content === `${b.showValue}`)
);
}) && b.afterOperation > 0
"
@ -704,17 +691,37 @@
</a-form-item>
</div>
</div>
</div>
</a-form>
<a-button class="white--text px-10" type="primary" @click="setData()" v-if="list.length > 0">提交</a-button>
</a-collapse-panel>
<!-- </div> -->
</a-collapse>
</a-form>
<div style="padding: 4px 0 40px 0">
<a-cascader
style="width: 200px"
:field-names="{ label: 'name', value: 'id', children: 'optionVos' }"
:options="options"
:display-render="displayRender"
expand-trigger="hover"
placeholder="请选择类型"
@change="changeQues"
/>
<a-select mode="multiple" size="default" placeholder="请选择对照组" style="width: 450px; margin-left: 40px" @change="handleChange">
<a-select-option v-for="i in controlGroups" :key="i.id">
{{ i.name }}
</a-select-option>
</a-select>
</div>
<a-button class="white--text px-10" type="primary" @click="setData()" v-if="list.length > 0">提交</a-button>
<a-card style="width: 100%; height: 600px; margin-top: 10px" title="病例分析统计">
<analysis :lists="lists" />
</a-card>
</div>
</template>
<script>
import { mapState, mapActions } from 'vuex';
import { getHList, selSearchCriteriaList, queryAll, countAnalysis, upload } from 'config/api';
import { getHList, selSearchCriteriaList, queryAll, countAnalysis, upload, queryQuestion } from 'config/api';
import Analysis from 'components/Echarts/Analysis';
const formItemLayout = {
labelCol: { span: 6 },
wrapperCol: { span: 9 },
@ -722,6 +729,7 @@ const formItemLayout = {
const tailItemLayout = { wrapperCol: { span: 18, offset: 4 } };
export default {
name: 'CaseAnalysis',
components: { Analysis },
data() {
return {
formItemLayout,
@ -773,8 +781,11 @@ export default {
name: '废弃',
},
],
lists: { pageNum: 1, pageSize: 10, total: 1, list: [] },
activeKey: ['1'], //
lists: {},
activeKey: ['0'], //
options: [], //
testQuestionsId: '', // Id
inpatientList: [], // Id
};
},
computed: {
@ -786,6 +797,7 @@ export default {
},
},
created() {
this.getQues();
this.getControlGroups();
this.handleSearchCriteriaList();
this.getHos();
@ -1077,6 +1089,35 @@ export default {
}
}
},
// ID
async getQues() {
try {
const params = {};
const res = await queryQuestion(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.options = data;
} else {
this.$message.error('查询失败');
}
} catch (error) {
this.$message.error(error);
}
},
//
changeQues(value) {
this.testQuestionsId = parseInt(value);
},
displayRender({ labels }) {
return labels[labels.length - 1];
},
handleChange(value) {
console.log(`Selected: ${value}`);
this.inpatientList = [];
for (let i = 0; i < value.length; i++) {
this.inpatientList.push(parseInt(value[i]));
}
},
//
async setData() {
try {
@ -1086,16 +1127,16 @@ export default {
conditionListDate: this.conditionListDate,
hospitalId: this.setObj.hospitalId, // id
hospitalization: this.setObj.hospitalization, //
inpatientId: [], // id
inpatientId: this.inpatientList, // id
inputStatus: this.setObj.inputStatus, //
testQuestionsId: '',
testQuestionsId: this.testQuestionsId,
},
};
const res = await countAnalysis(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.lists = data;
console.log(this.lists);
// console.log(this.lists);
} else {
this.$message.error('搜索失败');
}

1
src/views/CaseSearch/CaseSearch.vue

@ -797,6 +797,7 @@ export default {
this.getControlGroups();
this.handleSearchCriteriaList();
this.getHos();
this.setData();
},

6
src/views/PatientInfo/PatientInfo.vue

@ -719,7 +719,7 @@ export default {
action: upload, //
fileList: [], //
files: '', // Id
dateFormat: 'YYYY-MM-DD',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
dateChoose: new Date(),
subDateTime: '',
};
@ -980,7 +980,7 @@ export default {
},
//
changeDate(date) {
this.subDateTime = this.$moment(date._d).format('YYYY-MM-DD');
this.subDateTime = this.$moment(date._d).format('YYYY-MM-DD HH:mm:ss');
},
//
async setData() {
@ -989,7 +989,7 @@ export default {
param: {
list: this.contentList,
patientId: this.patientId,
timeSlot: this.subDateTime ? this.subDateTime : this.$moment(this.dateChoose).format('YYYY-MM-DD'),
timeSlot: this.subDateTime ? this.subDateTime : this.$moment(this.dateChoose).format('YYYY-MM-DD HH:mm:ss'),
},
};
const res = await saveCaseMes(params);

3
src/views/SelectPatient/SelectPatient.vue

@ -51,6 +51,7 @@ export default {
};
const res = await selPatientMes(params);
const { code, msg, data } = res.data;
console.log('获取列表');
if (code === 200) {
this.lists = data;
} else {
@ -58,7 +59,7 @@ export default {
throw msg;
}
} catch (error) {
throw new Error(`CaseSearch.vue method selSearchCriteriaList: ${error}`);
throw new Error(error);
}
},
},

Loading…
Cancel
Save