A19 Query response from database #4529
-
Hello, I'm new to Mirth Connect. I would like to set up a channel that accepts A19 queries and connects to a postgres database to find the patient id from the A19 query [QRD.8.1] in the database's 'patients' table. It then needs to send a query response and in that response also return some additional info such as visit number, gender, first and last name, which it extracts from the database for that patient id. So, how would I go about this? I don't think I can use a DB reader in the source right? I found the code example in mirth itself for connecting to a database, but then I'm a bit lost as to how to continue. Where would I place this javascript code, in the source filter? Once connected to the database, how to query the 'patientid' field in the 'patients' database for the contents of msg['QRD']['QRD.8']['QRD.8.1']? And, if found, return that same patient id in the query response, as well as some other data that it gets from fields in the database? Many thanks in advance for any help you can offer. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
You could place your javascript code in the postprocessor section. In this example (for Oracle DB), the query structure is reused for the response. Of course, you could build it from scratch. You could put some extra checks in the source filter section I'm not a qualified mirth expert, but this works:
|
Beta Was this translation helpful? Give feedback.
You could place your javascript code in the postprocessor section. In this example (for Oracle DB), the query structure is reused for the response. Of course, you could build it from scratch. You could put some extra checks in the source filter section
I'm not a qualified mirth expert, but this works: