diff --git a/frontend/src/components/admissions/SuicidalPatientAssessmentModal.tsx b/frontend/src/components/admissions/SuicidalPatientAssessmentModal.tsx index 2b044eac12..5e18a274c4 100644 --- a/frontend/src/components/admissions/SuicidalPatientAssessmentModal.tsx +++ b/frontend/src/components/admissions/SuicidalPatientAssessmentModal.tsx @@ -2,14 +2,26 @@ import { useState, useRef, useCallback, useEffect } from 'react' import { createSuicidalPatientAssessment } from '../../services/suicidalAssessment' -import { - fetchPatientOptions, - fetchInpatientAdmissionOptions, +import { + fetchPatientOptions, + fetchInpatientAdmissionOptions, fetchHealthcarePractitioners, - type LinkFieldOption + fetchIpRiskAnalysisOptions, + getCurrentUserPractitioner, + type LinkFieldOption, } from '../../services/common' import { toast } from '../../hooks/useToast' -import { X, ChevronDown } from 'lucide-react' +import { AlertTriangle, ChevronDown, FileText, Info } from 'lucide-react' +import { + CM_BTN_CANCEL, + CM_BTN_PRIMARY, + CREATE_MODAL_BODY_GRADIENT, + CREATE_MODAL_FOOTER_STICKY, + CREATE_MODAL_OVERLAY, + CreateModalHeader, + createModalShellClass, + createModalTabButtonClass, +} from '../ui/CreateModalChrome' interface SuicidalPatientAssessmentModalProps { admissionNo: string @@ -33,7 +45,7 @@ type SelectYesNoUnknown = '' | 'Yes' | 'No' | 'Unknown' interface FormState { // Basic Info assessment_date: string - assessed_by: string + practitioner: string // Suicidal Thoughts overwhelmed_thoughts_harming: SelectValue overwhelmed_thoughts_explanation: string @@ -111,7 +123,7 @@ const today = new Date().toISOString().split('T')[0] const emptyForm = (): FormState => ({ assessment_date: today, - assessed_by: '', + practitioner: '', overwhelmed_thoughts_harming: '', overwhelmed_thoughts_explanation: '', thoughts_occurrence_frequency: '', @@ -335,7 +347,7 @@ function GeneralTab({ form, setField, currentAdmission, currentPatient, currentPatientName, isLockedContext, - fetchPatientOpts, fetchAdmissionOpts, + fetchPatientOpts, fetchAdmissionOpts, fetchIpRiskOpts, setCurrentAdmission, setCurrentPatient, setCurrentPatientName, }: { form: FormState @@ -346,6 +358,7 @@ function GeneralTab({ isLockedContext: boolean fetchPatientOpts: (s: string) => Promise fetchAdmissionOpts: (s: string) => Promise + fetchIpRiskOpts: (s: string) => Promise setCurrentAdmission: (v: string) => void setCurrentPatient: (v: string) => void setCurrentPatientName: (v: string) => void @@ -410,10 +423,10 @@ function GeneralTab({
setField('assessed_by', opt.name)} - onClear={() => setField('assessed_by', '')} + label="Practitioner" + value={form.practitioner} + onSelect={(opt) => setField('practitioner', opt.name)} + onClear={() => setField('practitioner', '')} fetchOptions={async (search) => { const result = await fetchHealthcarePractitioners(search || undefined) return result @@ -601,10 +614,14 @@ function GeneralTab({

Reference & Additional Notes

-
- - setField('ip_risk_analysis_reference', e.target.value)} className={inputClass} placeholder="Link to IP Risk Analysis..." /> -
+ setField('ip_risk_analysis_reference', opt.name)} + onClear={() => setField('ip_risk_analysis_reference', '')} + fetchOptions={fetchIpRiskOpts} + placeholder="Search IP Risk Analysis..." + />