Repository navigation
feat: add FHIR dispensing authorization (REMS-893) - #191
Conversation
Support `$rems-rda` requests by case number or by patient demographics and medication. Return coded denial reasons from `$rems-rda` and `$rems-etasu`. Store each dispensing decision and support FHIR search by authorization number.
|
I manually tested the new FHIR The Docker demo required one local configuration adjustment. I set the pharmacy’s |
|
One acceptance criterion remains partially open, from REMS-893:
I reproduced a case marked Approved with an incomplete pharmacy requirement. For that same case, $rems-etasu returned success with no denial reason, while $rems-rda returned pharmacy-not-certified and did not issue an authorization. |
Describe your changes
Adds POST /4_0_0/GuidanceResponse/$rems-rda so pharmacy clients can request a REMS Dispensing Authorization over FHIR. Clients supply a pharmacy and identify the case in one of two ways: by case number, or by the patient’s first name, last name, date of birth, and medication RxNorm code.
Approvals return an RDA number and authorization period. RDA_VALIDITY_DAYS sets the validity period and defaults to 7 in .env.
Both $rems-rda and the existing $rems-etasu status check return coded OperationOutcome issues explaining denials. The FHIR and NCPDP authorization handlers share the check for outstanding dispensing requirements.
REMS Admin saves each RDA decision as a GuidanceResponse. Decisions can be read by resource ID, and issued authorizations can be searched by RDA number. Case-linked approvals also update the case’s authorization and pharmacy history.
Testing
I performed limited testing of the endpoint by sending curl requests from the terminal to a local REMS Admin instance. This PR is in draft because more testing is needed. In particular, I still need to verify that a request can travel from the pharmacy to REMS Admin and that the pharmacy receives the correct authorization number or denial reason.
Follow-ups.
When a prescription moves to another pharmacy: Suppose Pharmacy A completed its certification and Pharmacy B later asks to fill the same prescription. REMS Admin can count Pharmacy A’s certification when approving Pharmacy B. Once that approval lists B as the current pharmacy, the next time the prescriber signs the order, the system may skip the pharmacy check because B is already on the case.
When saving an approval is interrupted: REMS Admin first saves the authorization number, then adds it to the patient’s case history. If the server stops between those steps, someone can look up the authorization by number even though it is missing from the case history.
Looking up an approval issued without a case: A pharmacy requesting authorization by patient name and date of birth must also send the medication’s RxNorm code. REMS Admin uses that code to check the medication’s dispensing requirements. If there are none, it can issue an authorization even when no case exists for that patient and medication. The saved approval omits the medication code and, if the request did not include a FHIR patient ID, has no link to the patient. A later lookup by authorization number will succeed, but the approval alone cannot confirm which medication it covered or, in that situation, which patient it was for.
Issue ticket number and Jira link
REMS-893 — FDA-REMS
Checklist before requesting a review
devnot main (the only exception to this is releases fromdevand hotfix branches)Checklist for conducting a review
Workflow
Owner of the Pull Request will be responsible for merge after all requirements are met, including approval from at least one reviewer. Additional changes made after a review will dismiss any approvals and require re-review of the additional updates. Auto merging can be enabled below if additional changes are likely not to be needed. The bot will auto assign reviewers to your Pull Request for you.