Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ORY401

ORY401.m

Go to the documentation of this file.
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