feat: add edit and delete for manual source resources#632
Open
clintmoyer wants to merge 8 commits intofastenhealth:mainfrom
Open
feat: add edit and delete for manual source resources#632clintmoyer wants to merge 8 commits intofastenhealth:mainfrom
clintmoyer wants to merge 8 commits intofastenhealth:mainfrom
Conversation
add DeleteResourceBySourceId and UpdateResourceBySourceId to the database layer, restricted to manual/fasten platform sources. add DELETE and PUT handlers at /resource/fhir/:sourceId/:resourceId with appropriate error mapping (404 not found, 403 non-manual source). regenerate mock database.
add deleteResourceBySourceId and updateResourceBySourceId methods to the API service. show a delete button with confirmation modal on the resource detail page when viewing resources from manual/fasten sources. on success, display a toast and redirect to the source explore page.
add handler tests for DeleteResourceFhir and UpdateResourceFhir covering happy path, not-found, and invalid resource ID cases. add database tests for DeleteResourceBySourceId and UpdateResourceBySourceId covering happy path, non-manual source rejection, and resource-not-found cases.
add standalone ResourceEditComponent modal supporting Condition, Observation, MedicationRequest, Encounter, AllergyIntolerance, Procedure, and Immunization resource types. each type renders appropriate form controls for status, dates, values, and notes.
show an edit button alongside the delete button for supported resource types on manual/fasten sources. clicking opens the ResourceEditComponent modal, and on save refreshes the display model without a page reload.
add unit tests for ResourceEditComponent covering form building, date helpers, value type detection, merge logic, and submit behavior for all seven supported resource types. add tests for the detail page's isEditableResourceType and editResource modal integration.
add UpdateResourceFhirByType (PATCH) and DeleteResourceFhirByType handlers to preserve backward compatibility with the medical record wizard and practitioner pages after rebasing onto main. use a separate /resource/fhir-by-type/ route for type-based deletes to avoid conflicting with the source-based DELETE route.
run gofmt on Go source files and prettier on TypeScript, HTML, and SCSS files to enforce consistent code style.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Allow users to edit and delete FHIR resources directly from the resource detail page for manually-created records.
Tickets
Summary of Changes
Screenshots / Recordings
demo.mp4