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

PXRMEXLI.m

Go to the documentation of this file.
  1. PXRMEXLI ; SLC/PKR - List Manager routines for repository entry install. ;03/30/2009
  1. ;;2.0;CLINICAL REMINDERS;**6,12**;Feb 04, 2005;Build 73
  1. ;
  1. ;================================================
  1. EXIT ;Cleanup ^TMP arrays.
  1. K ^TMP("PXRMEXLC",$J),^TMP("PXRMEXTMP",$J),^TMP("PXRMEXFND",$J)
  1. Q
  1. ;
  1. ;================================================
  1. INSALL ;Install all components in a repository entry.
  1. N IND,INSTALL
  1. ;Initialize the name change storage.
  1. K PXRMNMCH
  1. S (IND,INSTALL,PXRMDONE)=0
  1. F S IND=$O(^TMP("PXRMEXLC",$J,"SEL",IND)) Q:(+IND=0)!(PXRMDONE) D
  1. . D INSCOM(IND,.INSTALL)
  1. ;
  1. ;If anything was installed rebuild the display.
  1. I INSTALL D CDISP^PXRMEXLC(PXRMRIEN)
  1. ;
  1. ;Save the install history in the repository.
  1. D SAVHIST^PXRMEXU1
  1. Q
  1. ;
  1. ;================================================
  1. INSCOM(IND,INSTALL) ;Install component IND.
  1. ;PXRMRIEN is not passed because this is invoked by the ListManger
  1. ;action to install a repository entry.
  1. N ACTION,ATTR,END,EXISTS,FIELDNUM,FILENUM,IND120,JND120
  1. N NEWNAME,NEWPT01,PT01,RTN,START,TEMP,TEMP0
  1. S TEMP=^TMP("PXRMEXLC",$J,"SEL",IND)
  1. S FILENUM=$P(TEMP,U,1)
  1. S IND120=$P(TEMP,U,2)
  1. S JND120=$P(TEMP,U,3)
  1. S EXISTS=$P(TEMP,U,4)
  1. ;Dialogs use their own installation screen.
  1. I FILENUM=801.41 D Q
  1. . D DBUILD^PXRMEXLB(PXRMRIEN,IND120,JND120)
  1. . D START^PXRMEXLD
  1. . S VALMBCK="R"
  1. S TEMP=^PXD(811.8,PXRMRIEN,120,IND120,1,JND120,0)
  1. S START=$P(TEMP,U,2)
  1. S END=$P(TEMP,U,3)
  1. S TEMP=^PXD(811.8,PXRMRIEN,100,START,0)
  1. ;Go to full screen mode.
  1. D FULL^VALM1
  1. I ((FILENUM=0)!(FILENUM=811.4)),DUZ(0)'="@" D Q
  1. . I FILENUM=0 W !,"Only programmers can install routines."
  1. . I FILENUM=811.4 W !,"Only programmers can install Reminder Computed Findings."
  1. . H 2
  1. . S VALMBCK="R"
  1. I FILENUM=0 D
  1. . D RTNLD^PXRMEXIC(PXRMRIEN,START,END,.ATTR,.RTN)
  1. . D CHECKSUM^PXRMEXCS(.ATTR,START,END)
  1. . S ACTION=$$GETRACT^PXRMEXCF(.ATTR,.NEWNAME,.PXRMNMCH,.RTN,EXISTS)
  1. .;Save what was done for the installation summary.
  1. . S ^TMP("PXRMEXIA",$J,IND,"ROUTINE",ATTR("NAME"),ACTION)=NEWNAME
  1. E D
  1. .;Make sure we have the .01, some files have .001.
  1. . S TEMP0=$P(TEMP,";",3)
  1. . S FIELDNUM=$P(TEMP0,"~",1)
  1. . I FIELDNUM=.001 S TEMP=^PXD(811.8,PXRMRIEN,100,(START+1),0)
  1. . S PT01=$P(TEMP,"~",2)
  1. . D SETATTR^PXRMEXFI(.ATTR,FILENUM,PT01)
  1. . D CHECKSUM^PXRMEXCS(.ATTR,START,END)
  1. . S ACTION=$$GETFACT^PXRMEXFI(PT01,.ATTR,.NEWPT01,.PXRMNMCH,EXISTS)
  1. .;Save what was done for the installation summary.
  1. . S ^TMP("PXRMEXIA",$J,IND,ATTR("FILE NAME"),ATTR("PT01"),ACTION)=NEWPT01
  1. ;If the ACTION is Quit then quit the entire install.
  1. I ACTION="Q" S PXRMDONE=1 Q
  1. ;If the ACTION is Skip then skip this component.
  1. I ACTION="S" S VALMBCK="R" Q
  1. ;If the ACTION is rePlace then skip this component.
  1. I ACTION="P" S VALMBCK="R" Q
  1. ;Install this component.
  1. I FILENUM=0 D
  1. . S NEWPT01=$G(PXRMNMCH(ATTR("FILE NUMBER"),ATTR("NAME")))
  1. . I NEWPT01="" S NEWPT01=ATTR("NAME")
  1. . D RTNSAVE^PXRMEXIC(.RTN,NEWPT01)
  1. . S INSTALL=1
  1. E D
  1. . D FILE^PXRMEXIC(PXRMRIEN,EXISTS,IND120,JND120,ACTION,.ATTR,.PXRMNMCH)
  1. . S INSTALL=1
  1. S VALMBCK="R"
  1. Q
  1. ;
  1. ;================================================
  1. INSSEL ;Get a list of components to install.
  1. N IND,INSTALL,VALMBG,VALMLST,VALMY
  1. ;
  1. S VALMBG=1,VALMLST=+$O(^TMP("PXRMEXLC",$J,"IDX",""),-1)
  1. ;
  1. ;Get the list to install.
  1. D EN^VALM2(XQORNOD(0))
  1. ;If there is no list quit.
  1. I '$D(VALMY) Q
  1. ;
  1. K ^TMP("PXRMEXIA",$J),^TMP("PXRMEXIAD",$J)
  1. ;
  1. ;Initialize the name change storage.
  1. K PXRMNMCH
  1. S (IND,INSTALL)=0
  1. F S IND=$O(VALMY(IND)) Q:(+IND=0)!(PXRMDONE) D INSCOM(IND,.INSTALL)
  1. ;
  1. ;If anything was installed rebuild the display.
  1. I INSTALL D CDISP^PXRMEXLC(PXRMRIEN)
  1. ;
  1. ;Save the install history in the repository.
  1. D SAVHIST^PXRMEXU1
  1. Q
  1. ;
  1. ;================================================
  1. INSTALL ;Install the repository entry PXRMRIEN.
  1. N CLOK,IEN,IND,VALMY
  1. ;Make sure the component list exists for this entry. PXRMRIEN is
  1. ;set in INSTALL^PXRMEXLR.
  1. S CLOK=1
  1. I '$D(^PXD(811.8,PXRMRIEN,120)) D CLIST^PXRMEXCO(PXRMRIEN,.CLOK)
  1. I 'CLOK Q
  1. ;Format the component list for display.
  1. D CDISP^PXRMEXLC(PXRMRIEN)
  1. S VALMCNT=$O(^TMP("PXRMEXLC",$J,"IDX"),-1)
  1. S VALMBCK="R"
  1. D XQORM
  1. Q
  1. ;
  1. ;================================================
  1. ;Exit action added to PXRM EXCH INSTALL MENU
  1. PEXIT ;PXRM EXCH INSTALL MENU protocol exit code
  1. S VALMSG="+ Next Screen - Prev Screen ?? More Actions"
  1. ;Reset after page up/down etc
  1. D XQORM
  1. Q
  1. ;
  1. ;================================================
  1. XQORM S XQORM("#")=$O(^ORD(101,"B","PXRM EXCH SELECT COMPONENT",0))_U_"1:"_VALMCNT
  1. S XQORM("A")="Select Action: "
  1. Q
  1. ;
  1. ;================================================
  1. XSEL ;PXRM EXCH SELECT COMPONENT validation
  1. N CNT,SELECT,SEL,PXRMDONE
  1. S SELECT=$P(XQORNOD(0),"=",2)
  1. I '$$VALID^PXRMEXLD(SELECT) S VALMBCK="R" Q
  1. ;
  1. ;Sort selections into ascending sequence order
  1. D ORDER^PXRMEXLC(.SELECT,1)
  1. ;
  1. K ^TMP("PXRMEXIA",$J),^TMP("PXRMEXIAD",$J)
  1. ;
  1. ;Install selected component
  1. N INSTALL
  1. S INSTALL=0,CNT=0,PXRMDONE=0
  1. F CNT=1:1 S SEL=$P(SELECT,",",CNT) Q:'SEL D Q:PXRMDONE
  1. . D INSCOM(SEL,.INSTALL)
  1. ;
  1. ;If anything was installed rebuild the display.
  1. I INSTALL D CDISP^PXRMEXLC(PXRMRIEN)
  1. ;
  1. ;Save the install history in the repository.
  1. D SAVHIST^PXRMEXU1
  1. ;
  1. ;Clear any renames made in the last session
  1. K PXRMNMCH
  1. Q
  1. ;