Announcement

Collapse
No announcement yet.

Curious mysql exception

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Curious mysql exception

    I've been trying to do what I think is a simple insert into a mysql table. I've set up the destination as a database and I can insert records when I use hardcoded text. However, when I try to use a field from the incoming HL7 message I get the following message in the mirth log:

    INFO [8_source._tcpEndpoint#-1391634918.receiver.3] com.webreach.mirth.server.mule.filters.JavaScriptF ilter: IT IS an ADT msg to be processed
    ERROR [8_destination_1.dispatcher.2] org.mule.impl.DefaultExceptionStrategy: Caught exception in Exception Strategy: Parameter index out of range (1 > 0). Query: INSERT IGNORE INTO mc_usagelog
    (PracticeId, UserId, Source, Action, Info, url, QueryString)
    VALUES ('TNJ07853DEMO','ADL','MI RTH','ADT','?', 'Mirth','ADT' Parameters: [Doe]
    java.sql.SQLException: Parameter index out of range (1 > 0). Query: INSERT IGNORE INTO mc_usagelog
    (PracticeId, UserId, Source, Action, Info, url, QueryString)
    VALUES ('TNJ07853DEMO','ADL','MI RTH','ADT','?', 'Mirth','ADT' Parameters: [Doe]
    at org.apache.commons.dbutils.QueryRunner.rethrow(Que ryRunner.java:330)
    at org.apache.commons.dbutils.QueryRunner.update(Quer yRunner.java:399)
    at org.mule.providers.jdbc.JdbcMessageDispatcher.doDi spatch(JdbcMessageDispatcher.java:95)
    at org.mule.providers.AbstractMessageDispatcher$Worke r.run(AbstractMessageDispatcher.java:257)
    at org.mule.impl.work.WorkerContext.run(WorkerContext .java:290)
    at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.runTask(ThreadPoolExecutor. java:650)
    at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.run(ThreadPoolExecutor.java :675)
    at java.lang.Thread.run(Unknown Source)
    INFO [8_source._tcpEndpoint#93012457.receiver.2] com.webreach.mirth.server.mule.filters.JavaScriptF ilter: IT IS an ADT msg to be processed

    The sql statement in the destination is:

    INSERT IGNORE INTO mc_usagelog
    (PracticeId, UserId, Source, Action, Info, url, QueryString)
    VALUES ('TNJ07853DEMO','ADL','MI RTH','ADT','${PatientLastName} ', 'Mirth','A01'

    If I replace '${PatientLastName}' with 'SomeHardCodeLastName' the insert works fine. The other thing to note is that I dragged PatientLastName over to the sql statement. It is a valid field. I would like to actually concatenate some of the HL7 fields into a single database destination field but I can't seem to get even the single field to insert.

    Any ideas? Thanks in advance.

  • #2
    Re: Curious mysql exception

    Remove the single quotes from the var replacement:

    '${PatientLastName}' should be ${PatientLastName}

    -Chris
    Chris Lang

    Comment


    • #3
      Re: Curious mysql exception

      Hmm, I must be dreaming. I could have sworn that I saw a working example with quotes. Anyway, removing the quotes worked great.

      Thanks!

      Comment

      Working...
      X
      😀
      🥰
      🤢
      😎
      😡
      👍
      👎