-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
feat(patients): add visit functionality #2251
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/hospitalrun/hospitalrun-frontend/dlostqfgl |
This pull request introduces 1 alert when merging f4effd8 into 9aba7da - view on LGTM.com new alerts:
|
src/patients/patient-slice.ts
Outdated
// } else { | ||
// visitError.message = 'patient.visit.error.unableToAdd' | ||
// dispatch(visitError(visitError)) | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove commented out code
src/patients/visits/VisitForm.tsx
Outdated
<DatePickerWithLabelFormGroup | ||
isRequired | ||
value={visit.startDateTime ? new Date(visit.startDateTime) : new Date()} | ||
label={t('patient.visits.startDateTime')} | ||
name="startDateTime" | ||
feedback={t(visitError?.startDateTime || '')} | ||
isInvalid={!!visitError?.startDateTime} | ||
isEditable={!disabled} | ||
onChange={(date) => onFieldChange('startDateTime', date.toISOString())} | ||
/> | ||
</Column> | ||
<Column sm={6}> | ||
<DatePickerWithLabelFormGroup | ||
isRequired | ||
value={visit.endDateTime ? new Date(visit.endDateTime) : new Date()} | ||
label={t('patient.visits.endDateTime')} | ||
name="endDateTime" | ||
feedback={t(visitError?.endDateTime || '')} | ||
isInvalid={!!visitError?.endDateTime} | ||
isEditable={!disabled} | ||
onChange={(date) => onFieldChange('endDateTime', date.toISOString())} | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these should be date time pickers rather than date pickers.
src/patients/visits/VisitForm.tsx
Outdated
<Row> | ||
<Column sm={6}> | ||
<SelectWithLabelFormGroup | ||
name="status" | ||
label={t('patient.visits.status')} | ||
isRequired | ||
options={statusOptions} | ||
defaultSelected={statusOptions.filter(({ value }) => value === status)} | ||
onChange={(values) => { | ||
onFieldChange('status', values[0]) | ||
setStatus(values[0] as VisitStatus) | ||
}} | ||
isEditable={!disabled} | ||
isInvalid={!!visitError?.status} | ||
/> | ||
</Column> | ||
</Row> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since there are no other fields in this row, lets have the status take up the whole row
VisitForm.defaultProps = { | ||
disabled: false, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we make disabled an optional field in the Props
interface, we don't need the default props since it will be a falsy value.
src/patients/visits/VisitTable.tsx
Outdated
columns={[ | ||
{ | ||
label: t('patient.visits.startDateTime'), | ||
key: 'startDateTime', | ||
formatter: (row) => format(new Date(row.startDateTime), 'yyyy-MM-dd'), | ||
}, | ||
{ | ||
label: t('patient.visits.endDateTime'), | ||
key: 'endDateTime', | ||
formatter: (row) => format(new Date(row.endDateTime), 'yyyy-MM-dd'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these will need to be formatted to a date time.
sns seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. |
LGTM. |
It's the only way. Guillermo's word. |
Fixes #2241
Changes proposed in this pull request: