API Reference

Create a Patient Hospitalization (admission)

URL: {{base_url}}/providers/{{serenity_user_provider_id}}/hospitalizations

Method: POST

Request Fields' descriptions:

  • admitted_by (Required, str): uuid field of a Practitioner object
  • created_by (Required, str): uuid field of a User object (User who sent the request)
  • healthcare_service (Required, str): uuid field of a Healthcareservice object
  • price_tier (Required, str): uuid field of a ServicePriceTiers object
  • patient (Required, str): uuid field of Patient
  • bed(Required, str): uuid field of Hospitalization Bed
  • location (Required, str): id field of a Location where admission took place

admit_source field's choices:

  • hosp-trans (Transferred from other hospital)
  • emd (From accident/emergency department)
  • outp (From outpatient department)
  • born (Born in hospital)
  • gp (General Practitioner referral)
  • mp (Medical Practitioner/physician referral)
  • nursing (From nursing home)
  • psych (From psychiatric hospital)
  • rehab (From rehabilitation facility)
  • other (Other)
{
  "patient": "50390ab0-489f-4a36-bfab-88a7fb9ea8e2",
  "admitted_at": "2023-03-17T11:27:23+02:00",
  "admitted_by": "06993a13-1211-4394-98f1-eff7d7009ba4",
  "healthcare_service": "a0a69dd7-4245-4e96-a7ae-d86ff728eacc",
  "price_tier": "549cac12-fcd9-498b-882c-127cb8e5d770",
  "notes": "Testing IPD",
  "created_by": "29489d19-9e2e-47ae-a8d6-694714159109",
  "destination_display": "",
  "discharge_disposition": "",
  "discharge_disposition_display": "",
  "location": "ce8b82c5-cf4b-4c6f-840d-8e3827a6ed4d",
  "bed": "29489d19-9e2e-47ae-a8d6-694714159109"
}
{
    "success": true,
    "message": "Successfully admitted the patient Miss Claire  Mutuyi!",
    "data": {
        "patient": {
            "id": 14562,
            "uuid": "50390ab0-489f-4a36-bfab-88a7fb9ea8e2",
            "mr_number": "64b47ecb-1580-495c-9de3-d82a47eb7567",
            "email": "[email protected]",
            "mobile": "+250727722710",
            "birth_date": "2000-01-03",
            "first_name": "Claire",
            "last_name": "Mutuyi",
            "gender": "FEMALE",
            "is_hospitalized": true
        },
        "healthcare_service_name": "Ward A",
        "admitted_by_name": "Mr Chris Dare",
        "created_by_name": "Jean baptiste Tuyizere",
        "uuid": "28b90d57-e1d6-4e30-bc8b-90a3f1cfe988",
        "created_at": "2023-04-28T00:26:44.564977Z",
        "is_deleted": false,
        "modified_at": "2023-04-28T00:26:44.565050Z",
        "admit_source": "other",
        "admit_source_display": "other",
        "admitted_at": "2023-03-17T11:27:23+02:00",
        "created_by_display": "Mr Jean baptiste Tuyizere",
        "healthcare_service_display": "Ward A",
        "origin_display": "",
        "price_tier_display": "Standard",
        "is_active": true,
        "is_readmission": false,
        "destination_display": "",
        "discharge_disposition": "",
        "discharge_disposition_display": "",
        "room_name": "room1",
        "bed_name": "bed2",
        "reason": "",
        "notes": "Testing IPD",
        "discharged_at": null,
        "discharged_by_name": null,
        "transferred_by_name": null,
        "transferred_at": null,
        "admitted_by": "06993a13-1211-4394-98f1-eff7d7009ba4",
        "created_by": "b6180d80-d4c4-4765-8563-6b98515ba730",
        "healthcare_service": "a0a69dd7-4245-4e96-a7ae-d86ff728eacc",
        "price_tier": "549cac12-fcd9-498b-882c-127cb8e5d770",
        "provider": "58ad38c5-b119-4779-849c-c2e21c98e6ba",
        "bed": 8,
        "discharged_by": null,
        "transferred_by": null
    },
    "errors": null
}

Get all Admissions at a Provider

Retrieve all admissions ordered by admitted_at field in DESC order

URL: {{base_url}}/providers/{{serenity_user_provider_id}}/hospitalizations
Method: GET

Hospitalizations can be searched though by the following fields:

  • patient's first_name
  • patient 's last_name
  • patient's mobile
  • patient's national_mobile_number
  • patient's mr_number
  • healthcareservice's _name

Other query parameters to filter by:

  • is_active (boolean) - Default value is True. False means, the patient is discharged
  • room (string)
  • bed (string)
  • patient_id (string) - uuid field of a Patient object
  • healthcare_service_id (string) - uuid field of a HealthCareService object
  • admitted_by_id (string) - uuid field of a Practitioner object
  • created_by_id (string) - uuid field of a User object
  • admitted_at__lte (datetime)
  • admitted_at__gte (datetime)

Example URL with search parameter:

{{base_url}}/providers/{{serenity_user_provider_id}}/hospitalizations?search=Chen&room=A34
{
    "success": true,
    "message": "Operation successful",
    "meta": {
        "current": 1,
        "page_size_query": "page_size",
        "next": null,
        "previous": null,
        "page_size": 50,
        "total": 3
    },
    "results": [
        {
            "patient": {
                "id": 14562,
                "uuid": "50390ab0-489f-4a36-bfab-88a7fb9ea8e2",
                "mr_number": "64b47ecb-1580-495c-9de3-d82a47eb7567",
                "email": "[email protected]",
                "mobile": "+250727722710",
                "birth_date": "2000-01-03",
                "first_name": "Claire",
                "last_name": "Mutuyi",
                "gender": "FEMALE",
                "is_hospitalized": true
            },
            "healthcare_service_name": "Ward A",
            "admitted_by_name": "Mr Chris Dare",
            "created_by_name": "Jean baptiste Tuyizere",
            "uuid": "e9597d17-326a-4434-af96-5af0d645e130",
            "created_at": "2023-04-28T00:19:03.775583Z",
            "is_deleted": false,
            "modified_at": "2023-04-28T00:19:03.775626Z",
            "admit_source": "other",
            "admit_source_display": "other",
            "admitted_at": "2023-03-17T09:27:23Z",
            "created_by_display": "Mr Jean baptiste Tuyizere",
            "healthcare_service_display": "Ward A",
            "origin_display": "",
            "price_tier_display": "Standard",
            "is_active": true,
            "is_readmission": false,
            "destination_display": "",
            "discharge_disposition": "",
            "discharge_disposition_display": "",
            "room_name": "room1",
            "bed_name": "bed1",
            "reason": "",
            "notes": "Testing IPD",
            "discharged_at": null,
            "discharged_by_name": null,
            "discharge_executed_by_name": null,
            "transferred_by_name": null,
            "transferred_at": null,
            "admitted_by": "06993a13-1211-4394-98f1-eff7d7009ba4",
            "created_by": "b6180d80-d4c4-4765-8563-6b98515ba730",
            "healthcare_service": "a0a69dd7-4245-4e96-a7ae-d86ff728eacc",
            "price_tier": "549cac12-fcd9-498b-882c-127cb8e5d770",
            "provider": "58ad38c5-b119-4779-849c-c2e21c98e6ba",
            "bed": 7,
            "discharged_by": null,
            "discharge_executed_by": null,
            "transferred_by": null
        }
    ]
}

Get a single hospitalization

URL: {{base_url}}/providers/{{serenity_user_provider_id}}/hospitalizations/{{hospitalization_id}}
Method: GET

{
    "success": true,
    "message": "The hospitalization was successfully fetched!",
    "data": {
        "patient": {
            "id": 14562,
            "uuid": "50390ab0-489f-4a36-bfab-88a7fb9ea8e2",
            "mr_number": "64b47ecb-1580-495c-9de3-d82a47eb7567",
            "email": "[email protected]",
            "mobile": "+250727722710",
            "birth_date": "2000-01-03",
            "first_name": "Claire",
            "last_name": "Mutuyi",
            "gender": "FEMALE",
            "is_hospitalized": true
        },
        "healthcare_service_name": "Ward A",
        "admitted_by_name": "Mr Chris Dare",
        "created_by_name": "Jean baptiste Tuyizere",
        "uuid": "e9597d17-326a-4434-af96-5af0d645e130",
        "created_at": "2023-04-28T00:19:03.775583Z",
        "is_deleted": false,
        "modified_at": "2023-04-28T00:19:03.775626Z",
        "admit_source": "other",
        "admit_source_display": "other",
        "admitted_at": "2023-03-17T09:27:23Z",
        "created_by_display": "Mr Jean baptiste Tuyizere",
        "healthcare_service_display": "Ward A",
        "origin_display": "",
        "price_tier_display": "Standard",
        "is_active": true,
        "is_readmission": false,
        "destination_display": "",
        "discharge_disposition": "",
        "discharge_disposition_display": "",
        "room_name": "room1",
        "bed_name": "bed1",
        "reason": "",
        "notes": "Testing IPD",
        "discharged_at": null,
        "discharged_by_name": null,
        "discharge_executed_by_name": null,
        "transferred_by_name": null,
        "transferred_at": null,
        "admitted_by": "06993a13-1211-4394-98f1-eff7d7009ba4",
        "created_by": "b6180d80-d4c4-4765-8563-6b98515ba730",
        "healthcare_service": "a0a69dd7-4245-4e96-a7ae-d86ff728eacc",
        "price_tier": "549cac12-fcd9-498b-882c-127cb8e5d770",
        "provider": "58ad38c5-b119-4779-849c-c2e21c98e6ba",
        "bed": 7,
        "discharged_by": null,
        "discharge_executed_by": null,
        "transferred_by": null
    },
    "errors": null
}

Update a hospitalization

URL: {{base_url}}/providers/{{serenity_user_provider_id}}/hospitalizations/{{hospitalization_id}}
Method: POST

Notes:
The following fields cannot be updated: provider, admitted_by, created_by, and patient

{
    "destination_display": "",
    "room": "A-15",
    "reason": "No reason",
    "notes": "No notes"
}
{
    "success": true,
    "message": "The hospitalization was successfully updated!",
    "data": null,
    "errors": null
}

Delete a hospitalization

URL: {{base_url}}/providers/{{serenity_user_provider_id}}/hospitalizations/{{hospitalization_id}}
Method: DELETE

{
    "success": true,
    "message": "The hospitalization was successfully deleted!",
    "data": null,
    "errors": null
}

Transfer patient's hospitalization to another healthcare/ward service

URL: {{base_url}}/providers/{{serenity_user_provider_id}}/hospitalizations/{{hospitalization_id}}/transfer
Method: PATCH

Request payload's fields:

  • transferred_by (required) - uuid field of a practioner object
  • transferred_at (required) - datetime the patient was discharged at
  • healthcare_service (Required, str): uuid field of a Healthcareservice object
  • price_tier (Required, str): uuid field of a ServicePriceTiers object
  • created_by (Required, str): uuid field of a User object (User who sent the request)
  • room (Required, str)
  • bed (Required, str)
  • location (Optional, str): id field of a Location where admission took place
{
    "created_by": "bd0f53f0-36a0-477f-90bb-2af556631436",
    "healthcare_service": "a0a69dd7-4245-4e96-a7ae-d86ff728eacc",
    "price_tier": "549cac12-fcd9-498b-882c-127cb8e5d770",
    "bed": "836253fe-d46b-4b38-bca3-7bea59df1af4",
    "reason": "Testing Transfer 2",
    "notes": "No notes",
    "transferred_by": "d2291e0e-eedc-4ea3-b85e-73d4d9a1f9be",
    "transferred_at": "2023-05-02T22:10:06.906240Z",
    "location": "ce8b82c5-cf4b-4c6f-840d-8e3827a6ed4d"
}
{
    "success": true,
    "message": "The patient was successfully transferred!",
    "data": {
        "patient": {
            "id": 14622,
            "uuid": "115a3478-0df6-4390-b33a-38a7eef2d947",
            "mr_number": "065c4b5a-b62e-4ec3-bc8e-15ca6f4e1f59",
            "email": "[email protected]",
            "mobile": "+233225588066",
            "birth_date": null,
            "first_name": "Ted",
            "last_name": "Bundy",
            "gender": "UNKNOWN",
            "is_hospitalized": true
        },
        "healthcare_service_name": "Ward A",
        "admitted_by_name": "Mr Evans Boadi",
        "created_by_name": "Evans Boadi",
        "uuid": "6b43119e-b3f6-4de7-b99d-51ce2167c302",
        "created_at": "2023-01-10T18:00:54.704580Z",
        "is_deleted": false,
        "modified_at": "2023-01-10T18:00:54.704639Z",
        "admit_source": "other",
        "admit_source_display": "other",
        "admitted_at": "2023-01-10T17:59:15.298145Z",
        "created_by_display": "Mr Evans Boadi",
        "healthcare_service_display": "Ward A",
        "origin_display": "",
        "price_tier_display": "Standard",
        "is_active": true,
        "is_readmission": true,
        "destination_display": "",
        "discharge_disposition": "",
        "discharge_disposition_display": "",
        "room": "A-14",
        "bed": "78",
        "reason": "Transfer",
        "notes": "No notes",
        "discharged_at": null,
        "discharged_by_name": null,
        "admitted_by": "e059acd0-8c33-493b-b47b-394d22c1963d",
        "created_by": "bd0f53f0-36a0-477f-90bb-2af556631436",
        "healthcare_service": "a0a69dd7-4245-4e96-a7ae-d86ff728eacc",
        "price_tier": "549cac12-fcd9-498b-882c-127cb8e5d770",
        "provider": "58ad38c5-b119-4779-849c-c2e21c98e6ba",
        "discharged_by": null
    },
    "errors": null
}

