This repository has been archived by the owner on Jan 9, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(patients): use panels for grouping content in view patient
- Loading branch information
1 parent
3be2de5
commit 452419c
Showing
1 changed file
with
101 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import React, { useEffect } from 'react' | ||
import { useDispatch, useSelector } from 'react-redux' | ||
import { useParams, withRouter } from 'react-router-dom' | ||
import { Spinner } from '@hospitalrun/components' | ||
import { Panel, Spinner } from '@hospitalrun/components' | ||
import { useTranslation } from 'react-i18next' | ||
import { differenceInYears } from 'date-fns' | ||
import useTitle from '../../util/useTitle' | ||
|
@@ -65,108 +65,111 @@ const ViewPatient = () => { | |
} | ||
|
||
return ( | ||
<div className="container"> | ||
<h3>Basic Information</h3> | ||
<div className="row"> | ||
<div className="col"> | ||
<SelectWithLabelFormGroup | ||
name="sex" | ||
label={t('patient.sex')} | ||
value={patient.sex} | ||
isEditable={false} | ||
options={[ | ||
{ label: t('sex.male'), value: 'male' }, | ||
{ label: t('sex.female'), value: 'female' }, | ||
{ label: t('sex.other'), value: 'other' }, | ||
{ label: t('sex.unknown'), value: 'unknown' }, | ||
]} | ||
/> | ||
<div> | ||
<Panel title={t('patient.basicInformation')} color="primary" collapsible> | ||
<div className="row"> | ||
<div className="col"> | ||
<SelectWithLabelFormGroup | ||
name="sex" | ||
label={t('patient.sex')} | ||
value={patient.sex} | ||
isEditable={false} | ||
options={[ | ||
{ label: t('sex.male'), value: 'male' }, | ||
{ label: t('sex.female'), value: 'female' }, | ||
{ label: t('sex.other'), value: 'other' }, | ||
{ label: t('sex.unknown'), value: 'unknown' }, | ||
]} | ||
/> | ||
</div> | ||
<div className="col"> | ||
<SelectWithLabelFormGroup | ||
name="type" | ||
label={t('patient.type')} | ||
value={patient.type} | ||
isEditable={false} | ||
options={[ | ||
{ label: t('patient.types.charity'), value: 'charity' }, | ||
{ label: t('patient.types.private'), value: 'private' }, | ||
]} | ||
/> | ||
</div> | ||
</div> | ||
<div className="col"> | ||
<SelectWithLabelFormGroup | ||
name="type" | ||
label={t('patient.type')} | ||
value={patient.type} | ||
isEditable={false} | ||
options={[ | ||
{ label: t('patient.types.charity'), value: 'charity' }, | ||
{ label: t('patient.types.private'), value: 'private' }, | ||
]} | ||
/> | ||
<div className="row"> | ||
<div className="col-md-6"> | ||
<TextInputWithLabelFormGroup | ||
label={ | ||
patient.isApproximateDateOfBirth ? t('patient.approximateAge') : t('patient.age') | ||
} | ||
name="age" | ||
value={getPatientAge(patient.dateOfBirth)} | ||
isEditable={false} | ||
/> | ||
</div> | ||
<div className="col-md-6"> | ||
<DatePickerWithLabelFormGroup | ||
label={ | ||
patient.isApproximateDateOfBirth | ||
? t('patient.approximateDateOfBirth') | ||
: t('patient.dateOfBirth') | ||
} | ||
name="dateOfBirth" | ||
value={getPatientDateOfBirth(patient.dateOfBirth)} | ||
isEditable={false} | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
<div className="row"> | ||
<div className="col-md-6"> | ||
<TextInputWithLabelFormGroup | ||
label={ | ||
patient.isApproximateDateOfBirth ? t('patient.approximateAge') : t('patient.age') | ||
} | ||
name="age" | ||
value={getPatientAge(patient.dateOfBirth)} | ||
isEditable={false} | ||
/> | ||
<div className="row"> | ||
<div className="col-md-6"> | ||
<TextInputWithLabelFormGroup | ||
label={t('patient.occupation')} | ||
name="occupation" | ||
value={patient.occupation} | ||
isEditable={false} | ||
/> | ||
</div> | ||
<div className="col-md-6"> | ||
<TextInputWithLabelFormGroup | ||
label={t('patient.preferredLanguage')} | ||
name="preferredLanguage" | ||
value={patient.preferredLanguage} | ||
isEditable={false} | ||
/> | ||
</div> | ||
</div> | ||
<div className="col-md-6"> | ||
<DatePickerWithLabelFormGroup | ||
label={ | ||
patient.isApproximateDateOfBirth | ||
? t('patient.approximateDateOfBirth') | ||
: t('patient.dateOfBirth') | ||
} | ||
name="dateOfBirth" | ||
value={getPatientDateOfBirth(patient.dateOfBirth)} | ||
isEditable={false} | ||
/> | ||
</Panel> | ||
<br /> | ||
<Panel title={t('patient.contactInformation')} color="primary" collapsible> | ||
<div className="row"> | ||
<div className="col"> | ||
<TextInputWithLabelFormGroup | ||
label={t('patient.phoneNumber')} | ||
name="phoneNumber" | ||
value={patient.phoneNumber} | ||
isEditable={false} | ||
/> | ||
</div> | ||
<div className="col"> | ||
<TextInputWithLabelFormGroup | ||
label={t('patient.email')} | ||
placeholder="[email protected]" | ||
name="email" | ||
value={patient.email} | ||
isEditable={false} | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
<div className="row"> | ||
<div className="col-md-6"> | ||
<TextInputWithLabelFormGroup | ||
label={t('patient.occupation')} | ||
name="occupation" | ||
value={patient.occupation} | ||
isEditable={false} | ||
/> | ||
<div className="row"> | ||
<div className="col"> | ||
<TextFieldWithLabelFormGroup | ||
label={t('patient.address')} | ||
name="address" | ||
value={patient.address} | ||
isEditable={false} | ||
/> | ||
</div> | ||
</div> | ||
<div className="col-md-6"> | ||
<TextInputWithLabelFormGroup | ||
label={t('patient.preferredLanguage')} | ||
name="preferredLanguage" | ||
value={patient.preferredLanguage} | ||
isEditable={false} | ||
/> | ||
</div> | ||
</div> | ||
<h3>{t('patient.contactInformation')}</h3> | ||
<div className="row"> | ||
<div className="col"> | ||
<TextInputWithLabelFormGroup | ||
label={t('patient.phoneNumber')} | ||
name="phoneNumber" | ||
value={patient.phoneNumber} | ||
isEditable={false} | ||
/> | ||
</div> | ||
<div className="col"> | ||
<TextInputWithLabelFormGroup | ||
label={t('patient.email')} | ||
placeholder="[email protected]" | ||
name="email" | ||
value={patient.email} | ||
isEditable={false} | ||
/> | ||
</div> | ||
</div> | ||
<div className="row"> | ||
<div className="col"> | ||
<TextFieldWithLabelFormGroup | ||
label={t('patient.address')} | ||
name="address" | ||
value={patient.address} | ||
isEditable={false} | ||
/> | ||
</div> | ||
</div> | ||
</Panel> | ||
</div> | ||
) | ||
} | ||
|