Mirth Community

Mirth Community (http://www.mirthcorp.com/community/forums/index.php)
-   Development (http://www.mirthcorp.com/community/forums/forumdisplay.php?f=8)
-   -   Transformation using Database (http://www.mirthcorp.com/community/forums/showthread.php?t=219224)

cabanjose367 06-25-2019 12:44 PM

Transformation using Database
I would like use a database for Mirth to reference and make a transformation. I will be transforming one insurance code into a different insurance code. So if I have and insurance code 1234 have it transformed into 4321. I have tried to use an array but i have multiple insurances that share the same code on one end but because the mailing address changes the code will be transformed into another code. Im using Mirth Connect 3.8 any help would be appreciated

cory_cole 06-25-2019 12:47 PM

Can you be more specific? Do you have a table that has the code transformations?

cabanjose367 06-25-2019 12:57 PM

Yes the table would have the transformations one column would have the old Insurance iD's and another column would have the new Insurance ID's.

cory_cole 06-25-2019 01:08 PM

What DB are you using?

cabanjose367 06-25-2019 01:11 PM

I was hoping I could use the mirth embedded Database since its not a database that will be growing. it is just to hold the values so I can reference

cory_cole 06-25-2019 01:19 PM

You can use any database for Mirth. Hopefully you are not using Derby. Mirth uses this for demos only and they highly recommend that you a different database when you setup Mirth, as it is not very robust databse. Most commonly used is Postgres. Do you know which DB you set Mirth up with?

cabanjose367 06-25-2019 01:20 PM

Postgres DB. I just looked to make sure.

cory_cole 06-25-2019 01:32 PM

You will need to fill in the information specific to your server....

var dbConn;

try {
dbConn = DatabaseConnectionFactory.createDatabaseConnection ('org.postgresql.Driver',IP Address, username, password);

var query = 'SELECT FIELD1 FROM TABLE WHERE FIELD2 = msg....
result = dbConn.executeCashedQuery(query);
var newCode = result.getString(1);
} finally {
if (dbConn) {

All times are GMT -8. The time now is 10:20 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Mirth Corporation