Discharge patient

URL: {{base_url}}/providers/{{serenity_user_provider_id}}/hospitalizations/{{hospitalization_id}}/discharge
Method: PATCH

Request payload's fields:

  • discharged_by (required) - uuid field of a practioner object

  • discharge_executed_by (optional) - uuid field of a user object

  • discharged_at (required) - datetime the patient was discharged at

  • destination_display (optional)

  • discharge_disposition (optional) - values are:

    • home (Home)
    • alt-home (Alternative home)
    • other-hcf (Other healthcare facility)
    • hospice (Hospice/Palliative care)
    • long (Long-term care)
    • advice (Left against advice)
    • Exp (Expired/Deceased)
    • psych (From psychiatric hospital)
    • rehab (From rehabilitation facility)
    • snf (Skilled nursing facility)
    • other (Other)
  • discharge_disposition_display (optional)

  • notes (optional)

{
    "discharged_by": "d2291e0e-eedc-4ea3-b85e-73d4d9a1f9be",
    "discharged_at": "2023-05-03T01:10:06.906240Z",
    "destination_display": "",
    "discharge_disposition": "alt-home",
    "discharge_disposition_display": "",
    "notes": "Test Discharge",
  	"discharge_executed_by": "<user-uuid>"
}
{
    "success": true,
    "message": "The patient is successfully discharged!",
    "data": {
        "patient": {
            "id": 14622,
            "uuid": "115a3478-0df6-4390-b33a-38a7eef2d947",
            "mr_number": "065c4b5a-b62e-4ec3-bc8e-15ca6f4e1f59",
            "email": "[email protected]",
            "mobile": "+233225588066",
            "birth_date": null,
            "first_name": "Ted",
            "last_name": "Bundy",
            "gender": "UNKNOWN",
            "is_hospitalized": false
        },
        "healthcare_service_name": "Ward A",
        "admitted_by_name": "Mr Evans Boadi",
        "created_by_name": "Evans Boadi",
        "uuid": "4adbe65f-b9be-46de-953d-e6542a2f7995",
        "created_at": "2022-12-29T18:36:29.957870Z",
        "is_deleted": false,
        "modified_at": "2022-12-29T18:36:29.957886Z",
        "admit_source": "planned",
        "admit_source_display": "Planned",
        "admitted_at": "2022-12-29T18:33:51.927673Z",
        "created_by_display": "Mr Evans Boadi",
        "healthcare_service_display": "Ward A",
        "origin_display": "",
        "price_tier_display": "Standard",
        "is_active": false,
        "is_readmission": false,
        "destination_display": "",
        "discharge_disposition": "alt-home",
        "discharge_disposition_display": "",
        "room": "A45",
        "bed": "56",
        "reason": "",
        "notes": "",
        "admitted_by": "e059acd0-8c33-493b-b47b-394d22c1963d",
        "created_by": "bd0f53f0-36a0-477f-90bb-2af556631436",
        "healthcare_service": "a0a69dd7-4245-4e96-a7ae-d86ff728eacc",
        "price_tier": "c8210517-d845-4429-a6cc-f75d79c5e7ef",
        "provider": "58ad38c5-b119-4779-849c-c2e21c98e6ba"
    },
    "errors": null
}