An API to manage the full chain of care for patients in the healthcare system
Create a new patient record.
{
"name": "John Doe",
"age": 35,
"condition": ["infection"]
}
Retrieve a patient by their unique ID.
Response: {
{
"_id": "676af0fa18204c7a86ab9449",
"patientId": 4,
"name": "John Doe",
"age": 35,
"condition": [
"infection"
],
"interventions": [],
"createdAt": "2024-12-24T17:35:54.571Z",
"updatedAt": "2024-12-24T17:35:54.571Z",
"__v": 0
}
Update a patient's record by their unique ID.
{
"name": "John Doe",
"age": 35,
"condition": ["Viral infections"]
}
Delete a patient record by ID.
Create a new intervention record.
{
"patientId": 4,
"description": "john Doe Viral infections get overcome"
}
Get interventions for a specific patient.
Response: [
{
"_id": "676af0fa18204c7a86ab9449",
"patientId": 4,
"name": "john Doe",
"age": 35,
"condition": [
"Viral infections"
],
"interventions": [
{
"_id": "676af1b918204c7a86ab9450",
"patientId": 4,
"description": "john Doe Viral infections get overcome ",
"date": "2024-12-24T17:39:05.239Z",
"createdAt": "2024-12-24T17:39:05.240Z",
"updatedAt": "2024-12-24T17:39:05.240Z",
"__v": 0
}
],
"createdAt": "2024-12-24T17:35:54.571Z",
"updatedAt": "2024-12-24T17:39:05.316Z",
"__v": 1
}
]
Update an intervention for a specific patient.
{
"patientId": 4,
"description": "Viral infections starting again"
}
Delete an intervention for a specific patient.
Create a new product or service record.
{
"patientId": "4",
"name": "Viral infections Scan",
"type": "SERVICE",
"category": "Diagnostic",
"description": "Full body scan",
"cost": 1500
}
Get products or services for a specific patient.
Response: [
[
{
"_id": "676af29c18204c7a86ab9457",
"patientId": 4,
"name": " Viral infections Scan",
"type": "SERVICE",
"category": "Diagnostic",
"description": "Full body scan",
"cost": 1500,
"patient": "676af0fa18204c7a86ab9449",
"date": "2024-12-24T17:42:52.489Z",
"createdAt": "2024-12-24T17:42:52.489Z",
"updatedAt": "2024-12-24T17:42:52.489Z",
"__v": 0
}
]
Update a product/service for a specific patient.
{
"patientId": "4",
"name": "Viral infections Scan",
"cost": 6000
}
Delete a product/service for a specific patient.
Create a new chain entry for a patient.
{
"patientId": "4",
"type": "INTERVENTION",
"notes": "Initial consultation"
}
Get the full chain of care for a specific patient.
Response: [
{
"status": "success",
"data": {
"patient": {
"id": "676af0fa18204c7a86ab9449",
"patientId": 4,
"name": "john Doe",
"age": 35
},
"chainEntries": {
"count": 1,
"entries": [
{
"_id": "676af2db18204c7a86ab945d",
"patientId": 4,
"type": "INTERVENTION",
"status": "PENDING",
"notes": "Initial consultation",
"patient": {
"_id": "676af0fa18204c7a86ab9449",
"patientId": 4,
"name": "john Doe",
"age": 35
},
"date": "2024-12-24T17:43:55.180Z",
"createdAt": "2024-12-24T17:43:55.180Z",
"updatedAt": "2024-12-24T17:43:55.180Z",
"__v": 0
}
]
},
"products": {
"count": 1,
"entries": [
{
"_id": "676af29c18204c7a86ab9457",
"patientId": 4,
"name": " Viral infections Scan",
"type": "SERVICE",
"category": "Diagnostic",
"description": "Full body scan",
"cost": 1500,
"patient": "676af0fa18204c7a86ab9449",
"date": "2024-12-24T17:42:52.489Z",
"createdAt": "2024-12-24T17:42:52.489Z",
"updatedAt": "2024-12-24T17:42:52.489Z",
"__v": 0
}
]
},
"interventions": {
"count": 2,
"entries": [
{
"_id": "676af1b918204c7a86ab9450",
"patientId": 4,
"description": "john Doe Viral infections get overcome ",
"date": "2024-12-24T17:39:05.239Z",
"createdAt": "2024-12-24T17:39:05.240Z",
"updatedAt": "2024-12-24T17:39:05.240Z",
"__v": 0
},
{
"_id": "6769a0491c67c3df65884845",
"patientId": 4,
"description": "Viral infections starting again",
"date": "2024-12-23T17:39:21.553Z",
"createdAt": "2024-12-23T17:39:21.557Z",
"updatedAt": "2024-12-24T17:41:58.024Z",
"__v": 0
}
]
}
}
}
]
Update the status or notes in the care chain for a specific patient.
{
"status": "IN_PROGRESS",
"notes": "Treatment ongoing - Day 2"
}
Delete a chain entry for a specific patient.
Use localhost:3000 for testing