import {CHANGE_ASSAY, CHANGE_CHECK, BILLING_ADVICE, ADD_SCHEME, SET_TIPS, SET_CHANGE_ADVICE_TREATMENT, SET_CHANGE_ADVICE_ASSAY, SET_CHANGE_ADVICE_CHECK, ADD_BILLING,CLEAR_ALL_PUSH_MESSAGE } from '../types/pushMessage';
import {changeAssay, changeCheck, setAdvice, addScheme, setTips, setChangeAdviceTreatment, setChangeAdviceAssay, setChangeAdviceCheck, addBilling,clearAllPushMessage } from '../actions/pushMessage';

const initState = {
  vigilant: [],
  doubt: [],
  possible: [],
  assay: [],
  determine: [],
  check: [ //辅检
    // {name: '胸部CT', id: 7, checked: false},
    // {name: '心肌酶谱', id: 8, checked: false},
  ],
  tips: {},
  advice: {
    // assay: '', 
    // check: '',
    // scheme: [],
    // adviceStr: '' 
  },
  AdviceStr: ''
};
export default function(state = initState, action) {
  switch (action.type) {
    case CHANGE_ASSAY:
      return changeAssay(state, action);
    case CHANGE_CHECK:
      return changeCheck(state, action);
    case BILLING_ADVICE:  //获取右侧推断信息
      return setAdvice(state, action);
    case ADD_SCHEME: 
      return addScheme(state, action);
    case SET_TIPS: 
      return setTips(state, action);
    case SET_CHANGE_ADVICE_TREATMENT:
      return setChangeAdviceTreatment(state, action);
    case SET_CHANGE_ADVICE_ASSAY: 
      return setChangeAdviceAssay(state, action);
    case SET_CHANGE_ADVICE_CHECK: 
      return setChangeAdviceCheck(state, action);
    case ADD_BILLING: 
      return addBilling(state, action);
    case CLEAR_ALL_PUSH_MESSAGE: 
      return clearAllPushMessage(state, action);
    default:
      return state;
  }
}
