refactor(health): 小程序端适配后端API重构
- 新增 medicationTask.js 替代 medicationRecord.js - 新增 medicationAdherence.js 依从性统计API
This commit is contained in:
@@ -1,79 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询用药记录列表
|
||||
export function listMedicationRecord(query) {
|
||||
return request({
|
||||
url: '/health/medicationRecord/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询今日用药记录
|
||||
export function getTodayRecords(personId) {
|
||||
return request({
|
||||
url: '/health/medicationRecord/today',
|
||||
method: 'get',
|
||||
params: { personId }
|
||||
})
|
||||
}
|
||||
|
||||
// 查询某计划某天的用药记录
|
||||
export function getRecordsByPlanAndDate(planId, date) {
|
||||
return request({
|
||||
url: '/health/medicationRecord/plan/' + planId + '/date/' + date,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询用药记录详细
|
||||
export function getMedicationRecord(id) {
|
||||
return request({
|
||||
url: '/health/medicationRecord/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增用药记录
|
||||
export function addMedicationRecord(data) {
|
||||
return request({
|
||||
url: '/health/medicationRecord',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改用药记录
|
||||
export function updateMedicationRecord(data) {
|
||||
return request({
|
||||
url: '/health/medicationRecord',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除用药记录
|
||||
export function delMedicationRecord(id) {
|
||||
return request({
|
||||
url: '/health/medicationRecord/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 服药(标记为已服用)
|
||||
export function takeMedication(id, dosage, remark) {
|
||||
return request({
|
||||
url: '/health/medicationRecord/take/' + id,
|
||||
method: 'put',
|
||||
params: { dosage, remark }
|
||||
})
|
||||
}
|
||||
|
||||
// 跳过服药
|
||||
export function skipMedication(id, remark) {
|
||||
return request({
|
||||
url: '/health/medicationRecord/skip/' + id,
|
||||
method: 'put',
|
||||
params: { remark }
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user