From 3d90f948b9aea1b6f02f9fe2fc063faa0ddb5a00 Mon Sep 17 00:00:00 2001 From: Akalintha007 <93814531+Akalintha007@users.noreply.github.com> Date: Fri, 7 Oct 2022 21:01:48 +0530 Subject: [PATCH] all api --- package.json | 5 +- src/HospitalRun.tsx | 64 +-- src/index.tsx | 1 + src/patients/ContactInfo.tsx | 42 +- src/patients/ContactInfoTypes.ts | 7 +- src/patients/GeneralInformation.tsx | 185 ++++----- .../appointments/AppointmentsList.tsx | 15 +- src/patients/edit/EditPatient.tsx | 54 ++- src/patients/history/mappers/helpers.tsx | 14 +- src/patients/hooks/usePatients.tsx | 9 + src/patients/new/NewPatient.tsx | 34 +- src/patients/new/PatientInterface.tsx | 48 +++ src/patients/search/SearchPatients.tsx | 166 +++++++- src/patients/search/ViewPatientsTable.tsx | 259 ++++++++++-- .../search/filter/FormControlLabelCustom.tsx | 58 +++ src/patients/search/filter/PatientFilter.tsx | 237 +++++++++++ src/patients/search/filter/theme.tsx | 14 + src/patients/util/constants.ts | 18 + src/patients/view/ImportantPatientInfo.tsx | 2 + src/patients/view/ViewPatient.tsx | 129 ++++-- src/patients/visits/FilterPatientModal.tsx | 73 ---- .../appointments/AppointmentDetailForm.tsx | 167 +++----- .../appointments/ViewAppointments.tsx | 115 +----- .../appointments/constants/Appointment.tsx | 18 - .../appointments/edit/EditAppointment.tsx | 139 +++---- .../appointments/new/NewAppointment.tsx | 73 ++-- .../appointments/service/Appointments.tsx | 234 ----------- .../appointments/service/Patients.tsx | 42 -- .../util/scheduling-appointment.util.ts | 8 +- .../appointments/util/validate-appointment.ts | 6 +- .../appointments/view/ViewAppointment.tsx | 80 +--- src/service/service.ts | 372 ++++++++++++++++++ src/shared/components/Sidebar.tsx | 2 +- .../DateTimePickerWithLabelFormGroup.tsx | 10 +- src/shared/db/AppointmentRepository.ts | 6 +- src/shared/model/Appointment.ts | 20 +- src/shared/model/Patient.ts | 2 - 37 files changed, 1651 insertions(+), 1077 deletions(-) create mode 100644 src/patients/new/PatientInterface.tsx create mode 100644 src/patients/search/filter/FormControlLabelCustom.tsx create mode 100644 src/patients/search/filter/PatientFilter.tsx create mode 100644 src/patients/search/filter/theme.tsx create mode 100644 src/patients/util/constants.ts delete mode 100644 src/patients/visits/FilterPatientModal.tsx delete mode 100644 src/scheduling/appointments/constants/Appointment.tsx delete mode 100644 src/scheduling/appointments/service/Appointments.tsx delete mode 100644 src/scheduling/appointments/service/Patients.tsx create mode 100644 src/service/service.ts diff --git a/package.json b/package.json index 05c7202f74..0846d384cd 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,11 @@ "private": false, "license": "MIT", "dependencies": { + "@emotion/react": "~11.10.4", + "@emotion/styled": "~11.10.4", "@hospitalrun/components": "~3.4.0", + "@mui/icons-material": "~5.10.6", + "@mui/material": "~5.10.6", "@reduxjs/toolkit": "~1.7.0", "@types/escape-string-regexp": "~2.0.1", "@types/json2csv": "~5.0.1", @@ -33,7 +37,6 @@ "react-bootstrap-typeahead": "~5.2.0", "react-dom": "~16.13.0", "react-i18next": "~11.15.0", - "react-moment": "~1.1.2", "react-query": "~2.25.2", "react-query-devtools": "~2.6.0", "react-redux": "~7.2.0", diff --git a/src/HospitalRun.tsx b/src/HospitalRun.tsx index 4bd60bdd01..7433d82315 100644 --- a/src/HospitalRun.tsx +++ b/src/HospitalRun.tsx @@ -29,38 +29,40 @@ const HospitalRun = () => {
-
- +
+
- -
-
-
-

{title}

- -
- -
- - - - - - - - - - -
- -
-
-
+ + +
+
+
+

{title}

+ +
+ +
+ + + + + + + + + + +
+ +
+
+
+
) diff --git a/src/index.tsx b/src/index.tsx index 20a7a15cca..2496d28553 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -8,6 +8,7 @@ import * as serviceWorker from './serviceWorker' import './shared/config/i18n' import store from './shared/store' + ReactDOM.render( diff --git a/src/patients/ContactInfo.tsx b/src/patients/ContactInfo.tsx index 2d3aa021e8..8aa515b7cf 100644 --- a/src/patients/ContactInfo.tsx +++ b/src/patients/ContactInfo.tsx @@ -1,6 +1,5 @@ import { Select, Label, Spinner, Row, Column, Icon } from '@hospitalrun/components' import React, { useEffect, ReactElement } from 'react' - import { SelectOption } from '../shared/components/input/SelectOption' import TextFieldWithLabelFormGroup from '../shared/components/input/TextFieldWithLabelFormGroup' import TextInputWithLabelFormGroup from '../shared/components/input/TextInputWithLabelFormGroup' @@ -36,16 +35,23 @@ const ContactInfo = (props: Props): ReactElement => { })) const header = ( - + name !== "email" && name !== "address"? + {/* {t('patient.contactInfoType.label')} & {t(label)} */} - {t(label)} + : + + + {t(label)} + + ) const componentList = { @@ -80,18 +86,22 @@ const ContactInfo = (props: Props): ReactElement => { const error = errors ? errors[i] : undefined return ( - -
- {/*
+
+ : + "" + } {
{data.length > 0 ? header : null} {entries} - {isEditable ? addButton : null} + {isEditable && name !== "email" ? addButton : null}
) } diff --git a/src/patients/ContactInfoTypes.ts b/src/patients/ContactInfoTypes.ts index 7a10cb9048..ed9a02cdba 100644 --- a/src/patients/ContactInfoTypes.ts +++ b/src/patients/ContactInfoTypes.ts @@ -2,8 +2,11 @@ enum ContactInfoTypes { home = 'home', mobile = 'mobile', work = 'work', - temporary = 'temporary', - old = 'old', + // main = 'main', + // night ='night', + // fax = 'fax', + // other = 'other' + } export default ContactInfoTypes diff --git a/src/patients/GeneralInformation.tsx b/src/patients/GeneralInformation.tsx index 5202b1ed50..8129ff8485 100644 --- a/src/patients/GeneralInformation.tsx +++ b/src/patients/GeneralInformation.tsx @@ -62,35 +62,35 @@ const GeneralInformation = (props: Props): ReactElement => { } const sexOptions: SelectOption[] = [ - { label: t('sex.male'), value: 'male' }, - { label: t('sex.female'), value: 'female' }, - { label: t('sex.other'), value: 'other' }, - { label: t('sex.unknown'), value: 'unknown' }, + { label: "Man", value: 'man' }, + { label: "Women", value: 'woman' }, + { label: "Other", value: 'nonbinary' }, + { label: "Unknown", value: 'unknown' }, ] - const typeOptions: SelectOption[] = [ - { label: t('patient.types.charity'), value: 'charity' }, - { label: t('patient.types.private'), value: 'private' }, - ] + // const typeOptions: SelectOption[] = [ + // { label: t('patient.types.charity'), value: 'charity' }, + // { label: t('patient.types.private'), value: 'private' }, + // ] - const bloodTypeOptions: SelectOption[] = [ - { label: t('bloodType.apositive'), value: 'A+' }, - { label: t('bloodType.anegative'), value: 'A-' }, - { label: t('bloodType.abpositive'), value: 'AB+' }, - { label: t('bloodType.abnegative'), value: 'AB-' }, - { label: t('bloodType.bpositive'), value: 'B+' }, - { label: t('bloodType.bnegative'), value: 'B-' }, - { label: t('bloodType.opositive'), value: 'O+' }, - { label: t('bloodType.onegative'), value: 'O-' }, - { label: t('bloodType.unknown'), value: 'unknown' }, - ] + // const bloodTypeOptions: SelectOption[] = [ + // { label: t('bloodType.apositive'), value: 'A+' }, + // { label: t('bloodType.anegative'), value: 'A-' }, + // { label: t('bloodType.abpositive'), value: 'AB+' }, + // { label: t('bloodType.abnegative'), value: 'AB-' }, + // { label: t('bloodType.bpositive'), value: 'B+' }, + // { label: t('bloodType.bnegative'), value: 'B-' }, + // { label: t('bloodType.opositive'), value: 'O+' }, + // { label: t('bloodType.onegative'), value: 'O-' }, + // { label: t('bloodType.unknown'), value: 'unknown' }, + // ] return (
{error?.message && }
-
+ {/*
{ isInvalid={!!error?.prefix} feedback={t(error?.prefix)} /> -
+
*/}
{ feedback={t(error?.givenName)} />
+
+ onFieldChange('suffix', event.currentTarget.value)} + isInvalid={!!error?.suffix} + feedback={t(error?.suffix)} + /> +
onFieldChange('familyName', event.currentTarget.value)} isInvalid={!!error?.familyName} feedback={t(error?.familyName)} />
-
- onFieldChange('suffix', event.currentTarget.value)} - isInvalid={!!error?.suffix} - feedback={t(error?.suffix)} - /> -
-
+
+ {patient.isApproximateDateOfBirth ? ( + + ) : ( + 0 + ? new Date(patient.dateOfBirth) + : undefined + } + maxDate={new Date(Date.now().valueOf())} + onChange={(date: Date) => onFieldChange('dateOfBirth', date.toISOString())} + isInvalid={!!error?.dateOfBirth} + feedback={t(error?.dateOfBirth)} + /> + )} +
+ +
+
+
-
-
+
*/} + {/*
-
-
@@ -162,19 +127,15 @@ const AppointmentDetailForm = (props: Props) => {
-
-