feat(installation): add encounter list
This commit is contained in:
@@ -1,14 +1,42 @@
|
||||
// types
|
||||
import type { MedicineGroup } from '~/models/medicine-group'
|
||||
import type { MedicineMethod } from '~/models/medicine-method'
|
||||
import type { Uom } from '~/models/uom'
|
||||
|
||||
// services
|
||||
import { getMedicineGroups } from '~/services/medicine-group.service'
|
||||
import { getMedicineMethods } from '~/services/medicine-method.service'
|
||||
import { getUoms } from '~/services/uom.service'
|
||||
import { getEncounters } from '~/services/encounter.service'
|
||||
|
||||
// variables
|
||||
export const medicineGroups = ref<{ value: string; label: string }[]>([])
|
||||
export const medicineMethods = ref<{ value: string; label: string }[]>([])
|
||||
export const uoms = ref<{ value: string; label: string }[]>([])
|
||||
export const encounterClasses = ref<{ value: string; label: string }[]>([])
|
||||
|
||||
export const getMedicineGroupList = async () => {
|
||||
const result = await getMedicineGroups()
|
||||
if (result.success) {
|
||||
const currentMedicineGroups = result.body?.data || []
|
||||
medicineGroups.value = currentMedicineGroups.map((medicineGroup: MedicineGroup) => ({
|
||||
value: medicineGroup.code,
|
||||
label: medicineGroup.name,
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
export const getMedicineMethodList = async () => {
|
||||
const result = await getMedicineMethods()
|
||||
if (result.success) {
|
||||
const currentMedicineMethods = result.body?.data || []
|
||||
medicineMethods.value = currentMedicineMethods.map((medicineMethod: MedicineMethod) => ({
|
||||
value: medicineMethod.code,
|
||||
label: medicineMethod.name,
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
export const getUomList = async () => {
|
||||
const result = await getUoms()
|
||||
if (result.success) {
|
||||
|
||||
Reference in New Issue
Block a user