This page is for programmers integrating with the MDScripts dispensing system. The page provides information and sample links for your testing purposes. In order to use this page, you will need a site id (5 digits), username and password. These 3 fields identify the site/user for the interface and are the same used on the login screen to access the system.

Link Example #1: Take user to inventory screen

https://www.mdscripts.com/dis/servlet/dis.Main?n=RemoteLogin&siteId=00000&username=username&password=password&target=ShowInventory

Parameters:
n:Should always be "RemoteLogin" to access this api
siteId:Five digit site id number
username:username
password:password
target:Target screen after the login. Examples are "ShowInventory","ShowReports","ShowCart" for dispensing, and "ShowRxPad" for ePrescribing
debug:Having trouble? Please add debug=1 to parameter list to enable debug on our end to assist you


Button Example: Use button or image instead of link

For any of the link examples on this page, you can elect to use an link image or button instead of a text link. Which one you use will depend on which blends in better in your application's user interface. Using a button has a few advantages like easier for the user to locate/click, and you don't have to URL Encode the parameters since the browser form does it when the HTTP POST is transmitted. To use a button instead of link, Example Link #1 would appear like this:

Sample HTML Code:
<form method="POST" action="https://www.mdscripts.com/dis/servlet/dis.Main" target="newWindow">
<input type="hidden" name="n" value="RemoteLogin">
<input type="hidden" name="siteId" value="00000">
<input type="hidden" name="username" value="username">
<input type="hidden" name="password" value="password">
<input type="hidden" name="target" value="ShowInventory">
<input type="submit" name="submit" value="eDispense">
</form>

This Sample HTML generates the HTML button:
You can change the button text to whatever you like and apply any HTML style to this button. If you need more assistance on constructing HTTP POSTS using HTML forms, please let us know.

Link Example #2: Get inventory in CSV format

https://www.mdscripts.com/dis/servlet/dis.Main?n=RemoteLogin&siteId=00000&username=username&password=password&target=ShowExportInventory

Parameters:
n:Should always be "RemoteLogin" to access this api
siteId:Five digit site id number
username:username
password:password
target:ShowExportInventory

Link Example #3: Dispense to blank patient

https://www.mdscripts.com/dis/servlet/dis.Main?n=RemoteLogin&siteId=00000&username=username&password=password&target=ShowCart

Parameters:
n:Should always be "RemoteLogin" to access this api
siteId:Five digit site id number
username:username
password:password
target:ShowCart is the name of the screen where the dispensing starts

Link Example #4: Dispense to patient with patient data only (no prescription information)

https://www.mdscripts.com/dis/servlet/dis.Main?n=RemoteLogin&siteId=00000&username=username&password=password&target=ShowCart&externalId=P100&store=1&firstName=Mary+Ann&lastName=Wellby

Parameters:
n:Should always be "RemoteLogin" to access this api
siteId:Five digit site id number
username:username
password:password
target:ShowCart is the name of the screen where the dispensing starts

Below is the listing of all the patient fields that can be passed on this link to ShowCart. Before looking at the patient specific fields, we would like to introduce these control fields:

externalId:If the external system has patient id's passing this along will make this system preload the patient from the database using this id BEFORE parsing the rest of the parameters in this link. This will prevent duplicate patient creation and is highly recommended.
store:Passing this parameter with any value will make the system store the patient information regardless if the operator proceeds with a dispense. This should be used of the dispensing will occur at a later location or if you just need to update patient information.
queue:Default behavior queues the patient. If you do not wish the patient to be added to the dispense queue, then set this value to 0. eg queue=0

Here is a listing of all of the patient information fields:

