PSS211PO ;DAL/JCH - PATCH PSS*1.0*211 POST INSTALL ;09/13/2017
;;1.0;PHARMACY DATA MANAGEMENT;**211**;09/30/97;Build 20
; This routine uses the following IAs:
; #4640 - ^HDISVF01 calls (supported)
; #4639 - ^HDISVCMR calls (supported)
; #4651 - ^HDISVF09 calls (supported)
;
EN ;MAIN ENTRY POINT
N SUCCESS,DEMFAC,X,Y,DA,X1,X2,ZTRTN,ZTDESC,ZTDTH,TMP,DOMPTR,DIE,DA,DR,FIL,DOMPTR,DOMAIN
S DEMFAC=$$KSP^XUPARAM("INST")
S DOMAIN="PHARMACY DATA MANAGEMENT"
S SUCCESS=$$GETIEN^HDISVF09(DOMAIN,.DOMPTR)
I 'SUCCESS!'+$G(DOMPTR) D Q
.D MES^XPDUTL("***** Error retrieving the IEN for the "_DOMAIN_" domain.")
.D PSTHALT("Seeding for file #50.60699 was not performed.")
S FIL=50.60699 D HDIS(FIL,DOMPTR,DOMAIN)
Q
;
HDIS(FIL,DOMPTR,DOMAIN) ; Do dummy 'seeding'
N TMP,HDIMSG,B,C
;
; New file can't be seeded if there is no data?
I FIL=50.60699 D Q
.I '$O(^PSMDF(50.60699,0)) D DUMSEED(50.60699,"SEEDOSF")
.D PSEED(50.60699,DOMPTR,DOMAIN)
;
Q
;
PSEED(FIL,DOMPTR,DOMAIN) ; Check for previous "seeding"(deployment), quit if already done.
N ASTATUS,TMP,XPROD,PSSITE,XMSUB,XMDUZ,XMY,HDITEXT,FILNAM,MSG,XMTEXT,XMZ
;
S ASTATUS=$P($$GETSTAT^HDISVF01(FIL),U)
I ASTATUS>3 S MSG="File: "_FIL_" Has already been seeded. Status is: "_ASTATUS D PSTHALT(MSG) Q
;
; set the seeding status to complete for data deployments.
D SETSTAT^HDISVF01(FIL,,4)
;
; send message to STS that patch is installed and the current status
D FILE^DID(FIL,"","NAME","FILNAM","ERR")
S FILNAM=$G(FILNAM("NAME"))
S XPROD=$$PROD^XUPROD()
S PSSITE=$$SITE^VASITE()
S XMSUB="Site: "_$P(PSSITE,"^",2)_" File: "_FIL_" in "_($S(XPROD:"PRODUCTION",1:"TEST"))_" ready for ERT Update"
S XMY("G.HDIS ERT NOTIFICATION@DOMAIN.EXT")=""
S XMDUZ="Site: "_$P(PSSITE,"^",3)_" Patch Install PSS*1.0*211 is Complete"
S XMY(DUZ)=""
K HDITEXT
S HDITEXT(1)=""
S HDITEXT(2)="Site: "_$P(PSSITE,"^",2)_" - "_$P(PSSITE,"^",3)
S HDITEXT(2)=HDITEXT(2)_" with Domain/IP Address of "_$G(^XMB("NETNAME")) ;facility name
S HDITEXT(3)="Has Installed Patch PSS*1.0*211 into their "_$S(XPROD:"PRODUCTION",1:"TEST")_" System Environment"
S HDITEXT(4)="The Patch was Installed on: "
S B=$$NOW^XLFDT N Y S Y=B D DD^%DT S HDITEXT(4)=HDITEXT(4)_Y ;date/time
S HDITEXT(5)=""
S HDITEXT(6)="Patch PSS*1.0*211 has standardized file: "_FILNAM_" (#"_FIL_")"
S HDITEXT(7)=""
S HDITEXT(8)="The current HDIS status of file #"_FIL_"is: "_$P($$GETSTAT^HDISVF01(FIL),U)
S HDITEXT(9)=""
S HDITEXT(10)="Site: "_$P(PSSITE,"^",2)_" - "_$P(PSSITE,"^",3)_" needs full file update of the "_FILNAM_" file (#"_FIL_" as soon as possible."
S HDITEXT(11)=""
N DIFROM S XMTEXT="HDITEXT(" D ^XMD K DIFROM
S MSG="File: "_FIL_" Has been 'seeded'. Message Number: "_$G(XMZ) D PSTDONE(MSG)
Q
;
PSTDONE(MSG) ; display FINISHED message
N HDIMSG
S HDIMSG(1)=""
S HDIMSG(2)=MSG
S HDIMSG(3)="***** Post-installation of Patch PSS*1.0*211 HDIS 'seeding' "_FILNAM_" file (#"_FIL_") has Completed."
S HDIMSG(4)="***** An update message has been sent to Enterprise VistA Support."
S HDIMSG(5)=""
D MES^XPDUTL(.HDIMSG)
Q
;
DUMSEED(PSMFILE,PSDTAG) ; New file <#nn.99> contains no data, can't be seeded unless there is at least one entry
; MASTER DOSAGE FORM (#50.60699) file initial population data elements from DAT99 line tag
;
; PSDATA ";" PIECE - FIELD # - FIELD NAME
; PIECE #1 - n/a - IEN
; PIECE #2 - .01 - RxNorm Name
; PIECE #3 - 1 - RxNorm Code
; PIECE #4 - 2 - RxNorm Term Type
;
N PSMFI,PSDATA,PSDATLN,PSFDA,PSRSLT,XUMF
S XUMF=1
F PSDATLN=1:1 S PSDATA=$P($T(@PSDTAG+PSDATLN),";",3,10) Q:PSDATA="" D
.N PSMFI,PSFDA,PSFDAIEN,PSEFFDT
.S PSMFI=$P(PSDATA,";")
.S PSFDA(PSMFILE,"+1,",.01)=$P(PSDATA,";",2)
.S PSFDA(PSMFILE,"+1,",1)=$P(PSDATA,";",3)
.S PSFDA(PSMFILE,"+1,",2)=$P(PSDATA,";",4)
.S PSRSLT=$$INSREC(PSMFILE,PSMFI,.PSFDA)
Q
;
INSREC(PSFILE,PSIEN,PSFDA) ; Insert PSIEN into file PSFILE with data in PSFDA
I ('$G(PSFILE)) Q "0^Invalid parameter"
N PSDERR
D UPDATE^DIE("","PSFDA","","PSDERR")
I $D(PSDERR) Q -1
Q +$G(PSFDA)
;
PSTHALT(MSG) ; display error message
S HDIMSG(1)=""
S HDIMSG(2)=MSG
S HDIMSG(3)="***** Post-installation of Patch PS*5.3*933 HDIS 'seeding' has been halted."
S HDIMSG(4)="***** Please contact Enterprise VistA Support."
S HDIMSG(5)=""
D MES^XPDUTL(.HDIMSG)
Q
;
SEEDOSF ; Data to populated the MASTER DOSAGE FORM (#50.60699) file.
;;1;24 Hour Extended Release Tablet;316936;DF
;;2;Aerosol;324049;ET
;;3;Bar;317692;DF
;;4;Beads;316993;DF
;;5;Buccal Film;858080;DF
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSS211PO 4672 printed Dec 13, 2024@02:29:29 Page 2
PSS211PO ;DAL/JCH - PATCH PSS*1.0*211 POST INSTALL ;09/13/2017
+1 ;;1.0;PHARMACY DATA MANAGEMENT;**211**;09/30/97;Build 20
+2 ; This routine uses the following IAs:
+3 ; #4640 - ^HDISVF01 calls (supported)
+4 ; #4639 - ^HDISVCMR calls (supported)
+5 ; #4651 - ^HDISVF09 calls (supported)
+6 ;
EN ;MAIN ENTRY POINT
+1 NEW SUCCESS,DEMFAC,X,Y,DA,X1,X2,ZTRTN,ZTDESC,ZTDTH,TMP,DOMPTR,DIE,DA,DR,FIL,DOMPTR,DOMAIN
+2 SET DEMFAC=$$KSP^XUPARAM("INST")
+3 SET DOMAIN="PHARMACY DATA MANAGEMENT"
+4 SET SUCCESS=$$GETIEN^HDISVF09(DOMAIN,.DOMPTR)
+5 IF 'SUCCESS!'+$GET(DOMPTR)
Begin DoDot:1
+6 DO MES^XPDUTL("***** Error retrieving the IEN for the "_DOMAIN_" domain.")
+7 DO PSTHALT("Seeding for file #50.60699 was not performed.")
End DoDot:1
QUIT
+8 SET FIL=50.60699
DO HDIS(FIL,DOMPTR,DOMAIN)
+9 QUIT
+10 ;
HDIS(FIL,DOMPTR,DOMAIN) ; Do dummy 'seeding'
+1 NEW TMP,HDIMSG,B,C
+2 ;
+3 ; New file can't be seeded if there is no data?
+4 IF FIL=50.60699
Begin DoDot:1
+5 IF '$ORDER(^PSMDF(50.60699,0))
DO DUMSEED(50.60699,"SEEDOSF")
+6 DO PSEED(50.60699,DOMPTR,DOMAIN)
End DoDot:1
QUIT
+7 ;
+8 QUIT
+9 ;
PSEED(FIL,DOMPTR,DOMAIN) ; Check for previous "seeding"(deployment), quit if already done.
+1 NEW ASTATUS,TMP,XPROD,PSSITE,XMSUB,XMDUZ,XMY,HDITEXT,FILNAM,MSG,XMTEXT,XMZ
+2 ;
+3 SET ASTATUS=$PIECE($$GETSTAT^HDISVF01(FIL),U)
+4 IF ASTATUS>3
SET MSG="File: "_FIL_" Has already been seeded. Status is: "_ASTATUS
DO PSTHALT(MSG)
QUIT
+5 ;
+6 ; set the seeding status to complete for data deployments.
+7 DO SETSTAT^HDISVF01(FIL,,4)
+8 ;
+9 ; send message to STS that patch is installed and the current status
+10 DO FILE^DID(FIL,"","NAME","FILNAM","ERR")
+11 SET FILNAM=$GET(FILNAM("NAME"))
+12 SET XPROD=$$PROD^XUPROD()
+13 SET PSSITE=$$SITE^VASITE()
+14 SET XMSUB="Site: "_$PIECE(PSSITE,"^",2)_" File: "_FIL_" in "_($SELECT(XPROD:"PRODUCTION",1:"TEST"))_" ready for ERT Update"
+15 SET XMY("G.HDIS ERT NOTIFICATION@DOMAIN.EXT")=""
+16 SET XMDUZ="Site: "_$PIECE(PSSITE,"^",3)_" Patch Install PSS*1.0*211 is Complete"
+17 SET XMY(DUZ)=""
+18 KILL HDITEXT
+19 SET HDITEXT(1)=""
+20 SET HDITEXT(2)="Site: "_$PIECE(PSSITE,"^",2)_" - "_$PIECE(PSSITE,"^",3)
+21 ;facility name
SET HDITEXT(2)=HDITEXT(2)_" with Domain/IP Address of "_$GET(^XMB("NETNAME"))
+22 SET HDITEXT(3)="Has Installed Patch PSS*1.0*211 into their "_$SELECT(XPROD:"PRODUCTION",1:"TEST")_" System Environment"
+23 SET HDITEXT(4)="The Patch was Installed on: "
+24 ;date/time
SET B=$$NOW^XLFDT
NEW Y
SET Y=B
DO DD^%DT
SET HDITEXT(4)=HDITEXT(4)_Y
+25 SET HDITEXT(5)=""
+26 SET HDITEXT(6)="Patch PSS*1.0*211 has standardized file: "_FILNAM_" (#"_FIL_")"
+27 SET HDITEXT(7)=""
+28 SET HDITEXT(8)="The current HDIS status of file #"_FIL_"is: "_$PIECE($$GETSTAT^HDISVF01(FIL),U)
+29 SET HDITEXT(9)=""
+30 SET HDITEXT(10)="Site: "_$PIECE(PSSITE,"^",2)_" - "_$PIECE(PSSITE,"^",3)_" needs full file update of the "_FILNAM_" file (#"_FIL_" as soon as possible."
+31 SET HDITEXT(11)=""
+32 NEW DIFROM
SET XMTEXT="HDITEXT("
DO ^XMD
KILL DIFROM
+33 SET MSG="File: "_FIL_" Has been 'seeded'. Message Number: "_$GET(XMZ)
DO PSTDONE(MSG)
+34 QUIT
+35 ;
PSTDONE(MSG) ; display FINISHED message
+1 NEW HDIMSG
+2 SET HDIMSG(1)=""
+3 SET HDIMSG(2)=MSG
+4 SET HDIMSG(3)="***** Post-installation of Patch PSS*1.0*211 HDIS 'seeding' "_FILNAM_" file (#"_FIL_") has Completed."
+5 SET HDIMSG(4)="***** An update message has been sent to Enterprise VistA Support."
+6 SET HDIMSG(5)=""
+7 DO MES^XPDUTL(.HDIMSG)
+8 QUIT
+9 ;
DUMSEED(PSMFILE,PSDTAG) ; New file <#nn.99> contains no data, can't be seeded unless there is at least one entry
+1 ; MASTER DOSAGE FORM (#50.60699) file initial population data elements from DAT99 line tag
+2 ;
+3 ; PSDATA ";" PIECE - FIELD # - FIELD NAME
+4 ; PIECE #1 - n/a - IEN
+5 ; PIECE #2 - .01 - RxNorm Name
+6 ; PIECE #3 - 1 - RxNorm Code
+7 ; PIECE #4 - 2 - RxNorm Term Type
+8 ;
+9 NEW PSMFI,PSDATA,PSDATLN,PSFDA,PSRSLT,XUMF
+10 SET XUMF=1
+11 FOR PSDATLN=1:1
SET PSDATA=$PIECE($TEXT(@PSDTAG+PSDATLN),";",3,10)
if PSDATA=""
QUIT
Begin DoDot:1
+12 NEW PSMFI,PSFDA,PSFDAIEN,PSEFFDT
+13 SET PSMFI=$PIECE(PSDATA,";")
+14 SET PSFDA(PSMFILE,"+1,",.01)=$PIECE(PSDATA,";",2)
+15 SET PSFDA(PSMFILE,"+1,",1)=$PIECE(PSDATA,";",3)
+16 SET PSFDA(PSMFILE,"+1,",2)=$PIECE(PSDATA,";",4)
+17 SET PSRSLT=$$INSREC(PSMFILE,PSMFI,.PSFDA)
End DoDot:1
+18 QUIT
+19 ;
INSREC(PSFILE,PSIEN,PSFDA) ; Insert PSIEN into file PSFILE with data in PSFDA
+1 IF ('$GET(PSFILE))
QUIT "0^Invalid parameter"
+2 NEW PSDERR
+3 DO UPDATE^DIE("","PSFDA","","PSDERR")
+4 IF $DATA(PSDERR)
QUIT -1
+5 QUIT +$GET(PSFDA)
+6 ;
PSTHALT(MSG) ; display error message
+1 SET HDIMSG(1)=""
+2 SET HDIMSG(2)=MSG
+3 SET HDIMSG(3)="***** Post-installation of Patch PS*5.3*933 HDIS 'seeding' has been halted."
+4 SET HDIMSG(4)="***** Please contact Enterprise VistA Support."
+5 SET HDIMSG(5)=""
+6 DO MES^XPDUTL(.HDIMSG)
+7 QUIT
+8 ;
SEEDOSF ; Data to populated the MASTER DOSAGE FORM (#50.60699) file.
+1 ;;1;24 Hour Extended Release Tablet;316936;DF
+2 ;;2;Aerosol;324049;ET
+3 ;;3;Bar;317692;DF
+4 ;;4;Beads;316993;DF
+5 ;;5;Buccal Film;858080;DF
+6 QUIT