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

Commit

Permalink
feat(patients): adds ability to search by patient friendlyId
Browse files Browse the repository at this point in the history
fix #1709
  • Loading branch information
jackcmeyer committed Jan 8, 2020
1 parent ad9fb13 commit a519550
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/__tests__/patients/patients-slice.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ describe('patients slice', () => {
jest.spyOn(PatientRepository, 'search')

const expectedSearchString = 'search string'
const expectedSearchFields = ['fullName']
const expectedSearchFields = ['fullName', 'friendlyId']
await searchPatients(expectedSearchString)(dispatch, getState, null)

expect(PatientRepository.search).toHaveBeenCalledWith(
Expand Down
4 changes: 3 additions & 1 deletion src/patients/patients-slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ export const searchPatients = (searchString: string): AppThunk => async (dispatc
if (searchString.trim() === '') {
patients = await PatientRepository.findAll()
} else {
patients = await PatientRepository.search(new Search(searchString, ['fullName']))
patients = await PatientRepository.search(
new Search(searchString, ['fullName', 'friendlyId']),
)
}

dispatch(getAllPatientsSuccess(patients))
Expand Down

0 comments on commit a519550

Please sign in to comment.