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

Example

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:

{"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}}

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

POST https://production.suggestic.com/cp/graphql

Headers

NameTypeDescription

Authorization*

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.

POST https://production.suggestic.com/cp/graphql

Request Body

NameTypeDescription

operations*

{"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*

{"0":["variables.reportPdf"]}

Map the files

0*

lab-test-report.pdf

Upload the PDF File

{
    // Response
}

The response will be:

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

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

Last updated