Overview

The Mural Link system is used to pay patients who are participating in clinical trials.

Note that Mural Link is a working title, and will be changed before launch.

Entities

The system consists of the following entities, whose roles and relationships are described below.

The hierachy is as follows:

Diagram

Client

The client is the company contracting with Mural Health. They are, or represent, a company such as pharmaceutical company, medical device manufacturer, or any other company that produces a product which is subject to clinical trial approval.

The client may also be a CRO, which has been engaged by the type of company described above.

Sponsor

The sponsor is the company that the client is working on behalf of. This may be the same company as the client, but will often be different because logistics are often handled by third parties such as CROs.

Contract

A contract is an agreement between the client and Mural Health. It covers one or more clinical trials. The client will provide funding to Mural Health, which will be used to distribute payments to the patients.

Clinical Trial

A clinical trial is a single phase of the process required to bring a product to market. Trial phases may each run for multiple years, so patients may receive regular payments for an extended period.

The trial is officially referred to via a protocol ID which is a unique identifier for the trial. However, they are most commonly referred to via marketing-friendly names.

Funding

Funding is the money provided to Mural Health to pay the patients. It is not used to pay Mural Health for its services. It is a fiduciary account. This means that Mural Health is authorized to distribute funds to the patients, but the money is still owned by the client.

Site

A site is a location where a clinical trial is conducted. These are usually private practices, hospitals, or universities.

A site may be participating in multiple trials, for multiple different clients and sponsors, simultaneously. A site may be working directly with Mural Health to manage the trials they are participating in, or they may be working under a CRO. It is possible that they can be doing both at the same time.

Site Coordinator

The site coordinator is an employee at the site who directly deals with the patient. They are frequently nurses or other medical staff. They will also be the users of the Mural Link system — registering and paying patients.

A site coordinator can work for multiple sites, although this is usually when there are multiple sites operating as part of the same business.

Patient

A patient is a person who is participating in a clinical trial. They will have a medical condition which is can potentially be treated by the product undergoing the trial.

Patients are often compensated financially for their time and travel. The amount paid to is strictly controlled by an Institutional Review Board (IRB) to ensure that patients are not coerced into participating against their best interests. Specifically, the amount paid, while it should be a fair amount, should not be high enough to encourage the individual to take inadvisable health risks.

Payment Schedule

For each site, there will be a payment schedule which describes each milestone, and how much a patient is to be paid. This is because the amouts will vary by geographic location, and by the type of trial. For example, patients in Los Angeles or New York may receive a higher amount than patients in the midwest. Also, trials involving surgery will pay significantly more than trials involving a pill or injection.

Table 1. Payment Schedule Example
Milestone Amount

Week 1

$100

Week 2

$75

Week 3

$75

Week 4

$75

Week 5

$75

Week 6

$75

Week 7

$75

Week 8

$150

Week 9

$150

Week 10

$200

These amounts will be programmed into the Mural Link system, so the site coordinator doesn’t have to keep track of amounts.

Each milestone can only be paid once. So if a patient is paid for the first two weeks, when they come for their third visit, the site coordinator will not see them available for payment. The site coordinator will only be able to pay them for the week three milestone.

Payment Methods

The patient will be able to select among multiple payment methods. They can have money deposited into their bank account, either by ACH or wire transfer, or directly onto their debit card.

Other payment options, such as Cash App, PayPal, Venmo, etc. will likely be added in the future.

Register

Any user can register an account with the system. However, they will not be able to do anything until they are assigned permissions.

Request

{
    "action": "register",
    "payload": {
        "email": "bud.carlson@example.com",
        "phone": "(212) 555-1212",
        "first_name": "Bud",
        "last_name": "Carlson",
        "password": "Th6@#&UQTa4[",
        "address": {
            "street1": "1400 Stonehedge Blvd",
            "street2": "",
            "city": "Alton",
            "state": "IL",
            "post_code": "62002"
        }
    }
}

Response

