Introduction

Welcome to the PMP Gateway API documentation. This API reference provides information on available endpoints and how to interact with them.

Using the PMP Gateway API, you can integrate patient prescription history data into your applications.

This API is RESTful and uses XML formatted requests and responses.

NOTE: The XML format requires that certain characters be encoded. These include ampersands (&), greater than and less than symbols (< >), quotation marks (") and apostrophes (').

Example code is provided for each API request. To get started, you can make requests against the testing environment using the code examples and the XML request data they reference.

Overview

When successful, your interactions with Gateway should follow this sequence of events:

  1. POST a Patient Request
  2. Receive a Patient Response containing a Report Request URL
  3. POST a Report Request to the Report Request URL
  4. Receive one of the following
    • the report content as html
    • a Report Response with a URL from which the report can be retrieved

The figure on the right illustrates this sequence of events. It also shows Gateway's various response types.

Please consult the schema for technical details: gateway_v5_schema.xsd

Communication diagram

PMP Network

PMP Gateway gets prescription data from a distributed network of state PMP systems. This section explains the architecture of the PMP network and how PMP Gateway fits into it.

State PMP Systems store prescription data for patients and allow authorized users to request or commit prescription data.

PMP Interconnect facilitates communications between state PMP systems. One role of PMP Interconnect is to manage permissions for how state PMP systems communicate with each other.

PMP Gateway connects to PMP Interconnect, providing an interface for healthcare providers to query patient prescription data.

Consequences of Distributed Architecture

The distributed architecture of the PMP system impacts how PMP Gateway functions. Some of the consequences:

  • Prescription data requests can only be as fast as the slowest PMP being queried. Consequently, the average response time is 7 seconds.
  • Errors may occur at any point in the network and cause patient requests to fail or return incomplete data. If an error occurs, the patient response will include a description of the error and where it occured.
PMP Diagram

Authentication

All requests must be made over HTTPS. Calls made over plain HTTP will fail.

This API uses basic HTTP authentication, which means you must provide a username and password with every API request. Each username is linked to a Licensee account and there may be multiple API users per Licensee.

Based on the user making the request and the destination PMP systems requested, PMP Gateway checks that:

  1. The Licensee is allowed to make a request against the destination PMP.
  2. The Health Care Provider Role specified in the request is allowed to make a request against the destination PMP.

If either fail for a PMP, the request for that specific PMP is not forwarded on to PMP InterConnect.

API Endpoints

Two API endpoints are available: testing and production.

The testing environment is populated with fake data and contains no real-world patient data. All testing and development should be done using this testing environment.

The production environment contains real HIPAA protected patient data that must be handled properly.

Testing API Endpoint

https://gateway-prep.pmp.appriss.com

Production API Endpoint

https://pmpgateway.net

Errors

PMP Gateway uses conventional HTTP response codes to indicate the success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that resulted from the provided information (e.g. a required parameter was missing) and codes in the 5xx range indicate an error with PMP Gateway.

HTTP Status Codes

200 OK Everything worked as expected.
400 Bad Request The XML document contained errors. This can be due to a missing required element or by not encoding characters in data elements.

401 Unauthorized Invalid login credentials.
410 Gone The resource has expired. This can be caused by sending a report request more than 24 hours after a patient request.
500 Internal Server Error Something went wrong. The response body will be a Patient Response with an Error section.
504 Gateway Timeout The report is not yet generated. Try again in a few minutes.

Patient Request

The Patient Request initiates a search for a patient's prescription data and results in a Patient Response.

The strcuture and contents of a Patient Request are dictated by the Gateway v5 schema. Please refer to the schema for detailed annotations on each element.

The Patient Request has many optional data elements. Additionally, some elements are conditional, meaning your request must include at least one element out of a set of possible elements.

The example request on the right includes all required elements and most of the optional elements. For the conditional elements, this example includes all possible options. There are notes where conditional elements are present.

<MedicalRecordID> - Required for licensees configured to use a Medical Record ID for the report URL. Otherwise optional. If used, it must be unique for each licensee. Otherwise there is the possibility of returning the wrong information for a patient and violating PHI.

It is also used for accounts configured to recieve NARxCHECK reports. If you provide the same Medical Record ID for the same patient in each Patient Request, the returned NARxCHECK report will include historical NARxCHECK Score information for the patient.

<RequestDestinations> - Optional. If omitted, the request will be made against the PMP systems configured for your Licensee account. If included, the listed destinations override your account configuration and requests will be sent to the PMP(s) listed under this element. Your Licensee permissions will still restrict which PMPs are accessible. Note: When several state PMPs are needed to gather information for a request, calls to these PMPs are made in parallel. The time needed to generate a response does not depend on the number of PMPs called.

<LicenseeRequestID> - Optional. Allows you to pass your own custom request ID, which will be returned in the Patient Response.

Note: Some optional elements have been omitted because they are not useful for the vast majority of users. For more information on these rarely used elements, consult the Gateway v5 schema.

Definition

POST https://gateway-prep.pmp.appriss.com/v5/patient

Example Request

curl https://gateway-prep.pmp.appriss.com/v5/patient \
  -u username:password \
  -H "Content-Type: application/xml" \
  -H "Accept: application/xml" \
  -d @patient_request.xml

Example Request Data

patient_request.xml

download
<?xml version="1.0" encoding="UTF-8"?>
<PatientRequest xmlns="http://xml.appriss.com/gateway/v5">
  <Requester>
    <LicenseeRequestId>identifier</LicenseeRequestId><!-- Optional. If Provided it will be echoed in the Patient Response. -->
    <SenderSoftware>
      <Developer>Software Inc.</Developer>
      <Product>Product Name</Product>
      <Version>Version Info</Version>
    </SenderSoftware>
    <RequestDestinations><!-- Optional. If ommitted, the request will be sent to the default PMPs that are configured for the Licensee. -->
      <Pmp>KS</Pmp>
    </RequestDestinations>
    <Provider>
      <Role>Physician</Role>
      <FirstName>Jon</FirstName>
      <LastName>Doe</LastName>
      <!-- At least one identifier is required: DEANumber, NPINumber, or ProfessionalLicenseNumber. -->
      <DEANumber>AB1234579</DEANumber>
      <NPINumber>1212345671</NPINumber>
      <ProfessionalLicenseNumber>
        <Type>String</Type>
        <Value>A1231xbzy-bx</Value>
        <StateCode>KY</StateCode>
      </ProfessionalLicenseNumber>
    </Provider>
    <Location>
      <Name>Store #123</Name>
      <!-- At least one identifier is required: DEANumber, NPINumber, or NCPDPNumber. -->
      <DEANumber>AB1234579</DEANumber>
      <NPINumber>1234567890</NPINumber>
      <NCPDPNumber>1234567</NCPDPNumber>
      <Address>
        <Street>Street 1</Street>
        <Street>Street 2</Street>
        <City>City</City>
        <StateCode>KS</StateCode>
        <ZipCode>40242</ZipCode>
        <ZipPlusFour>4242</ZipPlusFour>
      </Address>
    </Location>
  </Requester>
  <PrescriptionRequest>
    <Patient>
      <Name>
        <First>Bob</First>
        <Middle>Dylan</Middle><!-- Optional -->
        <Last>Testpatient</Last>
      </Name>
      <Birthdate>1900-01-01</Birthdate>
      <SexCode>M</SexCode>
      <Address>
        <Street>123 Main St</Street>
        <Street>Apt B</Street>
        <City>Wichita</City>
        <StateCode>KS</StateCode>
        <ZipCode>67203</ZipCode>
        <ZipPlusFour>4321</ZipPlusFour>
      </Address>
      <Phone>1234567890</Phone>
      <SSN>123-45-6789</SSN>
      <DriversLicenseIdentifier>
        <Value>S01-45-6789</Value>
        <StateCode>KS</StateCode>
      </DriversLicenseIdentifier>
      <PharmacyBenefitsMemberID>String</PharmacyBenefitsMemberID>
      <MedicalRecordID>XX-1234-AnyString</MedicalRecordID><!-- Optional. If you want historical scores in NARxCHECK reports then it is required. -->
    </Patient>
 </PrescriptionRequest>
</PatientRequest>

Example Response

<?xml version="1.0" encoding="UTF-8"?>
<PatientResponse xmlns="http://xml.appriss.com/gateway/v5">
  <RequestId>227</RequestId>
  <LicenseeRequestId>identifier</LicenseeRequestId>
  <Report>
    <ResponseDestinations>
      <Pmp>KS</Pmp>
    </ResponseDestinations>
    <NarxCheckScore>
      <Narcotics>170</Narcotics>
      <Stimulants>000</Stimulants>
      <Sedatives>120</Sedatives>
    </NarxCheckScore>
    <ReportRequestURLs>
      <ViewableReport Content-Type="text/html">https://gateway-prep.pmp.appriss.com/v5/report/141</ViewableReport>
    </ReportRequestURLs>
  </Report>
  <Disclaimer>...</Disclaimer>
</PatientResponse>

Minimal Example

The Patient Request has many optional data elements. Additionally, some elements are conditional, meaning that your request must include at least one element out of a set of possible elements.

This example is the most minimalistic request possible. It includes all required elements and the conditional elements which are most commonly used. Providing less information will result in XML validation errors.

Definition

POST https://gateway-prep.pmp.appriss.com/v5/patient

Example Request

curl https://gateway-prep.pmp.appriss.com/v5/patient \
  -u username:password \
  -H "Content-Type: application/xml" \
  -H "Accept: application/xml" \
  -d @patient_request__minimal.xml

Example Request Data

patient_request__minimal.xml

download
<?xml version="1.0" encoding="UTF-8"?>
<PatientRequest xmlns="http://xml.appriss.com/gateway/v5">
  <Requester>
    <Provider>
      <Role>Physician</Role>
      <FirstName>Jon</FirstName>
      <LastName>Doe</LastName>
      <DEANumber>AB1234579</DEANumber>
    </Provider>
    <Location>
      <Name>Store #123</Name>
      <DEANumber>AB1234579</DEANumber>
      <Address>
        <StateCode>KS</StateCode>
      </Address>
    </Location>
  </Requester>
  <PrescriptionRequest>
    <Patient>
      <Name>
        <First>Bob</First>
        <Last>Testpatient</Last>
      </Name>
      <Birthdate>1900-01-01</Birthdate>
      <!-- ZipCode or Phone is required. -->
      <Address>
        <ZipCode>67203</ZipCode>
      </Address>
      <Phone>1234567890</Phone>
    </Patient>
 </PrescriptionRequest>
</PatientRequest>

Example Response

<?xml version="1.0" encoding="UTF-8"?>
<PatientResponse xmlns="http://xml.appriss.com/gateway/v5">
  <RequestId>232</RequestId>
  <Report>
    <ResponseDestinations>
      <Pmp>KS</Pmp>
    </ResponseDestinations>
    <NarxCheckScore>
      <Narcotics>170</Narcotics>
      <Stimulants>000</Stimulants>
      <Sedatives>120</Sedatives>
    </NarxCheckScore>
    <ReportRequestURLs>
      <ViewableReport Content-Type="text/html">https://gateway-prep.pmp.appriss.com/v5/report/144</ViewableReport>
    </ReportRequestURLs>
  </Report>
  <Disclaimer>...</Disclaimer>
</PatientResponse>

Patient Response

A Patient Response contains the results of the searches made on the PMP systems. If any of the PMP searches are successful, the Patient Response will include a link to a prescription report. The Patient Response will also sometimes include additional information about the results of the search. For details, check out the Gateway v5 schema.

Because of the distributed nature of the PMP network, there are many factors which impact a Patient Response. This section explains some of the common responses and what they mean.

<Report>. Typically included in the Patient Response and summarizes any successful searches. <Response> nodes may also display based upon the type of unsuccessful response from the corresponding PMP.

<NarxCheckScore>. This element will be included in the response if the Licensee is configured to receive NARxCHECK reports rather than Prescription History reports.

Example Patient Response

<?xml version="1.0" encoding="UTF-8"?>
<PatientResponse xmlns="http://xml.appriss.com/gateway/v5">
  <RequestId>227</RequestId>
  <LicenseeRequestId>identifier</LicenseeRequestId>
  <Report>
    <ResponseDestinations>
      <Pmp>KS</Pmp>
    </ResponseDestinations>
    <NarxCheckScore>
      <Narcotics>170</Narcotics>
      <Stimulants>000</Stimulants>
      <Sedatives>120</Sedatives>
    </NarxCheckScore>
    <ReportRequestURLs>
      <ViewableReport Content-Type="text/html">https://gateway-prep.pmp.appriss.com/v5/report/141</ViewableReport>
    </ReportRequestURLs>
  </Report>
  <Disclaimer>...</Disclaimer>
</PatientResponse>

Disallowed

A Patient Response will include a <Disallowed> response in these circumstances:

  • You make a request to a PMP that has not granted access to your Licensee.
  • The <Provider> <Role> specified in the Patient Request is not permitted to query the specified PMP.
  • Multiple patients are found matching the criteria you provide.

In the last case, the response will include instructions to manually search the state PMP website for the patient.

If you would like access to query additional PMPs, contact the Appriss Project Manager who handles your account. Our project managers work with the PMPs to manage permissions requests.

Response Details

The Pmp node contains the state abbreviation for the PMP system which the response is for.

The Message node will be a simple text explanation of what happened. This should be appropriate to display to users.

The Details node will be present if there are details about the error beyond the message. This is especially important for responses involving multiple matches, as it is what indicates that the error was a multiple match error in particular.

The Source node describes where in the request lifecycle the error originated. This may be helpful in troubleshooting.

Example Request Data: Unauthorized Role

patient_response__disallowed.xml

download
<?xml version="1.0" encoding="UTF-8"?>
<PatientResponse xmlns="http://xml.appriss.com/gateway/v5">
  <RequestId>238</RequestId>
  <Response>
    <ResponseDestinations>
      <Pmp>KS</Pmp>
    </ResponseDestinations>
    <Disallowed>
      <Message>A Dentist from KS is not allowed to make requests.</Message>
      <Source>GATEWAY</Source>
    </Disallowed>
  </Response>
  <Disclaimer>...</Disclaimer>
</PatientResponse>

Example Response Data: Multiple Match

patient_response__multiple.xml

download
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<PatientResponse xmlns=\"http://xml.appriss.com/gateway/v5\">
  <RequestId>234</RequestId>
  <Response>
    <ResponseDestinations>
      <Pmp>KS</Pmp>
    </ResponseDestinations>
    <Disallowed>
      <Message>There was a permissions problem making this request</Message>
      <Details><![CDATA[Based on the patient details submitted, the responding state PMP could not identify a unique patient. Please manually search for the patient in the state's PMP website.]]></Details>
      <Source>PMP</Source>
    </Disallowed>
  </Response>
  <Disclaimer>...</Disclaimer>
</PatientResponse>

Error

If a technical problem prevents a Patient Request from being processed, the response will include an <Error> response element.

If technical problem preventing the request from being processed, the response will be an error. This could be accompanied by an non-200 HTTP response code.

Response Details

The Pmp node contains the state abbreviation for the PMP system which the response is for.

The Message node will be a simple text explanation of what happened. This should be appropriate to display to users.

The Details node will be present if there are details about the error beyond the message. This is especially important for responses involving multiple matches, as it is what indicates that the error was a multiple match error in particular.

The Source node describes where in the request lifecycle the error originated. This may be helpful in troubleshooting.

Example Request Data

patient_response__error.xml

download
<?xml version="1.0" encoding="UTF-8"?>
<PatientResponse xmlns="http://xml.appriss.com/gateway/v5">
  <RequestId>241</RequestId>
  <Response>
    <ResponseDestinations>
      <Pmp>KY</Pmp>
    </ResponseDestinations>
    <Error>
      <Message>Error Message from the PMP</Message>
      <Details>Optionally - More technical details regarding the error.</Details>
      <Source>PMP</Source>
    </Error>
  </Response>
  <Disclaimer>...</Disclaimer>
</PatientResponse>

Report Request

To make a Report Request, you must first make a successful Patient Request. The Patient Response includes the URL where you POST Report Requests for that patient. We need to use a POST command for retrieving the report to track who makes the request.

The URL returned in a Patient Response expires 24 hours after the Patient Request was made. To retrieve another URL, you will need to make another Patient Request.

Note: The last element of the URL can be either a report identifier or a Medical Record ID, depending on whether the licensee has been configured to use a patient's Medical Record ID for the report URL. This will be the same Medical Record ID used in the corresponding Patient Request.

Report Details

If the Report Request is successful, the response will include a report.

Reports can be returned in one of two ways. You specify the method by including or excluding the <ReportLink /> element from your request. If you exclude it, the report will be returned as raw HTML. If you include it, the response will include a URL where the report can be accessed once.

Request Data

The report request has many optional data elements. Additionally, some elements are conditional, meaning that your request must include at least one element out of a set of possible elements.

This example includes all required elements and most of the optional elements. For conditional elements, this example includes all possible options. There are comments where conditional elements are present.

Note: In the example on the right, some optional elements have been ommitted because they are not useful for the vast majority of users.

For more technical details on Report Requests, please refer to the Gateway v5 schema.

Definition

POST https://gateway-prep.pmp.appriss.com/v5/report/*VARIES*

Example Request Data

report_request.xml

download
<?xml version="1.0" encoding="UTF-8"?>
<ReportRequest xmlns="http://xml.appriss.com/gateway/v5">
  <Requester>
    <ReportLink /><!-- Include this element to get the report as a on-time-use URL. -->
    <Provider><!-- Person viewing the report. -->
      <Role>Physician</Role>
      <FirstName>Jon</FirstName>
      <LastName>Doe</LastName>
      <!-- At least one identifier is required: DEANumber, NPINumber, or ProfessionalLicenseNumber. -->
      <DEANumber>AB1234579</DEANumber>
      <NPINumber>1212345671</NPINumber>
      <ProfessionalLicenseNumber>
        <Type>Something</Type>
        <Value>A1231xbzy-bx</Value>
        <StateCode>OH</StateCode>
      </ProfessionalLicenseNumber>
    </Provider>
    <Location>
      <Name>Store #123</Name>
      <!-- At least one identifier is required: DEANumber, NPINumber, or NCPDPNumber. -->
      <DEANumber>AB1234579</DEANumber>
      <NPINumber>1234567890</NPINumber>
      <NCPDPNumber>1234567</NCPDPNumber>
      <Address>
        <Street>Street1</Street>
        <Street>Street2</Street>
        <City>City</City>
        <StateCode>OH</StateCode>
        <ZipCode>40242</ZipCode>
        <ZipPlusFour>4242</ZipPlusFour>
      </Address>
    </Location>
  </Requester>
</ReportRequest>

Report Request Minimal

The Report Request example on the right is as minimalistic as possible. It includes all required elements and the conditional elements which are most commonly used. Providing less information will result in XML validation errors.

This minimal example can serve as a good starting point during development. However, when you submit Report Requests, you should include as many of the optional fields as you possibly can. Including optional elements makes it easier to track errors, makes your code more future-proof, and helps with generating usage statistics for your organization.

Definition

POST https://gateway-prep.pmp.appriss.com/v5/report/*VARIES*

Example Request Data

report_request__minimal.xml

download
<?xml version="1.0" encoding="UTF-8"?>
<ReportRequest xmlns="http://xml.appriss.com/gateway/v5">
  <Requester>
    <ReportLink /><!-- Include this element to get the report as a on-time-use URL. -->
    <Provider><!-- Person viewing the report. -->
      <Role>Physician</Role>
      <FirstName>Jon</FirstName>
      <LastName>Doe</LastName>
      <!-- At least one identifier is required: DEANumber, NPINumber, or ProfessionalLicenseNumber. -->
      <DEANumber>AB1234579</DEANumber>
    </Provider>
    <Location>
      <Name>Store #123</Name>
      <!-- At least one identifier is required: DEANumber, NPINumber, or NCPDPNumber. -->
      <DEANumber>AB1234579</DEANumber>
      <Address>
        <StateCode>OH</StateCode>
      </Address>
    </Location>
  </Requester>
</ReportRequest>

Report Response

The response will be either the actual report content in html or a Report Response. Depending upon the Licensee's configuration, the report type will be either a Prescription History report or a NARxCHECK report.

HTML Report

If you do not include the <ReportLink /> node in a Report Request, the Report Response will include the HTML data for the report.

Example Response Data

download
<!DOCTYPE html>
<html>
<head>
    <title>PMP Gateway Data Report</title>
    <script type="text/javascript" src="https://gateway-prep.pmp.appriss.com/narx-content/content/201507/jquery-ui-1.11.4/external/jquery/jquery.js"></script>
    <script type="text/javascript" src="https://gateway-prep.pmp.appriss.com/narx-content/content/201507/jquery-ui-1.11.4/jquery-ui.js"></script>
    <script type="text/javascript" src="https://gateway-prep.pmp.appriss.com/narx-content/scripts/jquery.tablesorter.min.js"></script>
    <link rel="stylesheet" href="https://gateway-prep.pmp.appriss.com/narx-content/content/201507/jquery-ui-1.11.4/jquery-ui.css" type="text/css" media="all" />

        <style type="text/css">
        /* common styles */

        div.pr_content * {
            font-family:Arial,Verdana,sans-serif;
        }

        div.pr_content {
            width: 1005px;
           /* Centering */
           margin: 0 auto 0 auto;
        }

        div.pr_content table.layout {
            width: 1005px;
            min-width: 1005px;
            font-size: 14px;
        }

        div.pr_content table,
        div.pr_content th,
        div.pr_content td {
            border-collapse: collapse; 
            padding-top: 5px;
            padding-bottom: 5px;
            padding-left: 10px;
            padding-right: 10px;
        }


        /* Datatable */
        div.pr_content .datatable {
            margin:0px;
            width:100%;
            width: 1005px;
            font-size: 14px;
        }

        div.pr_content table.datatable td {
            text-align: left;
        }
		
		
        div.pr_content table.datatable thead tr .header {
            padding-right: 15px;
        	background-image: url(https://gateway-prep.pmp.appriss.com/narx-content/content/bg.gif);
        	background-repeat: no-repeat;
        	background-position: center right;
        	cursor: pointer;
        }

        div.pr_content table.datatable thead tr .headerSortDown, table.datatable thead tr .headerSortUp {
             background-color: #d9dfea;
             border-top-left-radius: 5px;
             border-top-right-radius: 5px;
        }

        div.pr_content table.datatable thead tr .headerSortUp {
        	background-image: url(https://gateway-prep.pmp.appriss.com/narx-content/content/asc.gif);
        }
        div.pr_content table.datatable thead tr .headerSortDown {
        	background-image: url(https://gateway-prep.pmp.appriss.com/narx-content/content/desc.gif);
        }

        /* End Datatable */

        #data-analysis {
          cursor: pointer;
        }

		#prescriptions-table thead tr th,
        #prescriptions-table tbody tr td 
        {
            font-size:12px;
        }

        #providers-table thead tr th,
		#providers-table tbody tr td {
            font-size:12px;
        }
		
        #pharmacies-table thead tr th,
		#pharmacies-table tbody tr td {
            font-size:12px;
        }

        div.pr_content th {
            text-align: left;
            font-weight: normal;
            border-bottom: 1px solid #ccc;
        }

        div.pr_content hr {
            height: 1px;
            border-color:#ccc;
            border:0;
            border-top: 1px solid #ccc;
            margin: 1em 0;
        }


        div.pr_content .left {
            text-align: left;
            padding-left: 0px;
        }

        div.pr_content .right {
            text-align: right !important;
            padding-right: 0px;
        }

         div.pr_content .centered {
            text-align: center !important;
        }

        div.pr_content .wide {
            width: 300px;
        }

        div.pr_content .error {
            color: red;
        }


        #canvas_container {
            width: 100%;
            margin-left:0px;
            padding-left:0px;
        }
        div.pr_content .score_label {
            font-size:32px;
            font-weight:bold;
            width:125px;
        }

        div.pr_content .score {
            font-size:32px;
            font-weight:bold;
            width:75px;
            min-width:100px;
            text-align: center;
        }

        div.pr_content .score_legend {
            font-size:12px;
        }

        div.pr_content .drug_odd {
            background-color:#FFFFFF;
        }

        div.pr_content .drug_even {
            background-color:#f8f8f8;
        }

        div.pr_content .hidden {
            display:none;
        }

        #hovertable {
            font-size:10px;
            padding:5px;
            text-align:left;
            border:1px solid #ccc;
            width:800px;
            background-color:white;
            margin:0px;
            margin-right:10px;
        }

        #hovertable thead tr {
            border-bottom:1px solid #ccc;
            background-color:#050054;
            color:white;
        }

        #dochovertable {
            font-size:10px;
            padding:5px;
            text-align:left;
            border:1px solid #ccc;
            width:800px;
        }

        #dochovertable thead tr {
            border-bottom:1px solid #ccc;
            background-color:#050054;
            color:white;
        }

        div.pr_content a:hover {
            cursor:pointer;
        }

        div.pr_content .shadow {
	        -moz-box-shadow: 3px 3px 4px #cccccc;
	        -webkit-box-shadow: 3px 3px 4px #cccccc;
	        box-shadow: 3px 3px 4px #cccccc;
	        /* For IE 8 */
	        -ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#cccccc')";
	        /* For IE 5.5 - 7 */
	        filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#cccccc');
        }

        div.pr_content .title {
           float:left;
           font-size:16px;
           font-weight:bold;
           white-space: nowrap;
        }
        div.pr_content .title-space {
           width:120px;
        }

        div.pr_content .title-extra{
           float:left;
           margin-left:20px;
           white-space: nowrap;
        }

        div.pr_content .title-extra-right{
           white-space: nowrap;
           float:right;
        }

        div.pr_content .narx-table-title-bar {
            font-size: 14px;
            margin-top: 15px;
            margin-bottom: 45px;
        }
        div.pr_content .narx-table-title-bar span:first-child {
            margin-left: 10px;
        }

        div.pr_content .clear {
            clear:both;
        }

        div.pr_content .font14 {
           font-size:14px;
        }
        div.pr_content .font12 {
           font-size:12px;
        }

        div.pr_content .gray {
            color:#ccc;
        }
        div.pr_content .superscript{
            font-size:large;
            vertical-align:top;
        }
        div.pr_content .darkred {
            color:darkred;
        }

        div.pr_content .align-right {
            text-align: right;
        }

        div.pr_content .historical-score-title {
           color:#ccc;
           font-size:14px;
           text-align:center;
           padding-top:0px;
           padding-bottom:0px;
        }

        div.pr_content .border-bottom {
           border-bottom:1px solid #ccc;
        }

        div.pr_content .border-top {
           border-top:1px solid #ccc;
        }

        div.pr_content .border-top-space {
           border-top:1px solid #ccc;
        }

        div.pr_content .border {
           border:1px solid #ccc;
        }

        div.pr_content .title-bar {
           height: 35px;
        }

        div.pr_content .title-bar::after{
           clear:both;
        }

        div.pr_content .patient-title {
           font-size:22px;
           font-weight: bold;
           margin-top: 25px;
           margin-left: 10px;
        }

        div.pr_content .float-left {
           float:left;
        }

        div.pr_content .float-right {
           float:right;
        }

        div.pr_content .bold {
           font-weight:bold;
        }

        #note-overlay {
           width:800px;
           display:none;
           text-align:left;
           background-color:#fffdce;
           padding:0px;
        }


        div.pr_content .visit_odd {
            background-color:#ffffff;
        }

        div.pr_content .visit_even {
            background-color:#f8f8f8;
        }



        #visit-table {
            width:798px;
            margin:0px 1px 0px 1px;
            font-size: 12px;
        }

        #visit-overlay {
           display:none;
           background-color:#fefefe;
           padding:0px;
        }

        #visit-titlebar{
             text-align:right;
             background-color:#eeeeee;
             height:20px;
             line-height:20px;
             width:800px;
             cursor:move;
        }

        div.pr_content .hover-title {
           float:left;
           margin-left:10px;
           font-size:12px;
           font-weight:bold;
        }

        div.pr_content .close-button {
          float:right;
 
          text-decoration:none;
          cursor:pointer;
        }

        #demo-overlay {
            display:none;
            background-color:#fefefe;
            padding:0px;
            margin:0px;
        }
        #demo-titlebar {
            text-align:right;
            background-color:#eeeeee;
            height:20px;
            padding-right:0px;
            line-height:20px;
            width:800px;
            cursor:move;
        }

        #demo-table {
            margin-left:1px;
            margin-right:1px;
            width: 798px;
        }

        #data-analysis {
          margin-left:10px;
        }

        div.pr_content .control_link {
          text-decoration:none;
          cursor:pointer;
        }

        div.pr_content .pr_alert {
           background:#FFFBDE;
	       border: 1px  dotted #C9AF00;
	       color: #A69000;
           padding: 5px 5px 5px 10px;
        }

        #demobar  {
           border-bottom: 1px solid #ccc;
           border-top: 1px solid #ccc;
           margin-top: 5px;
           margin-bottom: 10px;
           padding: 5px 5px 5px 10px; 
           font-size: 14px;
        }

        #demobar .demoitem{
            margin-left: 18px;
        }

        #demobar .demodate{
            float:right;
            padding: 0;
        }
        #demobar .demodate:after{
            clear:both;
        }

        
    </style>


        <style type="text/css">
        /* data report specific styles */

    </style>

