import {sockteStore} from '@/stores/sockteInfo'
|
import { confingInfoStore } from '@/stores/StoresConfing'
|
import {getPatientInfo2,updatePatient} from '@/api/user/index'
|
import {writePatient,writeResult} from './sockteStomp'
|
import { ipcRenderer } from 'electron'
|
/**
|
* 发送患者卡号返回患者信息
|
* @param codeStr
|
*/
|
const sendPationCodeApi=(codeStr:string)=>{
|
ipcRenderer.invoke('logger', `用患者code获取患者数据 code:${codeStr}`)
|
const pcName= sockteStore().pcName
|
const mode={
|
machineName:pcName,
|
clientCode:confingInfoStore().confingInfo.clientCode,
|
queryCode:codeStr
|
}
|
getPatientInfo2(mode).then(re=>{
|
ipcRenderer.invoke('logger', `获取患者数据成功:${JSON.stringify(re)}`)
|
writePatient(re.data)
|
}).catch(err=>{
|
ipcRenderer.invoke('logger', `获取患者数据失败:${err}`)
|
})
|
}
|
const updatePatientApi=(pam:object)=>{
|
updatePatient(pam).then(re=>{
|
writeResult(re.data)
|
})
|
|
}
|
export {
|
sendPationCodeApi,
|
updatePatientApi
|
}
|