From b358334450e6632603f720ec0821f2c991a0d2a9 Mon Sep 17 00:00:00 2001 From: sns Date: Sat, 1 Aug 2020 14:23:30 -0500 Subject: [PATCH] feat(patients): add visit functionality --- src/patients/patient-slice.ts | 4 ---- src/patients/visits/VisitForm.tsx | 11 ++++++----- src/patients/visits/VisitTable.tsx | 4 ++-- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/patients/patient-slice.ts b/src/patients/patient-slice.ts index 73be3d9afc..83f8695913 100644 --- a/src/patients/patient-slice.ts +++ b/src/patients/patient-slice.ts @@ -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 diff --git a/src/patients/visits/VisitForm.tsx b/src/patients/visits/VisitForm.tsx index 9e1de31890..8e3fd8fd3a 100644 --- a/src/patients/visits/VisitForm.tsx +++ b/src/patients/visits/VisitForm.tsx @@ -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' @@ -23,7 +24,7 @@ interface Props { visit: Partial visitError?: Error onChange?: (newVisit: Partial) => void - disabled: boolean + disabled?: boolean } const VisitForm = (props: Props) => { @@ -50,7 +51,7 @@ const VisitForm = (props: Props) => { {visitError?.message && } - { /> - { - + { { 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' },