File tree Expand file tree Collapse file tree 4 files changed +54
-6
lines changed
components/RegisterEpisodeForm Expand file tree Collapse file tree 4 files changed +54
-6
lines changed Original file line number Diff line number Diff line change @@ -167,11 +167,7 @@ export const useRegisterPatient = () => {
167167 ) ;
168168} ;
169169
170- export const useRegisterEpisode = (
171- hospitalID ?: string ,
172- patientID ?: string ,
173- episodeType = 'Inguinal Mesh Hernia Repair'
174- ) => {
170+ export const useRegisterEpisode = ( hospitalID ?: string , patientID ?: string ) => {
175171 const history = useHistory ( ) ;
176172
177173 return useMutation < RegisterEpisodePayload , AxiosError , RegisterEpisodeFormType > (
@@ -184,7 +180,7 @@ export const useRegisterEpisode = (
184180 surgeon_ids : params ?. surgeons ?. map ( ( surgeon ) => surgeon ?. value ) ?? [ '1' ] ,
185181 comments : params ?. comments ,
186182 mesh_type : params ?. meshType ?. label ,
187- episode_type : episodeType ,
183+ episode_type : params ?. episodeType . label ,
188184 type : params . type ?. label ,
189185 cepod : params . cepod ?. label ,
190186 complexity : params ?. complexity ?. label ,
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import {
1818 OCCURRENCE_OPTIONS ,
1919 SIDE_OPTIONS ,
2020 TYPE_OPTIONS ,
21+ EPISODE_TYPE_OPTIONS ,
2122} from '../../constants' ;
2223import { RegisterEpisodeFormType } from '../../types' ;
2324import { getHospitalOptions , getSurgeonOptions } from '../../utils' ;
@@ -127,6 +128,33 @@ const RegisterEpisodeForm: React.FC<Props> = ({
127128 </ FormHeadingContainer >
128129 < FormHeadingContainer >
129130 < SectionTitle > Episode Details</ SectionTitle >
131+ < FieldWrapper >
132+ < Field name = "episodeType" >
133+ { ( props ) => {
134+ const hasError = props . meta . touched && props . meta . invalid && ! props . meta . active ;
135+
136+ return (
137+ < SelectWrapper >
138+ < Select
139+ id = "episode_type"
140+ label = "Episode Type"
141+ styleType = "outlined"
142+ size = "md"
143+ required
144+ status = { hasError ? 'error' : 'hint' }
145+ hintMsg = { hasError ? props . meta . error : undefined }
146+ options = { EPISODE_TYPE_OPTIONS }
147+ { ...omit ( props . input , [ 'onFocus' ] ) }
148+ selectedOption = { EPISODE_TYPE_OPTIONS . find (
149+ ( option ) => option . value === props . input . value . value
150+ ) }
151+ handleSelectedOption = { props . input . onChange }
152+ />
153+ </ SelectWrapper >
154+ ) ;
155+ } }
156+ </ Field >
157+ </ FieldWrapper >
130158 < FieldWrapper >
131159 < Field name = "cepod" >
132160 { ( props ) => {
Original file line number Diff line number Diff line change @@ -127,3 +127,26 @@ export const FOLLOW_UP_PAIN_OPTIONS: SelectOption[] = [
127127 label : 'Severe' ,
128128 } ,
129129] ;
130+
131+ export const EPISODE_TYPE_OPTIONS : SelectOption [ ] = [
132+ {
133+ value : 0 ,
134+ label : 'Inguinal Mesh Hernia Repair' ,
135+ } ,
136+ {
137+ value : 1 ,
138+ label : 'Incisional Mesh Hernia Repair' ,
139+ } ,
140+ {
141+ value : 2 ,
142+ label : 'Femoral Mesh Hernia Repair' ,
143+ } ,
144+ {
145+ value : 3 ,
146+ label : 'Hiatus Mesh Hernia Repair' ,
147+ } ,
148+ {
149+ value : 4 ,
150+ label : 'Umbilical/Periumbilicial Mesh Hernia Repair' ,
151+ } ,
152+ ] ;
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { SelectOption } from '../../models/apiTypes';
33export type RegisterEpisodeFormType = {
44 hospital : SelectOption ;
55 patientHospitalId : number ;
6+ episodeType : SelectOption ;
67 surgeryDate : string ;
78 cepod : SelectOption ;
89 side : SelectOption ;
You can’t perform that action at this time.
0 commit comments