---
# System prepended metadata

title: Untitled

---

## Patient tạo appointment

```curl
curl --location --request POST 'http://localhost:5001/hybrid-dbs-stag/asia-southeast1/api/v1/appointments' \
--header 'Authorization: Bearer eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJyb2xlTGlzdCI6WyJzdGFmZiJdLCJlbWFpbCI6InRlc3RAc3RhZmYuY29tIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJhdXRoX3RpbWUiOjE2NzM5NDc3OTEsInVzZXJfaWQiOiJ0ZXN0QHN0YWZmLmNvbSIsImZpcmViYXNlIjp7ImlkZW50aXRpZXMiOnsiZW1haWwiOlsidGVzdEBzdGFmZi5jb20iXX0sInNpZ25faW5fcHJvdmlkZXIiOiJwYXNzd29yZCJ9LCJpYXQiOjE2NzM5NDc3OTEsImV4cCI6MTY3Mzk1MTM5MSwiYXVkIjoiaHlicmlkLWRicy1zdGFnIiwiaXNzIjoiaHR0cHM6Ly9zZWN1cmV0b2tlbi5nb29nbGUuY29tL2h5YnJpZC1kYnMtc3RhZyIsInN1YiI6InRlc3RAc3RhZmYuY29tIn0.' \
--header 'Content-Type: application/json' \
--data-raw '{
    "doctorUid": "doctor-mock-uid",
    "userRequest": {
        "descriptionText": "Hello",
        "descriptionAudioBase64": null,
        "questionText": "Hello",
        "questionAudioBase64": null,
        "attachmentUrlList": [
            "https://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Image_created_with_a_mobile_phone.png/1200px-Image_created_with_a_mobile_phone.png",
            "https://media.istockphoto.com/id/1322277517/photo/wild-grass-in-the-mountains-at-sunset.jpg?s=612x612&w=0&k=20&c=6mItwwFFGqKNKEAzv0mv6TaxhLN3zSE43bWmFN--J5w="
        ]
    }
}'
```

Lưu ý:

- Trong `descriptionText` và `descriptionAudioBase64`, chỉ 1 field có value, field còn lại phải null.
- Tương tự với `questionText` và `questionAudioBase64`.

## Patient thanh toán appointment

```curl
curl --location --request PATCH 'http://localhost:5001/hybrid-dbs-stag/asia-southeast1/api/v1/appointments/2dcba719-1b6a-427d-8297-f0a78eae1f04/confirm-by-user' \
--header 'Authorization: Bearer eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJyb2xlTGlzdCI6WyJzdGFmZiJdLCJlbWFpbCI6InRlc3RAc3RhZmYuY29tIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJhdXRoX3RpbWUiOjE2NzM5NDc3OTEsInVzZXJfaWQiOiJ0ZXN0QHN0YWZmLmNvbSIsImZpcmViYXNlIjp7ImlkZW50aXRpZXMiOnsiZW1haWwiOlsidGVzdEBzdGFmZi5jb20iXX0sInNpZ25faW5fcHJvdmlkZXIiOiJwYXNzd29yZCJ9LCJpYXQiOjE2NzM5NDc3OTEsImV4cCI6MTY3Mzk1MTM5MSwiYXVkIjoiaHlicmlkLWRicy1zdGFnIiwiaXNzIjoiaHR0cHM6Ly9zZWN1cmV0b2tlbi5nb29nbGUuY29tL2h5YnJpZC1kYnMtc3RhZyIsInN1YiI6InRlc3RAc3RhZmYuY29tIn0.' \
--header 'Content-Type: application/json' \
--data-raw '{
    "startAt": "2023-01-05T04:00:00.000Z",
    "orgDurationInMinutes": 30
}'
```

## Patient cập nhật medical form

