Skip to main content

APIs

This page provides information about the APIs in Komodo Care Connect that you can call and use.

The eRX API (PJN_ErxApi) is a RESTful web service for enrolling patients into care programs. For more information, reference Create a care plan from an eRX API call.

/services/apexrest/mvn/eRxApi

Methods

doPost()

/services/apexrest/mvn/eRxApi

This is the POST method that sends Komodo Care Connect the information to enroll a patient into a care program. A JSON payload must be passed with the following attributes to upsert records into Komodo Care Connect:

Table 146. JSON payload attributes

Key/Object

Data type

Required?

Description

vendorName

string

The name of the vendor. This must match the API name of an existing eRX Vendor (mvn__PJN_eRX_Vendor__mdt) metadata record.

programName

string

The name of the care program. This must match the API name of an existing Program (mvn__PJN_Program__mdt) metadata record.

enrollmentDate

string

The date that the patient is enrolled into the care program. This is used to generate a unique external ID for the Care Plan (Case) record. This must be in the yyyy-mm-dd format.

patient

object

The details about the patient. This is mapped to the Patient (PJN_Patient) record type of the Person Account (PersonAccount) object. For more information about this object in the JSON payload, reference Table 147, “JSON payload - Account and Person Account objects below. (The same keys and objects are used for all Person Account and Account records in the JSON payload, but not every key or object is used for every record type.)

physician

object

The details about the physician. This is mapped to the Physician (PJN_Physician) record type of the Person Account (PersonAccount) object. For more information about this object in the JSON payload, reference Table 147, “JSON payload - Account and Person Account objects below. (The same keys and objects are used for all Person Account and Account records in the JSON payload, but not every key or object is used for every record type.)

staff

object

The details about a staff member. This is mapped to the Staff (PJN_Staff) record type of the Person Account (PersonAccount) object. For more information about this object in the JSON payload, reference Table 147, “JSON payload - Account and Person Account objects below. (The same keys and objects are used for all Person Account and Account records in the JSON payload, but not every key or object is used for every record type.)

caregiver

object

The details about a caregiver. This is mapped to the Caregiver (PJN_Caregiver) record type of the Person Account (PersonAccount) object. For more information about this object in the JSON payload, reference Table 147, “JSON payload - Account and Person Account objects below. (The same keys and objects are used for all Person Account and Account records in the JSON payload, but not every key or object is used for every record type.)

pharmacy

object

The details about a pharmacy. This is mapped to the Pharmacy (PJN_Pharmacy) record type of the Account object. For more information about this object in the JSON payload, reference Table 147, “JSON payload - Account and Person Account objects below. (The same keys and objects are used for all Person Account and Account records in the JSON payload, but not every key or object is used for every record type.)

organization

object

The details about an organization. This is mapped to the Organization (PJN_Organization) record type of the Account object. For more information about this object in the JSON payload, reference Table 147, “JSON payload - Account and Person Account objects below. (The same keys and objects are used for all Person Account and Account records in the JSON payload, but not every key or object is used for every record type.)

consents

object

The details about one or more consents. This is mapped to the Consent (mvn__PJN_Contact_Point_Type_Consent__c) object. For more information about this object in the JSON payload, reference Table 149, “JSON payload - Consent object below.

insurances

object

The details about one or more insurance plans. This is mapped to the Member Plan (mvn__PJN_Member_Plan__c) object. For more information about this object in the JSON payload, reference Table 150, “JSON payload - Member Plan object below.

prescriptions

object

The details about one or more prescriptions. This is mapped to the Prescription (mvn__PJN_Prescription__c) object. For more information about this object in the JSON payload, reference Table 151, “JSON payload - Prescription object below.

Note

The Pharmacy (mvn__PJN_Pharmacy__c) field on the Prescription record will be automatically populated using the External ID (mvn__PJN_External_Id__c) on the Pharmacy (Account) record upserted from the same JSON payload.

additionalObjects

object

Additional details to be mapped to any object defined on the eRX Object (mvn__PJN_eRX_Object__mdt) and eRX Field (mvn__PJN_eRX_Field__mdt) custom metadata types. For more information on how to configure additional keys for the JSON payload, reference Create a care plan from an eRX API call.



Table 147. JSON payload - Account and Person Account objects

Key/Object

Data type

