Skip to content

Patient

Syarif Ubaidillah edited this page Jul 7, 2022 · 1 revision

Patient

Setiap fitur yang memiliki header Authorization berarti harus login untuk mendapatkan access_token dan refresh_token.

Setiap fitur yang memiliki Query Param dapat digunakan seperti ini /api/example?paramA=12&paramB=331.

Create

Fitur terbatas pada role Administrator

Method Path
POST /api/patient
Header Value
Content-Type application/json
Authorization Bearer <access_token>
Request Body
{
	"national_id": "8729301745162748",
	"full_name": "Faizur Ramadhan",
	"gender": "Male",
	"address": "Sumenep",
	"birthdate": "2001-04-14",
	"blood_type": "A"
}
Response Body
{
	"message": "Patient Created",
}

FindAll

Method Path
GET /api/patient
Header Value
Authorization Bearer <access_token>
Query Param Data Type Format
date_start String yyyy-mm-dd
date_end String yyyy-mm-dd
Response Body
{
	"data": [
		{
			"id": 1,
			"code": "RM00001",
			"national_id": "8729301745162748",
			"full_name": "Faizur Ramadhan",
			"gender": "Male",
			"address": "Sumenep",
			"birthdate": "2001-04-14",
			"blood_type": "A"
		}
	],
	"message": "Patient Fetched"
}

FindByID

Method Path
GET /api/patient/{id}
Header Value
Authorization Bearer <access_token>
Response Body
{
	"data": {
		"id": 1,
		"code": "RM00001",
		"national_id": "8729301745162748",
		"full_name": "Faizur Ramadhan",
		"gender": "Male",
		"address": "Sumenep",
		"birthdate": "2001-04-14",
		"blood_type": "A"
	},
	"message": "Patient Fetched"
}

Update

Fitur terbatas pada role Administrator

Method Path
PUT /api/patient/{id}/update
Header Value
Content-Type application/json
Authorization Bearer <access_token>
Request Body
{
	"national_id": "8729301745162748",
	"full_name": "Faizur Ramadhan",
	"gender": "Male",
	"address": "Sumenep",
	"birthdate": "2001-04-14",
	"blood_type": "A"
}
Response Body
{
	"message": "Patient #{id} Updated",
}

Delete

Fitur terbatas pada role Administrator

Method Path
DELETE /api/patient/{id}/delete
Header Value
Authorization Bearer <access_token>
Response Body
{
	"message": "Patient #{id} Deleted",
}
Clone this wiki locally