candoumbe / candoumbe/physiotrack
✨ add endpoint to ingest various physiologic measures
- Dominant language
- JavaScript
- Stars
- 0
- Forks
- 0
- Avg merge
- 19h 11m
- Merged PRs (30d)
- 4
Description
The endpoint should accept
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
Add an endpoint that allows clients to submit physiological measures.
The endpoint should be a `POST {subject_id}/measures` where :
- `subject_id` in the URL represents the identifier of the subject of the measure. This value should allow to retrieve all measures of the same subject
- the body should accepts object that has at least the following properties
- `id` : unique identifier of the measure
- "version" : version of the measure object
- "type": the type of the measure ("blood_pressure", "temperature", "body_height", ...)
- unit: a string which is an international unit into which `value` is expressed
- value : the actual value of the measure (could be number or an object where each property is a value
```json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "PhysiologicalDataSubmission",
"description": "Schema for recording various types of physiological measurements",
"type": "object",
"required": ["id", "subject_id", "timestamp", "measurement"],
"properties": {
"id": {
"type": "string",
"format": "uuid",
"description": "Unique identifier for this specific measurement record"
},
"subject_id": {
"type": "string",
"format": "uuid",
"description": "Unique identifier of the subject (UUID)"
},
"timestamp": {
"type": "string",
"format": "date-time",
"description": "Date and time when the measurement was taken (ISO 8601 format)"
},
"measurement": {
"type": "object",
"description": "The physiological measurement data object",
"required": ["type", "value"],
"properties": {
"type": {
"type": "string",
"enum": ["blood_pressure", "weight", "height", "temperature", "heart_rate"],
"description": "The category of the physiological measurement"
},
"unit": {
"type": "string",
"description": "The unit of measurement used (e.g., mmHg, kg, cm, °C)"
},
"value": {
"type": "object",
"description": "The actual measurement value, which can be a single number or a complex object depending on the type"
}
},
"allOf": [
{
"if": { "properties": { "type": { "const": "blood_pressure" } } },
"then": {
"properties": {
"value": {
"type": "object",
"description": "Blood pressure components",
"required": ["systolic", "diastolic"],
"properties": {
"systolic": {
"type": "integer",
"minimum": 0,
"description": "Systolic blood pressure value"
},
"diastolic": {
"type": "integer",
"minimum": 0,
"description": "Diastolic blood pressure value"
}
}
},
"unit": {
"const": "mmHg",
"description": "Unit for blood pressure"
}
}
}
},
{
"if": { "properties": { "type": { "const": "weight" } } },
"then": {
"properties": {
"value": {
"type": "number",
"exclusiveMinimum": 0,
"description": "Numeric weight value"
},
"unit": {
"enum": ["kg", "lb"],
"description": "Weight measurement unit"
}
}
}
},
{
"if": { "properties": { "type": { "const": "height" } } },
"then": {
"properties": {
"value": {
"type": "number",
"exclusiveMinimum": 0,
"description": "Numeric height value"
},
"unit": {
"enum": ["cm", "m", "in"],
"description": "Height measurement unit"
}
}
}
},
{
"if": { "properties": { "type": { "const": "temperature" } } },
"then": {
"properties": {
"value": {
"type": "number",
"description": "Numeric temperature value"
},
"unit": {
"enum": ["°C", "°F"],
"description": "Temperature measurement unit"
}
}
}
}
]
}
}
}
```
The json schema is not exhaustive and can contain additional data
**Describe alternatives you've considered**
- distinct endpoints per type of supported measures. it won't scale if the api starts support tens of type of measure
**Additional context**
Have a look at Measurement base class.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading the Measurement base class and tracing the existing API entry points for subjects and measurements. Implement and verify POST {subject_id}/measures against the supplied schema, including the listed measurement types, units, values, identifiers, and timestamps; done means clients can submit measurements and retrieve them by subject.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100