This topic contains 1 reply, has 2 voices, and was last updated by  jbaker 1 month, 2 weeks ago.

creating an NTE segment rom OBX-5

  • I am working on writing a code to iterate and increment through the OBX-4 e.g. 1.1, 1.2,1.4 to create an NTE segment concatenating the values in obx5. This also occurs for 2.1. 2.2, 2.3 etc. Please I need some help with writing the script.

    what the inbound obx looks like
    OBX|1|CWE|1234-1^Service comment^LN^BC34765^Special Requests^L|1.1|^^^OPCOM^Note: This test will not routinely detect Cyclospora, Cryptosporidium, or Cystoisospora (formerly Isospora) species.^L^^^Note: This test will not routinely detect Cyclospora, Cryptosporidium, or Cystoisospora (formerly Isospora) species.|
    OBX|2|CWE|1234-5^Microsporidia identified in Stool by Trichrome stain^LN^BC34765^Exam^L|1.1|^^^CEX^Concentrated Exam:^L^^^Concentrated Exam:||||||F||||
    OBX|3|CWE|1234-5^Microsporidia identified in Stool by Trichrome stain^LN^BC34765^Exam^L|1.2|^^^FEW^Few^L^^^Few||||||F|||
    OBX|4|CWE|1234-5^Microsporidia identified in Stool by Trichrome stain^LN^BC34765^Exam^L|1.3|56789^Entamoeba coli cyst (organism)^SCT^ECCY^Entamoeba coli cysts^L^^v1^Entamoeba coli cyst (organism)|||A|||F|||
    OBX|5|CWE|1234-5^Microsporidia identified in Stool by Trichrome stain^LN^BC34765^Exam^L|2.1|^^^TRCR^Trichrome:^L^^^Trichrome:||||||F|||
    OBX|6|CWE|1234-5^Microsporidia identified in Stool by Trichrome stain^LN^BC34765^Exam^L|2.2|^^^FEW^Few^L^^^Few||||||F|||
    OBX|7|CWE|1234-5^Microsporidia identified in Stool by Trichrome stain^LN^BC34765^Exam^L|2.3|56789^Entamoeba coli cyst (organism)^SCT^ECCY^Entamoeba coli cysts^L^^v1^Entamoeba coli cyst (organism)|||A|||F|||

    what the outbound NTE should be. The NTE is created from the looking at the obx4, and concatenating the obx5 1.1,1.2,1.3 or 2.1, 2.2, 2.3 etc.

    NTE|1|| Specimen Description Stool
    NTE|2|| Special Requests Note: This test will not routinely detect
    NTE|3|| Cyclospora, Cryptosporidium, or Cystoisospora
    NTE|4|| (formerly Isospora) species.
    NTE|5||<B> Exam</B> <B>Concentrated Exam: Few Entamoeba coli cysts</B>
    NTE|6|| <B>Trichrome: Few Entamoeba coli cysts , Moderate</B>
    NTE|7|| <B>Blastocystis hominis</B>

    Are you parsing the inbound message to an hl7 table defined by a VMD? Would make sure your OBX segments belong to a segment group that includes NTE segments, then create a loop:


    for i=1,#MessageIn.OBXGROUP do
    MessageOut.OBXGROUP[i].NTE[3] = MessageIn[i].OBX[5][1][1] .. MessageIn[i].OBX[5][1][2] .. etc.
    end

    if you’re looking to get fancy with the concatenation I personally would write it out as it’s own function that you send the contents of OBX-5 over to that sends back what you want in NTE-3:

    MessageOut.OBXGROUP[i].NTE[3] = MyCatFunction(MessageIn[i].OBX[5])

    forgive my syntax just demoing the concept, hope it helps.

You must be logged in to reply to this topic.