• 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|^~\&|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|^~\&|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 , ,
  • 15 Nov

    Q&A 30: I only want to email the latest run time log

    Q: I only want to have email the latest run time. We are trying to come up with a standard email notification format, and we just could not figure out to set up email body as we want. What I would like to want is to have email only to show the result of the latest action.

    A: We are going to use a small Pascal Script to achieve this. Please have a look at the following screenshots.

    Open the Pascal Script Setup of this Rule:

    • Enable ‘On Rule Begin’
    • Add the following ‘On Rule Begin’ Script. Function psRTLog will clear the RunTime Log.
    Begin
      psExitCode:= 1;
      // ... add your code here
      psResetRTLog;
    End.

    Limagito File Mover Reset RunTime Log

    In your email setup you can use  %LRT  (%LRT = Log RunTime) to show the RunTime Log content:

    Limagito File Mover Email Setup

    We decided to make it even easier in our latest version and added an alternative to using Pascal Script. This new build will be available soon.

    Limagito File Mover Clear Log at Rule Begin

    If you need any help with our ‘Clear Log at Rule Begin’ option, please let us know.

    Best Regards,

    Limagito Team

    By Limagito-Team Logging Q&A , , ,
  • 11 Nov

    Pascal Script Xml Functions added to Limagito File Mover

    Pascal Script Xml Functions added to Limagito File Mover

    We added two extra Pascal Script functions in version v2020.11.11.0.

    • Function psXMLGetAttribute(Const aXML, aRootNode, aChildNode, aAttrName: String): String;
    • Function psXMLSetAttribute(Const aXML, aRootNode, aChildNode, aAttrName, aAttrValue: String): String;

    These functions allow you to Get and Set Xml Attributes. aRootNode or aChildNode can be empty. We prepared the Pascal Script engine to be ready for other Xml requests users may have. Don’t hesitate to ask for extra Xml features.

    We added these functions because we received the following request:

    Currently I have different XML-Files which more or less will have static file contents besides that it would be needed to update one field with the current date of the day. Scheduler will be used and set to run every weekday at approx. 23:59:59.  In the files the XML-field document > date need to be updated in date format YYYY-MM-DD.

    Example for today (2020-11-11):

    <document level=”01-01-xx-xx-xx” date=”2020-11-11″ name=”davinci”>

    Rest of the file contents stays unchanged.

     

    • In the following example will change the value of a node attribute. The Source will be a Xml file (WIN as Source).

    Limagito File Mover WIN as Source

    • The Destination is Pascal Script. The Script will use these new function and write the adjusted Xml content to a new file.

    Limagito File Mover Pascal Script as Destination

    • Don’t forget to adjust the Const ctDest to the path you need the adjusted xml to be saved in.

    Var
      iList: Integer;
      tmpDateStr: String;
      tmpList: TStringList;
      tmpPos: Integer;
      tmpXml: String;
    Const
      ctDest = 'C:\Test\In\Patrick\Out\';
    Begin
      psExitCode:= 0;
      // ... add your code here
      // <!--?xml version="1.0" encoding="ISO-8859-1"?-->
      // 
      // 
      tmpList := TStringList.Create;
      Try
        Try
          // Load Xml File
          psLogWrite(1, '', 'Loading ' + psFilePath + psFileName);
          tmpList.LoadFromFile(psFilePath + psFileName);
          // Prepare Date as String
          tmpDateStr := FormatDateTime('YYYY-MM-DD', Now); // i.e. 2020-11-10
          // Function psXMLGetAttribute(Const aXML, aRootNode, aChildNode, aAttrName): String;
          tmpXml := psXMLGetAttribute(Trim(tmpList.Text), 'document', '', 'date');
          psLogWrite(1, '', 'XML Get Date Attr Value: ' + tmpXML);
          // Function psXMLSetAttribute(Const aXML, aRootNode, aChildNode, aAttrName, aAttrValue: String): String;
          psLogWrite(1, '', 'XML Set Date Attr Valuet ' + tmpDateStr);
          tmpXml := psXMLSetAttribute(Trim(tmpList.Text), 'document', '', 'date', tmpDateStr);
          // Save To File
          // psLogWrite(1, '', 'XML Result: ' + tmpXml);
          tmpList.Text := Trim(tmpXML);
          Try
            tmpList.SaveToFile(ctDest + psFileName);
            psLogWrite(1, '', 'SaveToFile: ' + psFilePath + psFileName + ' Successful');
            // Set Result
            psExitCode:= 1;
          Except
            psLogWrite(1, '', 'SaveToFile:' + psFilePath + psFileName + ' Error');
          End;
        Except
          psLogWrite(1, '', 'LoadFromFile: ' + psFilePath + psFileName + ' Error');
        End;
      Finally
        tmpList.Free;
      End;
    End.

     

    • Original Source Xml file contains a Date attribute with value “2018-11-30”:

    Limagito File Mover Xml Source example

    • The new Destination Xml file contains the adjusted Date attribute with value “2020-11-11”:

    Limagito File Mover Xml Destination Example

    • RunTime log result:

    Limagito File Mover Xml RunTime Log

    If you need any help with these Pascal Script ‘Xml functions’, please let us know.

    Best Regards,

    Limagito Team

    By Limagito-Team Pascal Script XML ,
1 2 3 4 5 6 7 25
SEARCH