{
    "action": "register",
    "payload": {
        "uid": "2FENQymKqep0AHbvZLRyRgQiepg",
        "email": "bud.carlson@example.com",
        "first_name": "Bud",
        "last_name": "Carlson",
        "address": {
            "uid": "2FENQtSgMX12m8Wdira2DmFAiOK",
            "street1": "1400 Stonehedge Blvd",
            "city": "Alton",
            "state": "IL",
            "post_code": "62002"
        },
        "phone": "(212) 555-1212",
        "email_verified": false,
        "sms_verified": false,
        "patient": {
            "address": {}
        },
        "caregiver": {
            "address": {},
            "patient": {
                "address": {}
            }
        }
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENQtSZOizshUcvSKOJxrH3FOr",
    "roles": [],
    "user_type": "external"
}

Log In

Logging in is required to take any action except registration. Upon successful login, the user will receive a session ID which much be used for all subsequent requests.

Request

{
    "action": "login",
    "payload": {
        "email": "admin@example.com",
        "password": "259otqjIbYNDeFd2rx5XNpNX4Si"
    }
}

Response

{
    "action": "login",
    "payload": {
        "session_id": "2FENQswGEee3LiTqHwIEVOHaIUb",
        "invalid_attempts": 0
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENQs1zaDtGeYxEDekO6TFcDjS",
    "roles": [],
    "user_type": "external"
}

keepalive

This call is used to determine whether the current session_id is still valid.

It also refreshes the session timeout.

Request

{
    "action": "keepalive",
    "session_id": "2FENQswGEee3LiTqHwIEVOHaIUb"
}

Response

{
    "action": "keepalive",
    "status_code": 200,
    "message": "session valid",
    "request_id": "2FENQtOVofyvK7CY8auLM8Ky4VI",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Log Out

Expire the current session ID.

Request

{
    "action": "logout",
    "session_id": "2FENQswGEee3LiTqHwIEVOHaIUb"
}

Response

{
    "action": "logout",
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENQs3JOAd0k7wHCTZB2x8Qssj",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

ping

Simple test of server connectivity. ping does not require a valid session ID.

Request

{
    "action": "ping"
}

Response

{
    "action": "ping",
    "status_code": 200,
    "message": "pong",
    "request_id": "2FENQu23cpdKOCA2tfkro4wPPBf",
    "roles": [],
    "user_type": "external"
}

My Info

Retrieve the logged-in user’s information.

Request

{
    "action": "my_info",
    "session_id": "2FENR69xxAGlKj6ydIvtu7ny5MY",
    "payload": {
        "token": ""
    }
}

Response

{
    "action": "my_info",
    "payload": {
        "uid": "2FENR6hskFeKS3w8dWJsToeY0iq",
        "email": "benita.hampton@example.com",
        "first_name": "Benita",
        "last_name": "Hampton",
        "address": {
            "uid": "2FENR2oCEKWii3DofGWPWiV4JBq",
            "street1": "1599 Midland St",
            "city": "Vancouver",
            "state": "WA",
            "post_code": "98661"
        },
        "phone": "(212) 555-1212",
        "email_verified": false,
        "sms_verified": false,
        "patient": {
            "address": {}
        },
        "caregiver": {
            "address": {},
            "patient": {
                "address": {}
            }
        }
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENR2nU2qojFnu02Bt67yxpcw0",
    "roles": [],
    "user_type": "external"
}

Get user verification token

For admin use only.

Retrieve a user’s verification token for testing purposes.

Request

{
    "action": "get_user_verification_token",
    "session_id": "2FENR2hZlA28lR1EuLEyc6iPs4H",
    "payload": {
        "user_uid": "2FENR6hskFeKS3w8dWJsToeY0iq"
    }
}

Response

{
    "action": "get_user_verification_token",
    "payload": "2FENR5QDEhZGUg433udoHuVCNh1",
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENR3636IoiYmzPQDDELHiCkwL",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Get Users

Look up registered users.

This is for use by admins only, and is used to grant permissions.

Request

{
    "action": "get_users",
    "session_id": "2FENR4plwnHxZEum0BQYWCb2mMB"
}

Response

{
    "action": "get_users",
    "payload": [
        {
            "uid": "2FENQymKqep0AHbvZLRyRgQiepg",
            "email": "bud.carlson@example.com",
            "first_name": "Bud",
            "last_name": "Carlson",
            "address": {
                "uid": "2FENQtSgMX12m8Wdira2DmFAiOK",
                "street1": "1400 Stonehedge Blvd",
                "city": "Alton",
                "state": "IL",
                "post_code": "62002"
            },
            "phone": "(212) 555-1212",
            "email_verified": false,
            "sms_verified": false,
            "patient": {
                "address": {}
            },
            "caregiver": {
                "address": {},
                "patient": {
                    "address": {}
                }
            }
        },
        {
            "uid": "2FENR6hskFeKS3w8dWJsToeY0iq",
            "email": "benita.hampton@example.com",
            "first_name": "Benita",
            "last_name": "Hampton",
            "address": {
                "uid": "2FENR2oCEKWii3DofGWPWiV4JBq",
                "street1": "1599 Midland St",
                "city": "Vancouver",
                "state": "WA",
                "post_code": "98661"
            },
            "phone": "(212) 555-1212",
            "email_verified": true,
            "sms_verified": false,
            "patient": {
                "address": {}
            },
            "caregiver": {
                "address": {},
                "patient": {
                    "address": {}
                }
            }
        },
        {
            "uid": "2FENQwYMmpg1Q7DvrClzUwRVLml",
            "email": "irwin.peterson@example.com",
            "first_name": "Irwin",
            "last_name": "Peterson",
            "address": {
                "uid": "2FENQsjnci78kmOooUunfkQqsS8",
                "street1": "685 Cedarwood Ln",
                "city": "Akron",
                "state": "OH",
                "post_code": "44309"
            },
            "phone": "(212) 555-1212",
            "email_verified": false,
            "sms_verified": false,
            "patient": {
                "address": {}
            },
            "caregiver": {
                "address": {},
                "patient": {
                    "address": {}
                }
            }
        },
        {
            "uid": "2FENQx5DbHltowRjmKV0Jv1AYjC",
            "email": "harvey.wise@example.com",
            "first_name": "Harvey",
            "last_name": "Wise",
            "address": {
                "uid": "2FENQzTrP5ObUeghUswEUZb34Xp",
                "street1": "1978 North Hampton St",
                "city": "Omaha",
                "state": "NE",
                "post_code": "68108"
            },
            "phone": "(212) 555-1212",
            "email_verified": false,
            "sms_verified": false,
            "patient": {
                "address": {}
            },
            "caregiver": {
                "address": {},
                "patient": {
                    "address": {}
                }
            }
        }
    ],
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENR0FRonvIMtHveF5KStm6wuR",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Update User

Request

{
    "action": "update_user",
    "session_id": "2FENR2az0S7TLx8rWJlpxeoGevc",
    "payload": {
        "uid": "2FENQzoNqeuTV1GB2S3NsGOyZm3",
        "email": "daniel.morgan@example.com",
        "first_name": "Michael",
        "last_name": "Knight",
        "address": {
            "uid": "2FENQzn0QRzRq3dav8jnRWI6i69",
            "street1": "1788 Genesse Blvd",
            "city": "Memphis",
            "state": "TN",
            "post_code": "38101"
        },
        "phone": "(212) 555-1212",
        "email_verified": false,
        "sms_verified": false,
        "patient": {
            "address": {}
        },
        "caregiver": {
            "address": {},
            "patient": {
                "address": {}
            }
        },
        "password": "3(=F7~K$Wq4#"
    }
}

Response

{
    "action": "update_user",
    "payload": {
        "uid": "2FENQzoNqeuTV1GB2S3NsGOyZm3",
        "email": "daniel.morgan@example.com",
        "first_name": "Michael",
        "last_name": "Knight",
        "address": {
            "uid": "2FENQzn0QRzRq3dav8jnRWI6i69",
            "street1": "1788 Genesse Blvd",
            "city": "Memphis",
            "state": "TN",
            "post_code": "38101"
        },
        "phone": "(212) 555-1212",
        "email_verified": false,
        "sms_verified": false,
        "patient": {
            "address": {}
        },
        "caregiver": {
            "address": {},
            "patient": {
                "address": {}
            }
        }
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENQzsbghsscEZ6lJsR9nLNcxH",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Get Clients

The get_clients call is required to get client IDs to be used when creating contracts.

This functionality is only available to admin users.

This requires the get_clients permission.

Request

{
    "action": "get_clients",
    "session_id": "2FENR1KcbQM3IAQr5oZ34ZhCA64"
}

Response

{
    "action": "get_clients",
    "payload": [],
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENR6WrqkOvlULlPs2x2auz1RL",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Create Client

A client represents a customer of the service. For now there’s nothing here but a name.

This functionality is only available to admin users.

Request

{
    "action": "create_client",
    "session_id": "2FENR1KcbQM3IAQr5oZ34ZhCA64",
    "payload": {
        "name": "Crane, Inc.",
        "sales_contact": "Evangeline Hensley",
        "tax_id": "461145481",
        "contact_name": "Jim Vaughn",
        "contact_phone": "(708) 152-1896",
        "contact_email": "jim.vaughn@example.com",
        "address": {
            "street1": "1727 Willow Rd",
            "street2": "",
            "city": "Utica",
            "state": "NY",
            "post_code": "13504"
        }
    }
}

Response

{
    "action": "create_client",
    "payload": {
        "uid": "2FENR1GX5Ns6xwfY860XRtNW3Xm",
        "name": "Crane, Inc.",
        "sales_contact": "",
        "client_type": "",
        "tax_id": "",
        "client_signature_date": "",
        "address": {
            "uid": "2FENR1dzbisVGAbgEN7fAaZ4jET",
            "street1": "1727 Willow Rd",
            "city": "Utica",
            "state": "NY",
            "post_code": "13504"
        }
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENQzyTbTepyUlL7fWT1sVqFxi",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Get Client

get_client is like get_clients, except it returns a single client by UID.

Requires permission view_clients.

Request

{
    "action": "get_client",
    "session_id": "2FENR7TC8oqIwuoUydVGdwzqEDK",
    "payload": {
        "uid": "2FENR2Tn5QyGjRJ1F4LU6zdN3nG"
    }
}

Response

{
    "action": "get_client",
    "payload": {
        "uid": "2FENR2Tn5QyGjRJ1F4LU6zdN3nG",
        "name": "Osborn, Inc.",
        "sales_contact": "",
        "client_type": "",
        "tax_id": "",
        "client_signature_date": "",
        "address": {
            "uid": "2FENR5J1B64o49xn8mky3glDwGb",
            "street1": "1569 Plymth Terr",
            "city": "Memphis",
            "state": "TN",
            "post_code": "38101"
        },
        "audit_history": [
            {
                "uid": "2FENR2h32MuAdmOBdoEUDUuVVoV",
                "resource_uid": "2FENR2Tn5QyGjRJ1F4LU6zdN3nG",
                "user_uid": "admin",
                "changes": "created client"
            }
        ]
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENR2fxW4lr7k7ImTTqXXSG7ZL",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Edit Client

A client may be edited to fix a typo.

This functionality is only available to admin users.

Request

{
    "action": "edit_client",
    "session_id": "2FENR7TC8oqIwuoUydVGdwzqEDK",
    "payload": {
        "uid": "2FENR2Tn5QyGjRJ1F4LU6zdN3nG",
        "name": "06114bb90cc044988292c1b1ce80dd13"
    }
}

Response

{
    "action": "edit_client",
    "payload": {
        "uid": "2FENR2Tn5QyGjRJ1F4LU6zdN3nG",
        "name": "06114bb90cc044988292c1b1ce80dd13",
        "sales_contact": "",
        "client_type": "",
        "tax_id": "",
        "client_signature_date": "",
        "address": {
            "uid": "2FENR5J1B64o49xn8mky3glDwGb",
            "street1": "1569 Plymth Terr",
            "city": "Memphis",
            "state": "TN",
            "post_code": "38101"
        },
        "audit_history": [
            {
                "uid": "2FENR2h32MuAdmOBdoEUDUuVVoV",
                "resource_uid": "2FENR2Tn5QyGjRJ1F4LU6zdN3nG",
                "user_uid": "admin",
                "changes": "created client"
            },
            {
                "uid": "2FENR2OtIa4zKJElKl3iOkm7wiM",
                "resource_uid": "2FENR2Tn5QyGjRJ1F4LU6zdN3nG",
                "user_uid": "admin",
                "changes": "changed name from \"Osborn, Inc.\" to \"06114bb90cc044988292c1b1ce80dd13\", changed address uid from \"2FENR5J1B64o49xn8mky3glDwGb\" to \"\""
            }
        ]
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENR50qAtDR241rUy91RN1vmJF",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Search Clients

Search for a client by partial name.

Requires permission view_clients.

Request

{
    "action": "search_clients",
    "session_id": "2FENR79fBNviHl2CJPiOtGLfxTo",
    "payload": {
        "query": "Oscar"
    }
}

Response

{
    "action": "search_clients",
    "payload": [
        {
            "uid": "2FENR67DXFAKtUqid2BK265gleZ",
            "name": "Oscar Wilde",
            "sales_contact": "",
            "client_type": "",
            "tax_id": "",
            "client_signature_date": "",
            "address": {}
        },
        {
            "uid": "2FENR109RBdpxcTerPpgbLLnYEC",
            "name": "Oscar the Grouch",
            "sales_contact": "",
            "client_type": "",
            "tax_id": "",
            "client_signature_date": "",
            "address": {}
        }
    ],
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENR2R6WZaCKl0j9KeUAxdKZBf",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Delete Client

A client can not be deleted if they have any contracts.

Request

{
    "action": "delete_client",
    "session_id": "2FENR72Swfbc6t1vKg8nYp0qyP5",
    "payload": {
        "client_uid": "2FENR5V2GaE76qnBHyHxbgRyUQq"
    }
}

Response

{
    "action": "delete_client",
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENR19G1SRULLw4iEp7LfFvdAG",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Create Contract

A contract will be created to be associated with one or more studies being conducted by the client.

This functionality is only available to admin users.

Request

{
    "action": "create_contract",
    "session_id": "2FENQzyTTXkAHy2RTb2Fq62oWs9",
    "payload": {
        "client_uid": "2FENR7HwdzLXX6pVisblEyR3vzZ",
        "name": "Example Contract Peters-3675",
        "client_signature_date": "2022-09-06",
        "contract_start_date": "2022-09-25",
        "contract_end_date": "2025-01-02",
        "total_contract_value": "443000",
        "currency": "USD"
    }
}

Response

{
    "action": "create_contract",
    "payload": {
        "uid": "2FENR2i2VTgLUEzsgRtTZvkeHiR",
        "client_uid": "2FENR7HwdzLXX6pVisblEyR3vzZ",
        "name": "Example Contract Peters-3675",
        "total_contract_value": "$443,000.00",
        "currency": "USD",
        "client_signature_date": "2022-09-06T00:00:00Z",
        "contract_start_date": "2022-09-25T00:00:00Z",
        "contract_end_date": "2025-01-02T00:00:00Z",
        "document_url": "http://api:6666/contracts/2FENR3QcbefIlRFCZqKR5Rkk6Bw"
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENR58y2ewlsaAYC9OLUDihq49",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Edit Contract

Contracts may be edited to correct typos.

This functionality is only available to admin users.

Request

{
    "action": "edit_contract",
    "session_id": "2FENR5Ulc2GnbrphWKd1VInvhgV",
    "payload": {
        "uid": "2FENR68J321devvHqHBJCc8zK3B",
        "name": "Example Contract 02"
    }
}

Response

{
    "action": "edit_contract",
    "payload": {
        "uid": "2FENR68J321devvHqHBJCc8zK3B",
        "client_uid": "2FENR52q4HXQl1Rb5wcdEAxDxuq",
        "name": "Example Contract 02",
        "total_contract_value": "$441,000.00",
        "currency": "USD",
        "client_signature_date": "2022-08-20T00:00:00Z",
        "contract_start_date": "2022-09-25T00:00:00Z",
        "contract_end_date": "2024-07-16T00:00:00Z",
        "document_url": "http://api:6666/contracts/2FENR2MnmKCWZ0r8WZ04ho2zSxr"
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENR3Xroo9RfC2xok4i0SYNYBu",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Get Contracts

The get_contracts function returns all contracts, and must be used to get contract IDs to create studies.

This functionality is only available to admin users.

Requires permission view_contract.

Request

{
    "action": "get_contracts",
    "session_id": "2FENQzmFXiHDNPj9LsTd0UalAti",
    "payload": {
        "client_uid": "2FENR5r9LiPQIgCvRt8dr4Cz5Sx"
    }
}

Response

{
    "action": "get_contracts",
    "payload": [
        {
            "uid": "2FENR0ZFb019KngVMzC6Ugu87Qc",
            "client_uid": "2FENR5r9LiPQIgCvRt8dr4Cz5Sx",
            "name": "Example Contract Robertson-4971",
            "total_contract_value": "$451,000.00",
            "currency": "USD",
            "client_signature_date": "2022-08-10T00:00:00Z",
            "contract_start_date": "2022-09-25T00:00:00Z",
            "contract_end_date": "2025-04-05T00:00:00Z",
            "document_url": "http://api:6666/contracts/2FENR3pg1lNxeDy4ht6vAsf4Uo4"
        }
    ],
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENR1RjdLDkuoP0NpImmADFAZe",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Upload Contract

Upload a PDF of the contract. It accepts a base-64 encoded file.

Requires permission edit_contract.

Request

{
    "action": "upload_contract",
    "session_id": "2FENR0d2FmeX6BG5fCuK9jgkQ7q",
    "payload": {
        "contract_uid": "2FENR0zLLasCWG81UxJ9O73ybuH",
        "data": "JVBERi0xLjQKJf////8KMSAwIG9iago8PCAvVGl0bGUgKFN0cmlwZSBQYXlvdXRzKQovQXV0aG9yIChTaGF3biBNaWxvY2hpaykK<truncated>",
        "filename": "example.pdf",
        "client_signature_date": "2022-09-06",
        "contract_start_date": "2022-09-25",
        "contract_end_date": "2024-07-17",
        "total_contract_value": "382000",
        "currency": "USD"
    }
}

Response

{
    "action": "upload_contract",
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENR67htQHuXQGBB84FRRTvxbF",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Get Contract

Get the details of a single contract.

Requires the permission view_contract.

Request

{
    "action": "get_contract",
    "session_id": "2FENR0d2FmeX6BG5fCuK9jgkQ7q",
    "payload": {
        "contract_uid": "2FENR0zLLasCWG81UxJ9O73ybuH"
    }
}

Response

{
    "action": "get_contract",
    "payload": {
        "uid": "2FENR0zLLasCWG81UxJ9O73ybuH",
        "client_uid": "",
        "name": "Example Contract Hale-6373",
        "total_contract_value": "$498,000.00",
        "currency": "USD",
        "contract_start_date": "2022-09-25T00:00:00+00:00",
        "document_url": "http://api:6666/contracts/2FENR3F07SXF0H80Zso1rQbvAbJ"
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENR1FF20sWiyX3eohtYd7QHvK",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Delete Contract

Delete a contract. A contract may not be deleted if it has already been funded.

Request

{
    "action": "delete_contract",
    "session_id": "2FENR5OukrZryRWwvHmIPzsK39p",
    "payload": {
        "contract_uid": "2FENR4QF4LA0LJF7edSZUWJiGHQ"
    }
}

Response

{
    "action": "delete_contract",
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENR1GtVeBxhTbweUAsXqSBR7B",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Create Trial

A trial represents a clinical trial being conducted by the client.

This requires the create_trial permission.

Request

{
    "action": "create_trial",
    "session_id": "2FENR4F74uBRNfSmZsh6hqyJywA",
    "payload": {
        "contract_uid": "2FENR5xKmsUK0jOa5bD0zHvn7V4",
        "name": "Trial Carney-35",
        "protocol_id": "XK2721-37901"
    }
}

Response

{
    "action": "create_trial",
    "payload": {
        "uid": "2FENR20NeolsXYG14Orv6cNhBqq",
        "contract_uid": "2FENR5xKmsUK0jOa5bD0zHvn7V4",
        "name": "Trial Carney-35",
        "protocol_id": "XK2721-37901"
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENR0FKyfsb71gH7h4fBgN2grI",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Create Site

A site is a location where clinical trials are conducted. This could be a private practice, hospital, or university.

The trial UID or contract UID is required to create a site. If the trial UID is sent, the trial/site association will be created automatically. Otherwise, a call must be made to add_trial_site to associate the site with the trial before subjects can be enrolled.

Request

{
    "action": "create_site",
    "session_id": "2FENR4F74uBRNfSmZsh6hqyJywA",
    "payload": {
        "name": "Garrison Clinic",
        "trial_uid": "2FENR20NeolsXYG14Orv6cNhBqq",
        "contract_uid": "2FENR5xKmsUK0jOa5bD0zHvn7V4"
    }
}

Response

{
    "action": "create_site",
    "payload": {
        "uid": "2FENR7296GbmUIeMxlkoI0tKsWq",
        "name": "Garrison Clinic",
        "contract_uid": "2FENR5xKmsUK0jOa5bD0zHvn7V4"
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENR7LG2nK8nwKQQ5lb9PVUHsK",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Unresolved directive in api.adoc - include::t/d/add_participant.adoc[]

Request

{
    "action": "add_participant",
    "session_id": "2FENR4F74uBRNfSmZsh6hqyJywA",
    "payload": {
        "site_uid": "2FENR7296GbmUIeMxlkoI0tKsWq",
        "first_name": "Jamar",
        "last_name": "Mcgowan",
        "email": "Jamar.Mcgowan@example.com",
        "dob": "1985-10-09",
        "phone": "(400) 421-5275",
        "email_enabled": true,
        "address": {
            "street1": "1266 Sharon Rd",
            "street2": "",
            "city": "Passadena",
            "state": "CA",
            "post_code": "91109"
        },
        "emergency_contact": "Joe Pesci",
        "emergency_phone": "(212) 555-1212"
    }
}

Response

{
    "action": "add_participant",
    "payload": {
        "uid": "2FENR5I1lxoZ4KlaOrVWRQ4TTaT",
        "email": "jamar.mcgowan@example.com",
        "emergency_contact": "Joe Pesci",
        "emergency_phone": "(212) 555-1212",
        "first_name": "Jamar",
        "last_name": "Mcgowan",
        "phone": "(400) 421-5275",
        "site_uid": "2FENR7296GbmUIeMxlkoI0tKsWq",
        "time_zone": "America/New_York",
        "dob": "1985-10-09",
        "address": {
            "uid": "2FENQzoPFsQ2NhbO3VBtLGH4upV",
            "street1": "1266 Sharon Rd",
            "city": "Passadena",
            "state": "CA",
            "post_code": "91109"
        }
    },
    "status_code": 200,
    "message": "patient added",
    "request_id": "2FENR6B67F1aGkwRer4PtrQcX6R",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Upload Document

Upload a document related to a patient or caregiver. Either patient_uid or caregiver_uid is required.

Requires permission upload_document.

Request

{
    "action": "upload_document",
    "session_id": "2FENR4F74uBRNfSmZsh6hqyJywA",
    "payload": {
        "patient_uid": "2FENR5I1lxoZ4KlaOrVWRQ4TTaT",
        "caregiver_uid": "",
        "filename": "example.pdf",
        "data": "JVBERi0xLjQKJf////8KMSAwIG9iago8PCAvVGl0bGUgKFN0cmlwZSBQYXlvdXRzKQovQXV0aG9yIChTaGF3biBNaWxvY2hpaykK<truncated>"
    }
}

Response

{
    "action": "upload_document",
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENR2gAk75FxC0z8YBiaRykU9B",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Get Document

Download a document. This retrieves documents created with upload_document.

As with upload_document, the caregiver_uid or patient_uid is required. The filename is also required.

Requires permission get_document.

Request

{
    "action": "get_document",
    "session_id": "2FENR4F74uBRNfSmZsh6hqyJywA",
    "payload": {
        "patient_uid": "2FENR5I1lxoZ4KlaOrVWRQ4TTaT",
        "caregiver_uid": "",
        "filename": "example.pdf"
    }
}

Response

{
    "action": "get_document",
    "payload": {
        "patient_uid": "2FENR5I1lxoZ4KlaOrVWRQ4TTaT",
        "data": "JVBERi0xLjQKJf////8KMSAwIG9iago8PCAvVGl0bGUgKFN0cmlwZSBQYXlvdXRzKQovQXV0aG9yIChTaGF3biBNaWxvY2hpaykK<truncated>",
        "filename": "example.pdf"
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENR39iBx0f4HQP7X4zd1MSRFK",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Get Funding

Get remaining funding for a contract.

Either the contract_uid or trial_uid can be used.

Request

{
    "action": "get_funding",
    "session_id": "2FENR2F8OjTQRds3yzhWS3YNHuS",
    "payload": {
        "contract_uid": "2FENR5eDyQsLR3P5w0zkmbZyBZF",
        "trial_uid": ""
    }
}

Response

{
    "action": "get_funding",
    "payload": 0,
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENR6fGruzNB1xG4NEyEg258Mg",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Funding

Funding is added by Mural Health employees only. Sufficient funding is required for payments to be made to patients on behalf of the client.

This functionality is only available to admin users.

Requires the add_funding permission.

Request

{
    "action": "add_funding",
    "session_id": "2FENR2F8OjTQRds3yzhWS3YNHuS",
    "payload": {
        "contract_uid": "2FENR5eDyQsLR3P5w0zkmbZyBZF",
        "amount": 111.11,
        "currency": "USD"
    }
}

Response

{
    "action": "add_funding",
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENR3yOuKEMDA0yApXb23OVtXJ",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Edit Trial

Edit trial information.

This requires the edit_trial permission.

Request

{
    "action": "edit_trial",
    "session_id": "2FENRA2LB4W42iWYWEfSuytiXO0",
    "payload": {
        "uid": "2FENRDZNVWaxty5XG0MiLxATRmH",
        "name": "Trial 02",
        "protocol_id": "potato"
    }
}

Response

{
    "action": "edit_trial",
    "payload": {
        "uid": "2FENRDZNVWaxty5XG0MiLxATRmH",
        "contract_uid": "2FENRClYVWeglmG21PfKsLjm8fx",
        "name": "Trial 02",
        "protocol_id": "potato"
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENR7aGNObt2i6KgwpeKkSE99U",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Search Trials

Search for a trial by name or protocol ID.

Requires permission view_trials.

Request

{
    "action": "search_trials",
    "session_id": "2FENREoNfONe9JWyNPYOqdmcZew",
    "payload": {
        "query": "micro"
    }
}

Response

{
    "action": "search_trials",
    "payload": [
        {
            "uid": "2FENRCEz8Js9fk3zv4UZYDH0cFB",
            "contract_uid": "2FENRC1CrBUZJX9cyVFdsD0xmN4",
            "name": "Potato Trial 43",
            "protocol_id": "microphone"
        }
    ],
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENR8z5O6IXczriQoW8k6lc8dY",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Get Trials

Get all trials available to the user.

Request

{
    "action": "get_trials",
    "session_id": "2FENRBCjCDs0Gm7Iur28n6BceQL",
    "payload": {
        "contract_uid": "2FENRC8cajrNwmtvzGs9MUYo1Qo"
    }
}

Response

{
    "action": "get_trials",
    "payload": [
        {
            "uid": "2FENR7bAycXh0ZefkNKKnyqKDaV",
            "contract_uid": "2FENRC8cajrNwmtvzGs9MUYo1Qo",
            "name": "Trial Aguilar-52",
            "protocol_id": "XK4817-48233"
        }
    ],
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENR8kOFiUm2y5tR4GkZ0HXUIP",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Get Trial

Get details about an individual trial.

Request

{
    "action": "get_trial",
    "session_id": "2FENR99c6H56HwqSsD4pTQyEaXi",
    "payload": {
        "trial_uid": "2FENR9pmh2kdiXjPLG53Fdyidgi"
    }
}

Response

{
    "action": "get_trial",
    "payload": {
        "uid": "2FENR9pmh2kdiXjPLG53Fdyidgi",
        "contract_uid": "2FENR80GPlVNTrvr0eFpkkov9GG",
        "name": "Trial Livingston-68",
        "protocol_id": "XK1011-16515"
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENRC3uPSPGSx0wX0xneR1j3E0",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Delete Trial

A trial may only be deleted if no patients are enrolled.

Request

{
    "action": "delete_trial",
    "session_id": "2FENR9wEUj94GkiVw0pgGedcrXB",
    "payload": {
        "trial_uid": "2FENRAYbEM1VjVbStfMxI5GzI3a"
    }
}

Response

{
    "action": "delete_trial",
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENR8HuyJzRSd8phf2RoQXK4nq",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Grant

An admin may grant any permissions to any user.

A user who is allowed to grant permissions may only grant permissions they themselves have.

Based on the hierarchy described above, a user may be granted permissions at any level. For example, if a user is granted create_trial permissions to a contract, then they may create studies for that contract. However, if they’re granted create_trial permissions for a client, they may create studies for any contract for that client.

Requires permission grant, and the user must have the permissions being granted.

Request

{
    "action": "grant",
    "session_id": "2FENR9ccQU9AEAZBFUZkHAX6kUo",
    "payload": {
        "resource_uid": "2FENRBPyEE4XQGmp2FqAYkMozPG",
        "user_uid": "2FENRBQbo7ZpodTI2dweH6WW8SL",
        "permissions": [
            "view_trials",
            "create_trial",
            "approve_payments"
        ]
    }
}

Response

{
    "action": "grant",
    "status_code": 200,
    "message": "3 permissions granted, 0 errors: ",
    "request_id": "2FENREFOP6y3OW31nP1jYBSpSqv",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Get Permissions

This is an internal admin function used for testing.

Request

{
    "action": "get_permissions",
    "session_id": "2FENRCIDFavQCt2sLoQedRs71j1",
    "payload": {
        "user_uid": "2FENRBtRvwcymbc8iumC5thGBRQ"
    }
}

Response

{
    "action": "get_permissions",
    "payload": {
        "create_trial": [
            {
                "uid": "2FENREtDyKNkAP7Xte2EVO5szeK",
                "description": "contract Example Contract Hutchinson-3590"
            }
        ]
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENR8E94oC3WnKUBxPEE6CkHJV",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Copy Permissions

This action allows a user (such as as site coordinator) to be set up with permissions identical to than of an existing user.

Note that any existing permissions for the new user will remain, even if the user whose permissions are being copied does not have them.

This action requires the grant permission.

Request

{
    "action": "copy_permissions",
    "session_id": "2FENR8hGhCzEpZ756U1z1WfB7H8",
    "payload": {
        "from_uid": "2FENR8MlC5OrPFuxkkLmjudP9dR",
        "to_uid": "2FENRIOcEnnHrmIedlQ7AGEKtTH"
    }
}

Response

{
    "action": "copy_permissions",
    "status_code": 200,
    "message": "1 of 1 permissions copied successfully",
    "request_id": "2FENRIe8fxi82Sn4BoHQDVPiNHt",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

List Permissions

View a list of all permissions in the system.

Not all permissions will be avaialble to the current user.

Request

{
    "action": "list_permissions",
    "session_id": "2FENRJzLVP6lbE2pLSWW5Ho6Aw0"
}

Response

{
    "action": "list_permissions",
    "payload": [
        "add_milestone",
        "add_patient",
        "add_trial_site",
        "approve_payments",
        "approve_travel",
        "assign_role",
        "bulk_email",
        "create_appointment",
        "create_site",
        "create_trial",
        "delete_site",
        "delete_trial",
        "edit_contract",
        "edit_trial",
        "enroll",
        "get_document",
        "grant",
        "manual_payment",
        "messaging",
        "milestone_payment",
        "set_enrollment_status",
        "set_payment_type",
        "travel_payment",
        "update_patient",
        "upload_document",
        "view_clients",
        "view_contract",
        "view_enrollments",
        "view_patients",
        "view_payment_schedule",
        "view_payments",
        "view_report",
        "view_sites",
        "view_trials"
    ],
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENRFSFP9LQdJfgphFgVPUeHdm",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Revoke

Revoke permissions from a user.

The user revoking the permission must have grant access and must also have the permission being revoked.

Request

{
    "action": "revoke",
    "session_id": "2FENRJYSsQzqQ2e4ZUwEI96WLMY",
    "payload": {
        "resource_uid": "2FENRLKZFcHZj5Kz5s0QcKo1hXt",
        "user_uid": "2FENRLQyZooisTBeweqfJuf0XpI",
        "permissions": [
            "approve_payments"
        ]
    }
}

Response

{
    "action": "revoke",
    "status_code": 200,
    "message": "1 permissions revoked, 0 errors: ",
    "request_id": "2FENRHh4YSeuzshK3D9n7UfEf4h",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Get Sites

Get all sites from the system.

Requires permission view_sites.

Request

{
    "action": "get_sites",
    "session_id": "2FENRKsTyoc5QmX4PTMuUPJj94j"
}

Response

{
    "action": "get_sites",
    "payload": [
        {
            "uid": "2FENR7296GbmUIeMxlkoI0tKsWq",
            "name": "Garrison Clinic",
            "contract_uid": "2FENR5xKmsUK0jOa5bD0zHvn7V4"
        }
    ],
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENRJSaTYiYCb3HWPmvKuAiWTM",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Edit Site

An admin or business partner can edit a site.

This feature is currently only available to an admin user.

Request

{
    "action": "edit_site",
    "session_id": "2FENRFfdPvxNsdtzTyUUt5xY8eZ",
    "payload": {
        "uid": "2FENRKapuMwYyaDgZdn1Jok0PaQ",
        "name": "ee4e547764494542afdd2313a589ea33"
    }
}

Response

{
    "action": "edit_site",
    "payload": {
        "uid": "2FENRKapuMwYyaDgZdn1Jok0PaQ",
        "name": "ee4e547764494542afdd2313a589ea33",
        "contract_uid": "2FENRFxUtiUvMmofG0iL1mFW3dE"
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENRLHe6yJMI4ZRN9rt2HQZq96",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Get Site

Look up an individual site by its UID.

Requires permission view_sites.

Request

{
    "action": "get_site",
    "session_id": "2FENRFfdPvxNsdtzTyUUt5xY8eZ",
    "payload": {
        "uid": "2FENRKapuMwYyaDgZdn1Jok0PaQ"
    }
}

Response

{
    "action": "get_site",
    "payload": {
        "uid": "2FENRKapuMwYyaDgZdn1Jok0PaQ",
        "name": "ee4e547764494542afdd2313a589ea33",
        "trial_sites": [
            {
                "site": {
                    "uid": "",
                    "name": ""
                },
                "trial": {
                    "uid": "2FENRJRELiXNafbCyNdYAIfGHwN",
                    "contract_uid": "",
                    "name": "Trial Mccray-13",
                    "protocol_id": ""
                }
            }
        ]
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENRGiGyZ8uOwRLadNnIj5UcCe",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Delete Site

Delete a site.

A site may not be deleted if it’s associated with one or more trials.

Request

{
    "action": "delete_site",
    "session_id": "2FENRGgu0cEadLqpolfV0CURSA9",
    "payload": {
        "site_uid": "2FENRImWwTAZ0Y9bMdNgM0hUPan"
    }
}

Response

{
    "action": "delete_site",
    "status_code": 200,
    "message": "site deleted",
    "request_id": "2FENRIzKm3fCGeXV4PjnBC0V26C",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Add Trial Site

Associate a site with a clinical trial.

Requires permission add_trial_site.

Request

{
    "action": "add_trial_site",
    "session_id": "2FENRGug5WS7IaYu3UWkqceNn26",
    "payload": {
        "trial_uid": "2FENRK4ZawC8UjzjvoEZrDyEh8p",
        "site_uid": "2FENRH2Svx4z0IgHpUIiAzfg0Fb"
    }
}

Response

{
    "action": "add_trial_site",
    "payload": {
        "uid": "2FENRMVVTHDOvaVTapYFNkFgwMR",
        "site_uid": "2FENRH2Svx4z0IgHpUIiAzfg0Fb",
        "trial_uid": "2FENRK4ZawC8UjzjvoEZrDyEh8p",
        "site": {
            "uid": "",
            "name": ""
        },
        "trial": {
            "uid": "",
            "contract_uid": "",
            "name": "",
            "protocol_id": ""
        }
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENRHugtejizgbIFH5hnfXxdXw",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Get Trial Sites

Retrieve all trial/site info by trial UID.

Request

{
    "action": "get_trial_sites",
    "session_id": "2FENRLTVw3bZIIkpAp1Iq270xQO",
    "payload": {
        "trial_uid": "2FENRL5UIkQpXmQkSM0VTOLElLm"
    }
}

Response

{
    "action": "get_trial_sites",
    "payload": [
        {
            "uid": "2FENRHblQdUQoauJkatYUCKwJqq",
            "site_uid": "2FENRKW7qlfSTE5AMkUTABdUdQ2",
            "trial_uid": "2FENRL5UIkQpXmQkSM0VTOLElLm",
            "site": {
                "uid": "2FENRKW7qlfSTE5AMkUTABdUdQ2",
                "name": "Guthrie Clinic",
                "contract_uid": "2FENRLnvjv9VpSWVwCXjhmPJlUQ"
            },
            "trial": {
                "uid": "2FENRL5UIkQpXmQkSM0VTOLElLm",
                "contract_uid": "2FENRLnvjv9VpSWVwCXjhmPJlUQ",
                "name": "Trial Contreras-74",
                "protocol_id": "XK5029-13902"
            }
        }
    ],
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENRHPyVcbVFw224zkawFxsyS0",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Search Patients

Search for a patient by partial name.

Requires permission view_patients.

Request

{
    "action": "search_patients",
    "session_id": "2FENRP0pAby7ABbyadxqlF4lrMm",
    "payload": {
        "query": "bill"
    }
}

Response

{
    "action": "search_patients",
    "payload": [
        {
            "uid": "2FENRNa710fyEuMNxJ7TQaKIxlT",
            "first_name": "Bill",
            "last_name": "Hicks",
            "address": {}
        },
        {
            "uid": "2FENROHFILFGECk5oFJzceYO0DL",
            "first_name": "William",
            "last_name": "Hickey",
            "address": {}
        }
    ],
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENRS0xSQ6KY1FCC3lHIqEFyoE",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Enroll

Enroll a patient in a trial at a site.

Requires the enroll permission.

Request

{
    "action": "enroll",
    "session_id": "2FENRTYoQiiMO4nJljGzTrEOVPs",
    "payload": {
        "patient_uid": "2FENRSH2u084qTgwyS3MHEoECac",
        "trial_uid": "2FENRRZXuH2aqwlUzHx46Orj3Py",
        "site_uid": "2FENROz7i6wEvDAt1xQmvUITFOq",
        "subject_id": "6457"
    }
}

Response

{
    "action": "enroll",
    "payload": {
        "uid": "2FENRRMNpM2un6jZwZsq0jbvcii",
        "trial_uid": "2FENRRZXuH2aqwlUzHx46Orj3Py",
        "trial_site_uid": "2FENRSHLqn2td6D58E6oSi29jDN",
        "patient_uid": "2FENRSH2u084qTgwyS3MHEoECac",
        "subject_id": "6457",
        "payment_type_uid": "",
        "status": "enrolled",
        "payment_address": {},
        "patient": {
            "address": {}
        },
        "trial_site": {
            "uid": "2FENRSHLqn2td6D58E6oSi29jDN",
            "site_uid": "2FENROz7i6wEvDAt1xQmvUITFOq",
            "trial_uid": "2FENRRZXuH2aqwlUzHx46Orj3Py",
            "site": {
                "uid": "",
                "name": ""
            },
            "trial": {
                "uid": "",
                "contract_uid": "",
                "name": "",
                "protocol_id": ""
            }
        },
        "user_uid": "2FENRTTmK1RwHdYyMeKNJdoGBhl"
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENRODNGpa9CkruXuWRzUxjVWO",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Get Patients

Get all patients visible to the current user.

Request

{
    "action": "get_patients",
    "session_id": "2FENRTYoQiiMO4nJljGzTrEOVPs",
    "payload": {
        "trial_uid": "2FENRRZXuH2aqwlUzHx46Orj3Py"
    }
}

Response

{
    "action": "get_patients",
    "payload": [
        {
            "uid": "2FENR5I1lxoZ4KlaOrVWRQ4TTaT",
            "email": "jamar.mcgowan@example.com",
            "emergency_contact": "Joe Pesci",
            "emergency_phone": "(212) 555-1212",
            "first_name": "Jamar",
            "last_name": "Mcgowan",
            "phone": "(400) 421-5275",
            "site_uid": "2FENR7296GbmUIeMxlkoI0tKsWq",
            "time_zone": "America/New_York",
            "dob": "1985-10-09",
            "address": {
                "uid": "2FENQzoPFsQ2NhbO3VBtLGH4upV",
                "street1": "1266 Sharon Rd",
                "city": "Passadena",
                "state": "CA",
                "post_code": "91109"
            }
        },
        {
            "uid": "2FENRIYaoqigo7twyYhrd6Ynz1r",
            "email": "byron.norton@example.com",
            "emergency_contact": "Joe Pesci",
            "emergency_phone": "(212) 555-1212",
            "first_name": "Byron",
            "last_name": "Norton",
            "phone": "(950) 361-0348",
            "site_uid": "2FENRG1bBxYpWDuxSqykPjdLB4A",
            "time_zone": "America/New_York",
            "dob": "1991-10-02",
            "address": {
                "uid": "2FENRHBRxasVeHqfJNtbVfExAJW",
                "street1": "1878 Tulip St",
                "city": "Denver",
                "state": "CO",
                "post_code": "80202"
            }
        },
        {
            "uid": "2FENRNa710fyEuMNxJ7TQaKIxlT",
            "email": "bill.hicks@example.com",
            "emergency_contact": "Joe Pesci",
            "emergency_phone": "(212) 555-1212",
            "first_name": "Bill",
            "last_name": "Hicks",
            "phone": "(300) 651-5311",
            "site_uid": "2FENRSKeuW687kHZGplOzl69Mxg",
            "time_zone": "America/New_York",
            "dob": "1961-12-16",
            "address": {
                "uid": "2FENRRaxhhj76fQWxG3xjcjMx0k",
                "street1": "1657 Lincoln Rd",
                "city": "Erie",
                "state": "PA",
                "post_code": "16515"
            }
        },
        {
            "uid": "2FENROHFILFGECk5oFJzceYO0DL",
            "email": "william.hickey@example.com",
            "emergency_contact": "Joe Pesci",
            "emergency_phone": "(212) 555-1212",
            "first_name": "William",
            "last_name": "Hickey",
            "phone": "(733) 022-8575",
            "site_uid": "2FENRSKeuW687kHZGplOzl69Mxg",
            "time_zone": "America/New_York",
            "dob": "1964-12-21",
            "address": {
                "uid": "2FENROt9OKIygLhpP5ItSeU3HKJ",
                "street1": "1857 Ashland St",
                "city": "Plainfield",
                "state": "NJ",
                "post_code": "07061"
            }
        },
        {
            "uid": "2FENRNUHZ3UUCkEg5a1eq2w5VgK",
            "email": "george.carlin@example.com",
            "emergency_contact": "Joe Pesci",
            "emergency_phone": "(212) 555-1212",
            "first_name": "George",
            "last_name": "Carlin",
            "phone": "(782) 932-4030",
            "site_uid": "2FENRSKeuW687kHZGplOzl69Mxg",
            "time_zone": "America/New_York",
            "dob": "1962-05-25",
            "address": {
                "uid": "2FENRTSNuBocn91jRT6TDHvA00p",
                "street1": "40 Columbus Dr",
                "city": "Appleton",
                "state": "WI",
                "post_code": "54911"
            }
        }
    ],
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENRUssEm9E5rMB6yJ0NcweUpL",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Get Enrolled

Get a list of patients enrolled in a trial at a site.

Requires permission view_enrollments.

Request

{
    "action": "get_enrolled",
    "session_id": "2FENRSqrUCAcokuiBy30GsIDEf2",
    "payload": {
        "trial_uid": "2FENRRNVO8LW7DWGhtwHCfYGMom",
        "site_uid": "2FENRRDl46unxXJYrqADw1SAyXK"
    }
}

Response

{
    "action": "get_enrolled",
    "payload": [
        {
            "uid": "2FENRR12EBrgLYzrJLCu0OGMc2J",
            "email": "nellie.blackburn@example.com",
            "emergency_contact": "Joe Pesci",
            "emergency_phone": "(212) 555-1212",
            "enrollment_uid": "2FENRRT3AHfgn2SaOXIJ0XhuWBN",
            "first_name": "Nellie",
            "last_name": "Blackburn",
            "phone": "(713) 237-2524",
            "site_uid": "2FENRRDl46unxXJYrqADw1SAyXK",
            "time_zone": "America/New_York",
            "dob": "1970-04-27",
            "address": {
                "uid": "2FENRQoSXGGSDRUUJzKASMQ1Du7",
                "street1": "434 Bourg St",
                "city": "Beloit",
                "state": "WI",
                "post_code": "53511"
            },
            "enrollments": [
                {
                    "uid": "2FENRRT3AHfgn2SaOXIJ0XhuWBN",
                    "subject_id": "6795",
                    "payment_type_uid": "",
                    "status": "enrolled",
                    "payment_address": {},
                    "patient": {
                        "address": {}
                    },
                    "trial_site": {
                        "site": {
                            "uid": "2FENRRDl46unxXJYrqADw1SAyXK",
                            "name": "Mcconnell Clinic"
                        },
                        "trial": {
                            "uid": "2FENRRNVO8LW7DWGhtwHCfYGMom",
                            "contract_uid": "",
                            "name": "Trial Benson-59",
                            "protocol_id": ""
                        }
                    }
                }
            ]
        }
    ],
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENRQxGX4vTVGiiDWeApu3BKI8",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Update Patient

Update a patient’s details.

Request

{
    "action": "update_patient",
    "session_id": "2FENRRIXpVWTXSg9XETCulVQ42g",
    "payload": {
        "uid": "2FENRRqfo0jzOOEVp3QSdZf31JW",
        "email": "paul.byrd@example.com",
        "emergency_contact": "Dwayne \"The Rock\" Johnson",
        "emergency_phone": "212-666-6666",
        "first_name": "Throatwobbler",
        "last_name": "Mangrove",
        "phone": "(889) 593-3779",
        "site_uid": "2FENRRJPH43196sy8T3KZoFaDdJ",
        "time_zone": "America/New_York",
        "dob": "1980-03-19",
        "address": {
            "uid": "2FENRUnicM71qVpHJJfboQiZlt0",
            "street1": "428 Third St",
            "city": "Miami",
            "state": "FL",
            "post_code": "33152",
            "street2": "Apartment 3"
        }
    }
}

Response

{
    "action": "update_patient",
    "payload": {
        "uid": "2FENRRqfo0jzOOEVp3QSdZf31JW",
        "email": "paul.byrd@example.com",
        "emergency_contact": "Dwayne \"The Rock\" Johnson",
        "emergency_phone": "212-666-6666",
        "first_name": "Throatwobbler",
        "last_name": "Mangrove",
        "phone": "(889) 593-3779",
        "site_uid": "2FENRRJPH43196sy8T3KZoFaDdJ",
        "time_zone": "America/New_York",
        "dob": "1980-03-19",
        "address": {
            "uid": "2FENRUnicM71qVpHJJfboQiZlt0",
            "street1": "428 Third St",
            "street2": "Apartment 3",
            "city": "Miami",
            "state": "FL",
            "post_code": "33152"
        }
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENRRQLC7T8tAPEwhDl2aqCyA1",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Get Enrollments

Retrieve all enrollments for a patient.

Requires permission view_patients.

Request

{
    "action": "get_enrollments",
    "session_id": "2FENRSKleL1BP8cX2CSQSsnTuFm",
    "payload": {
        "patient_uid": "2FENRS7NTRtmtGg5HUpS7NWzaMX"
    }
}

Response

{
    "action": "get_enrollments",
    "payload": [
        {
            "uid": "2FENRT8LTuxRSDjVUyyJimVhVcY",
            "trial_uid": "2FENRNsqo1k2X9FCaJ6BUjiBnne",
            "trial_site_uid": "2FENRPaLZBWym8rT7erTtlNZ8k2",
            "patient_uid": "2FENRS7NTRtmtGg5HUpS7NWzaMX",
            "subject_id": "6706",
            "payment_type_uid": "",
            "status": "enrolled",
            "payment_address": {},
            "patient": {
                "address": {}
            },
            "trial_site": {
                "uid": "2FENRPaLZBWym8rT7erTtlNZ8k2",
                "site_uid": "2FENRNvXMpKHdzJuGwvwC9huqVz",
                "trial_uid": "2FENRNsqo1k2X9FCaJ6BUjiBnne",
                "site": {
                    "uid": "",
                    "name": ""
                },
                "trial": {
                    "uid": "",
                    "contract_uid": "",
                    "name": "",
                    "protocol_id": ""
                }
            }
        }
    ],
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENRUkcf5VKl4OnMRvDWg09jQQ",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Set Enrollment Status

The allowed values are enrolled, dropped, and completed.

Request

{
    "action": "set_enrollment_status",
    "session_id": "2FENRSKleL1BP8cX2CSQSsnTuFm",
    "payload": {
        "status": "completed",
        "trial_uid": "2FENRNsqo1k2X9FCaJ6BUjiBnne",
        "patient_uid": "2FENRS7NTRtmtGg5HUpS7NWzaMX"
    }
}

Response

{
    "action": "set_enrollment_status",
    "payload": {
        "uid": "2FENRT8LTuxRSDjVUyyJimVhVcY",
        "trial_uid": "2FENRNsqo1k2X9FCaJ6BUjiBnne",
        "trial_site_uid": "2FENRPaLZBWym8rT7erTtlNZ8k2",
        "patient_uid": "2FENRS7NTRtmtGg5HUpS7NWzaMX",
        "subject_id": "6706",
        "payment_type_uid": "",
        "status": "completed",
        "payment_address": {},
        "patient": {
            "address": {}
        },
        "trial_site": {
            "uid": "2FENRPaLZBWym8rT7erTtlNZ8k2",
            "site_uid": "2FENRNvXMpKHdzJuGwvwC9huqVz",
            "trial_uid": "2FENRNsqo1k2X9FCaJ6BUjiBnne",
            "site": {
                "uid": "",
                "name": ""
            },
            "trial": {
                "uid": "",
                "contract_uid": "",
                "name": "",
                "protocol_id": ""
            }
        }
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENRNYiCLoD51ROU01GQ2jpuMT",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Get Patient

Retrieve an individual patient’s info.

Request

{
    "action": "get_patient",
    "session_id": "2FENRTHuykWPv9jIZ3Yjt8E9JHp",
    "payload": {
        "patient_uid": "2FENRQHwWq5gZENL0wRIRPFai64"
    }
}

Response

{
    "action": "get_patient",
    "payload": {
        "uid": "2FENRQHwWq5gZENL0wRIRPFai64",
        "email": "grover.hansen@example.com",
        "emergency_contact": "Joe Pesci",
        "emergency_phone": "(212) 555-1212",
        "first_name": "Grover",
        "last_name": "Hansen",
        "phone": "(538) 752-7150",
        "site_uid": "2FENRU6SlqMPKzKpOLzCxfZFHqf",
        "time_zone": "America/New_York",
        "user_uid": "2FENRTbsEJRpubjlMMxRtVznY1A",
        "dob": "1992-05-26",
        "address": {
            "uid": "2FENRTLsK1r0i4MqhyvaUxYyQHr",
            "street1": "1409 Tellfly St",
            "city": "Erie",
            "state": "PA",
            "post_code": "16515"
        }
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENRaPk8b4aASCFEWJxxeg5zmX",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Schedule Appointment

Schedule an appointment for a patient to return to the site for a follow-up visit. The enrollment_uid or patient_uid is required. If the patient is enrolled in multiple trials, the enrollment_uid is required.

The patient will automatically receive e-mail or SMS reminder notifications.

The date must be in YYYY-MM-DDTHH:MM:SS format, e.g. "2022-07-05T21:13:00".

Request

{
    "action": "schedule_appointment",
    "session_id": "2FENRYDNZ6XQOEdSfUQirKr9uVf",
    "payload": {
        "patient_uid": "2FENRXuYLeUams9EdclZz8iS9Ag",
        "datetime": "2022-10-01T21:01:00",
        "description": "Visit 03"
    }
}

Response

{
    "action": "schedule_appointment",
    "payload": {
        "uid": "2FENRbYUs8GIuooVl0QEtxf2pxe",
        "enrollment_uid": "2FENRYTs7LfGJCL4mHf5RGjTR0u",
        "description": "Visit 03",
        "datetime": "2022-10-01T21:01:00",
        "patient_uid": "2FENRXuYLeUams9EdclZz8iS9Ag"
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENRZEeKAyNGqLDf1MeztH6or6",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Bulk E-mail

Send an e-mail message to all patients enrolled in a trial at a site.

Request

{
    "action": "bulk_email",
    "session_id": "2FENRcS2CtbT46mLlirCvbcdiA1",
    "payload": {
        "trial_uid": "2FENRZLlH6WsjashOsBwZC0vtYP",
        "site_uid": "2FENRWcuB78Eh8GlIxHx87jfJdH",
        "subject": "Test Subject",
        "body": "Test Body"
    }
}

Response

{
    "action": "bulk_email",
    "payload": {
        "OK": 1
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENRbJZT5qHU8fgRuu2fRZyYek",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Get Payment Types

The patient has the option to select how they would like to receive their funds. This API call returns the available options.

Once an option is selected, the patient may have to enter additional information relevant to the payment type.

Request

{
    "action": "get_payment_types",
    "session_id": "2FENRWOztCGqDZBbUzVRmPJX1b7"
}

Response

{
    "action": "get_payment_types",
    "payload": {
        "payment_types": [
            {
                "uid": "28LLr9EUm9f1G5S5yxoOJKNTDP0",
                "name": "PayPal",
                "description": "pay me via PayPal"
            },
            {
                "uid": "2CRrLEBYGVFEyNejc3s3G6Ub7Vm",
                "name": "Venmo",
                "description": "pay me via Venmo"
            },
            {
                "uid": "28LLqy3paByy5jcqpoU9wXuTiYo",
                "name": "check",
                "description": "check mailed to my home address"
            },
            {
                "uid": "28LLr8WY5tNSSIDtcjRSmWODmGW",
                "name": "debit",
                "description": "deposited to my debit card"
            }
        ]
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENRhQXeNSJViId6MuQkj2MCig",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Set Payment Type

Set the preferred payment type for the patient for the trial.

Requires set_payment_type permission.

Request

{
    "action": "set_payment_type",
    "session_id": "2FENRWOztCGqDZBbUzVRmPJX1b7",
    "payload": {
        "payment_type_uid": "28LLr9EUm9f1G5S5yxoOJKNTDP0",
        "trial_uid": "2FENRbW232AuAcvtSlN7fSQxjRw",
        "patient_uid": "2FENRX5Rf44qszLqehZWjHOAf3e",
        "payment_email": "",
        "payment_phone": ""
    }
}

Response

{
    "action": "set_payment_type",
    "payload": {
        "uid": "2FENRX2eoMECP3Ja2nk9Atzj2Qt",
        "trial_uid": "2FENRbW232AuAcvtSlN7fSQxjRw",
        "trial_site_uid": "2FENRcfX8wxtx7W0Zjiq5Y32DTl",
        "patient_uid": "2FENRX5Rf44qszLqehZWjHOAf3e",
        "subject_id": "4263",
        "payment_type_uid": "28LLr9EUm9f1G5S5yxoOJKNTDP0",
        "status": "enrolled",
        "payment_email": "phyllis.black@example.com",
        "payment_phone": "(306) 581-0495",
        "payment_address": {},
        "patient": {
            "address": {}
        },
        "trial_site": {
            "uid": "2FENRcfX8wxtx7W0Zjiq5Y32DTl",
            "site_uid": "2FENRWXtmAvIhXdxH6uSS09UYeP",
            "trial_uid": "2FENRbW232AuAcvtSlN7fSQxjRw",
            "site": {
                "uid": "",
                "name": ""
            },
            "trial": {
                "uid": "",
                "contract_uid": "",
                "name": "",
                "protocol_id": ""
            }
        }
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENRdJurb2tAgMSL4zuuPwCylf",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Caregiver Relationships

Provides the list of relationships between participant and caregiver to use in the relationship field of the caregiver.

Request

{
    "action": "caregiver_relationships",
    "session_id": "2FENRjO5bWuJGsCFCqgbrkejL7L"
}

Response

{
    "action": "caregiver_relationships",
    "payload": [
        "parent",
        "guardian",
        "nurse"
    ],
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENRgTaniLWcxwNxlNeF5Sjka5",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Register Caregiver

A caregiver is a person who is allowed to act on behalf of a patient.

The patient may be a minor or unable to do some things for themselves for medical reasons.

Requires permission add_patient, because a caregiver is directly linked to the patient.

Request

{
    "action": "register_caregiver",
    "session_id": "2FENRjO5bWuJGsCFCqgbrkejL7L",
    "payload": {
        "patient_uid": "2FENRg2Cc6T6ohVyddGWnN1Nmlq",
        "first_name": "Brandie",
        "last_name": "Roy",
        "relationship": "parent",
        "email": "Brandie.Roy@example.com",
        "address": {
            "street1": "1224 Third St",
            "street2": "",
            "city": "Massillon",
            "state": "OH",
            "post_code": "44646"
        }
    }
}

Response

{
    "action": "register_caregiver",
    "payload": {
        "uid": "2FENRf9QdczA62WFlOSexe9CMqe",
        "patient_uid": "2FENRg2Cc6T6ohVyddGWnN1Nmlq",
        "email": "brandie.roy@example.com",
        "first_name": "Brandie",
        "last_name": "Roy",
        "relationship": "parent",
        "address": {
            "uid": "2FENRgRR0o4LVfU3hmlCowxw2Rn",
            "street1": "1224 Third St",
            "city": "Massillon",
            "state": "OH",
            "post_code": "44646"
        },
        "patient": {
            "address": {}
        },
        "user_uid": "2FENRj7zv2Nj1ykSofhVn5VWQTW"
    },
    "status_code": 200,
    "message": "caregiver added",
    "request_id": "2FENRk2IPOCs0YcEPi5XheV3mRQ",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Get Caregivers

Get caregivers by their patient’s UID.

Request

{
    "action": "get_caregivers",
    "session_id": "2FENRjO5bWuJGsCFCqgbrkejL7L",
    "payload": {
        "patient_uid": "2FENRg2Cc6T6ohVyddGWnN1Nmlq"
    }
}

Response

{
    "action": "get_caregivers",
    "payload": [
        {
            "uid": "2FENRf9QdczA62WFlOSexe9CMqe",
            "patient_uid": "2FENRg2Cc6T6ohVyddGWnN1Nmlq",
            "email": "brandie.roy@example.com",
            "first_name": "Brandie",
            "last_name": "Roy",
            "relationship": "parent",
            "address": {
                "uid": "2FENRgRR0o4LVfU3hmlCowxw2Rn",
                "street1": "1224 Third St",
                "city": "Massillon",
                "state": "OH",
                "post_code": "44646"
            },
            "patient": {
                "address": {}
            }
        }
    ],
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENRiJDfiIGmLxRwaGtWiKweYo",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Update Caregiver

Request

{
    "action": "update_caregiver",
    "session_id": "2FENRdlGb2uARZV5QfzJYm4AZAy",
    "payload": {
        "uid": "2FENRjHvsfKtHtRs0oAoMMPPA5T",
        "patient_uid": "2FENReMlmV1sRAJtaDE5iVOIncl",
        "email": "rodger.hahn@example.com",
        "first_name": "Maude",
        "last_name": "Lebowski",
        "address": {
            "uid": "2FENRedfw2g8uGCFKPWc5PKtEqw",
            "street1": "1016 Sunrise Rd",
            "city": "Knoxville",
            "state": "TN",
            "post_code": "37901"
        },
        "patient": {
            "address": {}
        },
        "user_uid": "2FENRfKAI7KjiwXiKMe7X5Lbado"
    }
}

Response

{
    "action": "update_caregiver",
    "payload": {
        "uid": "2FENRjHvsfKtHtRs0oAoMMPPA5T",
        "patient_uid": "2FENReMlmV1sRAJtaDE5iVOIncl",
        "email": "rodger.hahn@example.com",
        "first_name": "Maude",
        "last_name": "Lebowski",
        "address": {
            "uid": "2FENRedfw2g8uGCFKPWc5PKtEqw",
            "street1": "1016 Sunrise Rd",
            "city": "Knoxville",
            "state": "TN",
            "post_code": "37901"
        },
        "patient": {
            "address": {}
        }
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENRf5fke1YBvUvh90Xdr4IFkq",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Unresolved directive in api.adoc - include::t/d/get_user_by_caregiver_uid.adoc[]

Request

{
    "action": "get_user_by_caregiver_uid",
    "session_id": "2FENRgXYIrhXtcgXJfizzgSdfE4",
    "payload": {
        "caregiver_uid": "2FENRfOVwiw97MI8rzlR06E4yiy"
    }
}

Response

{
    "action": "get_user_by_caregiver_uid",
    "payload": {
        "uid": "2FENRcs1sNN2307G4mpvrsL9ZCi",
        "email": "robyn.dyer@example.com",
        "first_name": "Robyn",
        "last_name": "Dyer",
        "address": {},
        "email_verified": false,
        "sms_verified": false,
        "patient": {
            "address": {}
        },
        "caregiver": {
            "address": {},
            "patient": {
                "address": {}
            }
        }
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENRenya7nUmDjrQZySgQXu9qa",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Change User Password

This function allows an admin to change a user’s password for them.

This functionality is only available to an admin.

Request

{
    "action": "change_user_password",
    "session_id": "2FENRgXYIrhXtcgXJfizzgSdfE4",
    "payload": {
        "user_uid": "2FENRcs1sNN2307G4mpvrsL9ZCi",
        "new_password": "2F8PK5IprU6tQBF1XVo7WcMLk6B"
    }
}

Response

{
    "action": "change_user_password",
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENReAz8bSEmrSXsl9HkPm7nVx",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Switch User

An admin user may log in as another user to troubleshoot using their settings.

Request

{
    "action": "switch_user",
    "session_id": "2FENRpDyfnH6FNKNrj0YvbfKiWv",
    "payload": {
        "uid": "2FENRklZKngOGcAlAEIM72Xp1PV"
    }
}

Response

{
    "action": "switch_user",
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENRmoCH4RneabJD7vLnpJFYOv",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Unresolved directive in api.adoc - include::t/d/send_message.adoc[]

Request

{
    "action": "send_message",
    "session_id": "2FENRnrdldvObsdCNtWBj4Fn6CJ",
    "payload": {
        "message": "hello",
        "enrollment_uid": "2FENRqLqKuMrin2pOwi7hR9dEam"
    }
}

Response

{
    "action": "send_message",
    "payload": {
        "uid": "2FENRv4gUfO1uYO8w3fHIEqhsc9",
        "message": "hello",
        "enrollment_uid": "2FENRqLqKuMrin2pOwi7hR9dEam"
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENRzkWZgrIUfYrsDdgy3TRahJ",
    "roles": [
        "patient"
    ],
    "user_type": "external"
}

Unresolved directive in api.adoc - include::t/d/get_messages.adoc[]

Request

{
    "action": "get_messages",
    "session_id": "2FENRnrdldvObsdCNtWBj4Fn6CJ",
    "payload": {
        "enrollment_uid": "2FENRqLqKuMrin2pOwi7hR9dEam"
    }
}

Response

{
    "action": "get_messages",
    "payload": {
        "messages": [
            {
                "uid": "2FENRv4gUfO1uYO8w3fHIEqhsc9",
                "message": "hello",
                "enrollment_uid": "2FENRqLqKuMrin2pOwi7hR9dEam"
            }
        ]
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENRzzOGDIdzjflcpDyzJASc7t",
    "roles": [
        "patient"
    ],
    "user_type": "external"
}

Change Password

Allow the user to change their password. Requiring them to enter their current password and to enter the new password twice is the responsibility of the API client.

If the user was just registered, their verification token may be passed as token in the payload instead of a session_id.

Request

{
    "action": "change_password",
    "session_id": "2FENRzU8Pv7MfNJ5sVqtuqrfMAS",
    "payload": {
        "new_password": "my awesome new password"
    }
}

Response

{
    "action": "change_password",
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENRxm90mvixZY7WJ3DLBNZZn6",
    "roles": [],
    "user_type": "external"
}

Request Password Reset

If a user has forgotten their password, they can request a reset token.

This reset token can be used with the reset_password API call.

Request

{
    "action": "request_password_reset",
    "payload": {
        "email": "errol.hodges@example.com"
    }
}

Response

{
    "action": "request_password_reset",
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENS0gnzoPFeaZ1c1Gkj2jSqHL",
    "roles": [],
    "user_type": "external"
}

Reset Tokens

This feature is for admin users only. It is used to test the password reset functionality.

Request

{
    "action": "reset_tokens",
    "session_id": "2FENS0dUYYB2A0TEs9FYg8t97Zo"
}

Response

{
    "action": "reset_tokens",
    "payload": {
        "tokens": {
            "2FENS4y4NGjWJ8fQBfndUkDFAz2": "1988",
            "2FENS6ivrfytDuHvcro2VDQUKpz": "9820"
        }
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENS5ImIP3hoy0c9rJ6ry6gDtJ",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Reset Password

Reset password using a token received via e-mail after calling the request_password_reset API action.

Request

{
    "action": "reset_password",
    "payload": {
        "email": "millie.noel@example.com",
        "password": "monkey123",
        "token": "1988"
    }
}

Response

{
    "action": "reset_password",
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENS7UnPuGWcOSwhSYWKY9MECZ",
    "roles": [],
    "user_type": "external"
}

Add Milestone

This function adds the payment details for a milestone. This is specific per milestone, per site, per clinical trial.

The optional effective_date parameter is used to set the effective date of the milestone payment. By default, the effective date is the time this milestone is added. This allows automatic updates to the payment schedule as the trial progresses.

For example, if milestone "Week 1" is added today, and another is added for "Week 1" with an effective date of next month, then all payments made for the next month will use the first amount, and payments starting next month will use the second amount.

Requires permission add_milestone.

Request

{
    "action": "add_milestone",
    "session_id": "2FENS1KINfKT7EUnLVG9b0z7DWW",
    "payload": {
        "milestone": "Week 01",
        "amount": 100,
        "currency": "USD",
        "trial_uid": "2FENS5IE0ftZqi7CYcPrSpcloEj",
        "site_uid": "2FENS0MPVpkA2og0Tz6ej51Fhjn",
        "sort_order": 0
    }
}

Response

{
    "action": "add_milestone",
    "payload": {
        "uid": "2FENS0bT2skecASJKLopywKDmAG",
        "trial_site_uid": "2FENS2QUYebi6Ki85ui733bo4J8",
        "effective_date": "2022-09-24T21:01:19.489385Z",
        "milestone": "Week 01",
        "amount": 100,
        "currency": "USD",
        "sort_order": 0,
        "site_uid": "2FENS0MPVpkA2og0Tz6ej51Fhjn",
        "trial_uid": "2FENS5IE0ftZqi7CYcPrSpcloEj"
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENS5cVrmWbsa6FGs33lQK2ppr",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Get Payment Schedule

Retrieve a payment schedule for a trial/site combination.

Requires view_payment_schedule permission.

Request

{
    "action": "get_payment_schedule",
    "session_id": "2FENS2RY8gXMQ1WOzFOleU5dx2r",
    "payload": {
        "trial_uid": "2FENS1MTByHvF9dtEvZcSxdq5Fe",
        "site_uid": "2FENS64QvyP9sBJ7b6TMhGX3MhO",
        "enrollment_uid": ""
    }
}

Response

{
    "action": "get_payment_schedule",
    "payload": [
        {
            "uid": "2FENS1SKTEPTOfendM7nZo6rs4A",
            "trial_site_uid": "2FENS1yuZ3FNp7WZYmIhzd8gMgR",
            "effective_date": "2022-09-24T21:01:19.633835Z",
            "milestone": "First Visit",
            "amount": 75,
            "currency": "USD",
            "sort_order": 0
        }
    ],
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENS3OLqVQpFUTIUqyB7R0N5dP",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Milestone Payment

Pay a patient for a milestone visit. Generally, each milestone can only be paid once per patient. However, some studies may allow more than one, one a milestone-by-milestone basis.

Requires milestone_payment permission.

Request

{
    "action": "milestone_payment",
    "session_id": "2FENS2RY8gXMQ1WOzFOleU5dx2r",
    "payload": {
        "patient_uid": "2FENS3spiTCoFgFhYn5D81NRaue",
        "milestone_uid": "2FENS1SKTEPTOfendM7nZo6rs4A",
        "note": "test suite"
    }
}

Response

{
    "action": "milestone_payment",
    "payload": {
        "uid": "2FENS2qDwdu8msVBjEgzBqmva3w",
        "enrollment_uid": "2FENS1ShhuJlQAJdBvh9CtGYOrC",
        "payment_type": "milestone",
        "milestone_uid": "2FENS1SKTEPTOfendM7nZo6rs4A",
        "amount": 75,
        "currency": "USD",
        "note": "test suite",
        "status": "unclaimed",
        "created_by": "admin",
        "milestone": {
            "uid": "",
            "effective_date": "0001-01-01T00:00:00Z",
            "milestone": "",
            "amount": 0,
            "currency": "",
            "sort_order": 0
        }
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENS2dLiV85JAOVZfsetWwoCnU",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Get Patient Payments

Look up payments already made to a patient.

Requires view_payments permission.

Request

{
    "action": "get_patient_payments",
    "session_id": "2FENS2RY8gXMQ1WOzFOleU5dx2r",
    "payload": {
        "patient_uid": "2FENS3spiTCoFgFhYn5D81NRaue",
        "trial_uid": "2FENS1MTByHvF9dtEvZcSxdq5Fe"
    }
}

Response

{
    "action": "get_patient_payments",
    "payload": [
        {
            "uid": "2FENS2qDwdu8msVBjEgzBqmva3w",
            "enrollment_uid": "2FENS1ShhuJlQAJdBvh9CtGYOrC",
            "payment_type": "milestone",
            "milestone_uid": "2FENS1SKTEPTOfendM7nZo6rs4A",
            "amount": 75,
            "currency": "USD",
            "note": "",
            "status": "unclaimed",
            "created_by": "admin",
            "milestone": {
                "uid": "2FENS1SKTEPTOfendM7nZo6rs4A",
                "effective_date": "2022-09-24T21:01:19.633835Z",
                "milestone": "First Visit",
                "amount": 75,
                "currency": "USD",
                "sort_order": 0
            }
        }
    ],
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENS0uLvgvW7hblcEdGZirDQKG",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Manual Payment

Make a one-off payment that’s not associated with a trial milestone.

Manual payments generally require approval.

Requires manual_payment permission.

Request

{
    "action": "manual_payment",
    "session_id": "2FENS06IcAzNKbyrxVsj0PeHzLD",
    "payload": {
        "patient_uid": "2FENS3spVETybjLZeSoxDqyOc7F",
        "trial_uid": "2FENS3vTBo9NltOixeMxVONhK7p",
        "amount": 123,
        "currency": "USD",
        "category": "parking",
        "note": "test of manual"
    }
}

Response

{
    "action": "manual_payment",
    "payload": {
        "uid": "2FENS5GDnRaM3nIuoReQJmF1CLU",
        "enrollment_uid": "2FENS51geMLYXRWGSCcQPoHtaQD",
        "payment_type": "manual",
        "amount": 123,
        "currency": "USD",
        "note": "test of manual",
        "status": "unclaimed",
        "date": "2022-09-24",
        "created_by": "admin",
        "category": "parking",
        "milestone": {
            "uid": "",
            "effective_date": "0001-01-01T00:00:00Z",
            "milestone": "",
            "amount": 0,
            "currency": "",
            "sort_order": 0
        }
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENS0smDbc2W8csIcdHH23GSm1",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Approve Payment

Approve a pending payment so the electronic payment can be processed.

Requires the permission approve_payments.

Request

{
    "action": "approve_payment",
    "session_id": "2FENS06IcAzNKbyrxVsj0PeHzLD",
    "payload": {
        "payment_uid": "2FENS5GDnRaM3nIuoReQJmF1CLU"
    }
}

Response

{
    "action": "approve_payment",
    "payload": {
        "uid": "2FENS5GDnRaM3nIuoReQJmF1CLU",
        "enrollment_uid": "2FENS51geMLYXRWGSCcQPoHtaQD",
        "payment_type": "manual",
        "amount": 123,
        "currency": "USD",
        "note": "test of manual",
        "status": "approved",
        "date": "2022-09-24",
        "created_by": "admin",
        "category": "parking",
        "milestone": {
            "uid": "",
            "effective_date": "0001-01-01T00:00:00Z",
            "milestone": "",
            "amount": 0,
            "currency": "",
            "sort_order": 0
        }
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENS7nIBQC3PavENy7UqU0FXez",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Mileage Payment

A mileage payment is a reimbursement mileage traveled.

Requires permission mileage_payment.

Request

{
    "action": "mileage_payment",
    "session_id": "2FENSDrxd7sOymDBQyQAeCeaUHA",
    "payload": {
        "patient_uid": "2FENSD7U33ZfamMmtko2oGRtUD4",
        "trial_uid": "2FENSFUJGJFAADhuhnuoBUfWQME",
        "amount": 225,
        "currency": "USD",
        "note": "test of mileage"
    }
}

Response

{
    "action": "mileage_payment",
    "payload": {
        "uid": "2FENSFEy9O6S2zm9c2Izm1uPoGG",
        "enrollment_uid": "2FENS9k3Fskct0QgVX1tsRZBm2z",
        "payment_type": "mileage",
        "amount": 225,
        "currency": "USD",
        "note": "test of mileage",
        "status": "unclaimed",
        "created_by": "admin",
        "milestone": {
            "uid": "",
            "effective_date": "0001-01-01T00:00:00Z",
            "milestone": "",
            "amount": 0,
            "currency": "",
            "sort_order": 0
        }
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENSCNxv5QqpjYq6ltG23LDnCV",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Trial Payment Report

Retrieve all payments for a clinical trial.

Requires view_reports permission.

Request

{
    "action": "trial_payment_report",
    "session_id": "2FENSBzTr3P0rAzl5z8RopKiwaE",
    "payload": {
        "trial_uid": "2FENSDv4n23OkpRzMD2b2e3khw9",
        "format": "csv"
    }
}

Response

{
    "action": "trial_payment_report",
    "payload": "http://api:6666/reports/2FENSFaTMh3vj7AVnp8Ijb3MXNq",
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENSBIWg9gVXZ3Eb0yB2TPOneZ",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Funding Report

Retrieve the funding status of a contract.

Request

{
    "action": "funding_report",
    "session_id": "2FENSCsVUb8y6aLSm6SyKW21dkh",
    "payload": {
        "contract_uid": "2FENSDWdZpNmYbyb8lh8gmrZiAK",
        "format": "xlsx"
    }
}

Response

{
    "action": "funding_report",
    "payload": "http://api:6666/reports/2FENSHs7HkvIccWHeoW7w1RjQgR",
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENSH7UH9yssF2vITEbHyrWRGA",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Get User by Patient UID

Look up the user used by a patient to log in.

Request

{
    "action": "get_user_by_patient_uid",
    "session_id": "2FENSMc0lnrmncS1UeyaWjxMlvq",
    "payload": {
        "patient_uid": "2FENSHELWNafmYeVdNTnsSXUcAm"
    }
}

Response

{
    "action": "get_user_by_patient_uid",
    "payload": {
        "uid": "2FENSLrL4vfsv3z8fjz2y1Gj3mQ",
        "email": "dino.mcmillan@example.com",
        "first_name": "Dino",
        "last_name": "Mcmillan",
        "address": {},
        "phone": "(788) 000-7840",
        "email_verified": false,
        "sms_verified": false,
        "patient": {
            "address": {}
        },
        "caregiver": {
            "address": {},
            "patient": {
                "address": {}
            }
        }
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENSIZzTuVQq49LENSvyMsaLg2",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Get Unclaimed Payments

An API call made by a participant to view any unclaimed payments. They may then use the claim_payments API call to begin the payment transfer process.

Request

{
    "action": "get_unclaimed_payments",
    "session_id": "2FENSJlaGyIssduMXISRkur6wiz",
    "payload": {
        "patient_uid": "2FENSHELWNafmYeVdNTnsSXUcAm"
    }
}

Response

{
    "action": "get_unclaimed_payments",
    "payload": [
        {
            "uid": "2FENSL7lfkHKdY6YxpJUOZnDYuj",
            "enrollment_uid": "2FENSJEWMR2hMbiA3MEp46Sk7D5",
            "payment_type": "milestone",
            "milestone_uid": "2FENSKjyhNPx7rFhjBVaYJHcEzD",
            "amount": 75,
            "currency": "USD",
            "note": "",
            "status": "unclaimed",
            "created_by": "admin",
            "milestone": {
                "uid": "2FENSKjyhNPx7rFhjBVaYJHcEzD",
                "effective_date": "2022-09-24T21:01:21.398236Z",
                "milestone": "First Visit",
                "amount": 75,
                "currency": "USD",
                "sort_order": 0
            }
        }
    ],
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENSIZl6BMKEdTK7HPwjNThHSo",
    "roles": [
        "patient"
    ],
    "user_type": "external"
}

Claim Payments

The patient may claim all unclaimed patients, and this will initiate the transfer process.

Request

{
    "action": "claim_payments",
    "session_id": "2FENSJlaGyIssduMXISRkur6wiz",
    "payload": {
        "patient_uid": "2FENSHELWNafmYeVdNTnsSXUcAm"
    }
}

Response

{
    "action": "claim_payments",
    "status_code": 200,
    "message": "1 payments claimed, 0 failed",
    "request_id": "2FENSJtn7jtbc6KTcWUa5UuH3eN",
    "roles": [
        "patient"
    ],
    "user_type": "external"
}

Reimbursement Request

Request a reimbursement for an expense you have incurred that is related to the trial.

Request

{
    "action": "reimbursement_request",
    "session_id": "2FENSNPuE9QOKmECHJ7o0uHRam4",
    "payload": {
        "patient_uid": "2FENSGyQ8UZCTmnzAr5rOXYpkVm",
        "trial_uid": "2FENSG52mVP8GV7zKfllr6Q4Wmd",
        "amount": 53,
        "currency": "USD",
        "note": "meal reimbursement"
    }
}

Response

{
    "action": "reimbursement_request",
    "payload": {
        "uid": "2FENSLUvD8H2QNjJRNEfD3Et7gZ",
        "enrollment_uid": "2FENSKHwnS2VxwrOo7R8ul3GOTL",
        "payment_type": "reimbursement",
        "amount": 53,
        "currency": "USD",
        "note": "meal reimbursement",
        "status": "unapproved",
        "created_by": "admin",
        "milestone": {
            "uid": "",
            "effective_date": "0001-01-01T00:00:00Z",
            "milestone": "",
            "amount": 0,
            "currency": "",
            "sort_order": 0
        }
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENSMCaMbeUUgb42G7BgAkrZg2",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Get Categories

Get categories that are available for manual payments for this trial.

Request

{
    "action": "get_categories",
    "session_id": "2FENSUPzpjliLD83SaoopiigMHf",
    "payload": {
        "trial_uid": "2FENSOu1xwLn4OTSB86dzvXFTlR"
    }
}

Response

{
    "action": "get_categories",
    "payload": {
        "trial_uid": "",
        "categories": [
            "food",
            "lodging",
            "parking",
            "tolls"
        ]
    },
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENSUWBxlHW2HFaoo5bNKjfxI3",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Add Category

Add a category for manual payments to a trial.

If no categories are added, the default categories will be used for the trial. If any categories are added, the default categories will not be available.

Request

{
    "action": "add_category",
    "session_id": "2FENSUPzpjliLD83SaoopiigMHf",
    "payload": {
        "trial_uid": "2FENSOu1xwLn4OTSB86dzvXFTlR",
        "category": "applesauce"
    }
}

Response

{
    "action": "add_category",
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENSUehdByAzPjmW90bV5uWuCd",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Get Role Permissions

Retrieve the permissions associated with a role for a resource_uid.

This is an admin-only function.

Request

{
    "action": "get_role_permissions",
    "session_id": "2FENST0w6lf27Mnhv6yLkoklhYm",
    "payload": {
        "role_name": "Site Coordinator",
        "resource_uid": "2FENSRagvSO38CDRtPDunssGYfb"
    }
}

Response

{
    "action": "get_role_permissions",
    "payload": [],
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENSUKmwngOIvsGNVut87cVK2g",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Add Role Permissions

Add permissions to a role associated with a resource_uid.

This is an admin-only function.

Request

{
    "action": "add_role_permissions",
    "session_id": "2FENST0w6lf27Mnhv6yLkoklhYm",
    "payload": {
        "role_name": "monkey",
        "resource_uid": "2FENSRagvSO38CDRtPDunssGYfb",
        "permission_names": [
            "add_milestone"
        ]
    }
}

Response

{
    "action": "add_role_permissions",
    "status_code": 400,
    "message": "invalid role name",
    "request_id": "2FENSODTFbYEk6sAEUPGT3TqmLi",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Assign Role

Assign a role to a user for a resource (trial, site, client, etc.). This will give them all the permissions assigned to that role for that resource. It will also add the role name to the user’s profile.

Request

{
    "action": "assign_role",
    "session_id": "2FENSUQASglDStUk8TEuYyhZ77M",
    "payload": {
        "role_name": "Site Coordinator",
        "resource_uid": "2FENSQj2UwuDWWXRGfoJC1YD4An",
        "user_uid": "2FENSRj0NG1fkuWc5lR5KVE4kJH"
    }
}

Response

{
    "action": "assign_role",
    "status_code": 200,
    "message": "added 3 permissions; 0 errors",
    "request_id": "2FENSPWEdACFKONZRLzwkffrNYY",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Get Roles

Get all roles available in the system.

Request

{
    "action": "get_roles",
    "session_id": "2FENSRvP5otOpEssXfoCNU2ln0G"
}

Response

{
    "action": "get_roles",
    "payload": [
        "Admin",
        "Approver",
        "Client Report viewer",
        "Mural Admin",
        "Mural Support",
        "Site Admin",
        "Site Coordinator"
    ],
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENSRaDBq8G8pCNfOJd3A7H2KP",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Get Default Role Permissions

Get a list of permissions a role has by default. This template can be copied over to a specific resource, and modified (if necessary).

Request

{
    "action": "get_default_role_permissions",
    "session_id": "2FENSTwZapfKRBC7yGYl7BCqstw",
    "payload": {
        "role_name": "Site Coordinator"
    }
}

Response

{
    "action": "get_default_role_permissions",
    "payload": [
        "add_patient",
        "create_appointment",
        "enroll",
        "manual_payment",
        "milestone_payment",
        "set_enrollment_status",
        "set_payment_type",
        "travel_payment",
        "update_patient",
        "view_enrollments",
        "view_patients",
        "view_payment_schedule",
        "view_payments",
        "view_trials"
    ],
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENSRascJ0bgNrl24ZCk7NnZ4b",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Get User Sites

Get all sites associated with a user through their permissions.

Request

{
    "action": "get_user_sites",
    "session_id": "2FENSSipsFGuFXmx2xbfmQsEN6D",
    "payload": {
        "user_uid": "2FENSSwgiS7gBXgeagXYTzPSnMs"
    }
}

Response

{
    "action": "get_user_sites",
    "payload": [],
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENSOI7Tpku4JbcGvgCbgTdIMW",
    "roles": [
        "admin"
    ],
    "user_type": "external"
}

Get User Trials

Retrieve a list of all trials a user is associated with via their permissions.

Request

{
    "action": "get_user_trials",
    "payload": {
        "user_uid": "2FENSSwgiS7gBXgeagXYTzPSnMs"
    }
}

Response

{
    "action": "get_user_trials",
    "status_code": 401,
    "message": "you are not logged in",
    "request_id": "2FENSRvEsctCDHQCq73PoobBW7B",
    "roles": [],
    "user_type": "logged out"
}

Get Rateable Visits

Get a list of milestone payments for which a participant has not yet provided a rating.

Request

{
    "action": "get_rateable_visits",
    "session_id": "2FENSa2dfp7BoY3Mw6v7DHuT7Da"
}

Response

{
    "action": "get_rateable_visits",
    "payload": [
        {
            "uid": "2FENSQ4EAjOMcskgqB6ELrURts8",
            "enrollment_uid": "2FENSQxBQ10UygBRzJxW2LaqQzc",
            "payment_type": "milestone",
            "milestone_uid": "2FENSQHAAwHPZWTECqoyQbrCSlh",
            "amount": 75,
            "currency": "USD",
            "note": "",
            "status": "claimed",
            "created_by": "admin",
            "milestone": {
                "uid": "2FENSQHAAwHPZWTECqoyQbrCSlh",
                "effective_date": "2022-09-24T21:01:22.970341Z",
                "milestone": "First Visit",
                "amount": 75,
                "currency": "USD",
                "sort_order": 0
            }
        }
    ],
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENSX8COi96ptg9Z5t3k2hINDd",
    "roles": [
        "patient"
    ],
    "user_type": "external"
}

Rate Visit

Allow a participant to rate their experience for each milestone visit.

Request

{
    "action": "rate_visit",
    "session_id": "2FENSa2dfp7BoY3Mw6v7DHuT7Da",
    "payload": {
        "payment_uid": "2FENSQ4EAjOMcskgqB6ELrURts8",
        "rating": 9,
        "note": "Great visit!"
    }
}

Response

{
    "action": "rate_visit",
    "status_code": 200,
    "message": "OK",
    "request_id": "2FENScWBHgxAJpwpEG9uos5w1bH",
    "roles": [
        "patient"
    ],
    "user_type": "external"
}

Index