Skip to content

Alex/otr 2373 make new per practice care plan quick picks replace#7350

Open
alexwillingham wants to merge 3 commits intodevelopfrom
alex/otr-2373-make-new-per-practice-care-plan-quick-picks-replace
Open

Alex/otr 2373 make new per practice care plan quick picks replace#7350
alexwillingham wants to merge 3 commits intodevelopfrom
alex/otr-2373-make-new-per-practice-care-plan-quick-picks-replace

Conversation

@alexwillingham
Copy link
Copy Markdown
Contributor

@alexwillingham alexwillingham commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 PatientInstructionQuickPickData type + 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.

Comment on lines +90 to +99
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'>),
}),
};
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

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

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).

Copilot uses AI. Check for mistakes.
Comment on lines +56 to 63
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,
});
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

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

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).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants