#1
|
|||
|
|||
![]()
Maybe I'm missing something simple.... Is it possible to filter messages in a transformer? I have a situation where I know an outgoing message is going to fail, but that can only be determined after the transformer steps have done their slicing and dicing. I've tried a bunch of things, but no luck so far... Primary target is Mirth 3.0.1.
Thanks, Mike |
#2
|
|||
|
|||
![]()
Which Transformer do you use, source or destination? Keep in mind that you can filter in source and each destination. So if you transform the message in the source transformer you could use the destination filter to select the correct messages before sending them
|
#3
|
||||
|
||||
![]()
Hi mnowlin,
If I am understanding you correctly, you want to use a transformer step to remove the destination instead of a filter. If this is correct, you can see a great example of how to do this in the most recent webinar from Mirth. Here is a simple example as well: Code:
//checking to see if message is from hospital A if(msg['MSH']['MSH.3']['MSH.3.1'].toString() == "Hospital A"){ //if from hospital a, remove destination with ID of 1 destinationSet.remove([1]); } |
#4
|
||||
|
||||
![]() |
#5
|
|||
|
|||
![]()
Interesting - I'll give that a try.
Thanks, Mike |
#6
|
|||
|
|||
![]()
Hi jadams4,
Very interesting this functionality, but when I try to use it I'm getting this error: "InternalError: Java class "com.mirth.connect.server.userutil.Destination Set" has no public instance field or method named "remove". (5ed3ab56-e9fc-47ae-8c5c-6a03975c805e#245)" My code: var an_paciente_existe = ''; var erro_consulta_paciente = ''; var result_sql_consulta_paciente; var sql_consulta_paciente = "SELECT id_atend from Atendimento WHERE id_atend = '" + CodigoAN + "' "; result_sql_consulta_paciente = dbConn.executeCachedQuery(sql_consulta_paciente); while(result_sql_consulta_paciente.next()){ an_paciente_existe = result_sql_consulta_paciente.getString("id_atend") ; logger.info('an_paciente_existe ' + an_paciente_existe); } if(an_paciente_existe != ''){ logger.info('RETURN FALSE'); DestinationSet.remove(DestinationSet[1]); } Help me ? Thx! |
#7
|
|||
|
|||
![]()
I think the problem is the last line. It should show as:
destinationSet.remove(1); |
![]() |
Thread Tools | |
Display Modes | |
|
|