ORY401 ;MWA/VMP - POST INSTALL FOR PATCH OR*3.0*401 ; 8/9/16 10:11am
;;3.0;ORDER ENTRY/RESULTS REPORTING;**401**;;Build 11
Q ; this routine should only be called from an entry point
RUN ; main entry tag
N PIEN,LIST,ERR,ORPFIEN,MSGCNT,ORMSG
S MSGCNT=4
S PIEN=0,PIEN=$O(^XTV(8989.51,"B","ORK EDITABLE BY USER",PIEN)) Q:PIEN=""
S ORPFIEN=0,ORPFIEN=$O(^XTV(8989.51,"B","ORK PROCESSING FLAG",ORPFIEN))
D ENVAL^XPAR(.LIST,PIEN,,.ERR)
Q:$G(ERR)
N ORENT,PCNT S ORENT="" F S ORENT=$O(LIST(ORENT)) Q:'ORENT N ORINST S ORINST="" F S ORINST=$O(LIST(ORENT,ORINST)) Q:'ORINST I $G(LIST(ORENT,ORINST))=0 D
.S ORMSG(MSGCNT)="INSTANCE """_$G(^ORD(100.8,+ORINST,0))_""":",MSGCNT=MSGCNT+1,PCNT=MSGCNT
.N PFLIST D ENVAL^XPAR(.PFLIST,ORPFIEN,,.ERR) Q:$G(ERR)
.N PFENT S PFENT="" F S PFENT=$O(PFLIST(PFENT)) Q:'PFENT N PFINST S PFINST="" F S PFINST=$O(PFLIST(PFENT,PFINST)) Q:'PFINST I PFINST=ORINST D
..Q:PFLIST(PFENT,PFINST)="E"
..D CHG^XPAR(PFENT,ORPFIEN,"`"_PFINST,"E",.ERR)
..N FILENUM,FILE,P2,VALUE,IEN S P2=$P(PFENT,";",2) S FILENUM=$S(P2="VA(200,":200,P2="SC(":44,P2="DIC(49,":49,P2="DIC(4,":4,P2="DIC(4.2,":4.2,P2="DIC(9.4,":9.4,1:+$P(P2,"(",2))
..S IEN=$P(PFENT,";"),VALUE=$$GET1^DIQ(FILENUM,IEN_",",.01)
..S FILE=$S(P2="VA(200,":"NEW PERSON",P2="SC(":"HOSPITAL LOCATION",P2="DIC(49,":"SERVICE/SECTION",P2="DIC(4,":"INSTITUTION",P2="DIC(4.2,":"DOMAIN",P2="DIC(9.4,":"PACKAGE",1:P2)
..S ORMSG(MSGCNT)=" "_FILE_" - "_VALUE,MSGCNT=MSGCNT+1
.I PCNT=MSGCNT S ORMSG(MSGCNT)=" No changes",MSGCNT=MSGCNT+1
.S ORMSG(MSGCNT)=" ",MSGCNT=MSGCNT+1
D MAIL
Q
MAIL ; send mailman message
N XMSUB,XMDUZ,XMTEXT,XMY,DIFROM
S ORMSG(1)="OR*3.0*401 Post install routine has completed"
S ORMSG(2)="The ORK PROCESSING FLAG PARAMETER for the following entities have been changed to ENABLED"
S ORMSG(3)=" "
I '$D(ORMSG(4)) S ORMSG(4)="No changes"
S XMSUB="OR*3.0*401 Post install routine has completed"
S XMDUZ="ORDER ENTRY/RESULTS REPORTING PACKAGE"
S XMTEXT="ORMSG("
S XMY(DUZ)=""
D ^XMD
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HORY401 2035 printed Dec 13, 2024@02:41:47 Page 2
ORY401 ;MWA/VMP - POST INSTALL FOR PATCH OR*3.0*401 ; 8/9/16 10:11am
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**401**;;Build 11
+2 ; this routine should only be called from an entry point
QUIT
RUN ; main entry tag
+1 NEW PIEN,LIST,ERR,ORPFIEN,MSGCNT,ORMSG
+2 SET MSGCNT=4
+3 SET PIEN=0
SET PIEN=$ORDER(^XTV(8989.51,"B","ORK EDITABLE BY USER",PIEN))
if PIEN=""
QUIT
+4 SET ORPFIEN=0
SET ORPFIEN=$ORDER(^XTV(8989.51,"B","ORK PROCESSING FLAG",ORPFIEN))
+5 DO ENVAL^XPAR(.LIST,PIEN,,.ERR)
+6 if $GET(ERR)
QUIT
+7 NEW ORENT,PCNT
SET ORENT=""
FOR
SET ORENT=$ORDER(LIST(ORENT))
if 'ORENT
QUIT
NEW ORINST
SET ORINST=""
FOR
SET ORINST=$ORDER(LIST(ORENT,ORINST))
if 'ORINST
QUIT
IF $GET(LIST(ORENT,ORINST))=0
Begin DoDot:1
+8 SET ORMSG(MSGCNT)="INSTANCE """_$GET(^ORD(100.8,+ORINST,0))_""":"
SET MSGCNT=MSGCNT+1
SET PCNT=MSGCNT
+9 NEW PFLIST
DO ENVAL^XPAR(.PFLIST,ORPFIEN,,.ERR)
if $GET(ERR)
QUIT
+10 NEW PFENT
SET PFENT=""
FOR
SET PFENT=$ORDER(PFLIST(PFENT))
if 'PFENT
QUIT
NEW PFINST
SET PFINST=""
FOR
SET PFINST=$ORDER(PFLIST(PFENT,PFINST))
if 'PFINST
QUIT
IF PFINST=ORINST
Begin DoDot:2
+11 if PFLIST(PFENT,PFINST)="E"
QUIT
+12 DO CHG^XPAR(PFENT,ORPFIEN,"`"_PFINST,"E",.ERR)
+13 NEW FILENUM,FILE,P2,VALUE,IEN
SET P2=$PIECE(PFENT,";",2)
SET FILENUM=$SELECT(P2="VA(200,":200,P2="SC(":44,P2="DIC(49,":49,P2="DIC(4,":4,P2="DIC(4.2,":4.2,P2="DIC(9.4,":9.4,1:+$PIECE(P2,"(",2))
+14 SET IEN=$PIECE(PFENT,";")
SET VALUE=$$GET1^DIQ(FILENUM,IEN_",",.01)
+15 SET FILE=$SELECT(P2="VA(200,":"NEW PERSON",P2="SC(":"HOSPITAL LOCATION",P2="DIC(49,":"SERVICE/SECTION",P2="DIC(4,":"INSTITUTION",P2="DIC(4.2,":"DOMAIN",P2="DIC(9.4,":"PACKAGE",1:P2)
+16 SET ORMSG(MSGCNT)=" "_FILE_" - "_VALUE
SET MSGCNT=MSGCNT+1
End DoDot:2
+17 IF PCNT=MSGCNT
SET ORMSG(MSGCNT)=" No changes"
SET MSGCNT=MSGCNT+1
+18 SET ORMSG(MSGCNT)=" "
SET MSGCNT=MSGCNT+1
End DoDot:1
+19 DO MAIL
+20 QUIT
MAIL ; send mailman message
+1 NEW XMSUB,XMDUZ,XMTEXT,XMY,DIFROM
+2 SET ORMSG(1)="OR*3.0*401 Post install routine has completed"
+3 SET ORMSG(2)="The ORK PROCESSING FLAG PARAMETER for the following entities have been changed to ENABLED"
+4 SET ORMSG(3)=" "
+5 IF '$DATA(ORMSG(4))
SET ORMSG(4)="No changes"
+6 SET XMSUB="OR*3.0*401 Post install routine has completed"
+7 SET XMDUZ="ORDER ENTRY/RESULTS REPORTING PACKAGE"
+8 SET XMTEXT="ORMSG("
+9 SET XMY(DUZ)=""
+10 DO ^XMD
+11 QUIT