add real data to ai
This commit is contained in:
@@ -425,6 +425,31 @@ class UserAnalysesApi {
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
async getAllUserAnalysisResponses(): Promise<
|
||||
Database['medreport']['Functions']['get_latest_analysis_response_elements_for_current_user']['Returns']
|
||||
> {
|
||||
const {
|
||||
data: { user },
|
||||
} = await this.client.auth.getUser();
|
||||
|
||||
if (!user) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const { data, error } = await this.client
|
||||
.schema('medreport')
|
||||
.rpc('get_latest_analysis_response_elements_for_current_user', {
|
||||
p_user_id: user.id,
|
||||
});
|
||||
|
||||
if (error) {
|
||||
console.error('Error fetching user analysis responses: ', error);
|
||||
throw error;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
export function createUserAnalysesApi(client: SupabaseClient<Database>) {
|
||||
|
||||
@@ -764,8 +764,8 @@ export type Database = {
|
||||
norm_upper?: number | null
|
||||
norm_upper_included?: boolean | null
|
||||
original_response_element: Json
|
||||
response_time: string | null
|
||||
response_value: number | null
|
||||
response_time?: string | null
|
||||
response_value?: number | null
|
||||
response_value_is_negative?: boolean | null
|
||||
response_value_is_within_norm?: boolean | null
|
||||
status?: string | null
|
||||
@@ -1335,6 +1335,7 @@ export type Database = {
|
||||
medipost_private_message_id: string | null
|
||||
medusa_order_id: string | null
|
||||
response_xml: string | null
|
||||
updated_at: string | null
|
||||
xml: string | null
|
||||
}
|
||||
Insert: {
|
||||
@@ -1347,6 +1348,7 @@ export type Database = {
|
||||
medipost_private_message_id?: string | null
|
||||
medusa_order_id?: string | null
|
||||
response_xml?: string | null
|
||||
updated_at?: string | null
|
||||
xml?: string | null
|
||||
}
|
||||
Update: {
|
||||
@@ -1359,6 +1361,7 @@ export type Database = {
|
||||
medipost_private_message_id?: string | null
|
||||
medusa_order_id?: string | null
|
||||
response_xml?: string | null
|
||||
updated_at?: string | null
|
||||
xml?: string | null
|
||||
}
|
||||
Relationships: []
|
||||
@@ -2030,6 +2033,18 @@ export type Database = {
|
||||
personal_code: string
|
||||
}[]
|
||||
}
|
||||
get_latest_analysis_response_elements_for_current_user: {
|
||||
Args: { p_user_id: string }
|
||||
Returns: {
|
||||
analysis_name: string
|
||||
analysis_name_lab: string
|
||||
norm_lower: number
|
||||
norm_status: number
|
||||
norm_upper: number
|
||||
response_time: string
|
||||
response_value: number
|
||||
}[]
|
||||
}
|
||||
get_latest_medipost_dispatch_state_for_order: {
|
||||
Args: { medusa_order_id: string }
|
||||
Returns: {
|
||||
|
||||
Reference in New Issue
Block a user