Create Patient
Overview
In this section you will learn how to create a new patient in Telemedi using the API. This is the first of the steps you need to take before scheduling a consultation.
The patient object is one of the basic elements that are used on the platform. The identifier of this object is a string in the form of uuid. We will use it later when referring to consultation endpoints and uploading medical records.
How to create a new Patient over the API
Request Body
const body = {
    "gender": "number", // 0 -> 0: FEMALE, 1 - MALE
    "birthDate": "string", // "1951-09-18" -> The date of birth should correspond to the PESEL number.
    "pesel": "string", // "51091845515"
    "phoneNumber": "string", // "+48111222333" - The phone number should include the area code.
    "firstName": "string", // "Beata"
    "lastName": "string", // "Gruca"
    "email": "string",
    "address": {
        "postalCode": "string", // "12-312"
        "street": "string", // "Marszałkowska"
        "houseNumber": "string", // "13"
        "apartmentNumber": "string", // "15"
        "city": "string" // "Warszawa"
    },
    "mailingAgree": "boolean", // true
    "termsAccepted": "boolean", // true
    "plainPassword": "string", // "Password12345#"
    "generatePassword": "boolean", // false
    "confirmDuplicateEmail": "boolean", // false
    "locale": "string" // "pl"
}
Request
fetch('https://clinic.telemedi.co/api/v2/patients', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json'
    },
    body: JSON.stringify(body)
})
    .then(response => response.json())
    .then(response => console.log(response))
Response
{
    "id": "string", // "a45dee91-e628-4a30-bf8d-13f24aa469e3"
    "phone_national_number": "string", // "111222333"
    "phone_country": "string", // "PL"
    "phone_country_code": "number", // 48
    "diseases": [],
    "username": "string", // "89027376"
    "email": "string",
    "first_name": "string", // Beata
    "last_name": "string", // Gruca
    "gender": "number", // 0 -> 0: FEMALE, 1 - MALE
    "address": {
        "id": "string", // "a45dee91-e628-4a30-bf8d-13f24aa469e3"
        "street": "string", // "Marszałkowska"
        "house_number": "string", // "13"
        "apartment_number": "string", // "12"
        "postal_code": "string", // "12-312"
        "city": "string", // "Warszawa"
        "country": null
    },
    "pesel": "string", // "51091845515"
    "birth_date": "string", // "1951-09-18"
    "terms_accepted": "boolean", // true
    "medical_document_agree": "boolean", // true
    "nationality": "string", // "PL"
    "mailing_agree": "boolean", // true
    "phone_agree": "boolean", // false
    "passport_number": null,
    "passport_country": null,
    "parent_first_name": null,
    "parent_last_name": null,
    "parent_address": null,
    "parent_pesel": null,
    "default_timezone": "string", // "Europe/Warsaw"
    "force_change_password": "boolean", // false
    "identity_number": null,
    "doctor_signature": null,
    "weight": null,
    "height": null,
    "pozInterested": "boolean", // false
    "doctor_penalty_notify": "boolean", // true
    "identity_document_type": null,
    "identity_document_country_issuer": null,
    "user_parent": null,
    "username_in_fusion_auth": "string" // "51091845515"
}