ideafast / middleware-services

Python API containing endpoints for smartphone hub applications and transfer to data portal
0 stars 0 forks source link

Refactor DRM metadata retrieval to query inventory less #87

Closed jawrainey closed 3 years ago

jawrainey commented 3 years ago

Current DRM implementation uses inventory more often than necessary and the logic could mirror other pipelines instead. As such, four minor changes were made:

  1. 1-to-1 mapping between serial and inventory that should be used rather than comparing datetime in UCAM.
  2. Removes use of inventory endpoints in __patient_id_from_ucam and __patient_id_from_inventory, which now mirrors other pipelines (for future refactors).
  3. Removes unreachable IF statement
  4. Removes now unused private method: __device_id_from_ucam

Testing

  1. run the DRM pipeline locally from master and note the quantity of known and unknown records.
  2. Delete the local DB
  3. Switch to this branch and run it again and note the quantity of known/unknowns is the same.