-
Notifications
You must be signed in to change notification settings - Fork 0
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
Create Patient Service and Implement CRUD operations #45
Conversation
Coverage report
Show new covered files 🐣
Test suite run success89 tests passing in 8 suites. Report generated by 🧪jest coverage report action from 957a8ab |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm!
The only thing I would change in the future (not a big deal for this one at all) but just make sure that you include in the testing guidance to try out the new endpoints in Insomnia! (This should be kinda obvious but good to add)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The listing of all patients is returning a JSON Array this should be a searchset
Bundle instead. See https://hl7.org/fhir/R4/http.html#search for more info.
Additionally we should have the internal mongo _id
s projected out of the responses.
…ge to response to a searchset.
I made the requested changes. One potentially weird thing that I did was call |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one small comment but otherwise almost good to go!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm! Way to be flexible!!
Summary
This PR adds endpoints to the bulk-export-server to handle operations related to Patients. Adds operations to create, get, update and delete patients on the server. This PR also adds
Group
delete endpoint.[host]/Patient
and[host]/Group
now correctly return asearchset
as per fhir spec, https://hl7.org/fhir/R4/http.html#search.JIRA Issue
New behavior
bulk-export-server now has CRUD operations for Patients
GET
:[host]/Patient
GET
:[host]/Patient/[patientId]
POST
:[host]/Patient
PUT
:[host]/Patient/[patientID]
DELETE
:[host]/Patient/[patientID]
Now has new delete operation for Group
DELETE
:[host]/Group/[groupID]
Endpoints that find multiple Patients or Groups from the server,
GET
:[host]/Patient
andGET
:[host]/Group
, now return a searchset object instead of a json list of fhir Patient or Group objects.Code changes
.eslintrc.json
and.prettierignore
were changed to addecqm-content-r4-2021
to the excluded folders because they were causing warnings with eslint and prettier.src/server/app.js
was changed to add the new patient endpoints and new group endpoint to the server.src/services/group.service.js
: updated some comments to be more specific, wrapped the /Group get endpoint in a search set object, added new function for DELETE endpoint.src/services/patient.service.js
was created to implement functions that will interact with the database to fulfill the CRUD operations requested when a user accesses the endpoints for Patients.test/fixtures/updatedTestPatient.json
was created to test thePUT
endpoint.test/services/patient.service.test.js
are tests for the patient.service.js operations that follows closely from thegroup.service.test.js
file.src/util/bundleUtils.js
: created to generate the searchset bundle object that wraps the response from the server for the /Patient and /Group endpoints.src/util/mongo.controller.js
: added a default projection to filter out mongo-generated ids from the server's responses to all operations.test/services/group.service.test.js
: changed /Group test to interact with new searchset response from serverTesting guidance
npm run check