Jimmy Christian · Sep 6, 2022 go to post

Thank you Alex.

I just ran a HL7 Message with bad characters. But i do not see string "BAD" in the message which is sent to the HL7 Router.

I am looking for the Built map status, but it says nothing. But when i open the contents it gives an error.

If i can detect in some way that the sent message could not parse, then i can shutdown the service.

Jimmy Christian · Sep 6, 2022 go to post

Hello Alex,

Sorry for late response.

I see this approach is very interesting. So in the router, i am checking if it is a bad message. If yes, then i shutdown the service. Right?

Sounds very applicable. I will try and see. Just a question. When the router receives the message, if it is bad, the rawcontent has "BAD" in it?

Thanks,

Jimmy Christian.

Jimmy Christian · Jun 22, 2022 go to post

Hey Andy,

So reason i am using Comment Setting because ProcessMessage Setting is not coming up in the Settings section.

I am using the 

<ruleDefinition alias="" context="EnsLib.HL7.MsgRouter.RoutingEngine"...

Would be glad to have the ProcessMessage Settings  come up using the standard Rule definition class.

Thanks,

Jimmy Christian.

Jimmy Christian · Jun 20, 2022 go to post

I have found another way around. Not perfect but can solve the problem i am having for the Settings valuesmiley

So i am thinking to use the Comment section of the Config Item. Then using the below function i can grab the value of it in my Standard Rule Class. Also i can change the value during downtime. Tested it and its working. If i dont find a way to create a CUSTOM Settings, i can use the "Comment" settings. !!

ClassMethod ShowComment(ConfigItem As %String) As %String
{
Set tSC=$$$OKTry{
    
     &sql(SELECT Comment INTO :tComment FROM Ens_Config.Item WHERE Name = :ConfigItem)
        If (SQLCODE = 0)
         {
Set tSC=$$$OK   
}
  }Catch(ex){
Set tSC = ex.AsStatus()
$$$LOGERROR("Error in function ShowComment: "_tStatus)  }
 tComment
}

Jimmy Christian · Jun 20, 2022 go to post

Hey Andy,

So i tried to run this class method and was able to get some setting values. But problem is when i try to get the CATEGORY setting value , it is erroring out saying, there is no such setting as "Category".

Is there a way to grab the CATEGORY value setting via function?

Thanks,

Jimmy

Jimmy Christian · Jun 20, 2022 go to post

Hey Craig,

Thanks for your response. Yes, that is a good alternate . I had initially thought about it but the only reason i am not planning to use a table is to avoid extra step to import this updated table in the prod environment. We cannot just make direct changes to the table because of some source control reasons also. So having a setting in the router which i can use just to flip it from 0 to 1 or vice versa would be very handy .

Thank you Craig.

Jimmy Christian · Jun 17, 2022 go to post

My mistake. I think i did not explain correctly.

So i want a setting in my HL7 Router something like below. I included it in my rule definition, but the SETTING is not showing in the Router in the management portal. Once i can have the SETTINGS  available in my Router, i can access its value. Let me know.

Property RouteToDowntimeRouter As %Boolean;

Parameter SETTINGS = "RouteToDowntimeRouter";
 

Jimmy Christian · Jun 17, 2022 go to post

Thank you Heloisa. The article you mentioned is very helpful. 

I am trying to add a PARAMETER settings to the rule definition as mentioned above. Is there a way without creating a CUSTOM Process.

Thanks,

Jimmy Christian

Jimmy Christian · Jun 17, 2022 go to post

Thank you Andy.

I am but not able to add a PARAMETER "RouteToDowntimeRouter
to my standard RULE Definition class. Once set i want to access it when the message goes through. Is there a way to add it in standard definition as below?

