ideafast / middleware-services

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

Use UCAM lookup in Dreem DAG #42

Closed jawrainey closed 3 years ago

jawrainey commented 3 years ago

The current dreem data transfer service that uses the inventory should use UCAM instead once #15 implemented.

Previously, the code used the inventory API to determine which patients used which devices and when. This implementation now uses the UCAM API in addition to the inventory and simplifies the logic for how this is determined.

Testing

  1. Uncomment all but the metadata attribute in the dreem DAG.
  2. Configure main.py to auth and make queries to newcastle
  3. Ensure mongoDB is running (poetry run compose) and drop the records collection.
  4. Run the code and you'll see that a large portion of records is created for the data.

Note: I added print statements as logging as we can replace the print call with outputting to the log in the future and this is useful when running locally either way.