fix: debug encounter
This commit is contained in:
@@ -40,6 +40,22 @@ export async function getPatientDetail(id: number) {
|
||||
}
|
||||
}
|
||||
|
||||
export async function getPatientByIdentifier(search: string) {
|
||||
try {
|
||||
const urlPath = search.length === 16 ? `by-resident-identity/search=${encodeURIComponent(search)}` : `/search/${search}`
|
||||
const url = `${mainUrl}/${urlPath}`
|
||||
const resp = await xfetch(url, 'GET')
|
||||
const result: any = {}
|
||||
result.success = resp.success
|
||||
result.body = (resp.body as Record<string, any>) || {}
|
||||
result.type = urlPath.includes('by-resident-identity') ? 'resident-identity' : 'identity'
|
||||
return result
|
||||
} catch (error) {
|
||||
console.error('Error fetching patient by identifier:', error)
|
||||
throw new Error('Failed to get patient by identifier')
|
||||
}
|
||||
}
|
||||
|
||||
export async function postPatient(record: any) {
|
||||
try {
|
||||
const resp = await xfetch(mainUrl, 'POST', record)
|
||||
|
||||
Reference in New Issue
Block a user