# HealthcareParty

## Create a healthcare party

<mark style="color:green;">`POST`</mark> `https://demo.icure.cloud/rest/v2/hcparty`

One of Name or Last name+First name, Nihii, and Public key are required.

#### Request Body

| Name                                   | Type            | Description |
| -------------------------------------- | --------------- | ----------- |
| body<mark style="color:red;">\*</mark> | HealthcareParty |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Create a healthcare party

<mark style="color:green;">`POST`</mark> `https://demo.icure.cloud/rest/v2/hcparty/inGroup/{groupId}`

One of Name or Last name+First name, Nihii, and Public key are required.

#### Path Parameters

| Name                                      | Type   | Description |
| ----------------------------------------- | ------ | ----------- |
| groupId<mark style="color:red;">\*</mark> | String |             |

#### Request Body

| Name                                   | Type            | Description |
| -------------------------------------- | --------------- | ----------- |
| body<mark style="color:red;">\*</mark> | HealthcareParty |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Delete healthcare parties

<mark style="color:green;">`POST`</mark> `https://demo.icure.cloud/rest/v2/hcparty/delete/batch`

Deleting healthcareParties. Response is an array containing the id of deleted healthcare parties.

#### Request Body

| Name                                   | Type      | Description |
| -------------------------------------- | --------- | ----------- |
| body<mark style="color:red;">\*</mark> | ListOfIds |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Delete a healthcare party

<mark style="color:green;">`POST`</mark> `https://demo.icure.cloud/rest/v2/hcparty/delete/batch/inGroup/{groupId}`

Deleting a healthcareParty. Response is an array containing the id of deleted healthcare party.

#### Path Parameters

| Name                                      | Type   | Description |
| ----------------------------------------- | ------ | ----------- |
| groupId<mark style="color:red;">\*</mark> | String |             |

#### Request Body

| Name                                   | Type      | Description |
| -------------------------------------- | --------- | ----------- |
| body<mark style="color:red;">\*</mark> | ListOfIds |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## List healthcare parties with(out) pagination

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/hcparty`

Returns a list of healthcare parties.

#### Query Parameters

| Name            | Type    | Description                    |
| --------------- | ------- | ------------------------------ |
| startKey        | String  | A healthcare party Last name   |
| startDocumentId | String  | A healthcare party document ID |
| limit           | Integer | Number of rows                 |
| desc            | Boolean | Descending                     |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Find healthcare parties by name with(out) pagination

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/hcparty/byName`

Returns a list of healthcare parties.

#### Query Parameters

| Name            | Type    | Description                    |
| --------------- | ------- | ------------------------------ |
| name            | String  | The Last name search value     |
| startKey        | String  | A healthcare party Last name   |
| startDocumentId | String  | A healthcare party document ID |
| limit           | Integer | Number of rows                 |
| desc            | Boolean | Descending                     |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Find healthcare parties by name with(out) pagination

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/hcparty/bySpecialityAndPostCode/{type}/{spec}/{firstCode}/to/{lastCode}`

Returns a list of healthcare parties.

#### Path Parameters

| Name                                        | Type   | Description                         |
| ------------------------------------------- | ------ | ----------------------------------- |
| type<mark style="color:red;">\*</mark>      | String | The type of the HCP (persphysician) |
| spec<mark style="color:red;">\*</mark>      | String | The speciality of the HCP           |
| firstCode<mark style="color:red;">\*</mark> | String | The first postCode for the HCP      |
| lastCode<mark style="color:red;">\*</mark>  | String | The last postCode for the HCP       |

#### Query Parameters

| Name  | Type    | Description    |
| ----- | ------- | -------------- |
| limit | Integer | Number of rows |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Find healthcare parties by nihii or ssin with(out) pagination

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/hcparty/byNihiiOrSsin/{searchValue}`

Returns a list of healthcare parties.

#### Path Parameters

| Name                                          | Type   | Description |
| --------------------------------------------- | ------ | ----------- |
| searchValue<mark style="color:red;">\*</mark> | String |             |

#### Query Parameters

| Name            | Type    | Description                    |
| --------------- | ------- | ------------------------------ |
| startKey        | String  | A healthcare party Last name   |
| startDocumentId | String  | A healthcare party document ID |
| limit           | Integer | Number of rows                 |
| desc            | Boolean | Descending                     |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Get the current healthcare party if logged in.

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/hcparty/current`

General information about the current healthcare Party

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Get the HcParty encrypted AES keys indexed by owner

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/hcparty/byKeys/{healthcarePartyId}`

(key, value) of the map is as follows: (ID of the owner of the encrypted AES key, encrypted AES key)

#### Path Parameters

| Name                                                | Type   | Description |
| --------------------------------------------------- | ------ | ----------- |
| healthcarePartyId<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Get healthcareParties by their IDs

<mark style="color:green;">`POST`</mark> `https://demo.icure.cloud/rest/v2/hcparty/byIds`

General information about the healthcare Party

#### Request Body

| Name                                   | Type      | Description |
| -------------------------------------- | --------- | ----------- |
| body<mark style="color:red;">\*</mark> | ListOfIds |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Get a healthcareParty by his ID

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/hcparty/{healthcarePartyId}`

General information about the healthcare Party

#### Path Parameters

| Name                                                | Type   | Description |
| --------------------------------------------------- | ------ | ----------- |
| healthcarePartyId<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Get public key of a healthcare party

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/hcparty/{healthcarePartyId}/publicKey`

Returns the public key of a healthcare party in Hex

#### Path Parameters

| Name                                                | Type   | Description |
| --------------------------------------------------- | ------ | ----------- |
| healthcarePartyId<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Find healthcare parties by name with(out) pagination

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/hcparty/byNameStrict/{name}`

Returns a list of healthcare parties.

#### Path Parameters

| Name                                   | Type   | Description                |
| -------------------------------------- | ------ | -------------------------- |
| name<mark style="color:red;">\*</mark> | String | The Last name search value |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Find children of an healthcare parties

<mark style="color:blue;">`GET`</mark> `https://demo.icure.cloud/rest/v2/hcparty/{parentId}/children`

Return a list of children hcp.

#### Path Parameters

| Name                                       | Type   | Description |
| ------------------------------------------ | ------ | ----------- |
| parentId<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Modify a Healthcare Party.

<mark style="color:orange;">`PUT`</mark> `https://demo.icure.cloud/rest/v2/hcparty`

No particular return value. It's just a message.

#### Request Body

| Name                                   | Type            | Description |
| -------------------------------------- | --------------- | ----------- |
| body<mark style="color:red;">\*</mark> | HealthcareParty |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}

## Modify a Healthcare Party.

<mark style="color:orange;">`PUT`</mark> `https://demo.icure.cloud/rest/v2/hcparty/inGroup/{groupId}`

No particular return value. It's just a message.

#### Path Parameters

| Name                                      | Type   | Description |
| ----------------------------------------- | ------ | ----------- |
| groupId<mark style="color:red;">\*</mark> | String |             |

#### Request Body

| Name                                   | Type            | Description |
| -------------------------------------- | --------------- | ----------- |
| body<mark style="color:red;">\*</mark> | HealthcareParty |             |

{% tabs %}
{% tab title="200 " %}

{% endtab %}
{% endtabs %}
