> For the complete documentation index, see [llms.txt](https://docs.suggestic.com/telewellness-portal/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.suggestic.com/telewellness-portal/api-reference/lab-test-reports/create-a-lab-test-report.md).

# Create a Lab Test Report

Use the `createLabTestReport` mutation to create a lab test report.

## Required Argument

| **Argument Name** | **Type** | **Description**                                    |
| ----------------- | -------- | -------------------------------------------------- |
| `testName`        | String   | Lab test report name                               |
| `testDate`        | DateTime | Date and time when the lab test report is created. |
| `labName`         | String   | Laboratory name                                    |
| `title`           | String   | Lab test report title                              |

## Available fields

The following fields will be displayed in the response:

| **Field Name** | **Type** |                                                                                 **Description**                                                                                 |
| :------------: | :------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|    `success`   |  Boolean |                                               **True** if the lab test report has been created successfully. Otherwise, **Flase**                                               |
|    `message`   |  String  |                                                                            Description of the result                                                                            |
|    `report`    |  Object  | Object that returns the information of the [lab test report ](https://docs.suggestic.com/coaching-portal/api-references/lab-test-reports/lab-test-report-list#available-fields) |

## Example&#x20;

Because it is not possible to upload files in the GraphQL playground, the following example creates a lab test report using the Postman tool.

**Step 1. Create the mutation**

Define the variables and their corresponding values:

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

```graphql
{"query": "mutation CreateLabTest($memberId: ID!, $testName: String!, $testDate: DateTime!, $labName: String!, $title: String!, $reportPdf: Upload!) {createLabTestReport(memberId:$memberId testName: $testName testDate: $testDate labName: $labName title: $title reportPdf: $reportPdf) {success message }}","variables": {"memberId": "TWVtYmVyOjVlZDk5MjMyLWNhMTMtNGE2NS05MmIyLWZjMDk4ZjgyOWUwNA==", "testName": "Hormone Testing", "testDate": "2022-02-03T10:01:01", "labName": "Lab Test", "title": "Report Test", "reportPdf": null}}
```

{% endtab %}
{% endtabs %}

**Note:** Replace the `memberId` with your personal information.

**SET UP POSTMAN**

**Step 2: Add the URL server, select the POST method and add the Header**

<mark style="color:green;">`POST`</mark> `https://production.suggestic.com/cp/graphql`

#### Headers

| Name                                            | Type                 | Description |
| ----------------------------------------------- | -------------------- | ----------- |
| Authorization<mark style="color:red;">\*</mark> | Bearer \<JSON Token> | JSON Token  |

**Step 3: Add the Body information**

Click on the `form-data` option within the Body option and add the following 3 Key values:

* **operations:** Add the mutation defined in step 1.
* **map:** Map the files to your mutation.
* **0:** Choose the file type to upload your PDF file.

<mark style="color:green;">`POST`</mark> `https://production.suggestic.com/cp/graphql`

#### Request Body

| Name                                         | Type                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | Description         |
| -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------- |
| operations<mark style="color:red;">\*</mark> | {"query": "mutation CreateLabTest($memberId: ID!, $testName: String!, $testDate: DateTime!, $labName: String!, $title: String!, $reportPdf: Upload!) {createLabTestReport(memberId:$memberId testName: $testName testDate: $testDate labName: $labName title: $title reportPdf: $reportPdf) {success message }}","variables": {"memberId": "TWVtYmVyOjVlZDk5MjMyLWNhMTMtNGE2NS05MmIyLWZjMDk4ZjgyOWUwNA==", "testName": "Tester", "testDate": "2021-09-01T10:01:01", "labName": "Lab Test", "title": "Report Test", "reportPdf": null}} | Mutation            |
| map<mark style="color:red;">\*</mark>        | {"0":\["variables.reportPdf"]}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | Map the files       |
| 0<mark style="color:red;">\*</mark>          | lab-test-report.pdf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | Upload the PDF File |

{% tabs %}
{% tab title="200: OK Lab Test Report was successfully created" %}

```javascript
{
    // Response
}
```

{% endtab %}

{% tab title="500: Internal Server Error Internal Server Error" %}

{% endtab %}
{% endtabs %}

![](/files/JfLXQNkCeFYz3X3LhwoI)

The response will be:

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

```graphql
{
 "data": {
    "createLabTestReport": {
        "success": true,
        "message": "Lab Test Report was successfully created"
    }
 }
```

{% endtab %}
{% endtabs %}

Within the TeleWellness Portal, the created lab test is displayed as follows:

![](/files/48zAvsBHkfc6uMEVT74V)
