Forum Replies Created
-
AuthorReplies
-
I made a mistake. The msgcopy should be inside the loop. msgcopy will give you a new message handle for each message while maintaining the original metadata. To make it better, if he original message was large, after getting the data from the original message handle you could do something “msgset $mh “. That way you are not copying the data with each msgcopy, only the metadata. Note the original message handle is killed since it contains nothing needed after the loop. I hope this makes sense.
A lot of this nuance is what I’m trying to figure out. I’m assuming my statement prior about different message handles being passed in is correct. msgset puts data into the current message ID, so I don’t think I want that, I think msgcopy will be fine (since the original message is a small ADT), then I can replace the message itself. The script would be more like:
set fileList [lsort [glob /folder/ORU_R01_*.HOLD]]
foreach fileName $fileList {
set newmh [msgcopy $mh]
set fh [open $fileName r]
set newmsg [read $fh]
close $fh
set newmh $newmsg
lappend dispList “CONTINUE $newmh”
}I would do msgcreate, but I do want to keep the intial metadata (where it came from, etc). I believe this is ultimately what I’m looking for.
-
This reply was modified 2 weeks, 3 days ago by
Jason Russell.
April 2, 2025 at 9:31 am in reply to: How to convert data in xml into array or list using tcl script #121980Would you want to keep them linked? You may want a dictionary where the key is probably order number with the account and code as the dataset, you’d have something similar to:
reportInfo { ORD0029 {C628 PROC1}
ORD0030 {C629 PROC142}
… {…}
}
I’d have to look up the syntax specifically. You can pull the keys via dict keys and process them in a foreach later if you need. I think an array would work as well, but a dictionary will allow you to link an order number to the account/Code, where single variables/arrays would require you to make sure they were in a specific order, and keep that order if removing/adding elements later, assuming you needed that link.
Charlie, this may be what I’m looking for, with some potential modification, but some questions:
What is the point of the first msg copy? The original ADT will be in the first $mh, and any additional messages will be from the files themselves, so wouldn’t it be better to:
foreach fileName $fileList {
set fh [open $fileName r]
set newmsg [read $fh]
close $fh
msgset nmh $newmsg
<do some minor work on putting MRN/CSN into message>
lappend displist {CONTINUE $nmh}
}
This will produce a list that is {{CONTINUE <first message raw>} {CONTINUE <second message raw} {…}}
That will push each message individually into the next step (in this case, next step being translation)?
In essence the disposition list can be a list of lists (not just a list with two items) that contains the disposition and the message, that would functionally work the same as individual message, so if I were to pull in a file with multiple messages (a batch-style), we could process each message individually, and append the dispList with all of them to be broken apart after the TPS is done, doing other dispositions (KILL, ERROR, etc) on each message.
The ultimate issue is we get the documents long before we get the ADT (on the scale of two weeks). It’s an overly complicated process. They’re EMS runsheets, so the transport happens, EMT documents in software by company A. Company A sends the document immediately to us, and then nightly batches the runsheets to company B. Company B then holds the runsheets for a minimum of 5 working days to ensure there are no additional notes. The runsheet is then coded, and a nightly batch sends ADT and DFT. We use the ADT to create the encounter in Epic, then use the ensuing ADT out of epic with the keyword to pick up both the DFT and initial runsheet (ORU), and file them to the encounter. There’s other components but that’s the most basic workflow. When the ADT comes out, there may be 2-4 runsheets (modifications, etc) that are tied to the encounter. The short answer is you can’t query Epic for the encounter since it hasn’t been created yet.
Thankfully there is pretty much a zero chance. The second process is usually two weeks out from the first (Essentially Company A sends file to us and company B. Company B waits 5 days MINIMUM to make sure there’s no more updates, then processes it and sends us the ADT).
I was definitely hoping for something a bit more elegant, but writing to a place to be picked up is not uncommon in our old engine.
I’d love to know the use-case for this. Jim’s put in the most basic response on the how, but I’d like to know the ‘why’. Also are you wanting to get a hex equivalent or the pure binary (AA vs 00000000)? Either way you have to think about encoding, and what you are encoding to/from. As Charlie pointed out, HL7 is an ASCII protocol, but doing anything beyond the basic 127 charset need to know the encoding value (Epic/windows defaults to windows-1252, and a lot of people are turning to UTF-8 as a default ). Figuring out those charsets are… not fun.
Are you trying to capture control characters to start/stop a message or just want a way to encode/decode a string
Just as a note, I didn’t see this as an actual response, string trim (in general, none of the languages I’ve used it in vary in this regard), and it’s variants of left and right, does not “capture” data at all. It simply removes it. I suppose there are some convoluted ways to use it, but, as shown above, there’s much easier and simpler ways to do it.
To kind of wrap the previous responses up, as someone said, with languages in general, there’s always multiple different ways to approach a problem. However, with what you’re doing and how it would be implemented, I think
From an xlate standpoint, xlatesubstr is probably the simplest, though it probably takes multiple lines to accomplish. This allows easy reading via the xlate panes, rather than having to drill down and really look at the code, it’s all pretty much right there.
From a pure TCL standpoint clock is probably the simplest. I find TCL’s clock implementation a bit unwieldy, but it’s all there in one neat little package.
string range is probably second. It’s essentially the same as xlatesubstr but strictly in TCL. Takes multiple lines but is easy to read.
regex from a purely personal standpoint I would avoid. regex is essentially it’s own little language by itself. You can do some absolute magic with regex but it’s not fun to try to parse it out/troubleshoot.
Have you opened task manager to see what the guis are trying to run?
I have also noticed something odd with our set up. We have virtual desktops specifically for Cloverleaf development. They’re on the same virtual cluster that the servers are on. However, we have Imprivata OneSign SSO to log into the desktops that auto-logs us off after 10 minutes. When the box is logged off of, and one of the GUIs are up, it will cause a lot of CPU alarms through the vSphere client. Once you log in, it dies back off. We’ve never found a root cause (hard to see what’s hogging the CPU when you’re logged off of the box), and this may be somewhat related. It seems when one of the guis are “idle” it causes problems. Again, it’s really hard to find the root cause when you can’t log in, even using remote powershell scripts to see what is running. If the GUI is completely closed out it never happens. It also happens a LOT less with 2022.09 vs 20.1.
As for the network speed, I’m not sure how Cloverleaf caches data, but it does seem to pull data every time you open things and move around. Like I said on our setup, we have a pretty open connection to the server itself, and it can still take time. 20.1 was AWFUL with this, especially with the testing tool, it would take forever to load. Once we moved to 2022.09, much of it became substantially faster.
I figured I’d resurrect my old thread. We are setting a new FTP connection. We created a key pair, gave the end system the public key. I can successfully log in with the private key on the command line with sftp -i <key> <username>@<host>. However, when attempting to set the connection with Cloverleaf, I get an authentication error:
* SSH public key authentication failed: Unable to extract public key from private key file: Wrong passphrase or invalid/unrecognized private key file format
The only thing I can think of is we do have spaces in the passphrase, as well as an @ and an !. Would those conflict with Cloverleaf’s ability to use the keys? I didn’t see anything in the help that would indicate that.
We don’t use the wizards (Yet), but if you pull your help file up (through Infor’s website or locally if you aren’t on a newer version), and it’s under Inform Cloverleaf Integration Services User > Cloverleaf wizard. Searching ‘wizard’ should bring it up.
Online help link (2022): https://docs.infor.com/clis/2022.x/en-us/useradminlib_on-premise/default.html?helpcontent=clfisolh_on-premise/ksj1491837470180.html&hl=wizard
From a high-level standpoint, it’s another browser based application that allows restricted access to engine components. I believe they are pushing to move a lot of functionality to the Wizard as they continue to develop it. It may make things easier on the developer as well in the future, but again we’re not in that deep yet.
January 30, 2025 at 8:42 am in reply to: read connector Directory A , and deposit directory B without deleting files #121789Is this file overwritten daily, or incremented in some fashion (by datetime stamp or counter)?
edit: Also, is the location of the drive mounted/attached to the computer as a drive, or will it need to be FTP’d in some fashion?
-
This reply was modified 2 months, 2 weeks ago by
Jason Russell.
January 30, 2025 at 7:09 am in reply to: read connector Directory A , and deposit directory B without deleting files #121787This can be done, as Charlie stated, with fileset-local. However, you really want to either have the files renamed or removed so you don’t pick up duplicates. Probably the easiest way to do this is have a process outside of the process (shell scripting, timed event within cloverleaf, etc) that renames the files to something else so cloverleaf can pick them up.
- Outside process places file named pickmeup.fre
- script in some place checks for files older than x date/time, or keep a record of the last file picked up.
- Rename all files after that point to pickmeup.fre.clover (or whatever), and cloverleaf will pick up the file(s) and delete them.
- Cloverleaf processes files normally.
There’s a lot of unknowns here which make it difficult to answer the question.
- Are the files sequential or have date/time stamps?
- How many and how often are the files placed?
- Why is it a requirement to keep the files named the same in the same location.
- Can they not be moved after processing to put them in a different directory (as suggested).
No matter what method is used, as the files build in a location, they will start to take longer and longer to parse, search, and process.
Out of curiosity, what do you mean when you say “basic cleanup tasks”. We’re on a Linux environment, so I’m wondering if this is a windows specific thing, or just general ‘clenaup’ meaning reducing databases if necessary, cleaning up old files, etc?
Finally decided to contact support about this, and after a lot of testing, and getting close to going full debug mode, we found the issue. It seems that cloverleaf writes out a temporary mail file in $HCISITE/exec/hcimontord/. However, something happened with the files we wrote out, and cloverleaf wasn’t able to overwrite these files or change them. Once the files were removed, the alert worked fine. Something very odd and not common at all that was at play.
Amusingly enough, now it just crashes the monitorD if I get an error:
{ALERT
{ NAME {Error DB Depth – st_sched1 Test} }
{ VALUE errdb }
{ SOURCE t_eGSCH2aria_o }
{ WITH -2 }
{ COMP {> 0} }
{ FOR once }
{ REPEATING {
{ MAX 2 }
{ TIME {nsec 1} }
} }
{ WINDOW */5:30-17:30/*/* }
{ CUSTOMMSG {{ITEM {}} {DELIMITER keyvalue}} }
{ ACTION {
{ email {
{ FROM cloverleaf@infor.com }
{ TO jmcrussell@firsthealth.org }
{ SUBJ {Error DB Test} }
{ MSG {Test to trigger. } }
} }
} }
}Everything runs fine until an error hits, and then everything goes down. The monitor immediately crashes after I attempt to start it. Once I clear the errors, it works fine. Any ideas?
-
This reply was modified 2 weeks, 3 days ago by
-
AuthorReplies