</head>
<body>
    <div class="pr_content">

                <div class="patient-title"><b>TESTPATIENT, BETTY</b></div>
        <div id="demobar">
            <span>Age: 46</span>
                 <span  style="margin-left:150px;"><a href="#" class="control_link demo-toggle">demographics</a>  </span>
            <span style="float:right;">Data as of: 9/12/2016</span>
        </div>

        <!-- Report Message -->

        <!-- Data Tables -->
        <div class="narx-table-title-bar">
                <span class="title title-space">Prescriptions</span>
                <span class="title-extra">Total Prescriptions: 18</span>
        </div>
        

                <table id="prescriptions-table" class="datatable">
                    <thead>
                    <tr>
                        <th>Fill Date</th>
                        <th style="margin:0;padding:0;">&nbsp;</th>
                        <th class="">Drug</th>
                        <th class="centered">Qty</th>
                        <th class="centered">Days</th>
                        <th>Prescriber</th>
                        <th>Pharmacy</th>
                        <th class="centered">Refill</th>
                        <th class="right">MgEq</th>
                        <th class="right">MgEq/Day</th>
                        <th class="left" style="padding-left:10px;">Pymt Type</th>
                        <th class="centered" title="The State that provided this prescription record">PMP</th>
                    </tr></thead>
                    <tbody>

                        <tr class="drug_even">
                            <td class="">08/21/2015</td>
                            <td style="margin:0;padding:0;"><span class="superscript darkred"> </span></td>
                            <td class="left" style="min-width:290px;">OXYCODONE HCL ER 40 MG TABLET</td>
                            <td class="centered">30</td>
                            <td class="centered">30</td>
                            <td class="html-tooltip" data-for-sort="HOSPITAL, FAKE" title="HOSPITAL, FAKE[br][br][br] [br]DEA #:FH0005769">FA HOS</td>
                            <td>Fake C</td>
                            <td class="centered">0</td>
                            <td class="right">1,800.00</td>
                            <td class="right">60.00</td>
                            <td style="cursor:help;min-width:98px;" title="Commercial Insurance coverage" data-for-sort="Comm Ins">Comm Ins</td>
                            <td class="centered">KS</td>
                        </tr>
                        <tr class="drug_odd">
                            <td class="">08/21/2015</td>
                            <td style="margin:0;padding:0;"><span class="superscript darkred"> </span></td>
                            <td class="left" style="min-width:290px;">ALPRAZOLAM 1 MG TABLET</td>
                            <td class="centered">120</td>
                            <td class="centered">30</td>
                            <td class="html-tooltip" data-for-sort="DOC, GOOD" title="DOC, GOOD[br][br][br] [br]DEA #:GD0006406">GO DOC</td>
                            <td>PillsN</td>
                            <td class="centered">0</td>
                            <td class="right">240.00</td>
                            <td class="right">-</td>
                            <td style="cursor:help;min-width:98px;" title="Commercial Insurance coverage" data-for-sort="Comm Ins">Comm Ins</td>
                            <td class="centered">KS</td>
                        </tr>
                        <tr class="drug_even">
                            <td class="">08/20/2015</td>
                            <td style="margin:0;padding:0;"><span class="superscript darkred"> </span></td>
                            <td class="left" style="min-width:290px;">ALPRAZOLAM 0.5 MG TABLET</td>
                            <td class="centered">60</td>
                            <td class="centered">30</td>
                            <td class="html-tooltip" data-for-sort="FAMILYDOC, CANDICE" title="FAMILYDOC, CANDICE[br][br][br] [br]DEA #:CF0726200">CA FAM</td>
                            <td>Real C</td>
                            <td class="centered">0</td>
                            <td class="right">60.00</td>
                            <td class="right">-</td>
                            <td style="cursor:help;min-width:98px;" title="Commercial Insurance coverage" data-for-sort="Comm Ins">Comm Ins</td>
                            <td class="centered">KS</td>
                        </tr>
                        <tr class="drug_odd">
                            <td class="">06/27/2015</td>
                            <td style="margin:0;padding:0;"><span class="superscript darkred"> </span></td>
                            <td class="left" style="min-width:290px;">PERCOCET 5-325 MG TABLET</td>
                            <td class="centered">15</td>
                            <td class="centered">15</td>
                            <td class="html-tooltip" data-for-sort="HEADACHE, BRENDA" title="HEADACHE, BRENDA[br][br][br] [br]DEA #:BH0012221">BR HEA</td>
                            <td>Real C</td>
                            <td class="centered">0</td>
                            <td class="right">112.50</td>
                            <td class="right">7.50</td>
                            <td style="cursor:help;min-width:98px;" title="Commercial Insurance coverage" data-for-sort="Comm Ins">Comm Ins</td>
                            <td class="centered">KS</td>
                        </tr>
                        <tr class="drug_even">
                            <td class="">06/27/2015</td>
                            <td style="margin:0;padding:0;"><span class="superscript darkred"> </span></td>
                            <td class="left" style="min-width:290px;">ALPRAZOLAM 1 MG TABLET</td>
                            <td class="centered">120</td>
                            <td class="centered">30</td>
                            <td class="html-tooltip" data-for-sort="DOC, GOOD" title="DOC, GOOD[br][br][br] [br]DEA #:GD0006406">GO DOC</td>
                            <td>PillsN</td>
                            <td class="centered">0</td>
                            <td class="right">240.00</td>
                            <td class="right">-</td>
                            <td style="cursor:help;min-width:98px;" title="Commercial Insurance coverage" data-for-sort="Comm Ins">Comm Ins</td>
                            <td class="centered">KS</td>
                        </tr>
                        <tr class="drug_odd">
                            <td class="">06/26/2015</td>
                            <td style="margin:0;padding:0;"><span class="superscript darkred"> </span></td>
                            <td class="left" style="min-width:290px;">PERCOCET 5-325 MG TABLET</td>
                            <td class="centered">180</td>
                            <td class="centered">60</td>
                            <td class="html-tooltip" data-for-sort="HEADACHE, BRENDA" title="HEADACHE, BRENDA[br][br][br] [br]DEA #:BH0012221">BR HEA</td>
                            <td>Real C</td>
                            <td class="centered">0</td>
                            <td class="right">1,350.00</td>
                            <td class="right">22.50</td>
                            <td style="cursor:help;min-width:98px;" title="Commercial Insurance coverage" data-for-sort="Comm Ins">Comm Ins</td>
                            <td class="centered">KS</td>
                        </tr>
                        <tr class="drug_even">
                            <td class="">05/26/2015</td>
                            <td style="margin:0;padding:0;"><span class="superscript darkred"> </span></td>
                            <td class="left" style="min-width:290px;">OXYCODONE HCL 5 MG TABLET</td>
                            <td class="centered">60</td>
                            <td class="centered">30</td>
                            <td class="html-tooltip" data-for-sort="DOC, GOOD" title="DOC, GOOD[br][br][br] [br]DEA #:GD0006406">GO DOC</td>
                            <td>Real C</td>
                            <td class="centered">0</td>
                            <td class="right">450.00</td>
                            <td class="right">15.00</td>
                            <td style="cursor:help;min-width:98px;" title="Commercial Insurance coverage" data-for-sort="Comm Ins">Comm Ins</td>
                            <td class="centered">KS</td>
                        </tr>
                        <tr class="drug_odd">
                            <td class="">05/09/2015</td>
                            <td style="margin:0;padding:0;"><span class="superscript darkred"> </span></td>
                            <td class="left" style="min-width:290px;">OXYCONTIN 20 MG TABLET</td>
                            <td class="centered">60</td>
                            <td class="centered">30</td>
                            <td class="html-tooltip" data-for-sort="DOC, GOOD" title="DOC, GOOD[br][br][br] [br]DEA #:GD0006406">GO DOC</td>
                            <td>Real C</td>
                            <td class="centered">0</td>
                            <td class="right">1,800.00</td>
                            <td class="right">60.00</td>
                            <td style="cursor:help;min-width:98px;" title="Commercial Insurance coverage" data-for-sort="Comm Ins">Comm Ins</td>
                            <td class="centered">KS</td>
                        </tr>
                        <tr class="drug_even">
                            <td class="">04/04/2015</td>
                            <td style="margin:0;padding:0;"><span class="superscript darkred"> </span></td>
                            <td class="left" style="min-width:290px;">ALPRAZOLAM 1 MG TABLET</td>
                            <td class="centered">120</td>
                            <td class="centered">30</td>
                            <td class="html-tooltip" data-for-sort="DOC, GOOD" title="DOC, GOOD[br][br][br] [br]DEA #:GD0006406">GO DOC</td>
                            <td>We Fil</td>
                            <td class="centered">0</td>
                            <td class="right">240.00</td>
                            <td class="right">-</td>
                            <td style="cursor:help;min-width:98px;" title="Commercial Insurance coverage" data-for-sort="Comm Ins">Comm Ins</td>
                            <td class="centered">KS</td>
                        </tr>
                        <tr class="drug_odd">
                            <td class="">04/01/2015</td>
                            <td style="margin:0;padding:0;"><span class="superscript darkred"> </span></td>
                            <td class="left" style="min-width:290px;">AMBIEN CR 12.5 MG TABLET</td>
                            <td class="centered">23</td>
                            <td class="centered">23</td>
                            <td class="html-tooltip" data-for-sort="HEADACHE, BRENDA" title="HEADACHE, BRENDA[br][br][br] [br]DEA #:BH0012221">BR HEA</td>
                            <td>Real C</td>
                            <td class="centered">0</td>
                            <td class="right">14.38</td>
                            <td class="right">-</td>
                            <td style="cursor:help;min-width:98px;" title="Commercial Insurance coverage" data-for-sort="Comm Ins">Comm Ins</td>
                            <td class="centered">KS</td>
                        </tr>
                        <tr class="drug_even">
                            <td class="">03/27/2015</td>
                            <td style="margin:0;padding:0;"><span class="superscript darkred"> </span></td>
                            <td class="left" style="min-width:290px;">CLONAZEPAM 0.5 MG TABLET</td>
                            <td class="centered">90</td>
                            <td class="centered">30</td>
                            <td class="html-tooltip" data-for-sort="DOCTOR, BAD" title="DOCTOR, BAD[br][br][br] [br]DEA #:BD4135326">BA DOC</td>
                            <td>DrugWa</td>
                            <td class="centered">1</td>
                            <td class="right">90.00</td>
                            <td class="right">-</td>
                            <td style="cursor:help;min-width:98px;" title="Commercial Insurance coverage" data-for-sort="Comm Ins">Comm Ins</td>
                            <td class="centered">KS</td>
                        </tr>
                        <tr class="drug_odd">
                            <td class="">03/02/2015</td>
                            <td style="margin:0;padding:0;"><span class="superscript darkred"> </span></td>
                            <td class="left" style="min-width:290px;">CARISOPRODOL 350 MG TABLET</td>
                            <td class="centered">30</td>
                            <td class="centered">15</td>
                            <td class="html-tooltip" data-for-sort="HOSPITAL, FAKE" title="HOSPITAL, FAKE[br][br][br] [br]DEA #:FH0005769">FA HOS</td>
                            <td>Fake C</td>
                            <td class="centered">1</td>
                            <td class="right">26.25</td>
                            <td class="right">-</td>
                            <td style="cursor:help;min-width:98px;" title="Commercial Insurance coverage" data-for-sort="Comm Ins">Comm Ins</td>
                            <td class="centered">KS</td>
                        </tr>
                        <tr class="drug_even">
                            <td class="">02/27/2015</td>
                            <td style="margin:0;padding:0;"><span class="superscript darkred"> </span></td>
                            <td class="left" style="min-width:290px;">CLONAZEPAM 0.5 MG TABLET</td>
                            <td class="centered">90</td>
                            <td class="centered">30</td>
                            <td class="html-tooltip" data-for-sort="DOCTOR, BAD" title="DOCTOR, BAD[br][br][br] [br]DEA #:BD4135326">BA DOC</td>
                            <td>DrugWa</td>
                            <td class="centered">0</td>
                            <td class="right">90.00</td>
                            <td class="right">-</td>
                            <td style="cursor:help;min-width:98px;" title="Commercial Insurance coverage" data-for-sort="Comm Ins">Comm Ins</td>
                            <td class="centered">KS</td>
                        </tr>
                        <tr class="drug_odd">
                            <td class="">02/11/2015</td>
                            <td style="margin:0;padding:0;"><span class="superscript darkred"> </span></td>
                            <td class="left" style="min-width:290px;">AMBIEN CR 12.5 MG TABLET</td>
                            <td class="centered">12</td>
                            <td class="centered">2</td>
                            <td class="html-tooltip" data-for-sort="DOC, OHIO" title="DOC, OHIO[br][br][br] [br]DEA #:OD0017120">OH DOC</td>
                            <td>Script</td>
                            <td class="centered">0</td>
                            <td class="right">7.50</td>
                            <td class="right">-</td>
                            <td style="cursor:help;min-width:98px;" title="Commercial Insurance coverage" data-for-sort="Comm Ins">Comm Ins</td>
                            <td class="centered">KS</td>
                        </tr>
                        <tr class="drug_even">
                            <td class="">02/03/2015</td>
                            <td style="margin:0;padding:0;"><span class="superscript darkred"> </span></td>
                            <td class="left" style="min-width:290px;">CLONAZEPAM 0.5 MG TABLET</td>
                            <td class="centered">90</td>
                            <td class="centered">30</td>
                            <td class="html-tooltip" data-for-sort="DOCTOR, BAD" title="DOCTOR, BAD[br][br][br] [br]DEA #:BD4135326">BA DOC</td>
                            <td>DrugWa</td>
                            <td class="centered">1</td>
                            <td class="right">90.00</td>
                            <td class="right">-</td>
                            <td style="cursor:help;min-width:98px;" title="Commercial Insurance coverage" data-for-sort="Comm Ins">Comm Ins</td>
                            <td class="centered">KS</td>
                        </tr>
                        <tr class="drug_odd">
                            <td class="">01/09/2015</td>
                            <td style="margin:0;padding:0;"><span class="superscript darkred"> </span></td>
                            <td class="left" style="min-width:290px;">CLONAZEPAM 0.5 MG TABLET</td>
                            <td class="centered">90</td>
                            <td class="centered">30</td>
                            <td class="html-tooltip" data-for-sort="DOCTOR, BAD" title="DOCTOR, BAD[br][br][br] [br]DEA #:BD4135326">BA DOC</td>
                            <td>DrugWa</td>
                            <td class="centered">0</td>
                            <td class="right">90.00</td>
                            <td class="right">-</td>
                            <td style="cursor:help;min-width:98px;" title="Commercial Insurance coverage" data-for-sort="Comm Ins">Comm Ins</td>
                            <td class="centered">KS</td>
                        </tr>
                        <tr class="drug_even">
                            <td class="">01/02/2015</td>
                            <td style="margin:0;padding:0;"><span class="superscript darkred"> </span></td>
                            <td class="left" style="min-width:290px;">HYDROCODON-ACETAMINOPHN 10-325</td>
                            <td class="centered">180</td>
                            <td class="centered">90</td>
                            <td class="html-tooltip" data-for-sort="HEADACHE, BRENDA" title="HEADACHE, BRENDA[br][br][br] [br]DEA #:BH0012221">BR HEA</td>
                            <td>Real C</td>
                            <td class="centered">0</td>
                            <td class="right">1,800.00</td>
                            <td class="right">20.00</td>
                            <td style="cursor:help;min-width:98px;" title="Commercial Insurance coverage" data-for-sort="Comm Ins">Comm Ins</td>
                            <td class="centered">KS</td>
                        </tr>
                        <tr class="drug_odd">
                            <td class="">11/19/2014</td>
                            <td style="margin:0;padding:0;"><span class="superscript darkred"> </span></td>
                            <td class="left" style="min-width:290px;">ALPRAZOLAM 1 MG TABLET</td>
                            <td class="centered">120</td>
                            <td class="centered">30</td>
                            <td class="html-tooltip" data-for-sort="PILL, JOHN" title="PILL, JOHN[br][br][br] [br]DEA #:JP3187588">JO PIL</td>
                            <td>Fake C</td>
                            <td class="centered">0</td>
                            <td class="right">240.00</td>
                            <td class="right">-</td>
                            <td style="cursor:help;min-width:98px;" title="Commercial Insurance coverage" data-for-sort="Comm Ins">Comm Ins</td>
                            <td class="centered">KS</td>
                        </tr>
                    </tbody>
                </table>


        <hr />

       <div class="narx-table-title-bar">
           <span class="title title-space">Providers</span>
           <span class="title-extra">Total Providers: 7</span>
       </div>
        
                <table id="providers-table" class="datatable">
                    <thead>
                    <tr>
                        <th style="width:300px;">Name</th>
                        <th style="width:220px;">Address</th>
                        <th style="width:140px;">City</th>
                        <th style="width:100px;">State</th>
                        <th style="width:100px;">Zipcode</th>
                        <th style="width:100px;">DEA</th>
                    </tr>
                    </thead>
                    <tbody>

                        <tr class="drug_even">
                            <td>DOC, GOOD</td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td>GD0006406</td>
                        </tr>
                        <tr class="drug_odd">
                            <td>DOC, OHIO</td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td>OD0017120</td>
                        </tr>
                        <tr class="drug_even">
                            <td>DOCTOR, BAD</td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td>BD4135326</td>
                        </tr>
                        <tr class="drug_odd">
                            <td>FAMILYDOC, CANDICE</td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td>CF0726200</td>
                        </tr>
                        <tr class="drug_even">
                            <td>HEADACHE, BRENDA</td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td>BH0012221</td>
                        </tr>
                        <tr class="drug_odd">
                            <td>HOSPITAL, FAKE</td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td>FH0005769</td>
                        </tr>
                        <tr class="drug_even">
                            <td>PILL, JOHN</td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td>JP3187588</td>
                        </tr>
                    </tbody>
                </table>


        <hr />

        <div class="narx-table-title-bar">
            <span class="title title-space">Pharmacies</span>
            <span class="title-extra">Total Pharmacies: 8</span>
        </div>
        
                <table id="pharmacies-table" class="datatable">
                    <thead>
                    <tr>
                        <th style="width:300px;">Name</th>
                        <th style="width:220px;">Address</th>
                        <th style="width:140px;">City</th>
                        <th style="width:100px;">State</th>
                        <th style="width:100px;">Zipcode</th>
                        <th style="width:100px;">DEA</th>
                    </tr>
                    </thead>
                    <tbody>

                        <tr class="drug_even">
                            <td>DrugWarehouse</td>
                            <td>9878 ANY STREET</td>
                            <td>COLUMBUS</td>
                            <td>OH</td>
                            <td>43215</td>
                            <td>HO0777889</td>
                        </tr>
                        <tr class="drug_odd">
                            <td>Fake Chain Store 1</td>
                            <td>123 FAKE STREET</td>
                            <td>COLUMBUS</td>
                            <td>OH</td>
                            <td>43215</td>
                            <td>HO1109796</td>
                        </tr>
                        <tr class="drug_even">
                            <td>Fake Chain Store 2</td>
                            <td>365 MARLARKY LN</td>
                            <td>DAYTON</td>
                            <td>OH</td>
                            <td>44567</td>
                            <td>HO1565778</td>
                        </tr>
                        <tr class="drug_odd">
                            <td>PillsNStuff</td>
                            <td>64568 BLUE ST</td>
                            <td>CLEVELAND</td>
                            <td>OH</td>
                            <td>44123</td>
                            <td>HO2055879</td>
                        </tr>
                        <tr class="drug_even">
                            <td>Real Chain Store 1</td>
                            <td>897 LIKELY ST</td>
                            <td>WORTHINGTON</td>
                            <td>OH</td>
                            <td>43080</td>
                            <td>HO2697994</td>
                        </tr>
                        <tr class="drug_odd">
                            <td>Real Chain Store 2</td>
                            <td>987 ORANGE RD</td>
                            <td>GROVE CITY</td>
                            <td>OH</td>
                            <td>43123</td>
                            <td>HO2973750</td>
                        </tr>
                        <tr class="drug_even">
                            <td>Script Factory</td>
                            <td>8789 LUCKY RD</td>
                            <td>COLUMBUS</td>
                            <td>OH</td>
                            <td>43215</td>
                            <td>HO3058953</td>
                        </tr>
                        <tr class="drug_odd">
                            <td>We Fill Scripts</td>
                            <td>5645 DEADEND DR</td>
                            <td>COLUMBUS</td>
                            <td>OH</td>
                            <td>43215</td>
                            <td>HO1955650</td>
                        </tr>
                    </tbody>
                </table>


        <hr />


        <!-- Overlays -->
    <div id="demo-overlay" class="shadow border font12">
        <div id="demo-titlebar" class="border-bottom ui-dialog-titlebar ui-widget-header">
            <div class="hover-title">Patient Demographics</div>
            <span class="ui-icon ui-icon-close close-button" onclick="demoClose();">&nbsp;</span>
        </div>
        <div style="max-height:200px;overflow-y:auto;overflow-x:hidden;">
            <table id="demo-table">
                <tr>
                    <th>First Name</th>
                    <th>Last Name</th>
                    <th>Address</th>
                    <th>City</th>
                    <th>State</th>
                    <th>Zip</th>
                    <th>DOB</th>
                    <th>Prescriptions Count</th>
                </tr>

                    <tr class="drug_odd">
                        <td>BETTY</td>
                        <td>TESTPATIENT</td>
                        <td>123 BROADWAY</td>
                        <td>COLUMBUS</td>
                        <td>OH</td>
                        <td>43215</td>
                        <td>1/1/1970</td>
                        <td>11</td>
                    </tr>
                    <tr class="drug_even">
                        <td>BETTY</td>
                        <td>TESTPATIENT</td>
                        <td>234 N WEST ST</td>
                        <td>WESTERVILLE</td>
                        <td>OH</td>
                        <td>43081</td>
                        <td>1/1/1970</td>
                        <td>7</td>
                    </tr>
            </table>
        </div>
    </div>

    </div>

    <script type="text/javascript">

        var demoOverlayOpen = false;

        //Demographics


        function demoClose() {
            $("#demo-overlay").fadeOut();
            demoOverlayOpen=false;
        }

        $(".demo-toggle").click(function(evt){
            if(demoOverlayOpen){
                demoClose();
                return;
            }
            demoOverlayOpen=true;

            var offset=$('.demo-toggle').offset();

            var e=evt || window.event;
            var docX,docY;

            if (e.pageX == null)
            {
                // IE case

                var d= (document.documentElement &&
                        document.documentElement.scrollLeft != null) ?
                       document.documentElement : document.body;
                docX= e.clientX + d.scrollLeft;
                docY= e.clientY + d.scrollTop;
            }
            else
            {
                // all other browsers

                docX= e.pageX;
                docY= e.pageY;
            }

            $("#demo-overlay").css({
                position: 'absolute',
                display: 'none',
                top: docY+20,
                left: offset.left + 10,
                'font-size': '14px;',
                'font-family': 'Arial, Verdana, sans-serif'
            }).fadeIn(175);
        });



        function init_table_sorting() {
            // SEE http://tablesorter.com/docs/


            // new zebra widget to keep the unidentified drugs.

            $.tablesorter.addWidget({
                // give the widget a id

                id: "prescriptionZebra",
                format: function (table) {
                    var $tr, row = -1,
                        odd;
                    // loop through the visible rows

                    $("tr:visible", table.tBodies[0]).each(function (i) {
                        $tr = $(this);
                        // style children rows the same way the parent

                        // row was styled

                        if (!$tr.hasClass(table.config.cssChildRow)) row++;
                        odd = (row % 2 == 0);

                        $tr.removeClass(table.config.widgetZebra.css[odd ? 0 : 1]).
                                addClass(table.config.widgetZebra.css[odd ? 1 : 0]);
                    });
                }
            });

            //Write table parser

            // add parser through the tablesorter addParser method

            $.tablesorter.addParser({
                id: 'data-for-sort',
                is: function (s) {
                    // return false so this parser is not auto detected

                    return false;
                },
                format: function (s, item, td) {
                    //return td.dataset.forSort; //this is the "correct" way to do but not until ie11+.

                    return td.getAttribute("data-for-sort"); //slower way to do it.

                },
                type: 'text'
            });



            // Table sorting

            $("#prescriptions-table").tablesorter({
                textExtraction: "complex",
                headers: {
                    5: {
                        sorter: 'data-for-sort'
                    },
                    10: {
                        sorter: 'data-for-sort'
                    }
                },
                widgets: ['prescriptionZebra'], //defined above.

                widgetZebra: {
                    css: ["drug_even", "drug_odd"]
                }
            });

            $("#providers-table").tablesorter({
                widgets: ['zebra'],
                widgetZebra: {
                    css: ["drug_even", "drug_odd"]
                }
            });

            $("#pharmacies-table").tablesorter({
                widgets: ['zebra'],
                widgetZebra: {
                    css: ["drug_even", "drug_odd"]
                }
            });

        }


        $(document).ready(function () {

            $('#demo-overlay').draggable({ containment: 'window', scroll: false, handle: '#demo-titlebar' });
            init_table_sorting();

            $(document).tooltip();
            $('.html-tooltip').tooltip({
                content: function () {
                    //Need to handle each tag we will allow manually replace the markup.

                    var tooltipContent = $(this).attr('title').replace(/\[br\]/g, "<br />");
                    return tooltipContent;
                },
            });
        });



    </script>