firstName:Example: Mary Ann
middleName:Example: Stella
lastName:Example: Jones
address:Example: 123 Main St
address2:Example: #201
city:Example: Los Angeles
state:Example: CA or California
zip:Example: 76021 (everything but digits is ignored)
homePhone:Example: (954) 555-1232 (Everythig but digits is ignored)
cellPhone:
workPhone:
dob:MM/DD/YYYY
gender:m or f
weightLbs:double or int. Example: 180.5
heightInches:double or int. Example: 72
ssn:Example: 532-32-8899 (Everything but digits is ignored)
driversLicenseState:Example: CA or California
driversLicense:
email:Example: mary@gmail.com
patientConsent:MM/DD/YYYY (Date of patient consent for med history, 0=clear)
allergies:Example: 568t6,476t1 (comma separated allergy codes and type eg 568t6=peanuts, 476t1=penicillins)
conditions:Example: W22.01,W22.02 (comma separated ICD10s)
dateOfInjury:MM/DD/YYYY
claimReferenceId:For Workers' Comp, this is the claim number
authorizationId:Used for reimbursement of claims
prescriberId:Used to identify the prescriber. System compares to the following fields in providers table: emrId, NPI, DEA #.
doctorId:Used to identify the prescriber. System compares to the following fields in providers table: emrId, NPI, DEA #. (Legacy)
ncpdpId:E-Prescription Pharmacy NCPDPID
empName:Employer
empAddress:Employer
empAddress2:Employer
empCity:Employer
empState:Example: CA or California
empZip:Example: 76021 (everything but digits is ignored)
empPhone:Example: 532-32-8899 (Everything but digits is ignored)
payerName:Payer
payerAddress:Payer
payerAddress2:Payer
payerCity:Payer
payerState:Example: CA or California
payerZip:Example: 76021 (everything but digits is ignored)
payerPhone:Example: 532-32-8899 (Everything but digits is ignored)
payerFax:Example: 532-32-8899 (Everything but digits is ignored)
attorneyPractice:Attorney
attorneyName:Attorney
attorneyAddress:Attorney
attorneyAddress2:Attorney
attorneyCity:Attorney
attorneyState:Example: CA or California
attorneyZip:Example: 76021 (everything but digits is ignored)
attorneyPhone:Example: 532-32-8899 (Everything but digits is ignored)
attorneyFax:Example: 532-32-8899 (Everything but digits is ignored)
attorneyEmail:Example: mary@gmail.com

Link Example #5: Dispense to patient with patient AND prescription information

https://www.mdscripts.com/dis/servlet/dis.Main?n=RemoteLogin&siteId=00000&username=username&password=password&target=ShowCart&externalId=P100&store=1&firstName=Mary+Ann&lastName=Wellby
&ndc1=55885020030&qty1=30&refills1=5&sig1=Take+1+a+day&icd101=M06.372&daysSupply1=30

Parameters:

n:Should always be "RemoteLogin" to access this api
siteId:Five digit site id number
username:username
password:password
target:ShowCart is the name of the screen where the dispensing starts

The prescription information below is sent in addition to the patient information shown in the previous example. Multiple prescriptions are sent through the one call therefore the parameters below are enumerated 1..N . For example, ndc1,ndc2,ndc3 would be sent for the NDC numbers of the 1st, 2nd and 3rd prescriptions.

ndcNNDC number of the medication for the prescription
qtyNnumber of units. For example 30,60,90 or 14.1 for liquids
refillsNoptional field for the number of refills for the prescription
sigNdosing instructions for the patient (english or spanish)
icd10Ncondition code for reimbursement
daysSupplyNoptional days supply of the medication
writtenDateNoptional written date (otherwise assumes today)
originCodeNoptional origin code (NCPDP values 0 through 4)

Link Example #6: Dispense to patient with patient AND insurance information (NCPDP)

https://www.mdscripts.com/dis/servlet/dis.Main?n=RemoteLogin&siteId=00000&username=username&password=password&target=ShowCart&externalId=P100&store=1&firstName=Mary+Ann&lastName=Wellby
&bin1=610029&pcn1=CRK&cardholderId1=123456&groupId1=GRPA&personCode1=2&relationshipCode1=2&primaryFirstName1=John&primaryLastName1=Smith

Parameters:

n:Should always be "RemoteLogin" to access this api
siteId:Five digit site id number
username:username
password:password
target:ShowCart is the name of the screen where the dispensing starts

The insurance information below is sent in addition to the patient information shown in the previous example. Multiple multiple insurance information is sent through the one call therefore the parameters below are enumerated 1..4 . For example, bin1,bin2,bin3 would be sent for the BIN numbers of the 1st, 2nd and 3rd insurance cards.

binNInsurance plan's 6 digit BIN number (NCPDP 101-A1)
pcnNProcessor Control Number (NCPDP 104-A4)
cardholderIdNCardholder's ID (NCPDP 302-C2)
groupIdNInsurance group (NCPDP 301-C1)
personCodeNPerson Code (NCPDP 303-C3)
relationshipCodeNRelationship Code (NCPDP 306-C6)
primaryFirstNameNWhen not Cardholder (NCPDP 312-CC)
primaryLastNameNWhen not Cardholder (NCPDP 313-CD)