Announcement

Collapse

Mirth Connect 3.12.0 Released!

Mirth Connect 3.12.0 is now available as an appliance update and on our GitHub page. This release includes database performance improvements, improves visual HL7 representation, message pruning, keystore handling, PDF generation, community contributions, and fixes several security vulnerabilities. This release also contains many improvements to commercial extensions. See the release notes for the list of fixes and updates.

Download | See What's New | Upgrade Guide | Release Notes

For discussion on this release, see this thread.
See more
See less

repeating segments into sqlserver database

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

  • repeating segments into sqlserver database

    I have been searching the forum but with no luck on this topic yet. Could someone please give a newbie a helping hand on getting repeating segments into a sqlserver database. I have manageed to get single segments into the database but know repeating segments.

    Thanks,
    Chad

  • #2
    Re:repeating segments into sqlserver database

    Hi,

    if you need to recover repeating segments from HL7 messages in order to load them into database, you should use javascript code into transformer or destination screens with code like this:

    var obxi = 0;
    var test

    while (msg['OBX']['OBX.1']['OBX.1.1'][obxi] != null) {
    test += msg['OBX'][obxi]['OBX.1']['OBX.1.1'].toString() + ',';
    obxi++;
    }

    or, as far as I can remember, in versions like 1.6/1.7 there is a piece of code generated by development team, very useful for that purpouse. Is defined in message functions as "Iterate over segment", and is very similar.

    Ricard Bernat

    Comment


    • #3
      Re:repeating segments into sqlserver database

      Hi,

      if you need to recover repeating segments from HL7 messages in order to load them into database, you should use javascript code into transformer or destination screens with code like this:

      var obxi = 0;
      var test

      while (msg['OBX']['OBX.1']['OBX.1.1'][obxi] != null) {
      test += msg['OBX'][obxi]['OBX.1']['OBX.1.1'].toString() + ',';
      obxi++;
      }

      or, as far as I can remember, in versions like 1.6/1.7 there is a piece of code generated by development team, very useful for that purpouse. Is defined in message functions as "Iterate over segment", and is very similar.

      Ricard Bernat

      Comment


      • #4
        Re:repeating segments into sqlserver database

        see next message

        Post edited by: doc4child, at: 02/25/2008 10:00

        Comment


        • #5
          Re:repeating segments into sqlserver database

          The HL7 Message that i am using is......



          MSH|^~&|LAB|CCF|||20040920080937||ORM^O01|42640000 009|P|2.3|
          PID|||56797971||RESULTSREVIEW^TESTPATIENT^||196505 25|M||||||||||56797971|
          PV1||O|UNKO^|||||
          ORC|RE||A0203809||IP|||||||
          OBR|1|A0203809|A0203809|400090^Complete Blood Count|||200609240000|||||||200609240847||deleted^^ ^^MD^^^^^^||||||200609241055|||P
          OBX|1|ST|40010^White Blood Count (WBC) (x1000)||PENDING||||||P
          OBX|2|ST|40020^Red Blood Count (RBC)||PENDING||||||P
          ORC|RE||A0203809||CM|||||||
          OBR|2|A0203809|A0203809|650300^Depakene (Valproic Acid) Level|||200609240000|||||||200609240847||^deleted^ ^^^MD^^^^^^||||||200609241055|||F
          OBX|3|NM|65030^Depakene (Valproic Acid) Level||76.8|ug/ml|50-100||||F|||200609241054||



          The Table in the test database in mssql server is.......


          USE [test]
          GO
          /****** Object: Table [dbo].[Observations] Script Date: 02/24/2008 19:35:39 ******/
          SET ANSI_NULLS ON
          GO
          SET QUOTED_IDENTIFIER ON
          GO
          CREATE TABLE [dbo].[Observations](
          [ID] [int] IDENTITY(1,1) NOT NULL,
          [patientID] [int] NULL,
          [Ob_Name] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
          [Ob_Value] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
          [Ob_Range] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
          ) ON [PRIMARY]

          the Sqlserver username is sa and password is wd2ct4et

          See the attached channel (Mirth 1.7) with For......loop it works well without any errors...

          file_multi_obx_2_mssql.xml (13562 bytes)

          Post edited by: doc4child, at: 02/25/2008 10:02

          Comment

          Working...
          X