commitd2ec8c0f07Author: mario <dev.mario@sismedika@gmail.com> Date: Thu May 15 15:42:33 2025 +0700 add: db tx commit and rollback implementation commit264435f67eAuthor: mario <dev.mario@sismedika@gmail.com> Date: Thu May 15 14:34:20 2025 +0700 fix: shortlink generation logic update/create commit047ab1937aAuthor: mario <dev.mario@sismedika@gmail.com> Date: Thu May 15 11:06:04 2025 +0700 fix: if multiple studies patient, show first study by default commitc13f834b92Author: mario <dev.mario@sismedika@gmail.com> Date: Thu May 15 09:46:32 2025 +0700 add: register and login with DB query AND some struct type correction commitdd4451c2a8Author: mario <dev.mario@sismedika@gmail.com> Date: Wed May 14 10:23:33 2025 +0700 new file structure & koneksi ke DB commit8289881df3Author: mario <dev.mario@sismedika@gmail.com> Date: Tue May 13 16:49:07 2025 +0700 edit: rm debug route commitdd784da232Author: mario <dev.mario@sismedika@gmail.com> Date: Tue May 13 15:44:11 2025 +0700 add: implement shortlink commit2687a761ccAuthor: mario <dev.mario@sismedika@gmail.com> Date: Tue May 13 11:47:19 2025 +0700 add new dummy doctor user commiteb67eaca46Author: mario <dev.mario@sismedika@gmail.com> Date: Tue May 13 11:46:28 2025 +0700 add: ref_doctor studylist filter commit0d4825d152Author: mario <dev.mario@sismedika@gmail.com> Date: Tue May 13 10:07:16 2025 +0700 edit study_iuids & accNum in patient jwt to array commit2d1f135fdaAuthor: mario <dev.mario@sismedika@gmail.com> Date: Tue May 13 09:52:45 2025 +0700 patient see their multiple studies commit13bb380f51Author: mario <dev.mario@sismedika@gmail.com> Date: Fri May 9 10:13:16 2025 +0700 add: cors handler route and readme commit6c9ab574ceAuthor: mario <dev.mario@sismedika@gmail.com> Date: Mon May 5 11:50:36 2025 +0700 add: login & token validation tapi belum connect ke DB commit297c9a6a01Author: mario <dev.mario@sismedika@gmail.com> Date: Mon Apr 28 15:37:02 2025 +0700 add readme.md commit9b8e0260f3Author: mario <dev.mario@sismedika@gmail.com> Date: Mon Apr 7 15:46:07 2025 +0700 connected-to-google commitf340bc5916Author: mario <dev.mario@sismedika.com> Date: Mon Apr 7 11:14:18 2025 +0700 init
178 lines
4.2 KiB
HTTP
178 lines
4.2 KiB
HTTP
### Register new user, patient, and doctor tests
|
|
|
|
# Base URL for the API
|
|
@baseUrl = http://localhost:5555
|
|
|
|
|
|
### Register an admin user
|
|
POST {{baseUrl}}/auth/register
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"email": "admin@example.com",
|
|
"password": "password123",
|
|
"name": "Admin User",
|
|
"role": "admin"
|
|
}
|
|
|
|
### Register a new patient with multiple studies
|
|
POST {{baseUrl}}/auth/register
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"email": "patient1@example.com",
|
|
"password": "password123",
|
|
"name": "DIDIT SUYATNA^R.10049.18",
|
|
"role": "patient",
|
|
"patient": {
|
|
"patient_id": "00211622",
|
|
"patient_name": "DIDIT SUYATNA^R.10049.18",
|
|
"date_of_birth": "1980-01-01"
|
|
},
|
|
"studies": [
|
|
{
|
|
"study_instance_uid": "1.2.826.0.1.3680043.9.7307.1.20180530066",
|
|
"accession_number": "CR.180530.066",
|
|
"study_date": "2018-05-30",
|
|
"study_description": "Chest X-Ray"
|
|
}
|
|
]
|
|
}
|
|
###
|
|
POST {{baseUrl}}/auth/register
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"email": "patient1@example.com",
|
|
"password": "password123",
|
|
"name": "DIDIT SUYATNA^R.10049.18",
|
|
"role": "patient",
|
|
"patient": {
|
|
"patient_id": "00211622",
|
|
"patient_name": "DIDIT SUYATNA^R.10049.18",
|
|
"date_of_birth": "1980-01-01"
|
|
},
|
|
"studies": [
|
|
{
|
|
"study_instance_uid": "1.2.826.0.1.3680043.9.7307.1.20180713036",
|
|
"accession_number": "CR.180713.036",
|
|
"study_date": "2018-07-13",
|
|
"study_description": "Follow-up X-Ray"
|
|
}
|
|
]
|
|
}
|
|
|
|
### Register another patient with one study
|
|
POST {{baseUrl}}/auth/register
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"email": "patient2@example.com",
|
|
"password": "password123",
|
|
"name": "Bobon Santoso",
|
|
"role": "patient",
|
|
"patient": {
|
|
"patient_id": "MR00000359",
|
|
"patient_name": "Bobon Santoso",
|
|
"date_of_birth": "1985-01-01"
|
|
},
|
|
"studies": [
|
|
{
|
|
"study_instance_uid": "1.2.826.0.1.3680043.9.7307.1.202503196393.01",
|
|
"accession_number": "CR.250319.6393.01",
|
|
"study_date": "2025-03-19",
|
|
"study_description": "MRI Scan"
|
|
}
|
|
]
|
|
}
|
|
|
|
### Register another referring doctor
|
|
POST {{baseUrl}}/auth/register
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"email": "doctor@example.com",
|
|
"password": "password123",
|
|
"name": "DR. HERWINDO RIDWAN, SP.OT",
|
|
"role": "ref_doctor",
|
|
"doctor": {
|
|
"doctor_id": "DOC002",
|
|
"doctor_name": "DR. HERWINDO RIDWAN, SP.OT"
|
|
}
|
|
}
|
|
|
|
### Register another referring doctor
|
|
POST {{baseUrl}}/auth/register
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"email": "doctor2@example.com",
|
|
"password": "password123",
|
|
"name": "Referring^Physician",
|
|
"role": "ref_doctor",
|
|
"doctor": {
|
|
"doctor_id": "DOC003",
|
|
"doctor_name": "Referring^Physician"
|
|
}
|
|
}
|
|
|
|
### Register a new expertise doctor
|
|
POST {{baseUrl}}/auth/register
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"email": "expert@example.com",
|
|
"password": "password123",
|
|
"name": "Dr. Expertise",
|
|
"role": "expertise_doctor",
|
|
"doctor": {
|
|
"doctor_id": "EX456",
|
|
"doctor_name": "Dr. Expertise"
|
|
}
|
|
}
|
|
|
|
### Login with registered user
|
|
POST {{baseUrl}}/auth/login
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"email": "patient1@example.com",
|
|
"password": "password123"
|
|
}
|
|
|
|
### Login with admin user
|
|
POST {{baseUrl}}/auth/login
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"email": "admin@example.com",
|
|
"password": "password123"
|
|
}
|
|
|
|
### Login with patient user
|
|
POST {{baseUrl}}/auth/login
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"email": "patient2@example.com",
|
|
"password": "password123"
|
|
}
|
|
|
|
### Login with doctor user
|
|
POST {{baseUrl}}/auth/login
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"email": "doctor@example.com",
|
|
"password": "password123"
|
|
}
|
|
|
|
@refresh_token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiNCIsImVtYWlsIjoiZG9jdG9yQGV4YW1wbGUuY29tIiwicm9sZSI6InJlZl9kb2N0b3IiLCJ1c2VyX25hbWUiOiJEUi4gSEVSV0lORE8gUklEV0FOLCBTUC5PVCIsInRva2VuX3R5cGUiOiJyZWZyZXNoIiwiaG9tZV91cmwiOiIvIiwic3R1ZHlfbGlzdCI6ImVuYWJsZWQiLCJmaWx0ZXJfdXJsIjoic3R1ZGllcz9saW1pdD0xMDFcdTAwMjZvZmZzZXQ9MFx1MDAyNmZ1enp5bWF0Y2hpbmc9ZmFsc2VcdTAwMjZpbmNsdWRlZmllbGQ9MDAwODEwMzAsMDAwODAwNjAsMDAwODAwOTBcdTAwMjYwMDA4MDA5MD1EUi4rSEVSV0lORE8rUklEV0FOJTJDK1NQLk9UIiwiZXhwIjoxNzQ3OTAxMzI5LCJpYXQiOjE3NDcyOTY1Mjl9.M7khgg8eZHk20qGsdPDmUojdBvItXOE-834R6t_AF9Q"
|
|
|
|
### Refresh TOken
|
|
POST {{baseUrl}}/auth/refresh
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"refresh_token" : {{refresh_token}}
|
|
} |