Skip to content

EHR Admin: Make E&M code list self-service configurable in Admin#7244

Open
FilinBrChaos wants to merge 16 commits intodevelopfrom
plyshnykov/otr-2230-ehr-admin-make-em-code-list-self-service-configurable-in
Open

EHR Admin: Make E&M code list self-service configurable in Admin#7244
FilinBrChaos wants to merge 16 commits intodevelopfrom
plyshnykov/otr-2230-ehr-admin-make-em-code-list-self-service-configurable-in

Conversation

@FilinBrChaos
Copy link
Copy Markdown
Contributor

@FilinBrChaos
Copy link
Copy Markdown
Contributor Author

I decided to save em codes in ValueSet, we already do that for procedure-type. But i want some verification from you guys if it's a good architecture

…e-list-self-service-configurable-in

# Conflicts:
#	packages/utils/lib/ottehr-config/provider/index.ts
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 migrates the E&M CPT code list from static provider config into a FHIR ValueSet, and adds Admin self-service tooling (UI + zambdas) to view and manage that list.

Changes:

  • Added ValueSet-backed E&M code retrieval and updated E&M logic to use it (Candid + billing suggestions + EHR UI).
  • Introduced new authenticated zambdas to get/create/update/delete E&M codes in the ValueSet.
  • Added an Admin tab/page + dialog for managing E&M codes, plus supporting API client methods and test updates.

Reviewed changes

Copilot reviewed 29 out of 30 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
packages/zambdas/src/shared/candid.ts Uses E&M codes from a FHIR ValueSet to determine telemed E&M modifier logic.
packages/zambdas/src/ehr/recommend-billing-suggestions/index.ts Pulls E&M codes from the ValueSet to constrain/validate AI billing suggestions.
packages/zambdas/src/ehr/em-codes/update/validateRequestParameters.ts Validates update-em-code request bodies via zod.
packages/zambdas/src/ehr/em-codes/update/index.ts Updates an E&M code display in the ValueSet expansion.
packages/zambdas/src/ehr/em-codes/get/index.ts Returns E&M codes from the ValueSet expansion.
packages/zambdas/src/ehr/em-codes/delete/validateRequestParameters.ts Validates delete-em-code request bodies via zod.
packages/zambdas/src/ehr/em-codes/delete/index.ts Removes an E&M code from the ValueSet expansion.
packages/zambdas/src/ehr/em-codes/create/validateRequestParameters.ts Validates create-em-code request bodies via zod.
packages/zambdas/src/ehr/em-codes/create/index.ts Adds a new E&M code to the ValueSet expansion.
packages/utils/lib/types/api/index.ts Exposes E&M codes constants from the API types barrel.
packages/utils/lib/types/api/em-codes.constants.ts Defines the canonical E&M codes ValueSet URL.
packages/utils/lib/types/api/config/index.ts Exports new em-codes API config types/schemas.
packages/utils/lib/types/api/config/em-codes.ts Adds zod schemas and types for E&M code CRUD inputs/outputs.
packages/utils/lib/ottehr-config/provider/index.ts Removes hardcoded E&M code options from provider config.
packages/config-types/config/provider.ts Removes emCodeOptions from ProviderConfigSchema.
config/oystehr/em-codes.json Seeds the E&M codes ValueSet with an expansion list of CPT codes.
config/oystehr-core/zambdas.json Registers the new E&M code CRUD zambdas.
apps/ehr/tests/component/EMCodeField.test.tsx Updates tests to mock useEMCodes instead of static config.
apps/ehr/tests/component/BillingCodesContainer.test.tsx Updates tests to mock useEMCodes instead of static config.
apps/ehr/src/pages/AdminPage.tsx Adds an Admin tab/panel for “E&M Codes”.
apps/ehr/src/features/visits/telemed/components/admin/admin.queries.tsx Adds mutations for create/update/delete E&M codes and cache invalidation.
apps/ehr/src/features/visits/telemed/components/admin/EMCodesAdminPage.tsx New Admin page to list/edit/delete E&M codes.
apps/ehr/src/features/visits/telemed/components/admin/EMCodeDialog.tsx New dialog for creating/updating an E&M code.
apps/ehr/src/features/visits/shared/hooks/useEMCodes.ts New hook to fetch E&M codes via zambda API.
apps/ehr/src/features/visits/shared/hooks/useBillingSuggestions.ts Uses useEMCodes instead of provider config for E&M filtering.
apps/ehr/src/features/visits/shared/components/assessment-tab/EMCodeField.tsx Uses useEMCodes for the E&M dropdown options.
apps/ehr/src/features/visits/shared/components/assessment-tab/BillingCodesContainer.tsx Uses useEMCodes for E&M options and disables UI while loading.
apps/ehr/src/constants/data-test-ids.ts Adds test IDs for the new E&M Admin UI.
apps/ehr/src/api/api.ts Adds client functions for get/create/update/delete E&M code zambdas.
.gitignore Ignores .claude and normalizes .playwright-mcp entry.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/zambdas/src/ehr/em-codes/create/index.ts Outdated
Comment thread packages/zambdas/src/ehr/em-codes/update/index.ts
Comment thread packages/zambdas/src/ehr/em-codes/delete/index.ts
Comment thread apps/ehr/src/features/visits/shared/hooks/useEMCodes.ts Outdated
Comment thread packages/config-types/config/provider.ts
Comment thread packages/zambdas/src/ehr/em-codes/create/index.ts Outdated
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

Copilot reviewed 33 out of 34 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/zambdas/src/ehr/em-codes/create/index.ts Outdated
Comment thread packages/zambdas/src/ehr/em-codes/update/index.ts
Comment thread packages/zambdas/src/ehr/em-codes/delete/index.ts Outdated
Comment thread packages/zambdas/src/shared/candid.ts Outdated
Comment thread packages/zambdas/src/ehr/recommend-billing-suggestions/index.ts Outdated
Comment thread packages/zambdas/src/ehr/em-codes/shared.ts Outdated
Comment thread config/oystehr/em-codes.json
Comment thread packages/utils/lib/ottehr-config/provider/index.ts
Comment thread packages/zambdas/src/ehr/em-codes/delete/index.ts
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.

3 participants