Skip to content

spezi-firebase-fhir#270

Draft
pauljohanneskraft wants to merge 22 commits into
mainfrom
fhir
Draft

spezi-firebase-fhir#270
pauljohanneskraft wants to merge 22 commits into
mainfrom
fhir

Conversation

@pauljohanneskraft

@pauljohanneskraft pauljohanneskraft commented Jul 21, 2025

Copy link
Copy Markdown
Collaborator

spezi-firebase-fhir

♻️ Current situation & Problem

This pull request intends to change ENGAGE-HF to make use of the schemas defined in spezi-firebase-fhir.

⚙️ Release Notes

Add a bullet point list summary of the feature and possible migration guides if this is a breaking change so this section can be added to the release notes.
Include code snippets that provide examples of the feature implemented or links to the documentation if it appends or changes the public interface.

📚 Documentation

Please ensure that you properly document any additions in conformance to Spezi Documentation Guide.
You can use this section to describe your solution, but we encourage contributors to document your reasoning and changes using in-line documentation.

✅ Testing

Please ensure that the PR meets the testing requirements set by CodeCov and that new functionality is appropriately tested.
This section describes important information about the tests and why some elements might not be testable.

Code of Conduct & Contributing Guidelines

By creating and submitting this pull request, you agree to follow our Code of Conduct and Contributing Guidelines:

@pauljohanneskraft

Copy link
Copy Markdown
Collaborator Author

TODO: The Web dashboard is apparently accessing valueMedicationRequest, so we will need to adapt the code there as well to introduce the new structure where we use valueReference and a medicationRequest that is inside the contained property.

@codecov

codecov Bot commented Jul 28, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.76404% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.18%. Comparing base (13811f3) to head (a539bb6).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...c/services/seeding/staticData/staticDataService.ts 14.29% 6 Missing ⚠️
...nctions/src/services/database/databaseConverter.ts 71.43% 4 Missing ⚠️
...ervices/seeding/staticData/rxNorm/rxNormService.ts 87.88% 2 Missing and 2 partials ⚠️
functions/src/services/trigger/triggerService.ts 75.00% 2 Missing and 1 partial ⚠️
...ns/src/functions/onUserMedicationRequestWritten.ts 0.00% 1 Missing ⚠️
...c/services/medication/databaseMedicationService.ts 92.31% 1 Missing ⚠️
...ons/src/services/patient/databasePatientService.ts 95.24% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #270      +/-   ##
==========================================
- Coverage   82.50%   82.18%   -0.31%     
==========================================
  Files          91       91              
  Lines        3598     3640      +42     
  Branches      890      900      +10     
==========================================
+ Hits         2968     2991      +23     
- Misses        596      615      +19     
  Partials       34       34              
Files with missing lines Coverage Δ
functions/src/functions/helpers.ts 46.16% <100.00%> (+2.16%) ⬆️
...unctions/src/functions/onUserAppointmentWritten.ts 100.00% <100.00%> (ø)
...rc/functions/onUserQuestionnaireResponseWritten.ts 100.00% <100.00%> (ø)
functions/src/healthSummary/generate.ts 91.24% <100.00%> (ø)
functions/src/healthSummary/generateChart.ts 100.00% <ø> (ø)
functions/src/healthSummary/keyPointsMessage.ts 96.56% <ø> (ø)
functions/src/models/healthSummaryData.ts 78.38% <ø> (ø)
functions/src/models/medicationRequestContext.ts 100.00% <ø> (ø)
...rvices/contraindication/contraindicationService.ts 100.00% <ø> (ø)
...contraindication/defaultContraindicationService.ts 97.15% <100.00%> (-0.04%) ⬇️
... and 23 more

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fc58a16...a539bb6. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This comment was marked as outdated.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request updates ENGAGE-HF to use the standardized FHIR schemas from the spezi-firebase-fhir package instead of maintaining local FHIR type definitions. The changes transition from custom FHIR implementations to the shared library while maintaining backward compatibility.

  • Updates all FHIR resources to use spezi-firebase-fhir library
  • Simplifies type definitions by removing duplicate FHIR base types
  • Maintains API compatibility through wrapper classes extending the new base types

Reviewed Changes

Copilot reviewed 109 out of 118 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
package.json Removes local firebase-admin dependency and fixes npm install script
functions/package.json Updates firebase-admin version and removes zod dependency
functions/models/package.json Adds spezi-firebase-fhir dependency
functions/models/src/index.ts Updates exports to remove custom FHIR types and use library types
functions/models/src/fhir/*.ts Replaces custom FHIR implementations with library-based ones
functions/models/src/fhir/baseTypes/*.ts Removes custom FHIR base type definitions
functions/src/services/**/*.ts Updates imports and usage to new FHIR types
functions/src/tests/**/*.ts Updates test data structures to match new FHIR schemas
Files not reviewed (2)
  • functions/models/package-lock.json: Language not supported
  • functions/package-lock.json: Language not supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread functions/src/services/trigger/triggerService.ts
Comment thread functions/models/src/helpers/fhirSchemaConverter.ts
Comment thread functions/models/src/helpers/fhirSchemaConverter.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants