Sidebar

GUI to do mapping

0 votes
294 views
asked Nov 29, 2018 by (270 points)
Is it possible using some GUI tool in QVERA to do mapping HL7 message to tables in DB without using Java Script and using only DRAG & DROP technique ?

1 Answer

+1 vote

There is not a drag and drop tool at this time, however, it is quite simple to use JavaScript editor to accomplish the task. Below is sample code that uses QIE node tags in the database queries to insert the HL7 fields into the query. In this sample, we first query the database to see if the patient already exists. If the patient exists then we use an update statement to update the database and if not then we use an insert statement to insert the patient into the database.

In the below scripts the queries are using Node Tags "{PID-8}" to reference the data fields in the HL7 message. To assist with looking up the node tags or HL7 data fields the user can use the Node Tag lookup feature by Selecting it from the View -> Node Tag Lookup menu or by pressing shift + F2. This will bring up a dialogue screen where you can select the HL7 fields by simply selecting the field with your cursor or from the tree view on the left.

 

QIE Code:

var queryResult = '';
//Query for existing patient
queryResult = qie.doQuery(
   "demo",
   "SELECT patientId from person where patientID = '{PID-3.1}'");
var patientId = queryResult.getNode("patientId");

//If patient exists then use update statment else use an insert statement
if (StringUtils.isNotBlank(patientId)) {
   queryResult = qie.doQuery(
      "demo",
      "UPDATE person \n" +
      "SET patientId = '{PID-3.1}' \n" +
      "SET lastName = '{PID-5.1}' \n" +
      "SET firstName = '{PID-5.2}' \n" +
      "SET dob = '{s[yyyyMMdd]:PID-7}' \n" +
      "WHERE predicateColumn = predicateValue");
} else {
   queryResult = qie.doQuery(
      "demo",
      "INSERT INTO person (patientId, lastName, firstName, dob) \n" +
      "VALUES ('{PID-3.1}', '{PID-5.1}', '{PID-5.2}', '{s[yyyyMMdd]:PID-7}')");
}

 

answered Dec 3, 2018 by gary-t-8719 (14,820 points)
edited Dec 6, 2018 by gary-t-8719
...