Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use endpoints #113

Merged
merged 9 commits into from
Oct 8, 2024
Merged

Use endpoints #113

merged 9 commits into from
Oct 8, 2024

Conversation

lmd59
Copy link
Contributor

@lmd59 lmd59 commented Oct 2, 2024

Summary

Shifts all front end functionality to use full server operation endpoints rather than local logic with CRUD endpoint interactions.

New behavior

Front end essentially acts the same with a few changes where spec-based operation functionality differs slightly from the original implemented logic.
The review functionality no longer asks whether date should be included and is also enabled for active measures.
Server-side $review and $approve operations now validate artifactAssessmentAuthor (reference) input appropriately according to both GET and POST inputs.

Code changes

Frontend...

  • Removes all front end database operation and related files including, dbOperations.ts, mongodb.ts, updates .env.example to remove MONGODB_URI environment variable
  • Removes child artifact management (handled by server):draftHelper.ts, serviceUtils.ts
  • Updates modifyresourceFields.ts to versionUtils.ts to calculate new versions
  • Updates all trpc procedures in draft.ts and service.ts to use server interactions. Note: Future updates could include reorganizing draft.ts and service.ts to better handle overlapping logic.
  • Update to ReleaseModal.tsx to remove deletion functionality from release process
  • Update authoring/[resourceType]/[id].tsx to simplify artifact updates and pass modified values to the updateDraft procedure
  • Update to review/[resourceType]/[id].tsx to change review workflow to use the operation rather than a local update. Enable active artifact reviews and remove date checkbox

Small changes...

  • ResourceInfoCard.tsx use consolidated trpc procedure
  • pages/[resourceType].tsx limit getServersideProps fetch to active only
  • authoring/index.tsx remove uuid setting since the server creates its own id

Server...

  • Update requestSchemas.ts to validate artifactAssessmentAuthor reference as it would be received from either a GET query parameter or a POST FHIR Parameters object. See https://hl7.org/fhir/R4/search.html#reference for more about how a reference is used in query parameters
  • Update Library/Measure services and tests according to new validation logic

Testing guidance

  • npm run check:all
  • Load your favorite measure bundle(s), including nested child bundle
  • npm run build:all
  • npm run start:all
  • Test out functionality at http://localhost:3001/mrs/ and make sure it has not changed (other than small ways described above)
  • Use insomnia to test $review or $approve GET with artifactAssessmentAuthor input as a string (like a canonical url) and to test POST with artifactAssessmentAuthor as a parameter i.e. within the parameter object:

{ name: 'artifactAssessmentAuthor', valueReference: { reference: 'http://example.org/fhir/Organization/123' } }

@elsaperelli elsaperelli self-requested a review October 3, 2024 13:23
@elsaperelli elsaperelli self-assigned this Oct 3, 2024
Copy link
Contributor

@elsaperelli elsaperelli left a comment

Choose a reason for hiding this comment

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

Lgtm! All of my comments are just little formatting things, everything looks and works great! HUGE transition!!! 🥳

app/src/server/trpc/routers/draft.ts Outdated Show resolved Hide resolved
app/src/server/trpc/routers/draft.ts Outdated Show resolved Hide resolved
app/src/server/trpc/routers/draft.ts Outdated Show resolved Hide resolved
app/src/server/trpc/routers/draft.ts Outdated Show resolved Hide resolved
app/src/server/trpc/routers/draft.ts Outdated Show resolved Hide resolved
app/src/server/trpc/routers/service.ts Outdated Show resolved Hide resolved
app/src/server/trpc/routers/service.ts Outdated Show resolved Hide resolved
app/src/server/trpc/routers/service.ts Show resolved Hide resolved
app/src/server/trpc/routers/service.ts Show resolved Hide resolved
app/src/util/versionUtils.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@elsaperelli elsaperelli left a comment

Choose a reason for hiding this comment

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

Lgtm!

@elsaperelli elsaperelli merged commit 9e6e8a2 into main Oct 8, 2024
2 checks passed
@elsaperelli elsaperelli deleted the use-endpoints branch October 8, 2024 18:53
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