Add Lab Test Report

Use the createLabTestReport mutation to create a lab test report.

Arguments

Argument Name

Type

Required?

Description

testName

String

Yes

Lab test report name.

title

String

Yes

Lab test report title. Not used on the app.

labName

String

Yes

Laboratory or processor name.

description

String

No

Description of the lab test.

testDate

DateTime

No

Date and time when the lab test report is created.

sampleCollectionDate

DateTime

No

Date and time of sample collection.

isVisible

Boolean

Yes

True if the lab test report should be displayed to end-users.

status

LabTestReportStatus

No

CREATED

ORDERED

FULFILLED

ERROR

RETURNED_TO_LAB

RESULTS_READY

PROCESS_COMPLETE

RESULTS_DELIVERED

orderingPhysician

String

No

Name or ID of the ordering provider.

externalId

String

No

External ID

orderId

String

No

Order ID

requisitionId

String

No

Requisition ID

reportPDF

Upload

No

Lab report file

imageUrl

String

No

URL of an image representative of the lab test. Will be used as video thumbnail if video is available.

videoUrl

String

No

Video URL to show in the report.

alert

Boolean

No

True if alert is active otherwise False.

alertText

String

No

Text shown in the alert.

alertAction

AlertAction

No

  • ATTEMPTED_FAILED: Unable to contact.

  • CONTACTED: Member Contacted and resolved.

alertStatus

AlertStatus

No

  • IN_REVIEW: In Review.

  • REVIEWED: Lab Reviewed - No Alerts.

  • OUT_OF_RANGE: Biomarker(s) Out of Range.

  • OTHER: Other.

  • FOLLOW_UP: Follow-up Required.

  • NO_FOLLOW_UP: No Follow-up Required.

  • COMPLETED: Lab Alert Completed.

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

Examples

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

Example 1

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

Example 2 with Lab Alerts

{
    "query": "mutation CreateLabTest($testName: String!, $testDate: DateTime!, $labName: String!, $title: String!, $reportPdf: Upload!, $alert: Boolean, $alertText: String, $alertStatus: AlertStatus, $alertStatus: AlertStatus) {createLabTestReport(testName: $testName testDate: $testDate labName: $labName title: $title reportPdf: $reportPdf alert: $alert alertText: $alertText alertStatus: $alertStatus alertAction: $alertAction) {success message }}",
    "variables": {
        "testName": "Hormone Testing",
        "testDate": "2022-02-03T10:01:01",
        "labName": "Lab Test",
        "reportPdf": null,
        "alert": true,
        "alertText":"Validation Error",
        "alertStatus":"REVIEWED",
        "alertAction":"CONTACTED"

    }
}

Example 3 with video and image

{
    "query": "mutation CreateLabTest($testName: String!, $testDate: DateTime!, $labName: String!, $title: String!, $reportPdf: Upload!, $status: LabTestReportStatus $videoUrl:String) {createLabTestReport( testName: $testName testDate: $testDate labName: $labName title: $title reportPdf: $reportPdf, status: $status, videoUrl: $videoUrl) {success message }}",
    "variables": {
        "testName": "Test with video",
        "testDate": "2023-04-12T14:44:19",
        "labName": "Test V",
        "reportPdf": null,
        "status": "RESULTS_READY",
        "videoUrl":"https://www.samplevideo.com/file.mp4"
        "imageUrl":"https://www.image.com/image.jpg"
    }
}

SET UP POSTMAN

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

POST https://production.suggestic.com/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/graphql

Request Body

NameTypeDescription

*

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

map*

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

Map the files

0*

lab-test-report.pdf

Upload the PDF File

{
    // Response
}

Step 4: Adding the Headers

  • Suggestic-partner: Partner Id

  • Authorization: Partner token

  • sg-user: Target userId

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