Table of Contents |
---|
...
Invoke Get patient by ID
Validate person_id - mpi_id exists
in case invalid return 422 (422 Person not found)
Save temporary variables from: $.data.authentication_methods
Validate Response $.data.is_active==TRUE
if not found - return 422 error (message: "Only for active MPI record can be created medication request!")
Validate person's verification status:
If MRR has based_on with valid activity, then skip this validation.
Else check patient's verification_status is not equal to NOT_VERIFIED.
in case of error return 409, "Patient is not verified"
Validate dates
created_at - similar to assertion date in FHIR -> Actual date medication request being created
inserted_at - date when Medication request was registered in E-Health
started_at/ended_at - Treatment period. Cannot be less than MR expiration period. Defined by doctor.
dispence_valid_from - Used for dispense validation. As for now equals Created at.
dispense_valid_to - Dispense valid from + medication_dispense_period parameter value. Implements dispense expiration period.
...