-
Notifications
You must be signed in to change notification settings - Fork 4
Home
Welcome to the Erx Tool wiki!
There seems to be some confusion with the ONC Certification process and vendors using the SureScripts Network in production and testing. If you are on the SureScripts network, you WILL NOT use it to test messages for the ONC Certification Process. All ONC Certification messages should be sent directly to the NIST ePrescribing Test Tool. You may, however, retrieve the PBM unique ID (PBM UID) of the patient from the eligibility response – through Surescripts. If you need to retrieve the PBM UID, use the eligibility request (270) to go through Surescripts to determine the patient's PBM UID from the response (271), for use in the RXHREQ-(EDI)/RxHistoryRequest-(XML) – and to determine which PBM to send it to. The RXHREQ-(EDI)/RxHistoryRequest-(XML) message should then be sent directly to the NIST ePrescribing Tool and not thru the SureScripts Network. SureScripts has entered a blank response for these patients in their system, so if you are getting back a blank medication history, you are most likely sending the query to SureScripts and NOT the NIST tool.
To send a message to the ERX tool, you need to have an account and to be logged in at the time you send a message. In your HTTP request, there must be an authorization header for which the value is “Basic (Base64Encoded)[username:password]”. To find the username and password, you can open the Transport Settings page. The password needs to be under its encrypted form.
For example if the username is Seube and the password is bdbd550aa069e504cad25235b4d38abd7a4c4e0c1da1efcaf3e56f566cbe52f9, you’d have to encode in base64 the string “Seube:bdbd550aa069e504cad25235b4d38abd7a4c4e0c1da1efcaf3e56f566cbe52f9” (using https://www.base64encode.org/ for example). The result of the encoding is “U2V1YmU6YmRiZDU1MGFhMDY5ZTUwNGNhZDI1MjM1YjRkMzhhYmQ3YTRjNGUwYzFkYTFlZmNhZjNlNTZmNTY2Y2JlNTJmOQ==”, so your header would be:
Authorization: Basic U2V1YmU6YmRiZDU1MGFhMDY5ZTUwNGNhZDI1MjM1YjRkMzhhYmQ3YTRjNGUwYzFkYTFlZmNhZjNlNTZmNTY2Y2JlNTJmOQ==
More info here: https://www.httpwatch.com/httpgallery/authentication/ (section 10.1 - Basic Authentication).
In addition to the Authorization header, you also need to set the Content-Type and Accept headers. The value of those headers depends on which protocol you're using:
REST and Surescript endpoints consumes text/xml content, so you need to set:
Content-Type: text/xml
The UrlEncoded endpoint consumes application/x-www-form-urlencoded, so you need to set:
Content-type: application/x-www-form-urlencoded
Here is an example of a Newrx message as we're expecting to receive on the endpoint:
UNA:+./*'
UIB+UNOA:0++77777777:C+++SENDER_ID:D+RECIPIENT_ID:P+20151120:141523'
UIH+SCRIPT:010:006:NEWRX+25106+ORDMU201'
PVD+PC+FF1234567:DH*1619967999:HPI+++MacClare:Susan:::++Clinic One+10105 Trailblazer Ct:Portland:OR:97215+5035552233:TE'
PVD+P2+1629900:D3*3030000003:HPI+++++Mail Order Pharmacy 10.6MU NOCS+1629-90 Supply Ln:Saint Louis:MO:63105+3145553142:TE'
PTT+1+19570321+Biscayne:Sophia:::+F+6532865:94+991 Monroe Avenue:Port Charlotte:FL:33952+9415551223:TE'
DRU+P:Procardia XL 30 MG 24 HR Extended R:00069265041:ND::30::207772:SBD:elease Oral Tablet:::AA:C42927:AB:C28253+:53:38:AC:C48542+:Take 1 tablet a day by mouth for seven days, then take 2 tablets by mo:uth once a day.+85:20151120:102*ZDS:30:804+1+R:0+1:I201:ABF'
SIG+1:THEN+20130731:14.01d+2:Take 1 tablet a day by mouth for seven days, then take 2 tablets by mouth once a day.+1:take:1:419652001::::1:tablet:2:C42998:+++by mouth:1:26643006:++:::::::::::1:day:1:258703001::::::+7:day:1:258703001+:::+::::::::::'
SIG+2:+20130731:14.01d+2:Take 1 tablet a day by mouth for seven days, then take 2 tablets by mouth once a day.+1:take:1:419652001::::2:tablet:2:C42998:+++by mouth:1:26643006:++:::::::::::1:day:1:258703001::::::+:::+:::+::::::::::'
UIT+25106+9'
UIZ++1'
<?xml version="1.0" encoding="utf-8"?>
<Message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="010" release="006" xmlns="http://www.ncpdp.org/schema/SCRIPT">
<Header>
<To Qualifier="P">RECIPIENT_ID</To>
<From Qualifier="D">SENDER_ID</From>
<MessageID>90927</MessageID>
<SentTime>2015-11-20T14:15:23</SentTime>
<PrescriberOrderNumber>ORDMU201</PrescriberOrderNumber>
</Header>
<Body>
<NewRx>
<Pharmacy>
<Identification>
<NPI>3030000003</NPI>
<NCPDPID>1629900</NCPDPID>
</Identification>
<StoreName>Mail Order Pharmacy 10.6MU NOCS</StoreName>
<Address>
<AddressLine1>1629-90 Supply Ln</AddressLine1>
<City>Saint Louis</City>
<State>MO</State>
<ZipCode>63105</ZipCode>
</Address>
<CommunicationNumbers>
<Communication>
<Number>3145553142</Number>
<Qualifier>TE</Qualifier>
</Communication>
</CommunicationNumbers>
</Pharmacy>
<Prescriber>
<Identification>
<DEANumber>FF1234567</DEANumber>
<NPI>1619967999</NPI>
</Identification>
<ClinicName>Clinic One</ClinicName>
<Name>
<LastName>MacClare</LastName>
<FirstName>Susan</FirstName>
</Name>
<Address>
<AddressLine1>10105 Trailblazer Ct</AddressLine1>
<City>Portland</City>
<State>OR</State>
<ZipCode>97215</ZipCode>
</Address>
<CommunicationNumbers>
<Communication>
<Number>5035552233</Number>
<Qualifier>TE</Qualifier>
</Communication>
</CommunicationNumbers>
</Prescriber>
<Patient>
<Identification>
<MedicalRecordIdentificationNumberEHR>Patient1</MedicalRecordIdentificationNumberEHR>
</Identification>
<Name>
<LastName>Biscayne</LastName>
<FirstName>Sophia</FirstName>
</Name>
<Gender>F</Gender>
<DateOfBirth>
<Date>1957-03-21</Date>
</DateOfBirth>
<Address>
<AddressLine1>991 Monroe Avenue</AddressLine1>
<City>Port Charlotte</City>
<State>FL</State>
<ZipCode>33952</ZipCode>
</Address>
<CommunicationNumbers>
<Communication>
<Number>9415551223</Number>
<Qualifier>TE</Qualifier>
</Communication>
</CommunicationNumbers>
</Patient>
<MedicationPrescribed>
<DrugDescription>Procardia XL 30 MG 24 HR Extended Release Oral Tablet</DrugDescription>
<DrugCoded>
<ProductCode>00069265041</ProductCode>
<ProductCodeQualifier>ND</ProductCodeQualifier>
<Strength>30</Strength>
<DrugDBCode>207772</DrugDBCode>
<DrugDBCodeQualifier>SBD</DrugDBCodeQualifier>
<FormSourceCode>AA</FormSourceCode>
<FormCode>C42927</FormCode>
<StrengthSourceCode>AB</StrengthSourceCode>
<StrengthCode>C28253</StrengthCode>
</DrugCoded>
<Quantity>
<Value>53</Value>
<CodeListQualifier>38</CodeListQualifier>
<UnitSourceCode>AC</UnitSourceCode>
<PotencyUnitCode>C48542</PotencyUnitCode>
</Quantity>
<DaysSupply>30</DaysSupply>
<Directions>Take 1 tablet a day by mouth for seven days, then take 2 tablets by mouth once a day.</Directions>
<Refills>
<Qualifier>R</Qualifier>
<Value>0</Value>
</Refills>
<Substitutions>1</Substitutions>
<WrittenDate>
<Date>2015-11-20</Date>
</WrittenDate>
<LastFillDate>
<Date>2015-10-30</Date>
</LastFillDate>
<Diagnosis>
<ClinicalInformationQualifier>1</ClinicalInformationQualifier>
<Primary>
<Qualifier>ABF</Qualifier>
<Value>I201</Value>
</Primary>
</Diagnosis>
<StructuredSIG>
<RepeatingSIG>
<SigSequencePositionNumber>1</SigSequencePositionNumber>
<MultipleSigModifier>THEN</MultipleSigModifier>
</RepeatingSIG>
<CodeSystem>
<SNOMEDVersion>20130731</SNOMEDVersion>
<FMTVersion>14.01d</FMTVersion>
</CodeSystem>
<FreeText>
<SigFreeTextStringIndicator>2</SigFreeTextStringIndicator>
<SigFreeText>Take 1 tablet a day by mouth for seven days, then take 2 tablets by mouth once a day.</SigFreeText>
</FreeText>
<Dose>
<DoseCompositeIndicator>1</DoseCompositeIndicator>
<DoseDeliveryMethodText>take</DoseDeliveryMethodText>
<DoseDeliveryMethodCodeQualifier>1</DoseDeliveryMethodCodeQualifier>
<DoseDeliveryMethodCode>419652001</DoseDeliveryMethodCode>
<DoseQuantity>1</DoseQuantity>
<DoseFormText>tablet</DoseFormText>
<DoseFormCodeQualifier>2</DoseFormCodeQualifier>
<DoseFormCode>C42998</DoseFormCode>
</Dose>
<RouteofAdministration>
<RouteofAdministrationText>by mouth</RouteofAdministrationText>
<RouteofAdministrationCodeQualifier>1</RouteofAdministrationCodeQualifier>
<RouteofAdministrationCode>26643006</RouteofAdministrationCode>
</RouteofAdministration>
<Timing>
<FrequencyNumericValue>1</FrequencyNumericValue>
<FrequencyUnitsText>day</FrequencyUnitsText>
<FrequencyUnitsCodeQualifier>1</FrequencyUnitsCodeQualifier>
<FrequencyUnitsCode>258703001</FrequencyUnitsCode>
</Timing>
<Duration>
<DurationNumericValue>7</DurationNumericValue>
<DurationText>day</DurationText>
<DurationTextCodeQualifier>1</DurationTextCodeQualifier>
<DurationTextCode>258703001</DurationTextCode>
</Duration>
</StructuredSIG>
<StructuredSIG>
<RepeatingSIG>
<SigSequencePositionNumber>2</SigSequencePositionNumber>
</RepeatingSIG>
<CodeSystem>
<SNOMEDVersion>20130731</SNOMEDVersion>
<FMTVersion>14.01d</FMTVersion>
</CodeSystem>
<FreeText>
<SigFreeTextStringIndicator>2</SigFreeTextStringIndicator>
<SigFreeText>Take 1 tablet a day by mouth for seven days, then take 2 tablets by mouth once a day.</SigFreeText>
</FreeText>
<Dose>
<DoseCompositeIndicator>1</DoseCompositeIndicator>
<DoseDeliveryMethodText>take</DoseDeliveryMethodText>
<DoseDeliveryMethodCodeQualifier>1</DoseDeliveryMethodCodeQualifier>
<DoseDeliveryMethodCode>419652001</DoseDeliveryMethodCode>
<DoseQuantity>2</DoseQuantity>
<DoseFormText>tablet</DoseFormText>
<DoseFormCodeQualifier>2</DoseFormCodeQualifier>
<DoseFormCode>C42998</DoseFormCode>
</Dose>
<RouteofAdministration>
<RouteofAdministrationText>by mouth</RouteofAdministrationText>
<RouteofAdministrationCodeQualifier>1</RouteofAdministrationCodeQualifier>
<RouteofAdministrationCode>26643006</RouteofAdministrationCode>
</RouteofAdministration>
<Timing>
<FrequencyNumericValue>1</FrequencyNumericValue>
<FrequencyUnitsText>day</FrequencyUnitsText>
<FrequencyUnitsCodeQualifier>1</FrequencyUnitsCodeQualifier>
<FrequencyUnitsCode>258703001</FrequencyUnitsCode>
</Timing>
</StructuredSIG>
</MedicationPrescribed>
</NewRx>
</Body>
</Message>
<?xml version="1.0" encoding="utf-8"?>
<Message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="010" release="006" mlns="http://www.ncpdp.org/schema/SCRIPT">
<Header>
<To Qualifier="P">1619967999</To>
<From Qualifier="D">3030000003</From>
<MessageID>78070437</MessageID>
<SentTime>20161013'T'122918</SentTime>
</Header>
<Body>
<EDIFACTMessage>VU5BOisuLyonVUlCK1VOT0E6MCsrNzgwNzA0Mzc6QysrKzE2MTk5Njc5OTk6RCszMDMwMDAwMDAzOlArMjAxNjEwMTM6MTIyOTE4J1VJSCtTQ1JJUFQ6MDEwOjAwNjpORVdSWCszNjU1NytSWDEyMydQVkQrUEMrMTYxOTk2Nzk5OTpIUEkqQk02MDQwNjA2OkRIKysrTWFjQ2xhcmU6U3VzYW4rK0NsaW5pYyBPbmU2KzEwMTA1IFRyYWlsYmxhemVyIEN0OlBvcnRsYW5kOk9SOjk3MjE1KzUwMzQ3MzIyMzM6VEUnUFZEK1AyKzE2Mjk5MDA6RDMqMzAzMDAwMDAwMzpIUEkrKysrK01haWwgT3JkZXIgUGhhcm1hY3kgMTAuNk1VIE5PQ1MrMTYyOS05MCBTdXBwbHkgTG46U2FpbnQgTG91aXM6TU86NjMxMDUrMzE0MjYwMzE0MjpURSdQVFQrMSsxOTU3MDMyMStCaXNjYXluZTpTb3BoaWErRitQQVRJRU5USUQ6RUorOTkxIE1vbnJvZSBBdmVudWU6UG9ydCBDaGFybG90dGU6Rkw6MzM5NTIrOTQxMjAxMTIyMzpURSdEUlUrUDpQcm9jYXJkaWEgWEwgMzAgTUcgT3JhbCBUYWJsZXQ6MDAwNjkyNjUwNDE6TkQ6OjMwOjoyMDc3NzI6U0JEOjI0IEhSIE5pZmVkaXBpbmUgMzAgTUcgRXh0ZW5kZWQgUmVsOmVhc2UgT3JhbCBUYWJsZXQgW1Byb2NhcmRpYV06OkFBOkM0MjkyNzpBQjpDMjgyNTMrOjUzOjM4OkFDOkM0ODU0Mis6VGFrZSAxIHRhYmxldCBhIG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