Forum Replies Created
-
AuthorReplies
-
I was wondering what happened. Thanks for the update.
It depends on what kind of conversion you’re looking for. For example, our state department of health wants to receive HL7 in the body of an HTTPS POST request. The raw HL7 message contents are wrapped in a simple JSON object. I can send you this code if that’s what you need. If you need to translate the message field by field into JSON, then I agree with Robert.
August 19, 2024 at 11:41 am in reply to: Can Cloverleaf query Active Directory for additional data? #121564You can use the ldapsearch command on Red Hat. You may need to install the openldap-clients package. You would have to call the command through a script (TPS or XLTP).
I agree. At the very least fix the editor so it doesn’t remove indentation from source code examples that are pasted into the editor.
I’ve found a workaround for this. If you paste RTF instead of plain text then the formatting is preserved, so I just make a draft Outlook email, paste the code in there, then copy and paste from Outlook into the forum.
Also, you’re better off storing the position of the PID segment in a variable (PIDpos below) so you don’t have to assume it’s the second segment when putting it back in the message. I haven’t tested these changes at all, so there may be other issues.proc tps_epic2athg_ORUfilter { args } {global HciConnNamekeylget args MODE modeset ctx “” ; keylget args CONTEXT ctxset module “tps_res2athg_ORUfilter/$HciConnName/$ctx”set uargs {} ; keylget args ARGS uargsset debug 0catch {keylget uargs DEBUG debug}set dispList {}set disp “KILL”switch -exact — $mode {start {}run {keylget args MSGID mhset msg [msgget $mh]set fieldSep [string index $msg 3]set subSep [string index $msg 4]set repSep [string index $msg 5]set segList [split $msg \r]set MSH [lsearch -all -inline -regexp $segList “^MSH”]# echo $MSHset MSHSplit [split $MSH $fieldSep]echo “MSHSPlit: $MSHSplit”set PIDpos [lsearch -regexp $segList “^PID”]set PID [lindex $segList $PIDpos]set PIDSplit [split $PID $fieldSep]set PV1 [lsearch -all -inline -regexp $segList “^PV1”]set obrList [lsearch -all -inline -regexp $segList “^OBR”]set obrCount 0# set obr16_ID “”foreach obr $obrList {set obr25 [lindex [split $obr $fieldSep] 25]# if { $obrCount == 0} {# set obr16_ID [lindex [split [lindex [split $obr $fieldSep] 16] $subSep] 0]# set obrCount 1# }if {$obr25 == “F”} {set disp “CONTINUE”# echo $dispbreak}}# set MSHSplit [lreplace $MSHSplit 5 5 “”]# set PIDSplit [lreplace $PIDSplit 3 3 “”]#build data to sendset thread [msgmetaget $mh DESTCONN]set dbName “db_eMFCC_PatList”set env [lindex [split $::env(HCISITE) _] 0]set mode “select”set fac [lindex $MSHSplit 3]set key [lindex [split $PV1 $fieldSep] 19]# DB call and return.set ret [sub_dataBase “thread=$thread” “dbName=$dbName” “env=$env” “mode=$mode” “fac=$fac” “key=$key”]echo “PidSplitb4: $PIDSplit”set retStatus [lindex [split $ret |] 0]set retData [lindex [split $ret |] 2]if { $retStatus != “Okay” } {set disp “KILL”} else {set PIDSplit [lreplace $PIDSplit 3 3 $retData]# set retDatLen [string length $retData]# echo $retDatLen# if {$retDatLen > 0} {# set MSHSplit [lreplace $MSHSplit 5 5 “1215”]# } else {# set MSH6 [tbllookup epic2athG-context.tbl $obr16_ID]# echo $MSH6# echo $obr16_ID# if {$MSH6 != “UNKNOWN”} {# set MSHSplit [lreplace $MSHSplit 5 5 $MSH6]# } else {# set disp “KILL”# }# }}echo “Before $segList”set segList [lreplace $segList $PIDpos $PIDpos [join $PIDSplit $fieldSep]]echo “After: $segList”set msg [join $segList \r]# echo $msgmsgset $mh $msg# echo $mhlappend dispList “$disp $mh”# echo $dispList}time {}shutdown {}default {error “Unknown mode ‘$mode’ in $module”}}return $dispList}This code:
set PID [lsearch -all -inline -regexp $segList “^PID”]
returns a list in $PID. This code:
set PIDSplit [split $PID $fieldSep]
expects $PID to contain a string, not a list.
You might be able to able to fix this by getting rid of the -all. If you really do need to handle more than one PID segment then you would probably need to add a loop to your code to iterate over all the matched segments.
- This reply was modified 5 months ago by David Barr.
Modifying bashrc alone didn’t solve my issue. The variables were not getting picked up by the autostart process. I opened a support ticket, and this was the resolution:
R&D suggested to try to add the path in /usr/lib/systemd/system/cloverleaf-autostart.service in line 3 and 4 before “export“ like:
/usr/bin/bash -c “export PATH=yourpythonpath:$PATH export LD_LIBRARY_PATH=yourpythonpath:$LD_LIBRARY_PATH export …..”
Also, the home page of the forum (https://usspvlclovertch2.infor.com/forums/) is not getting updated at all. The last post times are years out of date, and the login status indicators are not accurate.
I agree. At the very least fix the editor so it doesn’t remove indentation from source code examples that are pasted into the editor.
It looks like maybe I could add the environmental variables to /home/hci/.bashrc, but I would probably have to add them to the very top, because the file starts with these lines:
# .bashrc
# Add the following to the top of the ~/.bashrc for user hci
# Added this to handle non-interactive access (ie. SCP)
# The result will be the ‘.profile’ will be skipped when not helpful
[[ -z “$PS1” ]] && return # non-interactive
[[ $- =~ i ]] || return # non-interactive
tty -s || return # non-interactiveI think if I don’t put the variables above those lines then they would be skipped when running the commands from the systemd script. I may have to test this.
I’ve had Python 3 scripts working as TPS procs for a while. As you pointed out, you need to have PATH and LD_LIBRARY_PATH updated to include the cpython folder. It looks like I’m using version 3.8.12 which was referred to in one of the install guides, and it works. I’m currently on Cloverleaf 2022.09.03.
The problem I have is that I’m setting PATH and LD_LIBRARY_PATH in /etc/profile. That works when I start the engine processes from a shell prompt, but it doesn’t work when I use the supplied autostart scripts called from /usr/lib/systemd/system/cloverleaf-autostart.service.
Do you know how I can get the environment set up so that the autostart service has LD_LIBRARY_PATH set correctly when called on system startup?
- This reply was modified 5 months, 4 weeks ago by David Barr.
- This reply was modified 5 months, 4 weeks ago by David Barr.
Here’s the code to check if the date is a holiday.# Memorial Day – (Last Monday in may)# Labor Day – (First Monday in September)# Thanksgiving – (4th Thursday in November)# New Year’s Day – (January 1st)# Independence Day – (July 4th)# Christmas Eve – (December 24th)# Christmas Day – (December 25th)proc vmc_holidays { year } {set res {}# Memorial day, labor day, Thanksgivingforeach { month dow lim ind } {05 1 31 end09 1 30 011 4 30 3} {set s2 {}# get the numeric day of the week for the first of the monthset s [clock format [clock scan [format “%s%s01” $year $month]] -format %w]# find the day of month of the first monday or thursset day [expr (7+$dow-$s)%7+1]while { $day <= $lim } {# add the date of each matching day of the week in the month to a listlappend s2 [format “%s%s%02d” $year $month $day]incr day 7}# pick out just date specified by “ind” abovelappend res [lindex $s2 $ind]}# new years, independence, christmas & eve, new years observedforeach x { 0101 0704 1225 1231 } {set d “$year$x”set s [clock scan $d]set dow [clock format $s -format %a]if { $x eq “1231” && $dow ne “Fri” } {# new years day observed on Fri, 12/31continue}if { $x eq “1225” } {# compute where christmas and christmas eve fallif { $dow eq “Sat” } {lappend res [clock format [clock add $s -2 days] -format %Y%m%d]set s [clock add $s -1 day]} elseif { $dow eq “Sun” } {lappend res [clock format [clock add $s -2 days] -format %Y%m%d]set s [clock add $s 1 day]} elseif { $dow eq “Mon” } {lappend res [clock format [clock add $s 1 days] -format %Y%m%d]} else {lappend res [clock format [clock add $s -1 days] -format %Y%m%d]}} elseif { $dow eq “Sat” } {if { $x eq “0101” } {# this was observed last yearcontinue}set s [clock add $s -1 day]} elseif { $dow eq “Sun” } {set s [clock add $s 1 day]}lappend res [clock format $s -format %Y%m%d]}return [lsort $res]}proc is_vmc_holiday { date } {# see if the first 8 digits of the date or date/time stamp are in the list of holidays generated by the year portion of the datereturn [expr [lsearch -exact [vmc_holidays [string range $date 0 3]] [string range $date 0 7]] >= 0]}- This reply was modified 6 months ago by David Barr.
I’m not sure what you’re using as your alert action. You could potentially not put the holiday check in your alert rules but add it to the alert action. So if you have a script you’re calling to deliver the alert (email, calling a service, etc.), you could add something to that script to check for holidays before delivering the alert.
I’ve got a script that automatically calculates the holidays for our organization. I don’t use this from within alerts, but we have a separate thread that can send messages to staff through a secure messenger app. There are some checks in that process to see if it’s a holiday.
June 19, 2024 at 3:06 pm in reply to: Looking for documentation on web services (ws-server and ws-rawclient) #121495If you open the Cloverleaf IDE, click on Help/Contents/Open, it will probably take you to a site specific to your version. For me, it takes me to this site:
https://docs.infor.com/clis/2022.x/en-us/useradminlib_on-premise/default.html
From there you can click on “User” in the left hand column, then Application Adaptor Web Services User Guide. There’s also a search box on that page to search the documentation.
I can’t copy the link. I think it must be using some kind of javascript to open the new page rather than a simple URL. You can get to the downloads from the Concierge page/Products and Subscriptions. That page has a list of product lines, but at the very top there’s a link that says “Visit Infor Product Download Center.”
The release notes for on-premises hosted Cloverleaf are not in the “Release Center” where I was expecting them. They appear to just be KB articles in the new Customer Portal. I had to go to Concierge, click on “Access Infor Customer Portal”, search for “Cloverleaf release reports”. The article that I found was titled “Cloverleaf – Product Release Information.” There was a link to a spreadsheet of all the changes in the 2022.09.03 release that I was looking for.
-
AuthorReplies