123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- import { get, post, json } from "@utils/ajax";
- import { BILLING_ADVICE, SET_TIPS, SET_TIPS_DETAILS } from '../types/pushMessage';
- import { SET_CLICK_DIAG } from '../types/diagnosticList';
- import {storageLocal,getEMRParams} from '@utils/tools';
- const api={
- push:'/api/icss/push/pushInner',
- textPush:'/api/icss/push/pushText'
- }
- //获取右侧推送信息
- export const billing = (mdata) => {
- return (dispatch, getState) =>{
- const state = getState();
- let url = api.push;
- if(+state.typeConfig.typeConfig===1){
- url=api.textPush;
- }
- const emrData = getEMRParams();
- const params = {
- age: emrData.age,
- featureType: "5,6,7",
- diag: emrData.dis,
- lis: emrData.lis,
- other: emrData.other,
- pacs: emrData.pacs,
- sex: emrData.sex,
- vital:emrData.vital,
- symptom: mdata?(emrData.current + mdata):(emrData.current + emrData.main)
- };
- storageLocal.set('emrParam',params); //推送数据存储,用作推送前对比是否有变,有变才推送
- json(url, params).then((data) => {
- let {dis, lab, pacs} = data.data.data||{};
- lab = lab||[];
- pacs = pacs||[];
- // console.log('推送数据', data.data.data);
- let vigilant=[], //警惕
- doubt=[], //疑似诊断
- possible = [], //可能诊断
- determine=[]; //确诊
- doubt = dis&&dis['疑似诊断'],
- possible = dis&&dis['可能诊断'];
- vigilant = dis&&dis['警惕'];
- determine = dis&&dis['确诊']; //确诊
- if(lab) {
- for(let i = 0; i < lab.length; i++) {
- lab[i].checked = false
- }
- }
- if(pacs) {
- for(let i = 0; i < pacs.length; i++) {
- pacs[i].checked = false
- }
- }
- dispatch({
- type: BILLING_ADVICE,
- determine: determine || [],
- doubt: doubt||[],
- possible: possible||[],
- vigilant: vigilant||[],
- lab: lab||[],
- pacs: pacs||[],
- });
- }).catch((e) =>{
- console.log(e)
- })
- }
- };
- export const getTips = (diagItem) =>{
- return (dispatch, getState) =>{
- dispatch({
- type: SET_CLICK_DIAG,
- clickDiag: diagItem
- })
- const url = '/api/icss/introduceInfo/getByQuestionId';
- const params = {
- questionId: diagItem.id,
- type: 7,
- position: 1
- }
- json(url, params)
- .then((data)=>{
- dispatch({
- type: SET_TIPS,
- tips: data.data.data
- })
- }).catch((e) => {
- console.log(e)
- })
- }
- }
- export const getTipsDetails = () => {
- return(dispatch, getState) => {
- const state = getState();
- // 诊断指南新窗口展示
- // window.open(`/static/pages/information.html?type=7&&questionId=${state.diagnosticList.clickDiag.id}`);
- //弹窗显示
- const url ='/api/icss/introduceInfo/getByQuestionId'
- const imageUrlPrefix = 'http://192.168.2.241:82'
-
- const params = {
- type: 7,
- questionId: state.diagnosticList.clickDiag.id,
- position:2
- }
- json(url, params)
- .then((data)=>{
- dispatch({
- type: SET_TIPS_DETAILS,
- tipsDetails: data.data.data
- })
- }).catch((e) => {
- console.log(e)
- })
- }
- }
|