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 11:44 AM

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 11:47 AM

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

cabanjose367 06-25-2019 11:57 AM

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 12:08 PM

What DB are you using?

cabanjose367 06-25-2019 12: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 12: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 12:20 PM

Postgres DB. I just looked to make sure.

cory_cole 06-25-2019 12: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);
while(result.next())
{
var newCode = result.getString(1);
}
} finally {
if (dbConn) {
dbConn.close();
}
}


All times are GMT -8. The time now is 01:24 PM.

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