Length

Required?

Record type(s)

Mapped field

id

string

50

All Account and Person Account record types

Source System ID (HealthCloudGA__SourceSystemId__c)

name

string 

50

 

Pharmacy (PJN_Pharmacy)

Organization (PJN_Organization)

Name (Name)

firstName

string

50

 

All Person Account record types

First Name (FirstName)

middleName

string

50

 

All Person Account record types

Middle Name (MiddleName)

lastName

string

50

All Person Account record types

Last Name (LastName)

gender

string

1

 

All Person Account record types

Gender (HealthCloudGA__Gender__pc)

dateOfBirth

string (in yyyy-mm-dd format)

10

 

All Person Account record types

Birthdate (PersonBirthdate)

specialty

string

50

 

Physician (PJN_Physician)

Specialty (mvn__PJN_Specialty__c)

suffix

string

5

 

Physician (PJN_Physician)

Suffix (Suffix)

npi

string

50

 

Physician (PJN_Physician)

Pharmacy (PJN_Pharmacy)

Organization (PJN_Organization)

NPI (mvn__PJN_NPI__c)

addresses

object

N/A

All Account and Person Account record types

N/A. The related Contact Information record(s) will be created. For more information about this object in the JSON payload, reference Table 148, “JSON payload - Contact Information object below. (Similar keys and objects are used for all Contact Information records in the JSON payload, but not every key and object are required or used for every record type.)

phones

object

N/A

All Account and Person Account record types

N/A. The related Contact Information record(s) will be created. For more information about this object in the JSON payload, reference Table 148, “JSON payload - Contact Information object below. (Similar keys and objects are used for all Contact Information records in the JSON payload, but not every key and object are required or used for every record type.)

emails

object

N/A

All Account and Person Account record types

N/A. The related Contact Information record(s) will be created. For more information about this object in the JSON payload, reference Table 148, “JSON payload - Contact Information object below. (Similar keys and objects are used for all Contact Information records in the JSON payload, but not every key and object are required or used for every record type.)

faxes

object

N/A

All Account and Person Account record types

N/A. The related Contact Information record(s) will be created. For more information about this object in the JSON payload, reference Table 148, “JSON payload - Contact Information object below. (Similar keys and objects are used for all Contact Information records in the JSON payload, but not every key and object are required or used for every record type.)

additionalFields

object

N/A

 

All Account and Person Account record types

N/A. This depends on what objects and fields are defined on the eRX Object (mvn__PJN_eRX_Object__mdt) and eRX Field (mvn__PJN_eRX_Field__mdt) custom metadata types. For more information on how to configure additional fields to be mapped with the eRX API, reference Create a care plan from an eRX API call.



Table 148. JSON payload - Contact Information object

Key/Object

Data type

Length

Required?

Record type(s)

Mapped field

id

string

50

All Contact Information record types

External ID (mvn__PJN_External_ID__c)

addressLine1

string

50

Address (PJN_Address)

Address Line 1 (mvn__PJN_Address_Line_1__c)

addressLine2

string

50

 

Address (PJN_Address)

Address Line 2 (mvn__PJN_Address_Line_2__c)

city

string

10

Address (PJN_Address)

City (mvn__PJN_City__c)

state

string

2

Address (PJN_Address)

State (mvn__PJN_State__c)

postalCode

string

10

Address (PJN_Address)

Postal Code (mvn__PJN_Postal_Code__c)

country

string

2

Address (PJN_Address)

Country (mvn__PJN_Country__c)

countryCode

string

5

Phone (PJN_Phone)

Fax (PJN_Fax)

Phone (mvn__PJN_Phone__c)

Fax (mvn__PJN_Fax__c)

phoneNumber

string

12

Phone (PJN_Phone)

Phone (mvn__PJN_Phone__c)

Note

The final value that is stamped on the Phone field is the concatenation of countryCode and phoneNumber.

faxNumber

string

12

Fax (PJN_Fax)

Fax (mvn__PJN_Fax__c)

Note

The final value that is stamped on the Phone field is the concatenation of countryCode and faxNumber.

ext

string

5

Phone (PJN_Phone)

Fax (PJN_Fax)

Extension Number (mvn__PJN_Extension_Number__c)

emailAddress

string

50

Email (PJN_Email)

Email (mvn__PJN_Email__c)

