CALL CATALYST("P","POPUPS*":POP.KEY) (AREV Specific)
At 05 JUN 2002 09:40:54AM Robert M Sanders wrote:
Yesterday afternoon, we started having problems with our DOS Modfied Orders popup on MO NUMBER. I traced it last night down to the line 62 - CALL CATALYST("P","POPUPS*":POP.KEY). For some reason, it keeps breaking here. I rebuilt the indexes on HPH_MOD_ORDERS and then took them all off and put them back in. Still did not resolve the issue . . . . Any ideas?
Source Code Listing For SUB.POPUP.MOD.ORDERS in HPH_BP at 09:23 on 06/05/02
0001 SUBROUTINE SUB.POPUP.MOD.ORDERS(TYPE)
0002 DECLARE SUBROUTINE MSG, FSMSG, BTREE.EXTRACT
0003 EQUATE FALSE$ TO 0
0004 EQUATE TRUE$ TO 1
0005
0006 *Save setup so that calls from windows won't clobber windows
0007 SAVEDICT=@DICT
0008 SAVEREC=@RECORD
0009 SAVEID=@ID
0010 @RECCOUNT=0
0011 PNUMBER=@ID
0012 CONVERT '*' TO @VM IN PNUMBER
0013 PATID=PNUMBER
0014 PERFORM "SELECT HPH_MOD_ORDERS WITH PNUMBER EQ ":PATID:" (S) "
0015 KEYS='
0016 KEY.CNT=0
0017 DONE=FALSE$
0018 FIMAGE='
0019 IF @RECCOUNT THEN
0020 | CALL MSG(@RECCOUNT:' RECORD(S) FOUND ','UB',FIMAGE,
) 0021 | LOOP UNTIL DONE 0022 | | READNEXT @ID THEN 0023 | | | KEY.CNT += 1 0024 | | | KEYS=@ID 0025 | | END ELSE 0026 | | | DONE=1 0027 | | END 0028 | REPEAT 0029 | 0030 END 0031 0032 0033 IF KEYS THEN 0034 | POP.KEY=MODIFIED.ORDERS.NUMBER" 0035 | 0036 | POP.FILE=POPUPS" 0037 | OPEN POP.FILE TO PFILE ELSE 0038 | | MSG("POPUPS file is not available.") 0039 | END 0040 | BIMAGE=' 0041 | POP.LOCKED=0 0042 | 0043 | LOOP 0044 | | LOCK PFILE, POP.KEY THEN 0045 | | | POP.LOCKED=1 0046 | | | FOR POP.COUNT=1 TO 5 0047 | | | NEXT POP.COUNT 0048 | | END 0049 | UNTIL POP.LOCKED REPEAT 0050 | WRITEV KEYS TO PFILE,POP.KEY,4 ELSE 0051 | | MSG("Unable to update POPUPS.MOD.ORDERS in POPUPS.","","","") 0052 | END 0053 | UNLOCK PFILE,POP.KEY ELSE 0054 | | MSG("Unable to UNLOCK POPUPS.MOD.ORDERS in POPUPS.","","","") 0055 | END 0056 | MSG("","DB",BIMAGE,"") 0057 END 0058 0059 CALL MSG(@RECCOUNT:' RECORD(S) FOUND ','DB',FIMAGE,
)0060 debug
0061 IF KEYS THEN
0062 | CALL CATALYST("P","POPUPS*":POP.KEY)
0063 END ELSE
0064 | @ANS="
0065 | CALL MSG("This patient currently has no modified orders","A","","")
0066 END
0067 @DICT=SAVEDICT
0068 @RECORD=SAVEREC
0069 @ID=SAVEID
At 05 JUN 2002 01:11PM David Kafka wrote:
Robert,
You didn't say exactly what the error is, so it's a little hard to speculate. However, this program uses a technique that I personally have never seen before, writing a list of keys to the POPUPS record itself (line 50).
If the program always worked, and has now stopped, I would suspect first a possible problem with the key list that is written: particularly if at any point that list somehow had an @FM in it; that would "permanently" corrupt the POPUP record! I would take a look at the popup itself and see if it's still intact (i.e. all fields where they belong.) If not, it would be pretty easy to fix, I think.
It could be a lot of other things, too. It really would help to know exactly what the error you are seeing is.
David
At 05 JUN 2002 01:37PM Dave Harmacek wrote:
You have never heard of function POP_UP_SOFT ? Useful for your purpose without writing the popup. Thus, separate users can run their their own versions all at the same time. It is documented in the ARev Developer Series - System Subroutines manual. or see http://www.sprezzatura.com/revmedia/v3i4a1.htm and http://www.sprezzatura.com/revmedia/v3i6a8.htm
At 06 JUN 2002 04:19AM Curt Putnam wrote:
This piece of code is going the long way around the barn. Where the keys are being read & locked, it seems (cursory review) that not all get unlocked on the lock failure branch. What happens if the key list is too long? Damn - can't see the code while writing this - what happens if the popup record is already locked? What happens if the program that locked it crashes?
What is the failure message?