PTV Documentation
1. Go to the Manage page and add at least one pharmacy. This will add them to the WENO Pharmacy Directory that prescribers download.
2. Access your partner ID and md5 version of your password which will be required later. You can find these in your Account Details page
3. Send [email protected] your DEA Approved Pharmacy System audit. The audit will enable EPCS orders to be routed to all of your registered pharmacies.
4. Go to MANAGE ACCOUNT -> MANAGE IPS AND ENDPOINTS and whitelist all IPs you will use to send us messages.
5. Download the full NCPDP 20170715 Schema which includes the ECL here. Your system is already ePrescribing, so we do not go into detail with the schema unless you require it. Contact us if you want full details.
You need a listening endpoint for WENO to send real time eRx messages to your system. In this step we provide sample code to help you create such a listener. When we call your endpoint to send you a eRx message you are required to respond in “real time” with either the NCPDP STATUS or ERROR message.
PHP Code to Receive XML Messages from WENO
This sample_endpoint.php is a PHP sample to receive messages from WENO. You will have to publish it on the site where you want to host the endpoint.
C# Code to Receive XML Messages from WENO
This sample_endpoint.ashx is a generic HTTP handler. You will have to compile it and publish on the site where you want to host the endpoint. Also, this code sample is to receive XML messages but you can adapt it to receive JSON as well.
– Sample Real Time STATUS Message in XML
– Sample Real Time ERROR Message in XML
More about the Real Time Response Messages You Must Implement
The details of the header and body of the STATUS and ERROR messages are included below so you can understand the codes and how to populate the responses properly. Pay close attention to the header as the real time Status and Error is different that free standing Status and Error messages. Real time messages do not use a unique message ID or security. Free standing STATUS and ERROR messages must have a unique message ID, populate the RELATES TO MESSAGE ID & the Security Section with a Nonce Token. The Free standing ERROR and STATUS messages are used to communicate ERROR or STATUS after your system already accepted the message initially.
The Header of all eRx messages explained
Header Field | Requirement & Cardinality Notes | Data Type | Value Comments |
Message Attributes | Yes, occurs 1x. | an | DatatypesVersion=”20170715″ TransportVersion=”20170715″ TransactionDomain=”SCRIPT” TransactionVersion=”20170715″ StructuresVersion=”20170715″ ECLVersion=”20170715″ |
TO Qualifier | Yes, occurs 1x | ECL codes | The ECL codes options WENO support are as follows: P = Pharmacy D = Prescriber C = Clinic CF = Central Fill Pharmacy ZZZ = Mutually Defined PY = Payer REMS = REMS Administrator |
TO | Yes, occurs 1x | an 1..255 | The WENO Directory will provide the necessary IDs below: If P is TO Qualifier then enter NCPDP ID If D is TO Qualifier enter WENO prescriber ID If C is TO Qualifier enter WENO Clinic ID If CF is TO Qualifier enter the WENO Central Fill Pharmacy ID If ZZZ is TO Qualifier enter the appropriate WENO ID If PY is TO Qualifier enter the WENO Payer ID IF REMS is TO Qualifier enter the WENO REMS Administrator ID |
From Qualifier | Yes, occurs 1x | ECL codes | If qualifier field is populated then it is expecting these values: P = Pharmacy D = Prescriber WENO Online ID C = Clinic CF = Central Fill Pharmacy ZZZ = Mutually Defined PY = Payer REMS = REMS Administrator |
From | Yes, occurs 1x | an 1..255 | If the From Qualifier is: The WENO Directory will provide the necessary IDs. |
Message ID | Yes, occurs 1x | an 1..35 | Trace number. A unique reference identifier for the transmission, generated from the sender of the request and the sender of the response. When generated from the sender, it is then echoed back in the response message in the field RelatesToMessageID. The value in this field must be present in RelatesToMessageID on subsequent transactions (such as RxRenewalRequest, CancelRx, etc.) to tie back to an original transmission. If STATUS or ERROR message is a real-time response, then the message ID can either be zero or a unique ID. |
RelatesToMessageID | Conditional, occurs 1x if used. This is needed to tie back to a previous transaction | an 1..35 | On a direct response to electronic transactions this is used (such as a free-standing Error message, Status, RxHistoryResponse) or a subsequent follow up response (such as RxChangeResponse, RxRenewalResponse, CancelRxResponse, MTMServiceResponse) or a subsequent follow up transaction (such as RxFill, Verify), this field is mandatory and is used to link the original message (MessageID) from request to the response or to the subsequent follow up transaction. |
Sent Time | Yes, occurs 1x | UTC Date Type | UTCTimeCode (example: 1970-11-03T13:10:30.64) |
Security | Conditional, 1x. Required by WENO to authenticate API partner | Security, UsernameToken, Username = required, an 1..35, occurs 1x | For real time response use of STATUS or ERROR messages the security segment is not required. <Security> <UsernameToken> <Nonce>1032894770982709870</Nonce> </UsernameToken> <Security> |
SenderSoftware, SenderSoftwareDeveloper | Yes, occurs 1x | an 1..35 | A contact person for troubleshooting |
SenderSoftware, SenderSoftwareProduct | Yes, occurs 1x | an 1..35 | Identifies the entity responsible that generated the transaction. Note: For Status, Error, Verify transactions – contains software identification of the entity creating the response. |
SenderSoftware, SenderSoftwareVersionRelease | Yes, occurs 1x | an 1..50 | Identifies the software product version release of the entity responsible for generating the transaction or creating the response. |
Mailbox | NO | NOT supported – do not populate | GET Message and Mailboxing is not supported by WENO |
TestMessage | NO, occurs 1x if used | Boolean | Indicates if the message is a test message; however WENO does not allow test messages to go to real entities without prior approval from WENO. WENO provides test Pharmacies, Prescriber and other types of accounts for testing in the WENO Directory. |
RxReferenceNumber | NO, occurs 1x if used | an 1..35 | Not used by WENO – you may populate if it is useful |
TertiaryIdentifier | NO, occurs 1x if used | an 1..3 | Not used by WENO – you may populate if it is useful |
PrescriberOrderNumber | NO, occurs 1x if used | an 1..35 | Not used by WENO – you may populate if it is useful |
DigitalSignature Version attribute | Yes, occurs 1x | an | NOTE: Remember that in order for EHRs to send or PTVs to receive EPCS orders we need your DEA approved EPCS audit sent to [email protected]. PTVs populate with “not applicable” EHRs with their audit should populate the DigitalSignature Version attribute with the version your EHR uses to digitally sign the EPCS orders. If your EHR does not have its own DEA approved audit for EPCS, you can populate the Version attribute to “not applicable” |
DigitalSignatureIndicator | Yes, occurs 1x | Boolean | Is the message digitally signed? |
PrescriberOrderGroup | NO, occurs 1x if used | See image in the next column for data types if used. | Not used by WENO – you may populate if it is useful |
RxOrderReferenceGroup | NO, occurs 1x if used | See image in the next column for data types if used | Not used by WENO – you may populate if it is useful |
The Body of the STATUS message
Status Code Meanings
Status Code | Meaning |
---|---|
000 | Transaction successful (use this one for real time and you can avoid sending free standing STATUS later) |
001 | Transaction successful, message(s) waiting to be retrieved |
002 | No more messages (WENO does not support mail boxing, so this is not to be used) |
003 | Transaction successful, no messages to be retrieved (WENO does not support mail boxing, so this is not to be used) |
005 | Transaction successful, password soon to expire |
010 | Successful – accepted by ultimate receiver (use this one only if you plan to send a Free-Standing STATUS later. It was previously reported as successful, so you could leave it as is unless an ERROR occurs when you deliver to the ultimate receiver, then you can send the Free-Standing ERROR back). |
WENO handles VERIFY when EHRs need return receipt so you do not have to.
Status Description Codes
These are not required. If you want to populate them, refer to the 20170715 NCPDP schema we provided.
Prescription Delivery Method Code Meaning
1. Electronic (computer to computer)
2. Faxed
The Body of the ERROR Message
Error Code | What it means |
---|---|
600 | Communication problems – try again later |
601 | Receiver unable to process |
602 | Receiver system error |
700 | Configuration error |
900 | Transaction rejected |
Error “Description Code” and meaning | |
---|---|
008 | Request timed out before response could be received |
130 | COO Cardholder last name is invalid |
134 | Sending a quantity of 0 is invalid for this pharmacy |
144 | # of refills is invalid |
210 | Unable to process transaction – please resubmit |
220 | Transaction is a duplicate |
500 | XML syntax error – XPATH of the element in question must accompany in the Description field of this Error |
4000 | Intermediary is unable to deliver transaction to the recipient. |
4010 | Intermediary is unable to process response from recipient. |
4020 | Intermediary system error |
4030 | Sender not allowed to send this transaction type |
4040 | Receiver does not support this transaction type |
1000 | Unable to identify |
2000 | Data content is invalid |
3000 | Does not follow the NCPDP standard |
Weno provides an Endpoint tool on your dashboard page MANAGE ACCOUNT -> MANAGE IPS AND ENDPOINTS.
Note: when we ask for the secure endpoint URL be sure to specify the full path of the endpoint URL containing the script that handles the messages Weno sends to your endpoint, which can respond in real time with a Status or Error NCPDP message.
For example, if your server is located at https://www.myehr.com and the endpoint script is under /endpoint.php then your endpoint URL is https://www.myehr.com/endpoint.php
SSL is necessary.
Also, you will be asked to provide WENO’s credentials that you will provide to us so we can be authenticated by your system.
To complete step 3
1. Send your newly created endpoint a sample NewRx message successfully and return a real time STATUS message back to WENO using the endpoint testing tool; and
2. Send your new endpoint listener another sample message and make sure you can return a real time ERROR for all the reasons you may reject it. (Use the error codes properly).
You can test your endpoint by sending yourself our samples or send your own sample messages. This image shows how this is done in your Manage IP and Endpoint page.
Suppose your system initially accepts a NewRx on your endpoint listener…then discover it had an issue. This problem can be solved by sending the original sender a Free-Standing ERROR message. This is how to send some free standing ERROR or STATUS test messages:
1. Generate a unique message ID for the ERROR or STATUS message header section.
2. Populate the Test ERROR or STATUS message Header/To field with “D” qualifier and this test WENO Prescriber ID value = D111111:C111111 (in live, you will echo the real prescriber WENO ID using the D qualifier).
3. Populate header FROM as if your recently set up TEST Pharmacy is sending it.
4. Use this value for the field RelatesToMessageID in the header: TEST_RELATES_TO_MESSAGE_ID
5. It requires proper STATUS and Error Code/Description Code/ and Description test. Your Schema ECL has these values. They are listed in step 2 of this guide as well.
6. You can repeat this with a different message ID to test as often as you need.
7. Make sure the IP you are sending from is whitelisted – see step 1.
8. The Transaction Search on your dashboard will show you the message you send. This is useful to drill down and problem solve if needed.
9. Use this endpoint to send NCPDP standard messages, like the FREE standing ERROR or STATUS message to WENO: https://cert.wenoexchange.com/wenox/service.asmx?op=WenoSwitch
10. If you have issues, make sure the ERROR message is valid. Use the WENO Message Validator on the login page of cert dashboard.
You must register and manage all pharmacies using your technology to ePrescribe. We give you 3 ways:
1. Manually via your dashboard MANAGE section.
2. Manage API:
a. Manage API Schema
b. Add (US) Pharmacy Sample Message
c. Edit (US) Pharmacy Sample Message
d. Delete (US) Pharmacy Sample Message
e. Endpoint for Manage API: https://cert.wenoexchange.com/wenox/service.asmx?op=WenoSwitchManage
For a full list of examples you can download a collection of Manage API sample messages here.
3. A one time bulk upload (contact us for the template). This is useful for a temporary measure to quickly add them all on the live environment when you finish testing, but they must be managed continuously.
REGISTER AND MANAGE PRESCRIBERS
To Manually download the prescribers directory, on your dashboard navigation bar go to MANAGE ACCOUNT -> MANAGE LIST page.
Sample Code to Download the Prescriber Directory
Alternatively, you can programmatically download the prescribers directory using code. Find PHP and C# samples below.
PHP Code
<?php
$localfilename = "PrescriberDirectory.zip";
// for live data use live.wenoexchange.com instead
$url = "https://cert.wenoexchange.com/wenox/GetListResponse.aspx?PrescriberDirectory=yes";
// provide your Partner ID and password MD5 hash
// as shown on your dashboard under Account details -> Company Data
$partnerid = 'xxx';
$pass_hash = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
$out = fopen($localfilename, 'wb');
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FILE, $out);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERPWD, "{$partnerid}:{$pass_hash}");
curl_exec($ch);
curl_close($ch);
fclose($out);
echo "Weno $localfilename downloaded!\n";
?>
C# Code
using System;
using System.Net;
using System.Text;
namespace Weno
{
class Program
{
static void Main(string[] args)
{
// console application to download Weno directories
WebClientwebClient = new WebClient();
// provide your Partner ID and password MD5 hash
// as shown on your dashboard under Account details -> Company Data
string partnerId = "123"; // partnerID here
string password = "XXXXXXXX"; // partner password md5 hash here
// for live data use https://live.wenoexchange.com/wenox/GetListResponse.aspx instead
string url = "https://cert.wenoexchange.com/wenox/GetListResponse.aspx?PrescriberDirectory=yes";
// authenticate with weno
webClient.Headers["Authorization"] = "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes(partnerId + ":" + password));
webClient.Headers["Content-Type"] = "application/x-www-form-urlencoded";
// download file from weno
webClient.DownloadFile(new Uri(url), "PrescriberDirectory.zip");
}
}
}
- You provided your DEA approved system audit.
- You can receive NewRxs to your endpoint and return real time STATUS.
- You can receive NewRxs to your endpoint and return real time ERROR.
- You can receive a EPCS NewRx to your endpoint and return real time STATUS.
- You can receive a EPCS NewRx to your endpoint and return real time ERROR.
- Optional: You can send Free-Standing Status that marks it was delivered to ultimate recipient or leave it as assumed.
- Required: You can send Free-Standing ERROR that explains why it was not delivered to ultimate recipient or could not be processed (codes/descriptions).
- You have either used Manage API to manage pharmacies or WENO did an initial bulk upload for live and you have a way to manage them manually or via Manage API later.
You will not need access to the WENO prescriber directory until you get to the PTV WOL API +. This will show you how to use the WENO prescriber directory and how to send messages to prescribers. - WENO will reach out for press releases and logo later.
Congratulations! If you’re ready, then contact your certification manager (Kevin Pauley or Tina Goodman) we will register you for the live environment, where you will repeat these sanity checks for live.
Contact your certification manager if you would like WENO to do a bulk upload of all your pharmacies once and then you can either do the required maintenance via API or manually on dashboard. Your certification manager will provide you with more information about this.