type

string

7

All Contact Information record types

Type (mvn__PJN_Type__c)

primary

boolean

N/A

 

All Contact Information record types

Set as Primary (mvn__PJN_Set_as_Primary__c)

additionalFields

object

N/A

 

All Contact Information record types

N/A. This depends on what objects and fields are defined on the eRX Object (mvn__PJN_eRX_Object__mdt) and eRX Field (mvn__PJN_eRX_Field__mdt) custom metadata types. For more information on how to configure additional fields to be mapped with the eRX API, reference Create a care plan from an eRX API call.



Table 149. JSON payload - Consent object

Key/Object

Data type

Length

Required?

Mapped field

id

string

50

External Id (mvn__PJN_External_Id__c)

name

string

50

Data Use Purpose (mvn__PJN_Data_Use_Purpose__c)

Note

The string in the JSON payload must contain the External Id (mvn__PJN_External_Id__c) of an existing Data Use Purpose (DataUsePurpose) record.

effectiveDate

string (in yyyy-mm-dd format)

10

Effective From (mvn__PJN_Effective_From__c)

expirationDate

string (in yyyy-mm-dd format)

10

Effective To (mvn__PJN_Effective_To__c)

additionalFields

object

N/A

N/A. This depends on what objects and fields are defined on the eRX Object (mvn__PJN_eRX_Object__mdt) and eRX Field (mvn__PJN_eRX_Field__mdt) custom metadata types. For more information on how to configure additional fields to be mapped with the eRX API, reference Create a care plan from an eRX API call.



Table 150. JSON payload - Member Plan object

Key/Object

Data type

Length

Required?

Mapped field

id

string

50

External Id (mvn__PJN_External_Id__c)

relationshipToMember

string

255

Relationship to Cardholder (mvn__PJN_Relationship_to_Cardholder__c)

effectiveDate

string (in yyyy-mm-dd format)

10

Effective Date (mvn__PJN_Effective_Date__c)

expirationDate

string (in yyyy-mm-dd format)

10

Expiration Date (mvn__PJN_Expiration_Date__c)

companyName

string

255

Payer Name (mvn__PJN_Payer_Name_Text__c)

groupName

string

64

Group (mvn__PJN_Group__c)

memberNumber

string

64

Insurance ID (mvn__PJN_Insurance_ID__c)

policyHolderFirstName

string

Reference note.

Cardholder Name (mvn__PJN_Cardholder_Name__c)

Note

The final value that is stamped on the Cardholder Name field is the concatenation of policyHolderFirstName and policyHolderLastName with a space in between. Since the maximum length of the Cardholder Name value is 50, the maximum length of policyHolderFirstName and policyHolderLastName together is 49.

policyHolderLastName

string

Reference note.

additionalFields

object

N/A

N/A. This depends on what objects and fields are defined on the eRX Object (mvn__PJN_eRX_Object__mdt) and eRX Field (mvn__PJN_eRX_Field__mdt) custom metadata types. For more information on how to configure additional fields to be mapped with the eRX API, reference Create a care plan from an eRX API call.



Table 151. JSON payload - Prescription object

Key/Object

Data type

Length

Required?

Mapped field

id

string

50

External Id (mvn__PJN_External_Id__c)

drugNdc

string

50

Product (mvn__PJN_Product__c)

Note

The string in the JSON payload must contain the ID of an existing Care Program Product (CareProgramProduct) record.

quantity

string

50

Quantity (mvn__PJN_Quantity__c)

numberOfRefills

integer

5

Number of Refills (mvn__PJN_Number_of_Refills__c)

additionalFields

object

N/A

N/A. This depends on what objects and fields are defined on the eRX Object (mvn__PJN_eRX_Object__mdt) and eRX Field (mvn__PJN_eRX_Field__mdt) custom metadata types. For more information on how to configure additional fields to be mapped with the eRX API, reference Create a care plan from an eRX API call.



This is a sample JSON payload that can be passed in as the request body for the POST method of the eRX API. It includes additional object and field keys that have been configured in the examples in Create a care plan from an eRX API call.

