feat(MED-161): update analysis results view
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user