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

fix(patient): make note not required in care plan #2158

Merged
merged 12 commits into from
Jun 23, 2020
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