Astronaut Application Programming Interface for 170.315(g)(8) Application Access

Terms: Apache 2 license.

API version: 18.01

This document can be found on the web at: http://astronautvista.com/index.php/api

Each patient in VistA has a unique identifying number, called the DFN.

This API can be utilized from a Delphi application containing a proper RPC Broker connection (outlined here: https://www.va.gov/vdl/documents/Infrastructure/Remote_Proc_Call_Broker_(RPC)/xwb_1_1_ug.pdf).

RPC Details:


Input parameters:

  1. Last name – patient’s last name (required)

  2. First name – patient’s first name (required)

  3. DOB – date of birth in format mm-dd-yyyy (required)

  4. SSN – Social Security Number (optional)

  5. Gender – optional

Result: The result of the RPC will be 2 pieces, separated by a carot. The first piece is the success of the search, 1 for success, -1 for failure. The second piece, if successful will be the DFN of the patient. (i.e. If located patient’s DFN is 13166, then the result of the call is “1^13166”. If the call cannot locate a patient the result will be “-1^Patient not located”)

An example of a Delphi call:

RPCBrokerV.remoteprocedure := ‘VEFA GET PATIENT DFN’;

RPCBrokerV.Param[0].Value := ‘Newman’;

RPCBrokerV.Param[0].PType := literal;

RPCBrokerV.Param[0].Value := ‘Alice’;

RPCBrokerV.Param[0].PType := literal;

RPCBrokerV.Param[0].Value := ‘05-01-1970’;

RPCBrokerV.Param[0].PType := literal;


If piece(RPCBrokerV.Results,’^’,1)=1

  dfn := piece(RPCBrokerV.Results,’^’,2);

For g8:

1. Using the Health IT Module’s identified API functions (including the ID or token generated as part of the “Application Access – patient
selection” certification criterion at §170.315(g)(7)), the user demonstrates that one or more API routines responds to and returns the full set of data for each data category from the CCDS for the unique patient identified by the ID or token. Where applicable, the data must be formatted using the specified standards defined in the CCDS Reference Document in a computable format to the developer-identified requesting application:

use curl http://<ip address>/tccda/13168?meds=active&notes=all -u <username>:<password> and either pipe it to a file or to a command such as frgrep, xmlgrep, xmlstarlet version 1.3 or greater, or xmllint

curl command parameter summary including date range selection:

http://<ip address:port>/ccda/<DFN>?select=2015

that will select just the 2015 encounter

http://<ip address:port>/ccda/<DFN>?select=may,2015:august,2015

so will this

http://<ip address:port>/ccda/<DFN>?select=6/20/2015:7/1/2015

http://<ip address:port>/ccda/<DFN>?notes=all

http://<ip address:port>/vpr/<DFN>?format=outline

http://<ip address:port>/ccda/<DFN>?meds=active

• Patient Name xmlstarlet sel -N x="urn:hl7-org:v3" -t -c //x:patient/x:name  <filename>.xml
• Sex  xmlstarlet sel -N x="urn:hl7-org:v3" -t -c //x:patient/x:administrativeGenderCode <filename>.xml
• Date of Birth  xmlstarlet sel -N x="urn:hl7-org:v3" -t -c //x:patient/x:birthTime <filename>.xml
• Race  xmlstarlet sel -N x="urn:hl7-org:v3" -t -c //x:patient/x:raceCode <filename>.xml
• Ethnicity  xmlstarlet sel -N x="urn:hl7-org:v3" -t -c //x:patient/x:ethnicGroupCode <filename>.xml
• Preferred Language  xmlstarlet sel -N x="urn:hl7-org:v3" -t -c //x:patient/x:languageCode <filename>.xml
• Smoking Status fgrep tobacco or xmlstarlet sel -N x="urn:hl7-org:v3" -t -c "//x:title[text()='Social History']/.."
• Problems xmlstarlet sel -N x="urn:hl7-org:v3" -t -c "//x:title[text()='Problems']/.."
• Medications xmlstarlet sel -N x="urn:hl7-org:v3" -t -c "//x:title[text()='Medications']/.."
• Medication Allergies xmlstarlet sel -N x="urn:hl7-org:v3" -t -c "//x:title[text()='Allergies']/.." <filename>
• Laboratory Tests  xmlstarlet sel -N x="urn:hl7-org:v3" -t -c "//x:title[text()='Lab Results']/.."
• Laboratory Values(s)/Result(s) xmlstarlet sel -N x="urn:hl7-org:v3" -t -c "//x:title[text()='Lab Results']/.."
• Vital Signs xmlstarlet sel -N x="urn:hl7-org:v3" -t -c "//x:title[text()='Vital Signs']/.."
• Procedures  xmlstarlet sel -N x="urn:hl7-org:v3" -t -c "//x:title[text()='Procedure']/.."
• Care Team Member(s) xmlstarlet sel -N x="urn:hl7-org:v3" -t -c "//x:title[text()='Care Team Member']/.."
• Immunizations  xmlstarlet sel -N x="urn:hl7-org:v3" -t -c "//x:title[text()='Immunization']/.."
• Unique Device Identifier(s) for a Patient’s Implantable Device(s)
• Assessment and Plan of Treatment xmlstarlet sel -N x="urn:hl7-org:v3" -t -c "//x:title[text()='ASSESSMENT']/.."
xmlstarlet sel -N x="urn:hl7-org:v3" -t -c "//x:title[text()='PLAN OF TREATMENT']/.."
• Goals xmlstarlet sel -N x="urn:hl7-org:v3" -t -c "//x:title[text()=' GOALS']/.."
• Health Concerns xmlstarlet sel -N x="urn:hl7-org:v3" -t -c "//x:title[text()=' HEALTH CONCERNS']/.."