Class XYZRules Extends Ens.Rule.Definition CompileAfter CUSTOM.Util.Rules.FunctionSet ]
{ Parameter RuleAssistClass = "EnsLib.HL7.MsgRouter.RuleAssist"; XData RuleDefinition [ XMLNamespace "http://www.intersystems.com/rule]
{

Parameter SETTINGS = "RouteToDowntimeRouter";
Property  RouteToDowntimeRouter as %Boolean;


<ruleDefinition alias="" context="EnsLib.HL7.MsgRouter.RoutingEngine" production="HL7Production">
<ruleSet name="" effectiveBegin="" effectiveEnd="">
<rule name="Discard" disabled="false">
<when condition="ProcessMessage=0">
<return></return>
</when>
</rule>.

.

.

.

Jimmy Christian · Jun 18, 2021 go to post

That worked like a charm ! Thank you Sebastian.

Only thing is even if you insert more then 1 rows, it still tell you 1 Row (s) affected. Which is fine. But i had to just go and confirm that it worked.

Jimmy Christian · Jun 17, 2021 go to post

Thanks Eduard.

I get an error 

Input (UNION) encountered after the end of query^ INSERT INTO....

Jimmy Christian · Jun 17, 2021 go to post

Thanks Ken.

Actually i am trying to insert in the SQL utility provided in Ensemble. Not using a script.

Jimmy Christian · Jun 10, 2021 go to post

Hello Guilherme,

That makes sense.

I see my error now. I was trying to use session in the client method, which was causing problems.

Thanks a lot for your help!

Regards,

Jimmy Christian.

Jimmy Christian · May 29, 2020 go to post

Hello Pankaja,

Seems like for now custom code is the only option. I was not able to find any out of the box functionality for writing the counts of the total transactions without a custom code.

Here are few strategies for custom code i looked into.

1) In the File Operation , write the messages to a "Temp" File. At a certain time through a task or some other logic read from the temp file and collect all details you need and then write to another File.

2) I yet have to explore this option. At a point in time when you want your file, read from the Enslib.Hl7.Msg and create a file per your needs.

3) Write the live messages to a temp database. Generate necessary file from it when needed. Delete the messages from the DB and copy it to a Archive DB if needed.

4) As live messages are coming write to a Global and then run a task to create messages from the Globals.

Thanks,

Jimmy Christian.

Jimmy Christian · Jan 2, 2020 go to post

Thank you Marc for the detailed information.

I earlier tried the approach using the Record Mapper but it did not seam feasible in this scenario. 

So i have done is 

Created a CUSTOM operation class which extends Ens.BusinessOperation, EnsLib.HL7.Operation.Standard

It uses the file adapter.

Then I overided the oninit and outputDocument method.

  1. The file adapter creates HL7 file as usual
  2. I created a new method which calls the override outputDocument method and passes the filename . Then I do a count of segments and create another file into which I copy all the necessary information and delete the file which was originaly created .
  3. Above method is called in oninit, so it is triggered on schedule whenever the operation starts. First I check if a file exists, if it does and is not the current file then I call this new method.
Jimmy Christian · Dec 30, 2019 go to post

Ha ha. Thanks Jeffrey.

Yes the class name User.HL7.Stream seemed like the system defined class.

Jimmy Christian · Dec 29, 2019 go to post

That is very helpful. I wasnt aware of this class method or class. Thank you for your assistance. I will use it and let you know if  i encounter any issue.

I also tried using another method where i read the stream object using ReadLine.

Then if the string starts with "MSH" OR "FT1" i increment the count.

In that case i have to use the Terminator character as $C(10) or $C(13) 

Regards,

Jimmy Christian.

Jimmy Christian · Aug 6, 2019 go to post

Thank you Jenna.

You are absolutely right. I was able to update the DTL code and send a EnsStreamContainer object to the Operation.

It worked perfectly.

Regards,

Jimmy Christian.

Jimmy Christian · Aug 2, 2019 go to post

Thank you Jeffrey.  This is very helpful.

I didnt realize we can use Source property in the Condition.

Jimmy Christian · Jul 30, 2019 go to post

Yep !

I did restart the Operation after putting the logic. I had forgotten to set the return status to an error code.

I think E=D works when the %Status has an error code.

Thank you for help.

Regards,

Jimmy Christian.

Jimmy Christian · Jul 30, 2019 go to post

Thank you Eduard. 

Exactly !

I forgot to set the return status to an error in Catch Block. 

I set to an error code and the Operation is down.

Thank you for help.

Jimmy Christian · Jul 30, 2019 go to post

Thank you Chris. 

So to give you a little more information, i want to disable the Operation if the response i receive after sending a message is not a valid one.

If i disable using Ens.Director,  does the last message i sent gets re-queued or is  it considered processed?

Thanks,

Jimmy Christian.