Alex/otr 2373 make new per practice care plan quick picks replace#7350
Alex/otr 2373 make new per practice care plan quick picks replace#7350alexwillingham wants to merge 3 commits intodevelopfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR implements “Practice Quick Picks” for Patient Instructions by introducing a new quick-pick category backed by ActivityDefinition quick picks, wiring up CRUD zambdas + client API calls, adding an admin UI tab to manage them, and updating the Plan tab templates UI to use “My Quick Picks” vs “Practice Quick Picks”.
Changes:
- Add a new
PatientInstructionQuickPickDatatype + quick-pick category and corresponding CRUD zambdas/config. - Add EHR admin UI support to list/create/update/remove Patient Instruction quick picks.
- Update Plan tab Patient Instructions templates dialog/card to use the new naming and to load Practice Quick Picks via the new API.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/zambdas/src/ehr/shared/quick-pick-categories.ts | Adds Patient Instruction quick-pick category definition. |
| packages/zambdas/src/ehr/admin-create-patient-instruction-quick-pick/index.ts | New create handler for Patient Instruction quick picks. |
| packages/zambdas/src/ehr/admin-update-patient-instruction-quick-pick/index.ts | New update handler for Patient Instruction quick picks. |
| packages/zambdas/src/ehr/admin-get-patient-instruction-quick-picks/index.ts | New list handler for Patient Instruction quick picks. |
| packages/zambdas/src/ehr/admin-remove-patient-instruction-quick-pick/index.ts | New remove handler for Patient Instruction quick picks. |
| packages/utils/lib/types/api/quick-picks.types.ts | Adds Patient Instruction quick-pick API types. |
| config/oystehr-core/zambdas.json | Registers new zambdas for deployment. |
| apps/ehr/src/api/api.ts | Adds client functions to call the new patient-instruction quick-pick zambdas. |
| apps/ehr/src/features/visits/telemed/components/admin/QuickPicksAdminPage.tsx | Adds a new admin sub-tab and wires editor callbacks for patient instructions. |
| apps/ehr/src/features/visits/telemed/components/admin/QuickPickEditor.tsx | Extends editor fields with multiline/rows support. |
| apps/ehr/src/features/visits/shared/stores/appointment/appointment.queries.ts | Adds optional enabled control to useGetPatientInstructions. |
| apps/ehr/src/features/visits/shared/components/plan-tab/components/PatientInstructionsTemplatesDialog.tsx | Replaces org templates with practice quick picks; updates labels and fetching logic. |
| apps/ehr/src/features/visits/shared/components/plan-tab/PatientInstructionsCard.tsx | Renames UI/actions to “My Quick Picks” and “Practice Quick Picks” and updates dialog props. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| export const PATIENT_INSTRUCTION_QUICK_PICK_CATEGORY: QuickPickCategory<PatientInstructionQuickPickData> = { | ||
| tagCode: 'patient-instruction-quick-pick', | ||
| displayNameKey: 'name', | ||
| getDisplayName: (data) => data.name, | ||
| fromParsed: (id, title, config) => ({ | ||
| id, | ||
| name: title, | ||
| ...(config as Omit<PatientInstructionQuickPickData, 'id' | 'name'>), | ||
| }), | ||
| }; |
There was a problem hiding this comment.
The new Patient Instruction quick-pick category isn’t covered by the existing quick-pick helper unit tests. Please add a unit test (similar to the other categories) that verifies PatientInstruction quick picks serialize/deserialize correctly (title/name stripping into the config extension, and parsing back with text).
| const { isFetching: isFetchingPracticeQuickPicks, data: practiceQuickPicks } = useQuery({ | ||
| queryKey: ['practice-patient-instruction-quick-picks'], | ||
| queryFn: async () => { | ||
| const response = await getPatientInstructionQuickPicks(oystehrZambda!); | ||
| return response.quickPicks; | ||
| }, | ||
| enabled: !isMyTemplates && !!oystehrZambda, | ||
| }); |
There was a problem hiding this comment.
The practice quick-picks query doesn’t handle the error state. If the request fails, patientInstructions stays empty and the UI will show “No instruction templates”, which is misleading. Consider handling error from useQuery (e.g., show an error message/snackbar and avoid displaying the empty-state as if there are simply no templates).
OTR-2373: Make New Per-Practice Care Plan Quick Picks (replace 'organizational templates') and rename my templates to 'my quick picks'