{
    "vendorName": "MVN_KTX_VENDOR",
    "programName": "MVN_KTX",
    "enrollmentDate": "2021-04-29",
    "patient": {
        "id": "b479cd2d-45e2-416a-87a3-80612823eccf",
        "firstName": "John",
        "middleName": "D",
        "lastName": "Doe",
        "gender": "Male",
        "dateOfBirth": "1984-01-01",
        "addresses": [
            {
                "id": "f4ba3293-d975-40cb-9811-7e90b4abd369",
                "addressLine1": "1234 Street Road",
                "addressLine2": "Apt 12",
                "city": "Orlando",
                "state": "FL",
                "postalCode": "32818",
                "country": "United States",
                "type": "Mailing",
                "primary": true,
                "additionalFields": {
                    "closestCity": "Orlando"
                }
            }
        ],
        "phones": [
            {
                "id": "f35652e8-b6f9-44f0-a89f-18b8b28d951c",
                "phoneNumber": "555-123-4563",
                "ext": "x123",
                "countryCode": "+1",
                "type": "Mobile",
                "primary": true
            }
        ],
        "faxes": [
            {
                "id": "8498f034-afb9-4d3b-bd69-b77e86d855b7",
                "faxNumber": "555-323-4567",
                "countryCode": "+1",
                "type": "Home",
                "primary": true
            }
        ],
        "emails": [
            {
                "id": "f6d1b169-3714-4531-a9b6-465de46d5efa",
                "emailAddress": "jdoe@gmail.com",
                "type": "Personal",
                "primary": true
            }
        ]
    },
    "physician": {
        "id": "d69b63de-a67f-4133c-94e6-d6c3a3563d90",
        "firstName": "Will",
        "middleName": "",
        "lastName": "GOMEZ",
        "specialty": "",
        "suffix": "MD",
        "npi": "1003000100",
        "addresses": [
            {
                "id": "a21e8e0d-d871-4165-9b18-c4acfaff26b4",
                "addressLine1": "1234 Street Road",
                "addressLine2": "Apt 12",
                "city": "Orlando",
                "state": "FL",
                "postalCode": "32818",
                "country": "United States",
                "type": "Mailing",
                "primary": true
            }
        ],
        "phones": [
            {
                "id": "fbf6a3c8-4fd8-4d72-b579-efd44eb61c19",
                "phoneNumber": "555-123-d4567",
                "ext": "x123",
                "countryCode": "+1",
                "type": "Mobile",
                "primary": true
            }
        ],
        "faxes": [
            {
                "id": "8498f034-afb9-4d3b-bd69-b77e86d855b8",
                "faxNumber": "555-323-4568",
                "countryCode": "+1",
                "type": "Work",
                "primary": true
            }
        ],
        "emails": [
            {
                "id": "8e551c22-9037-453c-a7f2-2619a4d5a3a3",
                "emailAddress": "jdoe@gmail.com",
                "type": "Work",
                "primary": true
            }
        ]
    },
    "caregiver": {
        "id": "035fe461-121d-4cde-a728-b7fa9a024045",
        "firstName": "Jane",
        "middleName": "",
        "lastName": "Doe",
        "addresses": [
            {
                "id": "bdc4d596-10dc-47e9-bed5-ade1650d0b34",
                "addressLine1": "1234 Street Road",
                "addressLine2": "Apt 12",
                "city": "Orlando",
                "state": "FL",
                "postalCode": "32818",
                "country": "United States",
                "type": "Mailing",
                "primary": true
            }
        ],
        "phones": [
            {
                "id": "ae48a02d-75ca-4e89-b53d-2f662ba66cd0",
                "phoneNumber": "555-123-d4567",
                "ext": "x123",
                "countryCode": "+1",
                "type": "Mobile",
                "primary": true
            }
        ],
        "faxes": [
            {
                "id": "8498f034-afb9-4d3b-bd69-b77e86d85538",
                "faxNumber": "555-323-4569",
                "countryCode": "+1",
                "type": "Work",
                "primary": true
            }
        ],
        "emails": [
            {
                "id": "e1feaa53-ecd1-410f-b0e5-3b1db663253f",
                "emailAddress": "jdoe@gmail.com",
                "type": "Work",
                "primary": true
            }
        ]
    },
    "staff": {
        "id": "55b41576-f28b-48b8-b2e7-5b3604752f36",
        "firstName": "George",
        "middleName": "",
        "lastName": "Thomas",
        "addresses": [
            {
                "id": "6dea4c27-5e2c-4b98-b904-260713dd814d",
                "addressLine1": "1234 Street Road",
                "addressLine2": "Apt 12",
                "city": "Orlando",
                "state": "FL",
                "postalCode": "32818",
                "country": "United States",
                "type": "Mailing",
                "primary": true
            }
        ],
        "phones": [
            {
                "id": "f4e8e7b0-6bd7-466b-a240-dbc01de38b40",
                "phoneNumber": "555-123-d4567",
                "ext": "x123",
                "countryCode": "+1",    
                "type": "Mobile",
                "primary": true
            }
        ],
        "faxes": [
            {
                "id": "8498f034-afb9-4d3b-bd69-b77e86d85539",
                "faxNumber": "555-323-4560",
                "countryCode": "+1",
                "type": "Work",
                "primary": true
            }
        ],
        "emails": [
            {
                "id": "fd50064a-db1f-4689-b9ff-c08689b37ad9",
                "emailAddress": "jdoe@gmail.com",
                "type": "Work",
                "primary": true
            }
        ]
    },
    "pharmacy": {
        "id": "796cg7346-9ba7-4c20-bbdf-4d814cbea2c6",
        "name": "WALGREENS DRUG STORE #04589",
        "npi": "1720093031",
        "addresses": [
            {
                "id": "c343dfb3-91f8-4051-a441-6c16088ede45",
                "addressLine1": "1234 Street Road",
                "addressLine2": "Apt 12",
                "city": "Orlando",
                "state": "FL",
                "postalCode": "32818",
                "country": "United States",
                "type": "Mailing",
                "primary": true
            }
        ],
        "phones": [
            {
                "id": "40dc7f4c-4ee9-440a-9635-fc1efaa54f0d",
                "phoneNumber": "555-123-d4567",
                "ext": "x123",
                "countryCode": "+1",    
                "type": "Mobile",
                "primary": true
            }
        ],
        "faxes": [
            {
                "id": "8498f034-afb9-4d3b-bd69-b77e86d85889",
                "faxNumber": "555-323-4510",
                "countryCode": "+1",
                "type": "Work",
                "primary": true
            }
        ],
        "emails": [
            {
                "id": "26c95c08-5416-4902-b264-7e3ca1b1039a",
                "emailAddress": "wal@greens.com",
                "type": "Work",
                "primary": true
            }
        ]
    },
    "organization": {
        "id": "797cg6346-9ba7-4c20-bbdf-4d814cbea2c6",
        "name": "Mayo Clinic",
        "npi": "1720093091",
        "addresses": [
            {
                "id": "7e1a52b7-dddd-432c-9f10-698d8d4d1814",
                "addressLine1": "1234 Street Road",
                "addressLine2": "Apt 12",
                "city": "Orlando",
                "state": "FL",
                "postalCode": "32818",
                "country": "United States",
                "type": "Mailing",
                "primary": true
            }
        ],
        "phones": [
            {
                "id": "8b067d9d-65ca-46ba-9061-d2c1183694cf",
                "phoneNumber": "555-123-d4567",
                "ext": "x123",
                "countryCode": "+1",
                "type": "Mobile",
                "primary": true
            }
        ],
        "faxes": [
            {
                "id": "8498f034-afb9-4d3b-bd69-b77e86d85389",
                "faxNumber": "555-323-4520",
                "countryCode": "+1",
                "type": "Work",
                "primary": true
            }
        ],
        "emails": [
            {
                "id": "1dfd2b90-0f40-4c0a-be14-4a7fa783327a",
                "emailAddress": "mayo@clinic.com",
                "type": "Work",
                "primary": true
            }
        ]
    },
    "consents": [
        {
            "id": "7e5d030f-9479-4519-9bb7-468308603072",
            "name": "MVN_KTX_HIPAA",
            "effectiveDate": "2021-04-29",
            "expirationDate": "2022-04-29"
        }
    ],
    "insurances": [
        {
            "id": "42b44f52e-7f6e-42be-930d-10c1215e9d8",
            "relationshipToMember": "Self",
            "effectiveDate": "2020-01-01",
            "expirationDate": "2022-01-01",
            "companyName": "AETNA",
            "groupNumber": "123456",
            "memberNumber": "ABC12345678",
            "policyHolderFirstName": "JOHN",
            "policyHolderLastName": "DOE"
        }
    ],
    "prescriptions": [
        {
            "id": "7e5d030f-9479-4519-9bb7-468308603072",
            "drugNdc": "0123456789",
            "quantity": 3,
            "numberOfRefills": 2
        }
    ],
    "additionalObjects": [
        {
            "objectName": "mvn__PJN_Assistance_Program__c",
            "records": [
                {
                    "recordType": "PJN_Patient_Assistance_Program",
                    "additionalFields": {
                        "householdIncome": 75000,
                        "householdSize": 3
                    }
                }
            ]
        }
    ]
}

