- LR541PST ;HPS/DSK - LR*5.2*541 PATCH POST INSTALL ROUTINE ;Nov 12, 2020@15:02
- ;;5.2;LAB SERVICE;**541**;Sep 27, 1994;Build 7
- ;
- ;Reference to: Supported by:
- ;----------------- --------------
- ;STATUS^ORCSAVE2 IA #5903
- ;^OR(100 IA #3582
- ;
- Q
- ;
- EN ;
- ; 1. Scan all Microbiology accession areas starting in 2019.
- ; 2. If any test at ^LRO(68,LRAA,1,LRAD,1,LRAN,4,test,0) has a complete date/time,
- ; retrieve file 69 order number. Quit if no complete tests.
- ; 3. In file 69, find CPRS order number for the test. Quit if referral patient and
- ; no order number.
- ; 4. Check status in file 100. Quit if not active.
- ; 5. Check status in file 63. (Due to unreported issue in which file 68 status
- ; might be complete but file 63 status is preliminary.)
- ; 6. If any accession area for the test is preliminary or not present in file 63, quit.
- ; 7. If not ordered as a component of a panel, call STATUS^ORCSAVE2 to update CPRS status
- ; to complete.
- ; 8. If ordered as a component of a panel, check all panel components to determine
- ; if any are not complete in file 68.
- ; 9. For all complete component statuses in file 68, check file 63 statuses.
- ;10. If all are complete in file 68 and not preliminary in file 63, call STATUS^ORCSAVE2
- ; to update CPRS order number to complete.
- ;This routine is not deleted after install since it is tasked. A future
- ;patch will delete the routine.
- ;
- N LRDUZ
- S ZTRTN="START^LR541PST"
- S ZTDESC="LR*5.2*541 Post-Install Routine"
- S ZTIO="",ZTDTH=$H
- S LRDUZ=DUZ
- S ZTSAVE("LRDUZ")=""
- D ^%ZTLOAD
- W !!,"LR*5.2*541 Post-Install Routine has been tasked - TASK NUMBER: ",$G(ZTSK)
- W !!,"You as well as members of the LMI MailMan Group will receive"
- W !,"a MailMan message when the search completes.",!
- Q
- ;
- START ;
- N LRAREA,LRDATE,LRACN,LRNUM,LRDFN,LRIDT,LREX,LREXSTR,LRSUB,LREXEC
- S ^XTMP("LR 541 POST INSTALL",0)=$$FMADD^XLFDT(DT,60)_"^"_DT_"^LR*5.2*541 POST INSTALL"
- S ^XTMP("LR 541 POST INSTALL",1)="ORDERS (#100) file order numbers updated to complete status"
- ;kill in case re-started for some reason
- K ^TMP("LR541 OR NO UPDATE",$J),^TMP("LR541 OR CHECKED",$J)
- ;Find file 63 subscript for prelim/final status of all Microbiology edit codes
- S LREX=0,LREXSTR=""
- F S LREX=$O(^LAB(62.07,LREX)) Q:'LREX D
- . S LREXSTR=$G(^LAB(62.07,LREX,.1))
- . S LRSUB=$S(LREXSTR["11.5":1,LREXSTR["23":11,LREXSTR["19":8,LREXSTR["15":5,LREXSTR["34":16,1:"")
- . Q:LRSUB=""
- . S LREXEC(LREX)=LRSUB
- S (LRAREA,LRNUM)=0
- F S LRAREA=$O(^LRO(68,LRAREA)) Q:'LRAREA I $P($G(^LRO(68,LRAREA,0)),"^",2)="MI" D
- . ;start search in 2019
- . S LRDATE=3180000
- . F S LRDATE=$O(^LRO(68,LRAREA,1,LRDATE)) Q:'LRDATE D
- . . S LRACN=0
- . . F S LRACN=$O(^LRO(68,LRAREA,1,LRDATE,1,LRACN)) Q:'LRACN D
- . . . ;check to see if this accession was already checked
- . . . ;as a test within a profile
- . . . Q:$D(^TMP("LR541 TRACE",$J,LRAREA,LRDATE,LRACN))
- . . . S LRDFN=$P($G(^LRO(68,LRAREA,1,LRDATE,1,LRACN,0)),"^")
- . . . ;If a referral patient, quit. Referrals not stored in CPRS.
- . . . Q:$P($G(^LR(+LRDFN,0)),"^",2)'=2
- . . . S LRIDT=$P(^LRO(68,LRAREA,1,LRDATE,1,LRACN,3),"^",5)
- . . . D LRTST
- D XTMP,MAIL
- S:$D(ZTQUEUED) ZTREQ="@"
- Q
- ;
- LRTST ;
- N LRTST,LRSTR,LRPEND,LRSUB,LRORD,LRPANEL,LRODATE,LROSN
- N LRXDFN,LRXIDT,LRXTEST
- S LRTST=0
- F S LRTST=$O(^LRO(68,LRAREA,1,LRDATE,1,LRACN,4,LRTST)) Q:'LRTST D
- . S LRSTR=$G(^LRO(68,LRAREA,1,LRDATE,1,LRACN,4,LRTST,0))
- . ;Accession still pending
- . Q:$P(LRSTR,"^",5)=""
- . ;Accession merged or not performed
- . ;Not evaluating merged/not performed because root cause of issue
- . ;exists in result verification logic - not merging/not performed logic.
- . Q:$P(LRSTR,"^",6)'=""
- . S LRPEND=$$CHK63(LRDFN,LRIDT,LRTST)
- . Q:LRPEND
- . S LRPANEL=$P(^LRO(68,LRAREA,1,LRDATE,1,LRACN,4,LRTST,0),"^",9)
- . S LRORD=$G(^LRO(68,LRAREA,1,LRDATE,1,LRACN,.1))
- . Q:LRORD=""
- . S (LRODATE,LROSN)=0
- . F S LRODATE=$O(^LRO(69,"C",LRORD,LRODATE)) Q:'LRODATE D
- . . F S LROSN=$O(^LRO(69,"C",LRORD,LRODATE,LROSN)) Q:'LROSN D LRO69
- Q
- ;
- CHK63(LRXDFN,LRXIDT,LRXTEST) ;
- ;Because the test in file 68 might be complete, but the status
- ;in file 63 could be preliminary, check statuses in file 63.
- N LRXEX,LRXSUB
- S LRXEX=$P(^LAB(60,LRXTEST,0),"^",14)
- ;This is not a Micro test, so don't check further for prelim/final.
- I LRXEX="" Q 0
- I '$G(LREXEC(LRXEX)) Q 0
- S LRXSUB=LREXEC(LRXEX)
- ;This test has not yet been resulted, so is pending.
- I '$D(^LR(LRXDFN,"MI",LRXIDT,LRXSUB)) Q 1
- I $P($G(^LR(LRXDFN,"MI",LRXIDT,LRXSUB)),"^",2)'="F" Q 1
- Q 0
- ;
- LRO69 ;analyze CPRS order number
- N LROTST,LRNTST,LROCPRS
- S LROTST=0
- F S LROTST=$O(^LRO(69,LRODATE,1,LROSN,2,LROTST)) Q:'LROTST D
- . S LRNTST=$P(^LRO(69,LRODATE,1,LROSN,2,LROTST,0),"^")
- . ;Quit if test in file 69 does not correspond to the test
- . ;or panel being evaluated in file 68.
- . I LRNTST'=LRTST,LRNTST'=LRPANEL Q
- . S LROCPRS=$P(^LRO(69,LRODATE,1,LROSN,2,LROTST,0),"^",7)
- . ;CPRS order number will be null for referral orders
- . ;(already checked for referral, but adding line below as a safeguard.)
- . Q:LROCPRS=""
- . ;Order might have been checked if a panel was ordered.
- . Q:$D(^TMP("LR541 OR CHECKED",$J,LROCPRS))
- . Q:$D(^TMP("LR541 OR NO UPDATE",$J,LROCPRS))
- . ;only check orders with active status
- . I $P($G(^OR(100,LROCPRS,3)),"^",3)'=6 Q
- . ;Update status - this test is not a panel since test number
- . ;equals panel number
- . I LRTST=LRPANEL D UPDATE Q
- . ;check all accessions for test components of a panel
- . N LRXTST,LRXAA,LRXAD,LRXAN,LRXSTR,LRX68STR,LRXIDTZ
- . S LRXTST=0
- . F S LRXTST=$O(^LRO(69,LRODATE,1,LROSN,2,LRXTST)) Q:'LRXTST D
- . . S LRXSTR=$G(^LRO(69,LRODATE,1,LROSN,2,LRXTST,0))
- . . Q:$P(LRXSTR,"^",7)'=LROCPRS
- . . S LRXAD=$P(LRXSTR,"^",3)
- . . ;Accession fields might be null for profile tests.
- . . Q:LRXAD=""
- . . S LRXAA=$P(LRXSTR,"^",4),LRXAN=$P(LRXSTR,"^",5)
- . . I LRXAA=""!(LRXAN="") Q
- . . S LRNTST=$P(^LRO(69,LRODATE,1,LROSN,2,LRXTST,0),"^")
- . . ;cross check file 68 test status
- . . S LRX68STR=$G(^LRO(68,LRXAA,1,LRXAD,1,LRXAN,4,LRNTST,0))
- . . Q:LRX68STR=""
- . . ;This CPRS order is not yet final or was marked not performed or merged
- . . I $P(LRX68STR,"^",5)=""!($P(LRX68STR,"^",6)'="") S ^TMP("LR541 OR NO UPDATE",$J,LROCPRS)=""
- . . S LRXIDTZ=$P(^LRO(68,LRXAA,1,LRXAD,1,LRXAN,3),"^",5)
- . . S LRPEND=$$CHK63(LRDFN,LRXIDTZ,LRNTST)
- . . ;A test is pending on this order, so don't update to complete.
- . . I LRPEND S ^TMP("LR541 OR NO UPDATE",$J,LROCPRS)=""
- . ;set trace of orders checked
- . S ^TMP("LR541 OR CHECKED",$J,LROCPRS)=""
- . Q:$D(^TMP("LR541 OR NO UPDATE",$J,LROCPRS))
- . ;all component tests are complete, so update status on order
- . D UPDATE
- Q
- ;
- UPDATE ;update status to "complete" and set trace file
- D STATUS^ORCSAVE2(LROCPRS,2)
- S ^XTMP("LR 541 POST INSTALL",LROCPRS)=LRODATE_"^"_LROSN
- S LRNUM=LRNUM+1
- Q
- ;
- XTMP ;Generate MailMan message and keep in ^XTMP for 60 days
- S ^XTMP("LR 541 MAILMAN MESSAGE",0)=$$FMADD^XLFDT(DT,60)_"^"_DT_"^LR*5.2*541 POST INSTALL"
- I $O(^XTMP("LR 541 POST INSTALL",1))="" D Q
- . S ^XTMP("LR 541 MAILMAN MESSAGE",2)=" "
- . S ^XTMP("LR 541 MAILMAN MESSAGE",3)="LR*5.2*541 post-install routine found no occurrences"
- . S ^XTMP("LR 541 MAILMAN MESSAGE",4)="related to the issue for ServiceNow ticket INC13797003."
- . ;Set an entry in the detail ^XTMP("LR 541 POST INSTALL" if needed for future reference
- . S ^XTMP("LR 541 POST INSTALL",1)="No issues found."
- ;
- ;Issues were found
- S ^XTMP("LR 541 MAILMAN MESSAGE",1)=" "
- S ^XTMP("LR 541 MAILMAN MESSAGE",2)="The post install for LR*5.2*541 corrected the CPRS order status"
- S ^XTMP("LR 541 MAILMAN MESSAGE",3)="of "_LRNUM_" orders. The global ^XTMP(""LR 541 POST INSTALL"") contains"
- S ^XTMP("LR 541 MAILMAN MESSAGE",4)="the specific order numbers."
- K ^TMP("LR541 OR NO UPDATE",$J),^TMP("LR541 OR CHECKED",$J)
- Q
- ;
- MAIL ;
- N LRMY,LRMSUB,LRMTEXT,LRMFROM,LRMIN
- S LRMIN("FROM")="LR*5.2*541 Post-Install"
- S LRMY(LRDUZ)=""
- S LRMY("G.LMI")=""
- S LRMSUB="LR*5.2*541 Post-Install"
- S LRMTEXT="^XTMP(""LR 541 MAILMAN MESSAGE"")"
- D SENDMSG^XMXAPI(DUZ,LRMSUB,LRMTEXT,.LRMY,.LRMIN,"","")
- Q
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLR541PST 8275 printed Mar 13, 2025@21:08:46 Page 2
- LR541PST ;HPS/DSK - LR*5.2*541 PATCH POST INSTALL ROUTINE ;Nov 12, 2020@15:02
- +1 ;;5.2;LAB SERVICE;**541**;Sep 27, 1994;Build 7
- +2 ;
- +3 ;Reference to: Supported by:
- +4 ;----------------- --------------
- +5 ;STATUS^ORCSAVE2 IA #5903
- +6 ;^OR(100 IA #3582
- +7 ;
- +8 QUIT
- +9 ;
- EN ;
- +1 ; 1. Scan all Microbiology accession areas starting in 2019.
- +2 ; 2. If any test at ^LRO(68,LRAA,1,LRAD,1,LRAN,4,test,0) has a complete date/time,
- +3 ; retrieve file 69 order number. Quit if no complete tests.
- +4 ; 3. In file 69, find CPRS order number for the test. Quit if referral patient and
- +5 ; no order number.
- +6 ; 4. Check status in file 100. Quit if not active.
- +7 ; 5. Check status in file 63. (Due to unreported issue in which file 68 status
- +8 ; might be complete but file 63 status is preliminary.)
- +9 ; 6. If any accession area for the test is preliminary or not present in file 63, quit.
- +10 ; 7. If not ordered as a component of a panel, call STATUS^ORCSAVE2 to update CPRS status
- +11 ; to complete.
- +12 ; 8. If ordered as a component of a panel, check all panel components to determine
- +13 ; if any are not complete in file 68.
- +14 ; 9. For all complete component statuses in file 68, check file 63 statuses.
- +15 ;10. If all are complete in file 68 and not preliminary in file 63, call STATUS^ORCSAVE2
- +16 ; to update CPRS order number to complete.
- +17 ;This routine is not deleted after install since it is tasked. A future
- +18 ;patch will delete the routine.
- +19 ;
- +20 NEW LRDUZ
- +21 SET ZTRTN="START^LR541PST"
- +22 SET ZTDESC="LR*5.2*541 Post-Install Routine"
- +23 SET ZTIO=""
- SET ZTDTH=$HOROLOG
- +24 SET LRDUZ=DUZ
- +25 SET ZTSAVE("LRDUZ")=""
- +26 DO ^%ZTLOAD
- +27 WRITE !!,"LR*5.2*541 Post-Install Routine has been tasked - TASK NUMBER: ",$GET(ZTSK)
- +28 WRITE !!,"You as well as members of the LMI MailMan Group will receive"
- +29 WRITE !,"a MailMan message when the search completes.",!
- +30 QUIT
- +31 ;
- START ;
- +1 NEW LRAREA,LRDATE,LRACN,LRNUM,LRDFN,LRIDT,LREX,LREXSTR,LRSUB,LREXEC
- +2 SET ^XTMP("LR 541 POST INSTALL",0)=$$FMADD^XLFDT(DT,60)_"^"_DT_"^LR*5.2*541 POST INSTALL"
- +3 SET ^XTMP("LR 541 POST INSTALL",1)="ORDERS (#100) file order numbers updated to complete status"
- +4 ;kill in case re-started for some reason
- +5 KILL ^TMP("LR541 OR NO UPDATE",$JOB),^TMP("LR541 OR CHECKED",$JOB)
- +6 ;Find file 63 subscript for prelim/final status of all Microbiology edit codes
- +7 SET LREX=0
- SET LREXSTR=""
- +8 FOR
- SET LREX=$ORDER(^LAB(62.07,LREX))
- if 'LREX
- QUIT
- Begin DoDot:1
- +9 SET LREXSTR=$GET(^LAB(62.07,LREX,.1))
- +10 SET LRSUB=$SELECT(LREXSTR["11.5":1,LREXSTR["23":11,LREXSTR["19":8,LREXSTR["15":5,LREXSTR["34":16,1:"")
- +11 if LRSUB=""
- QUIT
- +12 SET LREXEC(LREX)=LRSUB
- End DoDot:1
- +13 SET (LRAREA,LRNUM)=0
- +14 FOR
- SET LRAREA=$ORDER(^LRO(68,LRAREA))
- if 'LRAREA
- QUIT
- IF $PIECE($GET(^LRO(68,LRAREA,0)),"^",2)="MI"
- Begin DoDot:1
- +15 ;start search in 2019
- +16 SET LRDATE=3180000
- +17 FOR
- SET LRDATE=$ORDER(^LRO(68,LRAREA,1,LRDATE))
- if 'LRDATE
- QUIT
- Begin DoDot:2
- +18 SET LRACN=0
- +19 FOR
- SET LRACN=$ORDER(^LRO(68,LRAREA,1,LRDATE,1,LRACN))
- if 'LRACN
- QUIT
- Begin DoDot:3
- +20 ;check to see if this accession was already checked
- +21 ;as a test within a profile
- +22 if $DATA(^TMP("LR541 TRACE",$JOB,LRAREA,LRDATE,LRACN))
- QUIT
- +23 SET LRDFN=$PIECE($GET(^LRO(68,LRAREA,1,LRDATE,1,LRACN,0)),"^")
- +24 ;If a referral patient, quit. Referrals not stored in CPRS.
- +25 if $PIECE($GET(^LR(+LRDFN,0)),"^",2)'=2
- QUIT
- +26 SET LRIDT=$PIECE(^LRO(68,LRAREA,1,LRDATE,1,LRACN,3),"^",5)
- +27 DO LRTST
- End DoDot:3
- End DoDot:2
- End DoDot:1
- +28 DO XTMP
- DO MAIL
- +29 if $DATA(ZTQUEUED)
- SET ZTREQ="@"
- +30 QUIT
- +31 ;
- LRTST ;
- +1 NEW LRTST,LRSTR,LRPEND,LRSUB,LRORD,LRPANEL,LRODATE,LROSN
- +2 NEW LRXDFN,LRXIDT,LRXTEST
- +3 SET LRTST=0
- +4 FOR
- SET LRTST=$ORDER(^LRO(68,LRAREA,1,LRDATE,1,LRACN,4,LRTST))
- if 'LRTST
- QUIT
- Begin DoDot:1
- +5 SET LRSTR=$GET(^LRO(68,LRAREA,1,LRDATE,1,LRACN,4,LRTST,0))
- +6 ;Accession still pending
- +7 if $PIECE(LRSTR,"^",5)=""
- QUIT
- +8 ;Accession merged or not performed
- +9 ;Not evaluating merged/not performed because root cause of issue
- +10 ;exists in result verification logic - not merging/not performed logic.
- +11 if $PIECE(LRSTR,"^",6)'=""
- QUIT
- +12 SET LRPEND=$$CHK63(LRDFN,LRIDT,LRTST)
- +13 if LRPEND
- QUIT
- +14 SET LRPANEL=$PIECE(^LRO(68,LRAREA,1,LRDATE,1,LRACN,4,LRTST,0),"^",9)
- +15 SET LRORD=$GET(^LRO(68,LRAREA,1,LRDATE,1,LRACN,.1))
- +16 if LRORD=""
- QUIT
- +17 SET (LRODATE,LROSN)=0
- +18 FOR
- SET LRODATE=$ORDER(^LRO(69,"C",LRORD,LRODATE))
- if 'LRODATE
- QUIT
- Begin DoDot:2
- +19 FOR
- SET LROSN=$ORDER(^LRO(69,"C",LRORD,LRODATE,LROSN))
- if 'LROSN
- QUIT
- DO LRO69
- End DoDot:2
- End DoDot:1
- +20 QUIT
- +21 ;
- CHK63(LRXDFN,LRXIDT,LRXTEST) ;
- +1 ;Because the test in file 68 might be complete, but the status
- +2 ;in file 63 could be preliminary, check statuses in file 63.
- +3 NEW LRXEX,LRXSUB
- +4 SET LRXEX=$PIECE(^LAB(60,LRXTEST,0),"^",14)
- +5 ;This is not a Micro test, so don't check further for prelim/final.
- +6 IF LRXEX=""
- QUIT 0
- +7 IF '$GET(LREXEC(LRXEX))
- QUIT 0
- +8 SET LRXSUB=LREXEC(LRXEX)
- +9 ;This test has not yet been resulted, so is pending.
- +10 IF '$DATA(^LR(LRXDFN,"MI",LRXIDT,LRXSUB))
- QUIT 1
- +11 IF $PIECE($GET(^LR(LRXDFN,"MI",LRXIDT,LRXSUB)),"^",2)'="F"
- QUIT 1
- +12 QUIT 0
- +13 ;
- LRO69 ;analyze CPRS order number
- +1 NEW LROTST,LRNTST,LROCPRS
- +2 SET LROTST=0
- +3 FOR
- SET LROTST=$ORDER(^LRO(69,LRODATE,1,LROSN,2,LROTST))
- if 'LROTST
- QUIT
- Begin DoDot:1
- +4 SET LRNTST=$PIECE(^LRO(69,LRODATE,1,LROSN,2,LROTST,0),"^")
- +5 ;Quit if test in file 69 does not correspond to the test
- +6 ;or panel being evaluated in file 68.
- +7 IF LRNTST'=LRTST
- IF LRNTST'=LRPANEL
- QUIT
- +8 SET LROCPRS=$PIECE(^LRO(69,LRODATE,1,LROSN,2,LROTST,0),"^",7)
- +9 ;CPRS order number will be null for referral orders
- +10 ;(already checked for referral, but adding line below as a safeguard.)
- +11 if LROCPRS=""
- QUIT
- +12 ;Order might have been checked if a panel was ordered.
- +13 if $DATA(^TMP("LR541 OR CHECKED",$JOB,LROCPRS))
- QUIT
- +14 if $DATA(^TMP("LR541 OR NO UPDATE",$JOB,LROCPRS))
- QUIT
- +15 ;only check orders with active status
- +16 IF $PIECE($GET(^OR(100,LROCPRS,3)),"^",3)'=6
- QUIT
- +17 ;Update status - this test is not a panel since test number
- +18 ;equals panel number
- +19 IF LRTST=LRPANEL
- DO UPDATE
- QUIT
- +20 ;check all accessions for test components of a panel
- +21 NEW LRXTST,LRXAA,LRXAD,LRXAN,LRXSTR,LRX68STR,LRXIDTZ
- +22 SET LRXTST=0
- +23 FOR
- SET LRXTST=$ORDER(^LRO(69,LRODATE,1,LROSN,2,LRXTST))
- if 'LRXTST
- QUIT
- Begin DoDot:2
- +24 SET LRXSTR=$GET(^LRO(69,LRODATE,1,LROSN,2,LRXTST,0))
- +25 if $PIECE(LRXSTR,"^",7)'=LROCPRS
- QUIT
- +26 SET LRXAD=$PIECE(LRXSTR,"^",3)
- +27 ;Accession fields might be null for profile tests.
- +28 if LRXAD=""
- QUIT
- +29 SET LRXAA=$PIECE(LRXSTR,"^",4)
- SET LRXAN=$PIECE(LRXSTR,"^",5)
- +30 IF LRXAA=""!(LRXAN="")
- QUIT
- +31 SET LRNTST=$PIECE(^LRO(69,LRODATE,1,LROSN,2,LRXTST,0),"^")
- +32 ;cross check file 68 test status
- +33 SET LRX68STR=$GET(^LRO(68,LRXAA,1,LRXAD,1,LRXAN,4,LRNTST,0))
- +34 if LRX68STR=""
- QUIT
- +35 ;This CPRS order is not yet final or was marked not performed or merged
- +36 IF $PIECE(LRX68STR,"^",5)=""!($PIECE(LRX68STR,"^",6)'="")
- SET ^TMP("LR541 OR NO UPDATE",$JOB,LROCPRS)=""
- +37 SET LRXIDTZ=$PIECE(^LRO(68,LRXAA,1,LRXAD,1,LRXAN,3),"^",5)
- +38 SET LRPEND=$$CHK63(LRDFN,LRXIDTZ,LRNTST)
- +39 ;A test is pending on this order, so don't update to complete.
- +40 IF LRPEND
- SET ^TMP("LR541 OR NO UPDATE",$JOB,LROCPRS)=""
- End DoDot:2
- +41 ;set trace of orders checked
- +42 SET ^TMP("LR541 OR CHECKED",$JOB,LROCPRS)=""
- +43 if $DATA(^TMP("LR541 OR NO UPDATE",$JOB,LROCPRS))
- QUIT
- +44 ;all component tests are complete, so update status on order
- +45 DO UPDATE
- End DoDot:1
- +46 QUIT
- +47 ;
- UPDATE ;update status to "complete" and set trace file
- +1 DO STATUS^ORCSAVE2(LROCPRS,2)
- +2 SET ^XTMP("LR 541 POST INSTALL",LROCPRS)=LRODATE_"^"_LROSN
- +3 SET LRNUM=LRNUM+1
- +4 QUIT
- +5 ;
- XTMP ;Generate MailMan message and keep in ^XTMP for 60 days
- +1 SET ^XTMP("LR 541 MAILMAN MESSAGE",0)=$$FMADD^XLFDT(DT,60)_"^"_DT_"^LR*5.2*541 POST INSTALL"
- +2 IF $ORDER(^XTMP("LR 541 POST INSTALL",1))=""
- Begin DoDot:1
- +3 SET ^XTMP("LR 541 MAILMAN MESSAGE",2)=" "
- +4 SET ^XTMP("LR 541 MAILMAN MESSAGE",3)="LR*5.2*541 post-install routine found no occurrences"
- +5 SET ^XTMP("LR 541 MAILMAN MESSAGE",4)="related to the issue for ServiceNow ticket INC13797003."
- +6 ;Set an entry in the detail ^XTMP("LR 541 POST INSTALL" if needed for future reference
- +7 SET ^XTMP("LR 541 POST INSTALL",1)="No issues found."
- End DoDot:1
- QUIT
- +8 ;
- +9 ;Issues were found
- +10 SET ^XTMP("LR 541 MAILMAN MESSAGE",1)=" "
- +11 SET ^XTMP("LR 541 MAILMAN MESSAGE",2)="The post install for LR*5.2*541 corrected the CPRS order status"
- +12 SET ^XTMP("LR 541 MAILMAN MESSAGE",3)="of "_LRNUM_" orders. The global ^XTMP(""LR 541 POST INSTALL"") contains"
- +13 SET ^XTMP("LR 541 MAILMAN MESSAGE",4)="the specific order numbers."
- +14 KILL ^TMP("LR541 OR NO UPDATE",$JOB),^TMP("LR541 OR CHECKED",$JOB)
- +15 QUIT
- +16 ;
- MAIL ;
- +1 NEW LRMY,LRMSUB,LRMTEXT,LRMFROM,LRMIN
- +2 SET LRMIN("FROM")="LR*5.2*541 Post-Install"
- +3 SET LRMY(LRDUZ)=""
- +4 SET LRMY("G.LMI")=""
- +5 SET LRMSUB="LR*5.2*541 Post-Install"
- +6 SET LRMTEXT="^XTMP(""LR 541 MAILMAN MESSAGE"")"
- +7 DO SENDMSG^XMXAPI(DUZ,LRMSUB,LRMTEXT,.LRMY,.LRMIN,"","")
- +8 QUIT