PSO797PI ;BIRM/KML - PSO*7*797 Post-install routine ;07/17/2025
;;7.0;OUTPATIENT PHARMACY;**797**;DEC 1997;Build 7
;
; No entry from top
Q
;
EN ; MAIN ENTRY POINT
K ^TMP("PSO797PI",$J)
N LINENUM,ERROR,ROUTINES
S ERROR=0
S LINENUM=0
D UPD5IS03
D MAIL("PSO*7*797 Installation is completed.")
Q
;
UPD5IS03 ; Update IS03 description in ASAP 5.0 and 5.0Z
;
N VER
F VER="5.0","5.0Z" D
. N VERIEN,ELIEN,SEGIEN,ASAPIENS,IS03,ISLINE,ISTEXT
. S VERIEN=$$FIND1^DIC(58.4001,",1,","O",VER)
. Q:'(VERIEN>0)
. S ASAPIENS=","_VERIEN_",1,"
. S SEGIEN=$$FIND1^DIC(58.40011,ASAPIENS,"O","IS")
. Q:'SEGIEN
. S ASAPIENS=","_SEGIEN_","_VERIEN_",1,"
. S ELIEN=$$FIND1^DIC(58.400111,ASAPIENS,"O","IS03")
. Q:'ELIEN
. D FILEDESC(ELIEN,SEGIEN,VERIEN)
Q
;
FILEDESC(ELIEN,SEGIEN,VERIEN) ; Update the DESCRIPTION field (#.07) of SPMP ASAP RECORD DEFINITION file (#58.4)
;
N IS03DESC,ASAPIENS,IS03ERR
Q:'ELIEN!'SEGIEN!'VERIEN
;
S ASAPIENS=ELIEN_","_SEGIEN_","_VERIEN_",1,"
S IS03=$$GET1^DIQ(58.400111,ASAPIENS,.07,"","IS03")
Q:$G(IS03(1))'["Freetext message. Use of this field is defined by the PDMP."
;
S IS03DESC(1)="Freetext message. Use of this field is defined by the PDMP. PDMPs may"
S IS03DESC(2)="designate this field to hold the submission period date range of the file"
S IS03DESC(3)="transmitted. When used to indicate the date range, it must be the first"
S IS03DESC(4)="data text in the field and must be inserted using the following layout"
S IS03DESC(5)="(where ""#"" and ""-"" are those literal characters):"
S IS03DESC(6)="#CCYYMMDD#-#CCYYMMDD#"
S IS03DESC(7)="For example, a pharmacy may be submitting records for the reporting period"
S IS03DESC(8)="of February 5, 2023 through February 11, 2023 but only filled reportable"
S IS03DESC(9)="prescriptions on February 5 and February 7. The full submission period"
S IS03DESC(10)="date range would be reported in IS03 as #20230205#-#20230211# "
S IS03DESC(11)="It is up to the PDMP to further define how to enter the submission date"
S IS03DESC(12)="range for exceptional cases, such as for late submission records."
S IS03DESC(13)="Note: IS03 can also be used to show the date range for Zero"
S IS03DESC(14)="Reports."
;
; File description text
D WP^DIE(58.400111,ASAPIENS,.07,,"IS03DESC","IS03ERR")
I $G(IS03ERR("DIERR")) D Q
. D REPORT("Error encountered during update of IS03 in ASAP "_VER_".","COMPLETE",.LINENUM)
. D REPORT("Error Code: "_$G(IS03ERR("DIERR",1)),"COMPLETE",.LINENUM)
. D REPORT($G(IS03ERR("DIERR",1,"TEXT",1)),"COMPLETE",.LINENUM)
. D REPORT("*","ERROR",.LINENUM)
D REPORT("The IS03 Description in ASAP "_VER_" has been updated successfully.","COMPLETE",.LINENUM)
Q
;
MAIL(XMSUB) ;Send mail message
N X,XMTEXT,XMY,XMDUZ,XMMG,XMSTRIP,XMROU,XMYBLOB,XMZ,XMDUN
S XMDUZ="PSO*7*797 Install"
S XMTEXT="^TMP(""PSO797PI"",$J,"
S XMY("G.PSO SPMP NOTIFICATIONS")=""
S XMY(DUZ)=""
N DIFROM D ^XMD
Q
;
REPORT(TEXT,ACTION,LINE) ; Report progress/issues
; Input
; TEXT - text to report to end-user
; ACTION - what was being processed
; LINE - line number for the mail message passed in by reference
D:ACTION="ERROR" 2
D:ACTION="COMPLETE" 1
Q
1 D BMES^XPDUTL(" "_TEXT)
S LINE=LINE+1
S ^TMP("PSO797PI",$J,LINE)=" "_TEXT
S LINE=LINE+1
S ^TMP("PSO797PI",$J,LINE)=""
Q
;
2 D BMES^XPDUTL(" "_TEXT_" Please contact product support.")
S LINE=LINE+1
S ^TMP("PSO797PI",$J,LINE)=" Please log a SNOW Ticket and refer to this message."
S LINE=LINE+1
S ^TMP("PSO797PI",$J,LINE)=""
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSO797PI 3614 printed Jan 29, 2026@15:22:19 Page 2
PSO797PI ;BIRM/KML - PSO*7*797 Post-install routine ;07/17/2025
+1 ;;7.0;OUTPATIENT PHARMACY;**797**;DEC 1997;Build 7
+2 ;
+3 ; No entry from top
+4 QUIT
+5 ;
EN ; MAIN ENTRY POINT
+1 KILL ^TMP("PSO797PI",$JOB)
+2 NEW LINENUM,ERROR,ROUTINES
+3 SET ERROR=0
+4 SET LINENUM=0
+5 DO UPD5IS03
+6 DO MAIL("PSO*7*797 Installation is completed.")
+7 QUIT
+8 ;
UPD5IS03 ; Update IS03 description in ASAP 5.0 and 5.0Z
+1 ;
+2 NEW VER
+3 FOR VER="5.0","5.0Z"
Begin DoDot:1
+4 NEW VERIEN,ELIEN,SEGIEN,ASAPIENS,IS03,ISLINE,ISTEXT
+5 SET VERIEN=$$FIND1^DIC(58.4001,",1,","O",VER)
+6 if '(VERIEN>0)
QUIT
+7 SET ASAPIENS=","_VERIEN_",1,"
+8 SET SEGIEN=$$FIND1^DIC(58.40011,ASAPIENS,"O","IS")
+9 if 'SEGIEN
QUIT
+10 SET ASAPIENS=","_SEGIEN_","_VERIEN_",1,"
+11 SET ELIEN=$$FIND1^DIC(58.400111,ASAPIENS,"O","IS03")
+12 if 'ELIEN
QUIT
+13 DO FILEDESC(ELIEN,SEGIEN,VERIEN)
End DoDot:1
+14 QUIT
+15 ;
FILEDESC(ELIEN,SEGIEN,VERIEN) ; Update the DESCRIPTION field (#.07) of SPMP ASAP RECORD DEFINITION file (#58.4)
+1 ;
+2 NEW IS03DESC,ASAPIENS,IS03ERR
+3 if 'ELIEN!'SEGIEN!'VERIEN
QUIT
+4 ;
+5 SET ASAPIENS=ELIEN_","_SEGIEN_","_VERIEN_",1,"
+6 SET IS03=$$GET1^DIQ(58.400111,ASAPIENS,.07,"","IS03")
+7 if $GET(IS03(1))'["Freetext message. Use of this field is defined by the PDMP."
QUIT
+8 ;
+9 SET IS03DESC(1)="Freetext message. Use of this field is defined by the PDMP. PDMPs may"
+10 SET IS03DESC(2)="designate this field to hold the submission period date range of the file"
+11 SET IS03DESC(3)="transmitted. When used to indicate the date range, it must be the first"
+12 SET IS03DESC(4)="data text in the field and must be inserted using the following layout"
+13 SET IS03DESC(5)="(where ""#"" and ""-"" are those literal characters):"
+14 SET IS03DESC(6)="#CCYYMMDD#-#CCYYMMDD#"
+15 SET IS03DESC(7)="For example, a pharmacy may be submitting records for the reporting period"
+16 SET IS03DESC(8)="of February 5, 2023 through February 11, 2023 but only filled reportable"
+17 SET IS03DESC(9)="prescriptions on February 5 and February 7. The full submission period"
+18 SET IS03DESC(10)="date range would be reported in IS03 as #20230205#-#20230211# "
+19 SET IS03DESC(11)="It is up to the PDMP to further define how to enter the submission date"
+20 SET IS03DESC(12)="range for exceptional cases, such as for late submission records."
+21 SET IS03DESC(13)="Note: IS03 can also be used to show the date range for Zero"
+22 SET IS03DESC(14)="Reports."
+23 ;
+24 ; File description text
+25 DO WP^DIE(58.400111,ASAPIENS,.07,,"IS03DESC","IS03ERR")
+26 IF $GET(IS03ERR("DIERR"))
Begin DoDot:1
+27 DO REPORT("Error encountered during update of IS03 in ASAP "_VER_".","COMPLETE",.LINENUM)
+28 DO REPORT("Error Code: "_$GET(IS03ERR("DIERR",1)),"COMPLETE",.LINENUM)
+29 DO REPORT($GET(IS03ERR("DIERR",1,"TEXT",1)),"COMPLETE",.LINENUM)
+30 DO REPORT("*","ERROR",.LINENUM)
End DoDot:1
QUIT
+31 DO REPORT("The IS03 Description in ASAP "_VER_" has been updated successfully.","COMPLETE",.LINENUM)
+32 QUIT
+33 ;
MAIL(XMSUB) ;Send mail message
+1 NEW X,XMTEXT,XMY,XMDUZ,XMMG,XMSTRIP,XMROU,XMYBLOB,XMZ,XMDUN
+2 SET XMDUZ="PSO*7*797 Install"
+3 SET XMTEXT="^TMP(""PSO797PI"",$J,"
+4 SET XMY("G.PSO SPMP NOTIFICATIONS")=""
+5 SET XMY(DUZ)=""
+6 NEW DIFROM
DO ^XMD
+7 QUIT
+8 ;
REPORT(TEXT,ACTION,LINE) ; Report progress/issues
+1 ; Input
+2 ; TEXT - text to report to end-user
+3 ; ACTION - what was being processed
+4 ; LINE - line number for the mail message passed in by reference
+5 if ACTION="ERROR"
DO 2
+6 if ACTION="COMPLETE"
DO 1
+7 QUIT
1 DO BMES^XPDUTL(" "_TEXT)
+1 SET LINE=LINE+1
+2 SET ^TMP("PSO797PI",$JOB,LINE)=" "_TEXT
+3 SET LINE=LINE+1
+4 SET ^TMP("PSO797PI",$JOB,LINE)=""
+5 QUIT
+6 ;
2 DO BMES^XPDUTL(" "_TEXT_" Please contact product support.")
+1 SET LINE=LINE+1
+2 SET ^TMP("PSO797PI",$JOB,LINE)=" Please log a SNOW Ticket and refer to this message."
+3 SET LINE=LINE+1
+4 SET ^TMP("PSO797PI",$JOB,LINE)=""
+5 QUIT