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

ORY429.m

Go to the documentation of this file.
ORY429 ; ISP/TC - Post Install Routine for OR*3.0*429 ;04/04/17  12:28
 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**429**;Dec 17, 1997;Build 33
 ;
 ; External References:
 ;   ICR  2263   ADD/EN^XPAR
 ;   ICR  2971   ^GMPL(125,"C"
 ;   ICR  10040  $$GET1^DIQ(44,ORCLIN,.01)
 ;   ICR  10060  ^VA(200,"B"
 ;   ICR  10141  MES^XPDUTL
 ;
DUPLIST(ORINVLST,ORLSTNM) ; Check invalid list for any duplicate entries
 N ORLIST,ORDUP S ORLIST="",ORDUP=0
 F  S ORLIST=$O(ORINVLST(ORLIST)) Q:ORLIST=""  D
 . I ORLSTNM=ORLIST S ORDUP=1 Q
 Q ORDUP
 ;
POST ; Post-install subroutine
 ;
 N ORUSRMSG,ORCLNMSG,ORSYSMSG
 Q:$$PATCH^XPDUTL("OR*3.0*429")
 S ORUSRMSG(1)="Migrating default user Problem Selection list from NEW PERSON File to the"
 S ORUSRMSG(2)="ORQQPL SELECTION LIST parameter..."
 D MES^XPDUTL(.ORUSRMSG)
 D SETUSRLT
 S ORCLNMSG(1)=""
 S ORCLNMSG(2)="Migrating default clinic Problem Selection list from PROBLEM SELECTION LIST"
 S ORCLNMSG(3)="File to the ORQQPL SELECTION LIST parameter..."
 D MES^XPDUTL(.ORCLNMSG)
 D SETCLNLT
 S ORSYSMSG(1)=""
 S ORSYSMSG(2)="Setting system & package level for ORQQPL SELECTION LIST parameter to a default"
 S ORSYSMSG(3)="VA National Selection List..."
 D MES^XPDUTL(.ORSYSMSG)
 D SETSYSPR
 Q
 ;
PRNTERR(ORERR,ORACT,ORENTY,ORLSTNM) ; Print out any errors during migration
 N ORTXT,ORFILE,ORENT
 S ORENT=$S($P(ORENTY,U)="USR":"user",$P(ORENTY,U)="LOC":"clinic",$P(ORENTY,U)="SYS":"system",1:"package")
 S ORTXT(1)=""
 S ORTXT(2)="  "_ORACT_" failed for "_ORENT_$S($L($P(ORENTY,U,2))>0:": "_$P(ORENTY,U,2),1:"")
 S ORTXT(3)="  Default list: "_ORLSTNM
 S ORTXT(4)="  Error: "_$P(ORERR,U,2)
 S ORTXT(5)=""
 D MES^XPDUTL(.ORTXT)
 Q
 ;
PRNTIERR(ORINVLST) ; Print out list with inactive codes
 N ORTXT,ORLST
 S ORTXT(1)=""
 S ORTXT(2)="  The following selection lists could not be migrated to the ORQQPL SELECTION"
 S ORTXT(3)="  LIST parameter because it contains one or more problems that have inactive"
 S ORTXT(4)="  SNOMED and/or ICD codes attached to them."
 S ORTXT(5)=""
 D MES^XPDUTL(.ORTXT)
 S ORLST=""
 F  S ORLST=$O(ORINVLST(ORLST)) Q:ORLST=""  D MES^XPDUTL("          "_ORLST)
 Q
 ;
SETCLNLT ; Migrate pre-existing clinic default list to ORQQPL SELECTION LIST param
 N ORCLIN,ORLST,ORERR,ORLSTNM,ORINVLST,ORCLNNM,ORPRVCLN,ORDLM,ORPRVDLM,ORENTY,ORACT
 S (ORCLIN,ORLST,ORPRVCLN,ORPRVDLM)=0,ORACT="Migration"
 F  S ORCLIN=$O(^GMPL(125,"C",ORCLIN)) Q:'ORCLIN  D
 . F  S ORLST=$O(^GMPL(125,"C",ORCLIN,ORLST)) Q:'ORLST  D
 . . S ORLSTNM=$$GET1^DIQ(125,ORLST,.01)
 . . Q:ORLSTNM=""
 . . S ORCLNNM=$$GET1^DIQ(44,ORCLIN,.01)
 . . S ORDLM=$$GET1^DIQ(125,ORLST,.02,"I")
 . . I '$$VALLIST^GMPLBLD2(ORLST) D
 . . . Q:$$DUPLIST(.ORINVLST,ORLSTNM)
 . . . S ORINVLST(ORLSTNM)=""
 . . E  D
 . . . I ORCLIN=ORPRVCLN D
 . . . . I ORDLM>=ORPRVDLM D EN^XPAR("LOC."_ORCLNNM,"ORQQPL SELECTION LIST",1,ORLSTNM,.ORERR)
 . . . E  D EN^XPAR("LOC."_ORCLNNM,"ORQQPL SELECTION LIST",1,ORLSTNM,.ORERR)
 . . I ORCLIN'=ORPRVCLN S ORPRVCLN=ORCLIN
 . . I ORDLM'=ORPRVDLM S ORPRVDLM=ORDLM
 . . S ORENTY="LOC^"_ORCLNNM
 . . I +$G(ORERR)>0 D PRNTERR(ORERR,ORACT,ORENTY,ORLSTNM) K ORERR
 I $D(ORINVLST) D PRNTIERR(.ORINVLST)
 Q
 ;
SETSYSPR ; Set system & package level of ORQQPL SELECTION LIST param to VA National list
 N ORLSTNM,ORSYSERR,ORPKGERR,ORACT,ORSENTY,ORPENTY
 S ORLSTNM="",ORACT="Setting"
 S ORSENTY="SYS^",ORPENTY="PKG^ORDER ENTRY/RESULTS REPORTING"
 F  S ORLSTNM=$O(^GMPL(125,"B",ORLSTNM)) Q:ORLSTNM=""  D
 . I $E(ORLSTNM,1,3)="VA-" D
 . . D EN^XPAR("SYS","ORQQPL SELECTION LIST",1,ORLSTNM,.ORSYSERR)
 . . D EN^XPAR("PKG","ORQQPL SELECTION LIST",1,ORLSTNM,.ORPKGERR)
 . . I +$G(ORSYSERR)>0 D PRNTERR(ORSYSERR,ORACT,ORSENTY,ORLSTNM)
 . . I +$G(ORPKGERR)>0 D PRNTERR(ORPKGERR,ORACT,ORPENTY,ORLSTNM)
 Q
 ;
SETUSRLT ; Migrate pre-existing user default list to ORQQPL SELECTION LIST param
 N ORDUZ,ORLST,ORLSTNM,ORUSR,ORERR,ORINVLST,ORENTY,ORACT
 S (ORUSR,ORDUZ)="",ORACT="Migration"
 F  S ORUSR=$O(^VA(200,"B",ORUSR)) Q:ORUSR=""  D
 . F  S ORDUZ=$O(^VA(200,"B",ORUSR,ORDUZ)) Q:ORDUZ=""  D
 . . S ORLST=$$GET1^DIQ(200,ORDUZ,125.1,"I")
 . . Q:'ORLST
 . . S ORLSTNM=$$GET1^DIQ(125,ORLST,.01)
 . . I ($L(ORLSTNM)>0) D
 . . . I '$$VALLIST^GMPLBLD2(ORLST) D
 . . . . Q:$$DUPLIST(.ORINVLST,ORLSTNM)
 . . . . S ORINVLST(ORLSTNM)=""
 . . . E  D ADD^XPAR(ORDUZ_";VA(200,","ORQQPL SELECTION LIST",1,ORLSTNM,.ORERR)
 . . S ORENTY="USR^"_ORUSR
 . . I +$G(ORERR)>0 D PRNTERR(ORERR,ORACT,ORENTY,ORLSTNM) K ORERR
 I $D(ORINVLST) D PRNTIERR(.ORINVLST)
 Q
 ;