</body>

</html>

Disallowed

Example Response Data

report_response__disallowed.xml

download
<?xml version="1.0" encoding="UTF-8"?>
<ReportResponse xmlns="http://xml.appriss.com/gateway/v5">
  <ReportRequestId>12342123</ReportRequestId>
  <Disallowed>
    <Message>Permissions message.</Message>
    <Source>GATEWAY</Source>
  </Disallowed>
</ReportResponse>

Error

Example Response Data

report_response__error.xml

download
<?xml version="1.0" encoding="UTF-8"?>
<ReportResponse xmlns="http://xml.appriss.com/gateway/v5">
  <ReportRequestId>12342123</ReportRequestId>
  <Error>
    <Message>Error message.</Message>
    <Source>GATEWAY</Source>
  </Error>
</ReportResponse>

Epic SSO

Customers who wish to integrate with the PMP Gateway using Epic will want to consider the Epic SSO option. It allows for significantly simpler integration with Epic.

Requirements

Epic SSO requires Epic 2015 or higher. Reference PRJ 161400 when speaking to Epic about the integration.

Details

The process for retrieving a report through Epic is separate from the process outlined above involving a patient request followed by a report request. A GET request is made to a different endpoint with the web service user and an encrypted data string as query parameters.

The encrypted data string constists of patient information, provider information, and timestamp formatted as query parameters then encrypted using the web service user's password. The Epic endpoint does not use HTTP Basic authentication like the patient and report request endpoints above. Instead, the request is authorized by decrypting the data string.