Status code

Description

200

The API call was a success, and the information submitted will be updated on the respective record(s).

400

The API call failed because the request body is invalid or missing.

500

The API call failed because there is a server side error.

The Missing Information Request API (PJN_MissingInformationRequestApi) is a RESTful web service for requesting and submitting information that is missing. Each API call is tracked in a Request History (mvn__PJN_Request_History__c) record for the given Data Request (mvn__PJN_Data_Request__c) record. For more information, reference Request for missing information.

/services/apexrest/mvn/missingInformationRequest/{UUID}

Methods

doGet()

/services/apexrest/mvn/missingInformationRequest/{UUID}

This is the GET method that returns a list of fields whose missing information are requested for. The details of the request are retrieved from a given Data Request (mvn__PJN_Data_Request__c) record.

Parameter

Type

Description

UUID

String

The UUID (mvn__PJN_UUID__c) value on the Data Request (mvn__PJN_Data_Request__c) record that contains the details of the request for information that is missing.

{
    "uuid": "ced654cd-6af2-4577-bdd4-b3f454819998",
    "fields": [
        {
            "uuid": "717abada-9b65-49aa-bc37-ffe164088005",
            "type": "STRING",
            "scale": null,
            "length": null,
            "label": "Contact Information: Address Line 2"
        },
        {
            "uuid": "3092db90-0616-489e-ad81-3155b386be11",
            "type": "DATE",
            "scale": null,
            "length": null,
            "label": "Patient: Date of Birth"
        }
    ],
    "expirationDate": "2024-11-01",
    "drugProgram": "Kalytex"
}

