/*
 * @Descripttion: zx
 * @Company: 思宏科技
 * @version: v1.0
 * @Author: zx
 * @Date: 2021-11-04 10:33:22
 * @LastEditors: OBKoro1
 * @LastEditTime: 2022-01-23 11:50:00
 */
import request from '../../src/js/request'
import { _REMOTE_VISITS, _NURSE_CLIENT, _MEMBERS } from '../base-api'

//远程探视列表
export const fhGetRemoteVisitsList = (id, params) =>
  request({
    url: `${_REMOTE_VISITS}/${id}`,
    params
  })

//远程探视详情
export const fhGetRemoteVisitsDetail = id =>
  request({
    url: `${_REMOTE_VISITS}/detail/${id}`
  })

//远程探视-患者详情
export const fhGetPatientInfo = (params, memberId) =>
  request({
    url: `${_NURSE_CLIENT}/${memberId}/patients`,
    params
  })

//远程探视-患者认证
export const fhSavePatientInfo = (data, memberId) =>
  request({
    url: `${_NURSE_CLIENT}/${memberId}/patients`,
    method: 'post',
    data
  })

//获取患者住院信息
export const fhGetPatientRecord = (params, memberId, hospitalId) =>
  request({
    url: `${_NURSE_CLIENT}/${memberId}/patients/hospitalization-record/${hospitalId}`,
    params
  })
// 通过id获取住院信息
export const fhGetPatientIdRecord = id =>
  request({
    url: `${_NURSE_CLIENT}/hospitalization-record/${id}`
  })

//创建患者住院信息
export const fhSavePatientRecord = (data, memberId) =>
  request({
    url: `${_NURSE_CLIENT}/${memberId}/patients/hospitalization-record`,
    method: 'post',
    data
  })

//修改患者住院信息
export const fhPutPatientRecord = (data, memberId, hospitalId) =>
  request({
    url: `${_NURSE_CLIENT}/${memberId}/patients/hospitalization-record/${hospitalId}`,
    method: 'put',
    data
  })
// 获取患者家属列表
export const fhGetFamilyMembers = (params, memberId) =>
  request({
    url: `${_NURSE_CLIENT}/patients/${memberId}/family-members`,
    params
  })
//患者添加家属
export const fhSaveFamilyMembers = (data, memberId) =>
  request({
    url: `${_NURSE_CLIENT}/patients/${memberId}/family-members`,
    method: 'post',
    data
  })
// 获取患者家属详情
export const fhGetFamilyMembersDetail = (params, memberId, familyMemberId) =>
  request({
    url: `${_NURSE_CLIENT}/patients/${memberId}/family-members/${familyMemberId}`,
    params
  })
// 患者编辑家属
export const fhEditFamilyMembers = (data, memberId, familyMemberId) =>
  request({
    url: `${_NURSE_CLIENT}/patients/${memberId}/family-members/${familyMemberId}`,
    method: 'put',
    data
  })
// 患者删除家属
export const fhDeleteFamilyMembers = (memberId, familyMemberId) =>
  request({
    url: `${_NURSE_CLIENT}/patients/${memberId}/family-members/${familyMemberId}`,
    method: 'delete'
  })
//预约远程探视
export const fhSaveRemoteVisits = (data, hospitalId, sickroomId) =>
  request({
    url: `${_REMOTE_VISITS}/${hospitalId}/${sickroomId}`,
    method: 'post',
    data
  })
// 修改
export const fhChangeRemoteVisits = (id, patientId, data) =>
  request({
    url: `${_REMOTE_VISITS}/patient/${id}/${patientId}`,
    method: 'put',
    data
  })
// 生成分享url
export const fhCreateUrl = params =>
  request({
    url: `${_MEMBERS}/url-link`,
    method: 'post',
    params
  })
// 生成远程探视二维码
export const fhCreateRemoteQr = params =>
  request({
    url: `${_REMOTE_VISITS}/qr-code`,
    method: 'post',
    params
  })
// 生成分享二维码
export const fhCreateQr = params =>
  request({
    url: `${_MEMBERS}/qr-code`,
    method: 'post',
    params
  })
// 获取该科室的远程探视设置
export const fhGetRemoteVisitsSetting = (hospitalId, sickroomId) =>
  request({
    url: `${_REMOTE_VISITS}/get-setting/${hospitalId}/${sickroomId}`
  })
// trtc签名
export const fhSendUserSign = (recordId, userId) =>
  request({
    url: `${_REMOTE_VISITS}/send-user-sig`,
    method: 'post',
    params: {
      recordId,
      userId
    }
  })