```curl
curl --location --request PATCH 'http://localhost:5001/hybrid-dbs-stag/asia-southeast1/api/v1/appointments/2dcba719-1b6a-427d-8297-f0a78eae1f04/medical-form/e32fcfbc-575c-47b2-a353-724c6e31e334' \
--header 'Authorization: Bearer eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJyb2xlTGlzdCI6WyJzdGFmZiJdLCJlbWFpbCI6InRlc3RAc3RhZmYuY29tIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJhdXRoX3RpbWUiOjE2NzM5NDc3OTEsInVzZXJfaWQiOiJ0ZXN0QHN0YWZmLmNvbSIsImZpcmViYXNlIjp7ImlkZW50aXRpZXMiOnsiZW1haWwiOlsidGVzdEBzdGFmZi5jb20iXX0sInNpZ25faW5fcHJvdmlkZXIiOiJwYXNzd29yZCJ9LCJpYXQiOjE2NzM5NDc3OTEsImV4cCI6MTY3Mzk1MTM5MSwiYXVkIjoiaHlicmlkLWRicy1zdGFnIiwiaXNzIjoiaHR0cHM6Ly9zZWN1cmV0b2tlbi5nb29nbGUuY29tL2h5YnJpZC1kYnMtc3RhZyIsInN1YiI6InRlc3RAc3RhZmYuY29tIn0.' \
--header 'Content-Type: application/json' \
--data-raw '{
    "type": "medicalHistory",
    "medicalHistoryForm": {
        "height": 1.73,
        "weight": 67.5,
        "medicalHistory": [
            "Hen suyễn",
            "Bệnh tim"
        ],
        "subjectiveSigns": [
            "Sốt / Ớn lạnh",
            "Chóng mặt",
            "Táo bón hoặc tiêu chảy"
        ],
        "allergy": "Sữa bò - Tiêu chảy",
        "physicalExercises": 0,
        "dietRisk": 0,
        "drinking": 0,
        "smoking": 0,
        "note": "Hello World",
        "attachmentUrlList": [
            "https://static.tuoitre.vn/tto/i/s626/2014/10/05/5hbID520.jpg"
        ]
    },
    "vitalSignsForm": null,
    "testResultsForm": null,
    "currentPrescriptionForm": null
}'
```

### Lưu ý

- Giải thích form: https://docs.google.com/spreadsheets/d/1gX8LZM6Ntc76_LW_xmVIR_-p_nRGe19qSKlJXrLg-0s/edit#gid=1937509792
- Các loại body:

#### Medical History

```json
{
    "type": "medicalHistory",
    "medicalHistoryForm": {
        "height": 1.73,
        "weight": 67.5,
        "medicalHistory": [
            "Hen suyễn",
            "Bệnh tim"
        ],
        "subjectiveSigns": [
            "Sốt / Ớn lạnh",
            "Chóng mặt",
            "Táo bón hoặc tiêu chảy"
        ],
        "allergy": "Sữa bò - Tiêu chảy",
        "physicalExercises": 0,
        "dietRisk": 0,
        "drinking": 0,
        "smoking": 0,
        "note": "Hello World",
        "attachmentUrlList": [
            "https://static.tuoitre.vn/tto/i/s626/2014/10/05/5hbID520.jpg"
        ]
    },
    "vitalSignsForm": null,
    "testResultsForm": null,
    "currentPrescriptionForm": null
}
```

#### Vital Signs

```json
{
    "type": "vitalSigns",
    "medicalHistoryForm": null,
    "vitalSignsForm": {
        "height": 1.73,
        "weight": 67.5,
        "bodyTemperature": 37,
        "heartRate": 101,
        "respiration": 40,
        "spO2": 50,
        "bloodPressureLow": 130,
        "bloodPressureHight": 160
    },
    "testResultsForm": null,
    "currentPrescriptionForm": null
}
```

#### Test Result

```json
{
    "type": "testResults",
    "medicalHistoryForm": null,
    "vitalSignsForm": null,
    "testResultsForm": {
        "attachmentUrlList": ["https://static.tuoitre.vn/tto/i/s626/2014/10/05/5hbID520.jpg"]
    },
    "currentPrescriptionForm": null
}

```

#### Current Prescription

```json
{
    "type": "currentPrescription",
    "medicalHistoryForm": null,
    "vitalSignsForm": null,
    "testResultsForm": null,
    "currentPrescriptionForm": {
        "attachmentUrlList": ["https://static.tuoitre.vn/tto/i/s626/2014/10/05/5hbID520.jpg"]
    },

}
```

## Patient cancel appointment

```curl
curl --location --request PATCH 'http://localhost:5001/hybrid-dbs-stag/asia-southeast1/api/v1/appointments/2dcba719-1b6a-427d-8297-f0a78eae1f04/cancel' \
--header 'Authorization: Bearer eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJyb2xlTGlzdCI6WyJzdGFmZiJdLCJlbWFpbCI6InRlc3RAc3RhZmYuY29tIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJhdXRoX3RpbWUiOjE2NzM5NDc3OTEsInVzZXJfaWQiOiJ0ZXN0QHN0YWZmLmNvbSIsImZpcmViYXNlIjp7ImlkZW50aXRpZXMiOnsiZW1haWwiOlsidGVzdEBzdGFmZi5jb20iXX0sInNpZ25faW5fcHJvdmlkZXIiOiJwYXNzd29yZCJ9LCJpYXQiOjE2NzM5NDc3OTEsImV4cCI6MTY3Mzk1MTM5MSwiYXVkIjoiaHlicmlkLWRicy1zdGFnIiwiaXNzIjoiaHR0cHM6Ly9zZWN1cmV0b2tlbi5nb29nbGUuY29tL2h5YnJpZC1kYnMtc3RhZyIsInN1YiI6InRlc3RAc3RhZmYuY29tIn0.'
```