Status code

Description

200

The API call was a success, and you will receive a JSON object with the details of the missing information request.

400

The API call failed because the UUID is either invalid or missing.

403

The API call failed because the user calling the API does not have access to an object or field.

404

The API call failed because the request for missing information could not be found. This could be because the Care Plan record, the Care Program record, the Data Request record, the Missing Information Group metadata record, and/or the patient's Account record is missing.

409

The API call failed because the request for missing information is no longer active. This could be because the Status (mvn__PJN_Status__c) field on the Data Request record is either Closed or Expired.

500

The API call failed because there is a server side error.

doPost()

/services/apexrest/mvn/missingInformationRequest/{UUID}

This is the POST method that submits information that was missing and has been requested for.

Parameter

Type

Description

UUID

String

The UUID (mvn__PJN_UUID__c) value on the Data Request (mvn__PJN_Data_Request__c) record that contains the details of the request for information that is missing.

[
    {
        "uuid": "717abada-9b65-49aa-bc37-ffe164088005",
        "type": "STRING",
        "scale": null,
        "length": null,
        "label": "Contact Information: Address Line 2",
        "value": "Apt #5B"
    },
    {
        "uuid": "3092db90-0616-489e-ad81-3155b386be11",
        "type": "DATE",
        "scale": null,
        "length": null,
        "label": "Patient: Date of Birth",
        "value": "1991-05-07"
    }
]

Status code

Description

200

The API call was a success, and the information submitted will be updated on the respective record(s).

400

The API call failed because either the UUID or the request body is invalid or missing.

403

The API call failed because the user calling the API does not have access to an object or field.

404

The API call failed because the request for missing information could not be found. This could be because the Care Plan record, the Care Program record, the Data Request record, the Missing Information Group metadata record, and/or the patient's Account record is missing.

409

The API call failed because the request for missing information is no longer active. This could be because the Status (mvn__PJN_Status__c) field on the Data Request record is either Closed or Expired.

412

The API call failed because the information submitted does not fulfill the field(s) whose information is requested for.

500

The API call failed because there is a server side error.