Skip to content
New issue

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

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

Already on GitHub? # to your account

[api/instruments] Add endpoint that allows you to add instruments to a battery #8868

Merged
merged 10 commits into from
Jan 4, 2024

Conversation

driusan
Copy link
Collaborator

@driusan driusan commented Aug 15, 2023

This implements a /candidates/{id}/{visit}/instruments POST endpoint which allows you to programmatically add an instrument to a candidate's battery through the LORIS API.

The POST endpoint takes input in the same format as GET, but adds any missing instruments to the battery instead of simple returning the existing test battery. It returns the new battery.

Copy link
Contributor

@xlecours xlecours left a comment

Choose a reason for hiding this comment

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

I don't think bypassing the test_battery is advisable. Was it the ask?

@@ -480,7 +481,10 @@ Where the instruments array represents the instruments that were administered fo
candidate at that visit. InstrumentNames are the short names and the forms for them
SHOULD all be retrievable through the `project` portion of the API.

PUT / PATCH / POST are not currently supported for candidate instruments.
POST accepts data of the same format. Any instruments in the Instrument key not currently in the visit test battery will be added to
Copy link
Contributor

Choose a reason for hiding this comment

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

Why ask for the Meta object? Just the instruments would be enough no?

{
  "Instruments": [...]
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The Meta object is generally required in all our endpoints for 1. symmetric 2. as a double check to ensure a bug didn't send it to the wrong endpoint, isn't it?

@driusan
Copy link
Collaborator Author

driusan commented Dec 12, 2023

Yes, the ask is to bypass the test battery and add an instrument that was administered which isn't part of the battery. It also is an atomic operation for the API that you can build "populate the test battery" out of but the inverse it not true

@driusan driusan merged commit 447c918 into aces:main Jan 4, 2024
19 checks passed
@ridz1208 ridz1208 added this to the 26.0.0 milestone Apr 9, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants