HL7

  • 31 Jul

    HL7 (text) File Modification with Limagito File Mover

    HL7 (text) File Modification

    Q: Good morning, thank you again for taking my call! Please find the before and after test files attached.

    1. You’ll see that the FT1 segment, specifically the FT1.25 section, was moved to FT1.7 section. (Each section is delimited by a pipe “|”.)
    2. We also added “CG” (without quotes) to the FT1.6 section. I’ve attached an image to visualize as well.

    I’m urgently trying to get this solution in place! Thank you for your help!!!!

    A: Summary of what we need to do:

    1. Load the HL7 (text) File.
    2. Iterate through the lines in the HL7 File.
    3. Search for a line that starts with ‘FT1|’.
    4. Make the requested adjustments.
    5. Save the HL7 file different from the Source.

    We created a Pascal Script to achieve this (v2021.7.31.0 or higher is needed for this script). Let’s start.

    1) Please add a Source and a File Filter for the .HL7 files you want to adjust
    2) Add the following Pascal Script as Destination, don’t forget to adjust the ctOutputPath const ( must end with a \ ).

    Limagito File Mover Pascal Script as Destination

    Var
      iList: Integer;
      tmpEntry: String;
      tmpError: String;
      tmpField: String;
      tmpFile : String;
      tmpList: TStringList;
      tmpEntryList: TStringList;
    Const
      ctOutputPath = 'C:\Test\IN_HL7\Out\';
    Begin
      psExitCode:= 0;
      // ... add your code here
      tmpFile := psFilePath + psFileName;
      tmpList := TStringList.Create;
      Try
        Try
          tmpList.LoadFromFile(tmpFile);
          // Iterate
          For iList := 0 to (tmpList.Count-1) Do
          Begin
            tmpEntry := tmpList.Strings[iList];
            If Pos('FT1|', tmpEntry) <> 0 Then
            Begin
              tmpEntryList := psDelimitedTextAsList('|', tmpEntry);
              If Assigned(tmpEntryList) Then
              Begin
                tmpEntryList.Delimiter := '|';
                tmpEntryList.StrictDelimiter := True;
                tmpEntryList.Quotechar := #0;
                // 0 indexed
                If tmpEntryList.Count >= 25 Then
                Begin
                  tmpEntryList.Strings[6] := 'CG';
                  tmpEntryList.Strings[7] := tmpEntryList.Strings[25];
                  tmpEntryList.Strings[25] := ''
                  tmpList.Strings[iList] := tmpEntryList.DelimitedText + '|';
                  // Save To File
                  tmpError := psSaveListToFile(tmpList, ctOutputPath + psFileName, False);
                  if tmpError = '' Then
                  begin
                    psExitCode := 1;
                    psLogWrite(1, '', 'Saved adjusted file to: ' + ctOutputPath + psFileName);
                  End
                  Else
                    psLogWrite(1, '', tmpError);
                End Else
                Begin
                  psLogWrite(1, '', 'Field Count error of: ' + tmpEntryList.DelimitedText);
                End;
                // Free
                tmpEntryList.Free;
                // Break
                Break;
              End;
            End;
          End;
        Except
          psLogWrite(1, '', 'Error loading file: ' + tmpFile);
        End;
      Finally
        tmpList.Free;
      End;
    End.

    #FileTransfer

    If you need any info about this ‘HL7 (text) File Modification’ request, please let us know.

    Best regards,

    Limagito Team

  • 28 Mar

    HL7 getOrderDocument Request ABN using Limagito File Mover

    Q: HL7 getOrderDocument Request ABN using Limagito File Mover. I would like to resume if possible the sending to ‘MyDomain’ with the ABN option. From my understanding we will use the same wrapper which is working well to send to a new url with a document type of ABN. ‘MyDomain’ will review the codes within the HL7 message and determine the patient needs to sign an ABN form. If they do not ‘MyDomain’ will process the order message and result back using the current download. If the patient has to sign ABN form ‘MyDomain’ will kick back the ACK with a code, we will need to download the ABN form and place on the local server for the staff to get the patient to sign. The order will be processed and resulted, the signed ABN form will be placed with the pickup order.

    A: We added this option in version v2021.3.28.0. FYI, we are using REST/JSON (not SOAP).

    We added some screenshots to get you started. This is how we tested this new option.

    • Use WIN as Source. Put your HL7 files needed for the getOrderDocument ABN request

    Limagito File Mover HL7 Source Folder

    • Please add two destinations. Important, the first destination should be HTTP and the second destination WIN

    Limagito File Mover HL7 as Destination

    • HTTP as Destination setup:
      • Be sure to select the ‘Result Directory’ Folder. Here we’ll put the ABN pdf files if required
      • Select ‘Content File as HL7 getOrderDocument ABN’ as Content Selection
      • ‘Content File’ option should stay: %SFP%SFN.
        • This way we’ll use the content of the source HL7 files for the getOrderDocument Request

    Limagito File Mover HL7 getOrderDocument

    • Add a second Destination, use WIN as Destination.
      • This is where we’ll move the source .dat HL7 files to when HTTP POST is successful.

     

    • Set Function Setup as in the following screenshot:
      • We enabled the ‘Exit Cyclus on Error’ option so if the HTTP Destination fails (which is the first one), we’ll leave it in the source folder and try again during the next scan.
      • So when we get a HTTP error we’ll not move it to the second Destination (WIN).

    Limagito File Mover Function Setup

    • RunTime Log Result:

    Limagito File Mover HL7 ABN is Required

    If you need any help with this ‘HL7 getOrderDocument Request ABN’ issue, please let us know.

    Best Regards,

    Limagito Team

    By Limagito-Team HL7 HTTP , ,
  • 22 Nov

    Submit a Base64-encoded order HL7 message with Limagito File Mover

    A while ago we received the following question from William: “Is it possible to submit a Base64-encoded order HL7 message”. Since we already had HTTP as Destination, we decided to add this as an extra feature. Available in version v2020.11.21.0

    We recieved the following information from the user:

    submitOrder
    The submitOrder method allows you to submit a Base64-encoded order HL7 message to the Data Exchange. The order can be either a Basic Lab Order or a Patient Service Center (PSC) Hold Order.

    Endpoint
    You must use the HTTP POST method to submit orders to the endpoint shown below, where domain specifies the Data Exchange environment. 

    POST https://domain/rest/orders/v1/submission

    Request: The Base64-encoded order HL7 message as text/plain format

    {“TVNIfF5+XCZ8Q1RGV3w5NzUwMjg0MHx8TkVMfDIwMT…”}

    Response: The Base64-encoded order acknowledgment (ACK) HL7 message as text/plain format

    As Source we’ll have HL7 order file (not encoded yet) which looks like (it’s just an example):

    MSH|^~\&amp;|INSTPROG|50203311|1111|MET|19980630080040||ORM^O01|MSG00001|P|2.3|
    PID|1||28514753||Joan^Howard^J||196303241225|F
    SAC|991912376^EXTLAB|01039421^THISLAB|092321A^LAS|092321^LAS||SER|19980620080037|R^PROCESS COMPLETED
    ORC|RE|5212498721A|||||^^^^^R
    OBR|1|5212498721A||2951-2^SODIUM^LN|||199807240826||||||||SER
    OBX|1|NM|2951-2^SODIUM^LN||24.3|ug/g||N

    What this new ‘Content File as HL7 order’ option will do is:

    • Strip the Message Control ID from the source HL7 file which is MSH.10 (i.e. MSG00001)
    • Base64-Encode the complete content of the file
    • Place the Base64-Encoded content between JSON quotes like {“Base64-encoded content”}
      • i.e. {“TVNIfF5+XCZ8Q1RGV3w5NzUwMjg0MHx8TkVMfDIwMT…”}
    • Post the result as text/plain format to the domain
    • Check the Response, Result Code = 200 => OK
    • Base64-Decode the content of the Response and check MSH and MSA
    22/11/2020 9:16:14 Check Result Code: 200, True
    22/11/2020 9:16:14 PostHTTP, ContentFileAsHL7order Response Data Decoded as HL7 MSH: MSH|^~\&amp;|1111|MET|INSTPROG|50203311|20201122081613||OOR^O02|MSG00001|P|2.3|||||
    22/11/2020 9:16:14 PostHTTP, ContentFileAsHL7order Response Data Decoded as HL7 MSA: MSA|AA|MSG00001|2916c40402e141b9b07d701671c5019d||
    • Compare the Message Control ID from the Request with the Message Control ID from the Response
      • Both should be the same => OK
      • When different: Error
    • Check the Acknowledgment Code MAS.01
      • AA: Application Acknowledgment: Accept => OK
      • AE: Application Acknowledgment: Error

    Interesting link

    Some screenshot to get you started:

    In our example we have a WIN as Source. The source file will be a HL7 order file (Example1.hl7).

    Limagito File Mover WIN as Source

    As Destination we selected HTTP:

    Limagito File Mover HTTP as Destination

    HTTP Setup:

    • Set Request to POST
    • Set Content Selecton to: Content File as HL7 order
    • Set %SFP%SFN as Content File
      • %SFP: Source File Path (i.e. C:\Test\IN_HL7\)
      • %SFN: Source File Name (i.e. Example1.hl7)
    • Leave Content-Type empty (default = text/plain)

    Limagito File Mover HTTP as Destination Setup

    Content of the Example1.hl7 file:

    Limagito File Mover HL7 example file

    RunTime Log Result:

    Limagito File Mover Submit HL7 order RunTime Log

    If you need any help with our ‘submit Base64-encoded order HL7 message’ option, please let us know. Also, other HL7 related feature requests are welcome.

    Best Regards,

    Limagito Team

    By Limagito-Team HL7 HTTP REST , ,
1 2
SEARCH