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

PXRMEXLM.m

Go to the documentation of this file.
  1. PXRMEXLM ;SLC/PKR/PJH - Clinical Reminder Exchange List Manager routines. ;08/16/2018
  1. ;;2.0;CLINICAL REMINDERS;**6,12,17,24,26,47,45**;Feb 04, 2005;Build 566
  1. ;
  1. ;=====================================================
  1. CRE ;Create a packed reminder and store it in the repository.
  1. D FULL^VALM1
  1. D CRE^PXRMEXPD
  1. S VALMBCK="R"
  1. Q
  1. ;
  1. ;=====================================================
  1. DEFINQ ;Reminder definition inquiry.
  1. N GBL,IEN,PXRMROOT,VALMCNT
  1. S GBL="^TMP(""PXRMRINQ"",$J)"
  1. S GBL=$NA(@GBL)
  1. S PXRMROOT="^PXD(811.9,"
  1. S IEN=$$SELECT^PXRMINQ(PXRMROOT,"Select Reminder Definition: ","")
  1. S IEN=$P(IEN,U,1)
  1. I IEN=-1 S VALMBCK="R" Q
  1. K ^TMP("PXRMRINQ",$J)
  1. D REMVAR^PXRMINQ(GBL,IEN)
  1. S VALMCNT=$O(^TMP("PXRMRINQ",$J,""),-1)
  1. D EN^VALM("PXRM EX DEFINITION INQUIRY")
  1. K ^TMP("PXRMRINQ",$J)
  1. S VALMBCK="R"
  1. Q
  1. ;
  1. ;=====================================================
  1. ENTRY ;Entry code
  1. D INITMPG^PXRMEXLM
  1. D BLDLIST^PXRMEXLC(0)
  1. D XQORM
  1. Q
  1. ;
  1. ;=====================================================
  1. EXIT ;Exit code
  1. D INITMPG^PXRMEXLM
  1. D CLEAN^VALM10
  1. D FULL^VALM1
  1. S VALMBCK="Q"
  1. K PXRMIGDS,PXRMINST
  1. Q
  1. ;
  1. ;=====================================================
  1. HDR ; Header code
  1. S VALMHDR(1)="Exchange File Entries."
  1. S VALMSG="+ Next Screen - Prev Screen ?? More Actions"
  1. Q
  1. ;
  1. ;=====================================================
  1. HELP ;Help code
  1. D HELP^PXRMEXMH
  1. Q
  1. ;
  1. ;=====================================================
  1. INIT ;Init
  1. S VALMCNT=0
  1. Q
  1. ;
  1. ;=====================================================
  1. INITMPG ;Initialized all the ^TMP globals.
  1. K ^TMP("PXRMEXDH",$J)
  1. K ^TMP("PXRMEXDGH",$J)
  1. K ^TMP("PXRMEXDL",$J)
  1. K ^TMP("PXRMEXHF",$J)
  1. K ^TMP("PXRMEXFND",$J)
  1. K ^TMP("PXRMEXIA",$J)
  1. K ^TMP("PXRMEXIAD",$J)
  1. K ^TMP("PXRMEXID",$J)
  1. K ^TMP("PXRMEXIH",$J)
  1. K ^TMP("PXRMEXLC",$J)
  1. K ^TMP("PXRMEXLD",$J)
  1. K ^TMP("PXRMEXLHF",$J)
  1. K ^TMP("PXRMEXLMM",$J)
  1. K ^TMP("PXRMEXLR",$J)
  1. K ^TMP("PXRMEXMH",$J)
  1. K ^TMP("PXRMEXMM",$J)
  1. K ^TMP("PXRMEXRI",$J)
  1. K ^TMP("PXRMEXTMP",$J)
  1. K ^TMP("PXRMEXTXT",$J)
  1. K ^TMP($J,"HS OBJECT")
  1. K ^TMP($J,"TIU OBJECT")
  1. K ^TMP($J,"ORDER DIALOG")
  1. K ^TMP($J,"PXRMEX DIALOG")
  1. K ^TMP($J,"PXRM FINDING REPLACE")
  1. Q
  1. ;
  1. ;=====================================================
  1. LDHF ;Load a host file into the repository.
  1. N IND,FILE,PATH,RBL,SUCCESS,TEMP
  1. ;Select the host file to load.
  1. D CLEAR^VALM1
  1. S TEMP=$$GETEHF^PXRMEXHF("PRD")
  1. I TEMP="" S VALMBCK="R" Q
  1. S PATH=$P(TEMP,U,1)
  1. S FILE=$P(TEMP,U,2)
  1. D LHF^PXRMEXHF(.SUCCESS,PATH,FILE)
  1. S RBL=SUCCESS
  1. I SUCCESS D
  1. . S VALMHDR(1)="Host file "_PATH_FILE_" successfully loaded."
  1. . K VALMHDR(2)
  1. E D
  1. . S VALMHDR(1)="There were problems loading host file "_PATH_FILE_"."
  1. . S TEMP=""
  1. . S IND=""
  1. . F S IND=$O(SUCCESS(IND)) Q:+IND=0 D
  1. .. I SUCCESS(IND) S RBL=1 Q
  1. .. I +$O(SUCCESS(IND))=0 S TEMP=TEMP_IND
  1. .. E S TEMP=TEMP_IND_", "
  1. . S VALMHDR(2)="Entries with problems were "_TEMP_"."
  1. ;Rebuild the list for display.
  1. D BLDLIST^PXRMEXLC(RBL)
  1. S VALMBCK="R"
  1. Q
  1. ;
  1. ;=====================================================
  1. LDMM ;Load a MailMan message into the repository.
  1. N IND,RBL,TEMP,XMZ
  1. ;Select the MailMan message to load.
  1. D CLEAR^VALM1
  1. S XMZ=$$GETMESSN^PXRMEXMM
  1. I XMZ=-1 W !,"No packed reminder definitions selected/found!" H 2
  1. I +XMZ'>0 S VALMBCK="R" Q
  1. D LMM^PXRMEXMM(.SUCCESS,XMZ)
  1. S RBL=SUCCESS
  1. I SUCCESS D
  1. . S VALMHDR(1)="MailMan message "_XMZ_" successfully loaded."
  1. .;Rebuild the list for display.
  1. . D BLDLIST^PXRMEXLC(1)
  1. E D
  1. . S VALMHDR(1)="There were problems loading MailMan message "_XMZ_"."
  1. . S TEMP=""
  1. . S IND=""
  1. . F S IND=$O(SUCCESS(IND)) Q:+IND=0 D
  1. .. I SUCCESS(IND) S RBL=1 Q
  1. .. I +$O(SUCCESS(IND))=0 S TEMP=TEMP_IND
  1. .. E S TEMP=TEMP_IND_", "
  1. . S VALMHDR(2)="Entries with problems were "_TEMP_"."
  1. ;Rebuild the list for display.
  1. D BLDLIST^PXRMEXLC(RBL)
  1. S VALMBCK="R"
  1. Q
  1. ;
  1. ;=====================================================
  1. LDWEB ;Load a host file from a web site into the repository.
  1. N SUCCESS,TEMP,URL
  1. S SUCCESS=$$LWEB^PXRMEXWB(.URL)
  1. I SUCCESS D
  1. . S VALMHDR(1)=URL_" successfully loaded."
  1. E D
  1. . S VALMHDR(1)="There were problems loading "_URL
  1. . I URL="" S VALMHDR(1)="No URL specified."
  1. ;Rebuild the list for display.
  1. D BLDLIST^PXRMEXLC(SUCCESS)
  1. S VALMBCK="R"
  1. Q
  1. ;
  1. ;=====================================================
  1. LRDEF ;List the name and print name of all reminder definitions.
  1. N VALMCNT
  1. I $D(^TMP("PXRMEXLD",$J,"VALMCNT")) S VALMCNT=^TMP("PXRMEXLD",$J,"VALMCNT")
  1. E D
  1. . N ARO,DEFLIST
  1. . S ARO=$$QUERYAO^PXRMLIST
  1. . S ^TMP("PXRMEXLD",$J,"ARO")=ARO
  1. . D RDEF^PXRMLIST(.DEFLIST,ARO)
  1. . M ^TMP("PXRMEXLD",$J)=DEFLIST
  1. . S VALMCNT=DEFLIST("VALMCNT")
  1. I '$G(^TMP("PXRMEXLD",$J,"ARO")) D CHGCAP^VALM("INACTIVE","Inactive")
  1. D EN^VALM("PXRM EX REMINDER LIST")
  1. Q
  1. ;
  1. ;=====================================================
  1. PEXIT ;PXRM EXCH 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. START ;Main entry point for PXRM EXCHANGE
  1. N PXRMDONE,PXRMNMCH
  1. ;PXRMDONE is set to true if the user enters an action of Quit.
  1. S PXRMDONE=0
  1. ;PXRMNMCH is used to store name change information. If a finding
  1. ;is copied to a new name or is replaced by another finding the
  1. ;information is stored here. It is used when installing definitions
  1. ;or dialogs so they use the new or replaced finding.
  1. N VALMBCK,VALMSG,X,XMZ
  1. S X="IORESET"
  1. D ENDR^%ZISS
  1. D EN^VALM("PXRM EX REMINDER EXCHANGE")
  1. W IORESET
  1. D KILL^%ZISS
  1. Q
  1. ;
  1. ;=====================================================
  1. XQORM ;Set the range for selection.
  1. N NEXCHE
  1. S NEXCHE=^TMP("PXRMEXLR",$J,"NEXCHE")
  1. S XQORM("#")=$O(^ORD(101,"B","PXRM EXCH SELECT ENTRY",0))_U_"1:"_NEXCHE
  1. S XQORM("A")="Select Action: "
  1. Q
  1. ;
  1. ;=====================================================
  1. XSEL ;PXRM EXCH SELECT COMPONENT validation
  1. N SEL,PXRMNAT,PXRMRIEN
  1. S SEL=$P(XQORNOD(0),"=",2)
  1. ;Remove trailing ,
  1. I $E(SEL,$L(SEL))="," S SEL=$E(SEL,1,$L(SEL)-1)
  1. ;Invalid selection
  1. I SEL["," D Q
  1. .W $C(7),!,"Only one item number allowed." H 2
  1. .S VALMBCK="R"
  1. I ('SEL)!(SEL>VALMCNT)!('$D(@VALMAR@("SEL",SEL))) D Q
  1. .W $C(7),!,SEL_" is not a valid item number." H 2
  1. .S VALMBCK="R"
  1. ;
  1. ;Get the repository IEN.
  1. S PXRMRIEN=^TMP("PXRMEXLR",$J,"SEL",SEL)
  1. ;Get the Exchange entry's class.
  1. S PXRMNAT=$$EXCLASS^PXRMEXU2(PXRMRIEN)
  1. ;
  1. ;Full screen mode
  1. D FULL^VALM1
  1. ;
  1. ;Option to Install, Delete or Install History
  1. N DIR,DIROUT,DIRUT,DTOUT,DUOUT,OPTION,X,Y
  1. S DIR(0)="SBM"_U_"IFE:Install Exchange File Entry;"
  1. S DIR(0)=DIR(0)_"DFE:Delete Exchange File Entry;"
  1. S DIR(0)=DIR(0)_"IH:Installation History;"
  1. S DIR("A")="Select Action: "
  1. S DIR("B")="IFE"
  1. S DIR("?")="Select from the codes displayed. For detailed help type ??"
  1. S DIR("??")=U_"D HLP^PXRMEXIX(3)"
  1. D ^DIR
  1. I $D(DIROUT)!$D(DIRUT) S VALMBCK="R" Q
  1. I $D(DTOUT)!$D(DUOUT) S VALMBCK="R" Q
  1. S OPTION=Y
  1. ;
  1. ;Install
  1. I OPTION="IFE" D
  1. .D EN^VALM("PXRM EX LIST COMPONENTS")
  1. .K ^TMP("PXRMEXLC",$J)
  1. ;
  1. I OPTION="DFE" D
  1. .N COUNT,IEN,IND,RELIST,VALMY
  1. .D DELETE^PXRMEXU1(SEL_",")
  1. .;Rebuild the list for List Manager to display.
  1. .K ^TMP("PXRMEXLR",$J)
  1. .D REXL^PXRMLIST("PXRMEXLR")
  1. .S VALMCNT=^TMP("PXRMEXLR",$J,"VALMCNT")
  1. .S VALMHDR(1)="Deleted 1 exchange file entry",VALMHDR(2)=" ",VALMBCK="R"
  1. ;
  1. I OPTION="IH" D START^PXRMEXIH
  1. ;
  1. S VALMBCK="R"
  1. Q
  1. ;