Announcement

Collapse
No announcement yet.

Transformation using Database

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

  • 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

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

    Comment


    • #3
      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.

      Comment


      • #4
        What DB are you using?

        Comment


        • #5
          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

          Comment


          • #6
            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?

            Comment


            • #7
              Postgres DB. I just looked to make sure.

              Comment


              • #8
                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();
                }
                }

                Comment

                Working...
                X