123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279 |
- import { json } from "@utils/ajax";
- import { SET_TREAT } from '@store/types/diagnosticList';
- import { ADD_DIAGNOSTIC, GET_DIAGNOSTIC_STR} from '@store/types/diagnosticList';
- import { SET_DRUG_INFO, SET_TREATMENT, SET_RECOMMEND_BASIC } from '@store/types/treat';
- import {storageLocal,getEMRParams} from '@utils/tools';
- import { isAddMainSuit } from '@store/async-actions/diagnosticList';
- const api={
- push:'/api/icss/push/pushInner',
- textPush:'/api/icss/push/pushText'
- }
- export const addDiagnostic = (item) => {
- return (dispatch, getState) => {
- const state = getState();
- let url = api.push;
- if(+state.typeConfig.confirmType===1){
- url=api.textPush;
- }
- const emrData = getEMRParams();
- const diagnosticList = state.diagnosticList.diagnosticList;
- let diag = '';
- if(diagnosticList) {
- for (let i = 0; i < diagnosticList.length; i++ ) {
- if(i ===0 ) {
- diag = diag + diagnosticList[i].name;
- } else {
- diag = diag + ',' + diagnosticList[i].name;
- }
- }
- }
- if (item.type === 1) {
- diag = diag + ',' + item.name
- } else {
- diag = diag + ',' + item.name
- }
- const params = {
- "age": emrData.age,
- "featureType": "8",
- "diag": diag,
- "diseaseId": item.id,
- "lis": emrData.lis,
- "other": emrData.other,
- "pacs": emrData.pacs,
- "sex": emrData.sex,
- "symptom": emrData.current + emrData.main,
- "vital": emrData.vital
- };
- json(url, params).then((data) =>{
- if (data.data.data) {
- item.treat = data.data.data.treat
- dispatch({
- type: ADD_DIAGNOSTIC,
- item: item
- })
- } else {
- item.treat = null
- dispatch({
- type: ADD_DIAGNOSTIC,
- item: item
- })
- }
- dispatch({
- type: GET_DIAGNOSTIC_STR
- });
- dispatch(isAddMainSuit())
- }).catch((e) =>{
- console.log(e)
- })
- }
- }
- export const getTreatResult = (item) =>{
- return (dispatch, getState) => {
- const state = getState();
- let url = api.push;
- if(+state.typeConfig.confirmType===1){
- url=api.textPush;
- }
- const emrData = getEMRParams();
- // const params = {
- // "age": emrData.age,
- // "featureType": "8",
- // "dis": emrData.dis,
- // "diseaseId": emrData.diseaeId,
- // "lis": emrData.lis,
- // "other": emrData.other,
- // "pacs": emrData.pacs,
- // "sex": emrData.sex,
- // "symptom": emrData.current||emrData.main,
- // "vital": emrData.vital
- // };
- const diagnosticList = state.diagnosticList.diagnosticList;
- let diag = '';
- if(diagnosticList) {
- for (let i = 0; i < diagnosticList.length; i++ ) {
- if(i ===0 ) {
- diag = diag + diagnosticList[i].name;
- } else {
- diag = diag + ',' + diagnosticList[i].name;
- }
-
- }
- }
- const params = {
- "age": emrData.age,
- "featureType": "8",
- "diag": diag,
- "diseaseId": item.id,
- "lis": emrData.lis,
- "other": emrData.other,
- "pacs": emrData.pacs,
- "sex": emrData.sex,
- "symptom": emrData.current + emrData.main,
- "vital": emrData.vital
- };
-
- json(url, params).then((data) =>{
- let treat;
- if(data.data.data) {
- treat = data.data.data.treat || {}
- }
- if(treat) {
- return dispatch({
- type: SET_TREATMENT,
- treatment: treat.treatment,
- generalTreat: treat.commonTreatment,
- surgeryTreat: treat.surgeryTreatment,
- })
- }
-
- return
- }).catch((e) =>{
- console.log(e)
- })
- // const treatment = [
- // {
- // id:132,
- // drugsName:"支气管扩张剂",
- // showInfo:"1",
- // medicitionsList:[
- // {
- // id:137,
- // medicitionName:"多索茶碱",
- // rate:"0.94",
- // isShow:"1", //1展示,0不展示
- // forbidden:"0", //0:正常,1:慎用,2:禁忌
- // showInfo: "1",
- // selected: false
- // },
- // {
- // id:138,
- // medicitionName:"二羟丙茶碱",
- // rate:"0.92",
- // isShow:"1",
- // forbidden:"1",
- // showInfo:"0",
- // selected: false
- // },
- // {
- // id:4,
- // medicitionName:"二羟丙茶碱11",
- // rate:"0.50",
- // isShow:"0",
- // forbidden:"2",
- // showInfo:false,
- // selected: false
- // }
- // ]
- // },
- // {
- // id:133,
- // drugsName:"抗生素类(喹诺酮类)",
- // showInfo: '0',
- // medicitionsList:[
- // {
- // id:139,
- // medicitionName:"左氧氟沙星",
- // rate:"0.50",
- // isShow:"1", //1展示,0不展示
- // forbidden:"0",
- // showInfo:'0',
- // selected: false
- // },
- // {
- // id:140,
- // medicitionName:"莫西沙星",
- // rate:"0.82",
- // isShow:"0",
- // forbidden:"2",
- // showInfo:"0",
- // selected: false
- // }
- // ]
- // }
- // ];
- // const generalTreat = '<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 25px; padding: 10px; border: 0px !important;\">风湿性心脏病通常侵犯二尖瓣,其次是主动脉瓣。风湿性主动脉瓣关闭不全也常合并二尖瓣病变,临床称之为联合瓣膜病(combined valvular disease)。梅毒性主动脉炎可发展为梅毒性主动脉关闭不全或主动脉瘤。</p><p style=\"text-align: right;\">来源 : 中华眼科学:全3册(下)</p><p><br/></p>';
- // const surgeryTreat = '<p style=\"box-sizing: border-box; margin-top: 0px; margin-bottom: 10px; line-height: 25px; padding: 10px; border: 0px !important;\">风湿性心脏病通常侵犯二尖瓣,其次是主动脉瓣。风湿性主动脉瓣关闭不全也常合并二尖瓣病变,临床称之为联合瓣膜病(combined valvular disease)。梅毒性主动脉炎可发展为梅毒性主动脉关闭不全或主动脉瘤。</p><p style=\"text-align: right;\">来源 : 中华眼科学:全3册(下)</p><p><br/></p>';
-
- // return dispatch({
- // type: SET_TREATMENT,
- // treatment: treatment,
- // generalTreat: generalTreat,
- // surgeryTreat: surgeryTreat,
- // })
- }
-
- }
- export const getInstroduce = (item)=>{
- return (dispatch, getState) =>{
- const url = '/api/icss/introduceInfo/getByQuestionId';
- const params = {
- questionId: item.id,
- type: 8,
- position: 5
- }
- json(url, params)
- .then((data)=>{
- if(data.data.data) {
- dispatch({
- type: SET_DRUG_INFO,
- instroduce: data.data.data.introduceDetailList,
- name: item.medicitionName
- })
- } else {
- dispatch({
- type: SET_DRUG_INFO,
- instroduce: [],
- name: item.medicitionName
- })
- }
-
- }).catch((e) => {
- console.log(e)
- })
- }
- }
- //其他推荐推荐依据不用展示
- // export const getRecommendBasic = (item)=>{
-
- // return (dispatch, getState) =>{
- // const url = '/api/icss/introduceInfo/getByQuestionId';
- // const params = {
- // questionId: item.id,
- // type: 9,
- // position: 2
- // }
- // json(url, params)
- // .then((data)=>{
- // if (data.status === 200) {
- // if(data.data.data) {
- // dispatch({
- // type: SET_RECOMMEND_BASIC,
- // recommendBasic: data.data.data.introduceDetailList,
- // })
- // } else {
- // dispatch({
- // type: SET_RECOMMEND_BASIC,
- // recommendBasic: [],
- // })
- // }
-
- // }
- // }).catch((e) => {
- // console.log(e)
- // })
- // }
- // }
|