libreconnect / backend

MIT License
13 stars 0 forks source link

Create module Heart #1

Closed NathaelB closed 1 month ago

NathaelB commented 1 month ago

Development of a module to manage all data relating to patients' cardiac health. This module will include the management of data such as heart rate, electrocardiograms, atrial fibrillation (AF) history, blood pressure, etc. To begin with, the module will focus on managing the patient's heart rate.

Features to be implemented

  1. Creating heart rate data
  2. Retrieving a patient's data
    • Route to retrieve a patient's heart rate data.
    • Data can be filtered using parameters (e.g. start date, end date, minimum/maximum heart rate, etc.).

Routes to be implemented

  1. POST /v1/heart/rates
    • Description: Add heart rate data for a patient.
    • Body: JSON containing a table of heart rates and, if necessary, the patient's identifier (for healthcare professionals)
      {
      "patientId": "123456",
      "heartRates": [
      {
      "startDate": "2024-06-30T19:42:00Z",
      "endDate": "2024-06-30T19:42:00Z",
      "heartRate": 100,
      },
      ]
      }
  2. GET /v1/heart/rates?patientId=123456
    • Description: Retrieve heart rate data from the connected patient or from a specific patient if patientId is provided.
    • Filter parameters (query params)
    • patientId?: Patient ID (optional, used by healthcare professionals).
    • startDate?: Filter start date.
    • endDate?: Filter end date.
    • minHeartRate?: Minimum heart rate.
    • maxHeartRate?: Maximum heart rate
    • Example of calls:
      GET /v1/heart/rates?startDate=2024-06-01T00:00:00Z&endDate=2024-06-30T23:59:59Z&minHeartRate=60&maxHeartRate=120
      GET /v1/heart/rates?patientId=12345&startDate=2024-06-01T00:00:00Z&endDate=2024-06-30T23:59:59Z&minHeartRate=60&maxHeartRate=120
NathaelB commented 1 month ago

You can use node ace g:module <name> to generate a module

NathaelB commented 1 month ago

Modification to the HeartRate model: dates will be transformed into timestamps to simplify calculations, as in the Step model.