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

Commit

Permalink
fix(patient): make note not required in care plan (#2158)
Browse files Browse the repository at this point in the history
Co-authored-by: HospitalRun Bot <[email protected]>
Co-authored-by: Matteo Vivona <[email protected]>
Co-authored-by: Jack Meyer <[email protected]>
  • Loading branch information
4 people authored Jun 23, 2020
1 parent 46327fd commit 34e6041
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 7 deletions.
3 changes: 3 additions & 0 deletions src/__tests__/patients/care-plans/AddCarePlanModal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Router } from 'react-router-dom'
import createMockStore from 'redux-mock-store'
import thunk from 'redux-thunk'

import PatientRepository from '../../../clients/db/PatientRepository'
import { CarePlanIntent, CarePlanStatus } from '../../../model/CarePlan'
import Patient from '../../../model/Patient'
import AddCarePlanModal from '../../../patients/care-plans/AddCarePlanModal'
Expand Down Expand Up @@ -42,6 +43,8 @@ describe('Add Care Plan Modal', () => {

const onCloseSpy = jest.fn()
const setup = () => {
jest.spyOn(PatientRepository, 'find').mockResolvedValue(patient)
jest.spyOn(PatientRepository, 'saveOrUpdate')
const store = mockStore({ patient: { patient, carePlanError } } as any)
const history = createMemoryHistory()
const wrapper = mount(
Expand Down
1 change: 0 additions & 1 deletion src/__tests__/patients/care-plans/CarePlanForm.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ describe('Care Plan Form', () => {
const noteInput = wrapper.findWhere((w) => w.prop('name') === 'note')
expect(noteInput).toHaveLength(1)
expect(noteInput.prop('patient.carePlan.note'))
expect(noteInput.prop('isRequired')).toBeTruthy()
expect(noteInput.prop('value')).toEqual(carePlan.note)
})

Expand Down
1 change: 0 additions & 1 deletion src/__tests__/patients/patient-slice.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,6 @@ describe('patients slice', () => {
startDate: 'patient.carePlan.error.startDateRequired',
endDate: 'patient.carePlan.error.endDateRequired',
condition: 'patient.carePlan.error.conditionRequired',
note: 'patient.carePlan.error.noteRequired',
}
const store = mockStore()
const expectedCarePlan = {} as CarePlan
Expand Down
1 change: 0 additions & 1 deletion src/patients/care-plans/CarePlanForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ const CarePlanForm = (props: Props) => {
<Row>
<Column sm={12}>
<TextFieldWithLabelFormGroup
isRequired
value={carePlan.note}
label={t('patient.carePlan.note')}
name="note"
Expand Down
4 changes: 0 additions & 4 deletions src/patients/patient-slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -457,10 +457,6 @@ function validateCarePlan(carePlan: CarePlan): AddCarePlanError {
error.condition = 'patient.carePlan.error.conditionRequired'
}

if (!carePlan.note) {
error.note = 'patient.carePlan.error.noteRequired'
}

return error
}

Expand Down

1 comment on commit 34e6041

@vercel
Copy link

@vercel vercel bot commented on 34e6041 Jun 23, 2020

Choose a reason for hiding this comment

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

Please sign in to comment.