feat(MED-161): update analysis results view

This commit is contained in:
2025-09-17 11:17:36 +03:00
parent 2019c2c1fc
commit bfadf56173
21 changed files with 384 additions and 228 deletions

View File

@@ -1,12 +1,13 @@
import { getSupabaseServerAdminClient } from "@/packages/supabase/src/clients/server-admin-client";
import type { AnalysisResponseElement } from "../types/analysis-response-element";
import { AnalysisOrderStatus } from '@/packages/shared/src/types/medipost-analysis';
import type { AnalysisResponseElement } from "../types/analysis-response-element";
export async function getExistingAnalysisResponseElements({
analysisResponseId,
}: {
analysisResponseId: number;
}) {
}): Promise<AnalysisResponseElement[]> {
const { data } = await getSupabaseServerAdminClient()
.schema('medreport')
.from('analysis_response_elements')
@@ -17,6 +18,18 @@ export async function getExistingAnalysisResponseElements({
return data as AnalysisResponseElement[];
}
export async function createAnalysisResponseElement({
element,
}: {
element: Omit<AnalysisResponseElement, 'created_at' | 'updated_at' | 'id'>;
}) {
await getSupabaseServerAdminClient()
.schema('medreport')
.from('analysis_response_elements')
.insert(element)
.throwOnError();
}
export async function upsertAnalysisResponse({
analysisOrderId,
orderNumber,