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

feat(patients): add visit functionality #2251

Merged
merged 4 commits into from
Aug 10, 2020

Conversation

morrme
Copy link
Contributor

@morrme morrme commented Jul 23, 2020

Fixes #2241

Changes proposed in this pull request:

  • Added support for visits to be created and listed for each patient
  • Updated models as needed
  • Updated enUS locale

@gitpod-io
Copy link

gitpod-io bot commented Jul 23, 2020

@vercel
Copy link

vercel bot commented Jul 24, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/hospitalrun/hospitalrun-frontend/dlostqfgl
✅ Preview: https://hospitalrun-frontend-git-fork-morrme-new-visit.hospitalrun.vercel.app

@matteovivona matteovivona added this to the v2.0 milestone Jul 24, 2020
@matteovivona matteovivona added the in progress indicates that issue/pull request is currently being worked on label Jul 24, 2020
@matteovivona matteovivona requested review from fox1t and jackcmeyer and removed request for fox1t July 24, 2020 07:18
@lgtm-com
Copy link

lgtm-com bot commented Jul 24, 2020

This pull request introduces 1 alert when merging f4effd8 into 9aba7da - view on LGTM.com

new alerts:

  • 1 for Unused variable, import, function or class

@morrme morrme marked this pull request as ready for review July 30, 2020 07:16
@morrme morrme changed the title WIP: feat(patients): add visit functionality feat(patients): add visit functionality Jul 30, 2020
@matteovivona matteovivona self-requested a review July 30, 2020 13:15
@matteovivona matteovivona added the 🚀enhancement an issue/pull request that adds a feature to the application label Jul 30, 2020
Comment on lines 554 to 557
// } else {
// visitError.message = 'patient.visit.error.unableToAdd'
// dispatch(visitError(visitError))
// }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove commented out code

Comment on lines 53 to 74
<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())}
/>
Copy link
Member

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.

Comment on lines 91 to 107
<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>
Copy link
Member

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

Comment on lines +140 to +142
VisitForm.defaultProps = {
disabled: false,
}
Copy link
Member

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.

Comment on lines 19 to 28
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'),
Copy link
Member

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.

@jsf-clabot
Copy link

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

✅ morrme
✅ tehKapa
❌ sns


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.

@fox1t
Copy link
Member

fox1t commented Aug 5, 2020

LGTM.
@jackcmeyer what do you think?
@tehkapa I approved Vercel deployment manually.

@matteovivona
Copy link
Contributor

@tehkapa I approved Vercel deployment manually.

It's the only way. Guillermo's word.

@jackcmeyer jackcmeyer merged commit f11e702 into HospitalRun:master Aug 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🚀enhancement an issue/pull request that adds a feature to the application in progress indicates that issue/pull request is currently being worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ability for documenting visits for a patient
5 participants