chore(strip): verwijder kapotte intake-tabs anamnese, onderzoeken en ROM
Opslaan faalde altijd door label/code-mismatch met de database-constraints (reviewbevinding). Tabs komen terug bij de rebuild op het nieuwe datamodel. - tab-mappen anamnese/, examination/, rom/ verwijderd - tabs uit intake-tabs.tsx, server actions uit actions.ts - intake-status API telt de secties niet meer mee (voortgangsring klopt) - Cortex-navigatiedoelen (regex, entity-mapping, prompt) bijgewerkt zodat 'ga naar anamnese' geen 404 meer geeft Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -186,116 +186,6 @@ export async function deleteRiskAssessment(patientId: string, intakeId: string,
|
||||
revalidatePath(buildPath(patientId, intakeId));
|
||||
}
|
||||
|
||||
// ---------------- Anamneses ----------------
|
||||
export async function getAnamneses(intakeId: string) {
|
||||
const supabase = await getSupabase();
|
||||
const { data, error } = await supabase
|
||||
.from('anamneses')
|
||||
.select('*')
|
||||
.eq('intake_id', intakeId)
|
||||
.order('anamnese_date', { ascending: false });
|
||||
if (error) {
|
||||
console.error('getAnamneses error', error);
|
||||
throw new Error('Kon anamneses niet ophalen');
|
||||
}
|
||||
return data || [];
|
||||
}
|
||||
|
||||
export interface AnamnesePayload {
|
||||
patientId: string;
|
||||
intakeId: string;
|
||||
date: string;
|
||||
type: string;
|
||||
content: string;
|
||||
notes?: string;
|
||||
}
|
||||
|
||||
export async function createAnamnese(payload: AnamnesePayload) {
|
||||
const supabase = await getSupabase();
|
||||
const { error } = await supabase.from('anamneses').insert({
|
||||
intake_id: payload.intakeId,
|
||||
anamnese_date: payload.date,
|
||||
anamnese_type: payload.type,
|
||||
content: payload.content,
|
||||
notes: payload.notes,
|
||||
});
|
||||
if (error) {
|
||||
console.error('createAnamnese error', error);
|
||||
throw new Error(error.message);
|
||||
}
|
||||
revalidatePath(buildPath(payload.patientId, payload.intakeId, 'anamnese'));
|
||||
revalidatePath(buildPath(payload.patientId, payload.intakeId));
|
||||
}
|
||||
|
||||
export async function deleteAnamnese(patientId: string, intakeId: string, anamneseId: string) {
|
||||
const supabase = await getSupabase();
|
||||
const { error } = await supabase.from('anamneses').delete().eq('id', anamneseId);
|
||||
if (error) {
|
||||
console.error('deleteAnamnese error', error);
|
||||
throw new Error(error.message);
|
||||
}
|
||||
revalidatePath(buildPath(patientId, intakeId, 'anamnese'));
|
||||
revalidatePath(buildPath(patientId, intakeId));
|
||||
}
|
||||
|
||||
// ---------------- Examinations (including ROM) ----------------
|
||||
export async function getExaminations(intakeId: string) {
|
||||
const supabase = await getSupabase();
|
||||
const { data, error } = await supabase
|
||||
.from('examinations')
|
||||
.select('*')
|
||||
.eq('intake_id', intakeId)
|
||||
.order('examination_date', { ascending: false });
|
||||
if (error) {
|
||||
console.error('getExaminations error', error);
|
||||
throw new Error('Kon onderzoeken niet ophalen');
|
||||
}
|
||||
return data || [];
|
||||
}
|
||||
|
||||
export interface ExaminationPayload {
|
||||
patientId: string;
|
||||
intakeId: string;
|
||||
date: string;
|
||||
type: string;
|
||||
findings: string;
|
||||
performer?: string;
|
||||
reason?: string;
|
||||
notes?: string;
|
||||
isRom?: boolean;
|
||||
}
|
||||
|
||||
export async function createExamination(payload: ExaminationPayload) {
|
||||
const supabase = await getSupabase();
|
||||
const { error } = await supabase.from('examinations').insert({
|
||||
intake_id: payload.intakeId,
|
||||
examination_date: payload.date,
|
||||
examination_type: payload.isRom ? 'ROM' : payload.type,
|
||||
findings: payload.findings,
|
||||
performed_by: payload.performer,
|
||||
reason: payload.reason,
|
||||
notes: payload.notes,
|
||||
});
|
||||
if (error) {
|
||||
console.error('createExamination error', error);
|
||||
throw new Error(error.message);
|
||||
}
|
||||
const tab = payload.isRom ? 'rom' : 'examination';
|
||||
revalidatePath(buildPath(payload.patientId, payload.intakeId, tab));
|
||||
revalidatePath(buildPath(payload.patientId, payload.intakeId));
|
||||
}
|
||||
|
||||
export async function deleteExamination(patientId: string, intakeId: string, examinationId: string) {
|
||||
const supabase = await getSupabase();
|
||||
const { error } = await supabase.from('examinations').delete().eq('id', examinationId);
|
||||
if (error) {
|
||||
console.error('deleteExamination error', error);
|
||||
throw new Error(error.message);
|
||||
}
|
||||
revalidatePath(buildPath(patientId, intakeId, 'examination'));
|
||||
revalidatePath(buildPath(patientId, intakeId, 'rom'));
|
||||
revalidatePath(buildPath(patientId, intakeId));
|
||||
}
|
||||
|
||||
// ---------------- Diagnoses ----------------
|
||||
export async function getDiagnoses(intakeId: string) {
|
||||
|
||||
Reference in New Issue
Block a user