Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
feat(patients): add visit functionality
Browse files Browse the repository at this point in the history
  Author:    morrme <morrme@users.noreply.github.com>
  • Loading branch information
sns authored and morrme committed Aug 1, 2020
1 parent e6ded60 commit affa668
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
4 changes: 0 additions & 4 deletions src/patients/patient-slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -551,9 +551,5 @@ export const addVisit = (

await dispatch(updatePatient(patient, onSuccess))
}
// } else {
// visitError.message = 'patient.visit.error.unableToAdd'
// dispatch(visitError(visitError))
// }
}
export default patientSlice.reducer
11 changes: 6 additions & 5 deletions src/patients/visits/VisitForm.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Alert, Column, Row } from '@hospitalrun/components'
import React, { useState } from 'react'

import DatePickerWithLabelFormGroup from '../../shared/components/input/DatePickerWithLabelFormGroup'
import DateTimePickerWithLabelFormGroup from '../../shared/components/input/DateTimePickerWithLabelFormGroup'

import SelectWithLabelFormGroup, {
Option,
} from '../../shared/components/input/SelectWithLableFormGroup'
Expand All @@ -23,7 +24,7 @@ interface Props {
visit: Partial<Visit>
visitError?: Error
onChange?: (newVisit: Partial<Visit>) => void
disabled: boolean
disabled?: boolean
}

const VisitForm = (props: Props) => {
Expand All @@ -50,7 +51,7 @@ const VisitForm = (props: Props) => {
{visitError?.message && <Alert color="danger" message={t(visitError.message)} />}
<Row>
<Column sm={6}>
<DatePickerWithLabelFormGroup
<DateTimePickerWithLabelFormGroup
isRequired
value={visit.startDateTime ? new Date(visit.startDateTime) : new Date()}
label={t('patient.visits.startDateTime')}
Expand All @@ -62,7 +63,7 @@ const VisitForm = (props: Props) => {
/>
</Column>
<Column sm={6}>
<DatePickerWithLabelFormGroup
<DateTimePickerWithLabelFormGroup
isRequired
value={visit.endDateTime ? new Date(visit.endDateTime) : new Date()}
label={t('patient.visits.endDateTime')}
Expand All @@ -89,7 +90,7 @@ const VisitForm = (props: Props) => {
</Column>
</Row>
<Row>
<Column sm={6}>
<Column sm={12}>
<SelectWithLabelFormGroup
name="status"
label={t('patient.visits.status')}
Expand Down
4 changes: 2 additions & 2 deletions src/patients/visits/VisitTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ const VisitTable = () => {
{
label: t('patient.visits.startDateTime'),
key: 'startDateTime',
formatter: (row) => format(new Date(row.startDateTime), 'yyyy-MM-dd'),
formatter: (row) => format(new Date(row.startDateTime), 'yyyy-MM-dd hh:mm a'),
},
{
label: t('patient.visits.endDateTime'),
key: 'endDateTime',
formatter: (row) => format(new Date(row.endDateTime), 'yyyy-MM-dd'),
formatter: (row) => format(new Date(row.endDateTime), 'yyyy-MM-dd hh:mm a'),
},
{ label: t('patient.visits.type'), key: 'type' },
{ label: t('patient.visits.status'), key: 'status' },
Expand Down

0 comments on commit affa668

Please sign in to comment.