If the request is successful, the response will an HTML report.

Epic Testing API Endpoint

https://gateway-prep.pmp.appriss.com/v5/report/epic

Epic Production API Endpoint

https://pmpgateway.net/v5/report/epic

Example Data String

This string is encrypted to form the data sent as a query parameter to the endpoint.

patientfirstname=Steven&patientlastname=Testpatient&patientdob=3%2F1%2F1970&patientmrn=3050256&patientzip=43215&providerrole=Physician&providerfirstname=Attending&providerlastname=Emergency&providerdea=AN1928285&providernpi=1114005147&facilityname=APPRISS+HEALTH&facilitystate=OH&facilitydea=&facilitynpi=1212123123&timestamp=20170719211305

Example Request

GET https://gateway-prep.pmp.appriss.com/v5/report/epic?web_service_user=appriss-epicsso-pharm&data=a5pVUIZY+ysw4+E8+bn2gHRI3VfdkbFNLqTY6MI3WcDd0XbuI/6j1l7t5f3gSZnmcBU/NUL9Q8fBiFMgtq93ei1km7fperTX/RGX3dlLyMYGru5hs99s1fuFKFl9b2UEAqetbtjqYoQA6GDp7SxRZm5WMVQilVPa+bWY1xLRyzNvwys9F7Z/VDbSjeIxUEMvvAjlDIeYCYZjEjVw5U49NLzR0YrKqf38pbA8uP9+ejOOfL5VcY/C19krO3sytOKhiHb493CMg4ULGmBU9ecEZIFu9d5p3n6n3yhYgBKxZpx3HsYyum0+3c8JLy1qxNqZAh5XLugva3S53cXC4s2O7OjyzcG9/1euDnIEflnikmOs3SAVT2YdpnMrptYbrJkDzA262igbMzuiMs7O79dFb7B3vZ1ykZme2GSNR4bDDqpntaoNQoUofYZo+dq/eVXq