Ignore:
Timestamp:
Dec 4, 2009, 8:26:01 PM (14 years ago)
Author:
George Lilly
Message:

WorldVistAEHR overlayed on FOIAVistA

Location:
FOIAVistA/tag/r
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMDLG5.m

    r628 r636  
    1 PXRMDLG5 ; SLC/PJH - Reminder Dialog Edit/Inquiry ;11/08/2007
    2  ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
     1PXRMDLG5 ; SLC/PJH - Reminder Dialog Edit/Inquiry ;05/17/2006
     2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21
    33 ;
    4 ALT(DIEN,LEV,DSEQ,NODE,VIEW,NLINE,CNT,ALTLEN) ;
    5  ;Display branching logic text in dialog summary view
    6  N DATA,DNAM,DTYP,IEN,TERM,TNAME,TSTAT,TEMP
    7  S DATA=$G(^PXRMD(801.41,DIEN,49))
    8  I '+$P(DATA,U)!($P($G(DATA),U,2)="") Q
    9  S TNAME=$P($G(^PXRMD(811.5,$P(DATA,U),0)),U)
    10  S TSTAT=$S($P(DATA,U,2)="1":"TRUE",1:"FALSE")
    11  I +$P(DATA,U,3)>0 D
    12  .S IEN=$P(DATA,U,3),DNAM=$P($G(^PXRMD(801.41,IEN,0)),U)
    13  .S DTYP=$S($P($G(^PXRMD(801.41,IEN,0)),U,4)="E":"Element",$P($G(^PXRMD(801.41,IEN,0)),U,4)="G":"Group")
    14  I $G(DNAM)="" S TEMP="Suppressed if Reminder Term "_TNAME_" evaluates as "_TSTAT
    15  I $G(DNAM)'="" S TEMP="Replaced by "_DNAM_" if Reminder Term "_TNAME_" evaluates as "_TSTAT
    16  D TEXT(.NLINES,CNT,ALTLEN,TEMP,NODE)
    17  Q
    184 ;
    195ASK(YESNO,PIEN) ;Confirm
     
    3622 S VALMBCK="R"
    3723 Q
     24 ;
     25MSEL(NUM) ;
     26 I NUM=4,'$$PATCH^XPDUTL("OR*3.0*243") D EN^DDIOL("THIS SELECTION IS NOT VALID, UNTIL CPRS 27 IS INSTALLED") Q 0
     27 Q 1
     28 ;
     29ALT(DIEN,LEV,DSEQ,NODE,VIEW,NLINE,CNT,ALTLEN) ;
     30 ;Display branching logic text in dialog summary view
     31 N DATA,DNAM,DTYP,IEN,TERM,TNAME,TSTAT,TEMP
     32 S DATA=$G(^PXRMD(801.41,DIEN,49))
     33 I '+$P(DATA,U)!($P($G(DATA),U,2)="") Q
     34 S TNAME=$P($G(^PXRMD(811.5,$P(DATA,U),0)),U)
     35 S TSTAT=$S($P(DATA,U,2)="1":"TRUE",1:"FALSE")
     36 I +$P(DATA,U,3)>0 D
     37 .S IEN=$P(DATA,U,3),DNAM=$P($G(^PXRMD(801.41,IEN,0)),U)
     38 .S DTYP=$S($P($G(^PXRMD(801.41,IEN,0)),U,4)="E":"Element",$P($G(^PXRMD(801.41,IEN,0)),U,4)="G":"Group")
     39 I $G(DNAM)="" S TEMP="Suppressed if Reminder Term "_TNAME_" evaluates as "_TSTAT
     40 I $G(DNAM)'="" S TEMP="Replaced by "_DNAM_" if Reminder Term "_TNAME_" evaluates as "_TSTAT
     41 D TEXT(.NLINES,CNT,ALTLEN,TEMP,NODE)
     42 Q
     43 ;
     44OTERM(DA) ;
     45 K OTERM
     46 S OTERM=$P($G(^PXRMD(801.41,DA,49)),U) Q
     47 ;
     48NTERM(DA,OTERM,NTERM) ;
     49 I +OTERM=0 S OTERM=$P($G(DA),U)
     50 I +NTERM=0 K OTERM Q 2
     51 I +OTERM=0,+NTERM>0 K OTERM Q 1
     52 I +OTERM'=+NTERM K OTERM Q 0
     53 K OTERM
     54 Q 1
     55 ;
     56TERMS(DA,X) ;
     57 N TERM
     58 S TERM=$P($G(^PXRMD(801.41,DA,49)),U)
     59 I +TERM=0 D  Q 0
     60 .W !,"Cannot set Reminder Term Status if the Reminder Term field is blank"
     61 .H 2
     62 I +TERM>0,$G(X)="" Q 2
     63 Q 1
    3864 ;
    3965BHELP(VALUE) ;
     
    5985 I VALUE=4 D
    6086 .;Patient Specific field
    61  .S HTEXT(1)="Enter either 1 for true or 0 for false. This value must be set to true"
     87 .S HTEXT(1)="Enter either 1 for true or 0 for false. This value must be set totrue"
    6288 .S HTEXT(2)="if item in this dialog will be using reminder term to either replace an item"
    6389 .S HTEXT(3)="or to suppress an item."
     
    6591 Q
    6692 ;
     93TEXT(NLINES,CNT,ATLEN,TEMP,NODE) ;
     94 N CNT1,NOUT,OUTPUT,WIDHT
     95 S WIDTH=IOM-(2+(CNT+ATLEN))
     96 S CNT1=1 D FORMATS^PXRMTEXT(1,WIDTH,TEMP,.NOUT,.OUTPUT)
     97 I NOUT>0 F CNT1=1:1:NOUT D
     98 .S NLINE=NLINE+1,^TMP(NODE,$J,NLINE,0)=$J("",2+(CNT+ATLEN))_OUTPUT(CNT1)
     99 Q
     100 ;
    67101INQ(DIEN) ;INQ Inquiry/Print option
     102 ;
    68103 ; Used by 801.41 print templates
    69104 ; [PXRM REMINDER DIALOG]
     
    84119 K ^TMP(NODE,$J)
    85120 Q
    86  ;
    87 MH(IEN) ;Allow IEN=109 (HX2) as a place holder for 601 entries that do not
    88  ;have a corresponding 601.71 entry.
    89  I IEN=109 Q 1
    90  I $G(PXRMINST)=1 Q 1
    91  N MAXNUM
    92  S MAXNUM=+$P($G(^PXRM(800,1,"MH")),U)
    93  I MAXNUM=0 S MAXNUM=25
    94  Q $$ONECR^YTQPXRM5(IEN,MAXNUM)
    95  ;
    96 MHLICR(IEN) ;Called by input template PXRM EDIT ELEMENT. Preserve Y so template
    97  ;branching works.
    98  N Y
    99  ;DBIA #5042
    100  I $$RL^YTQPXRM3(IEN)="Y" D
    101  .W !,"This MH test requires a license."
    102  .W !,"The question text will not appear in the progress note.",!
    103  .H 1
    104  Q
    105  ;
    106 MSEL(NUM) ;
    107  I NUM=4,'$$PATCH^XPDUTL("OR*3.0*243") D EN^DDIOL("THIS SELECTION IS NOT VALID, UNTIL CPRS 27 IS INSTALLED") Q 0
    108  Q 1
    109  ;
    110 MHREQHLP ;
    111  N TEXT
    112  S TEXT(1)="Select 0, ""Optional open and optional complete (partial complete possible)"","
    113  S TEXT(2)="if the user should be able to optionally select/open the MH test in the reminder dialog and optionally complete the MH test before the reminder dialog can be finished."
    114  S TEXT(3)=" "
    115  S TEXT(4)="Select 1, ""Required open and required complete before finish"","
    116  S TEXT(5)="if the user is required to select/open and complete the MH test in the reminder dialog before the reminder dialog can be finished."
    117  S TEXT(6)=" "
    118  S TEXT(7)="Select 2, ""Optional open and required complete or cancel before finish"","
    119  S TEXT(8)="if the user should be able to optionally select/open the MH test in the reminder dialog; however, if the user opens the MH test, then the user is required to complete or cancel the MH test before the reminder dialog can be finished."
    120  S TEXT(9)=" "
    121  S TEXT(10)="Note: Clicking the cancel button in the MH Test is considered the same as not opening the MH Test."
    122  S TEXT(11)="Also, Option 2, ""Optional open and required complete or cancel before finish"", only works with CPRS 27 and"
    123  S TEXT(12)="YS_MHA.dll. If Option 2 is selected and the user is using a pre-CPRS 27 version this option will be treated by CPRS as Option 1, ""Required open and required complete before finish""."
    124  D HELP^PXRMEUT(.TEXT)
    125  Q
    126  ;
    127 NTERM(DA,OTERM,NTERM) ;
    128  I +OTERM=0 S OTERM=$P($G(DA),U)
    129  I +NTERM=0 K OTERM Q 2
    130  I +OTERM=0,+NTERM>0 K OTERM Q 1
    131  I +OTERM'=+NTERM K OTERM Q 0
    132  K OTERM
    133  Q 1
    134  ;
    135 OTERM(DA) ;
    136  K OTERM
    137  S OTERM=$P($G(^PXRMD(801.41,DA,49)),U)
    138  Q
    139  ;
    140 RESCHK(IEN) ;Called by input template PXRM EDIT ELEMENT. Preserve Y so template
    141  ;branching works.
    142  N CNT,FDA,MSG,RG,RGIEN,VALID,Y
    143  S CNT=0
    144  F  S CNT=$O(^PXRMD(801.41,IEN,51,CNT)) Q:CNT'>0  D
    145  .S RGIEN=$P($G(^PXRMD(801.41,IEN,51,CNT,0)),U) I +RGIEN'>0 Q
    146  .S RG=$P($G(^PXRMD(801.41,RGIEN,0)),U,1)
    147  .I RG="" Q
    148  .S VALID=$$RGLSCR(IEN,RG,RGIEN)
    149  .I VALID Q
    150  .W !,"Deleting the result group ",RG," from the element/group."
    151  .S FDA(801.41121,CNT_","_IEN_",",.01)="@"
    152  .D FILE^DIE("E","FDA","MSG")
    153  .S RGKILL=1
    154  .I $D(MSG) D AWRITE^PXRMUTIL("MSG")
    155  Q
    156  ;
    157 RSELEDIT(DA) ;
    158  N NODE,RESULT
    159  ;RESULT=0 EDIT NOTHING
    160  ;RESULT=1 EDIT INFORMATIONAL TEXT
    161  ;RESULT=2 EDIT EVERYTHING
    162  S RESULT=2
    163  I $G(PXRMINST)=1,DUZ(0)="@" Q RESULT
    164  S NODE=$G(^PXRMD(801.41,DA,100))
    165  I $P(NODE,U)="N" S RESULT=0
    166  I RESULT=0,+$P(NODE,U,4)=0 S RESULT=1
    167  Q RESULT
    168  ;
    169 RGLSCR(DA,X,IEN) ;Input transform/screen for RESULT GROUP LIST
    170  I $G(PXRMINST)=1 Q 1
    171  I $G(PXRMEXCH)=1 Q 1
    172  N HELP,MHTEST,TEXT,VALID,Y
    173  S NMATCH=0
    174  S MHTEST=$O(^PXRMD(801.41,"B",X),-1)
    175  F  S MHTEST=$O(^PXRMD(801.41,"B",MHTEST)) Q:(NMATCH>1)!(MHTEST'[X)  S NMATCH=NMATCH+1
    176  ;If there is an exact match to the user's input turn help on.
    177  S HELP=$S($G(DIQUIET):0,NMATCH=1:1,1:0)
    178  S VALID=1
    179  ;Make sure the TYPE is a result group
    180  I '$D(^PXRMD(801.41,"TYPE","S",IEN)) D
    181  . I HELP S TEXT(1)="TYPE must be a result group."
    182  . S VALID=0
    183  ;Make sure the finding item for the element matches the
    184  ;MH Test assigned to the Result Group
    185  S MHTEST=+$P($G(^PXRMD(801.41,DA,1)),U,5) I MHTEST="" D
    186  . I HELP S TEXT(2)="The MH test is missing."
    187  . S VALID=0
    188  I +$P($G(^PXRMD(801.41,IEN,50)),U)'=MHTEST D
    189  . I HELP S TEXT(3)="The finding item does not match the MH Test assigned to the Result Group"
    190  . S VALID=0
    191  ;Make sure a scale has been defined.
    192  I +$P($G(^PXRMD(801.41,IEN,50)),U,2)'>0 D
    193  . I HELP S TEXT(4)="An MH Scale must be defined."
    194  . S VALID=0
    195  ;Make sure it is not disabled.
    196  I $P($G(^PXRMD(801.41,IEN,0)),U,3)'="" D
    197  . S VALID=0
    198  . I HELP D
    199  .. N EM,TYPE
    200  .. S TYPE=$P(^PXRMD(801.41,IEN,0),U,4)
    201  .. S TYPE=$$EXTERNAL^DILFD(801.41,4,"",TYPE,.EM)
    202  .. S TEXT(5)="The "_TYPE_" is disabled."
    203  I HELP,'VALID D EN^DDIOL(.TEXT)
    204  Q VALID
    205  ;
    206 TERMS(DA,X) ;
    207  N TERM
    208  S TERM=$P($G(^PXRMD(801.41,DA,49)),U)
    209  I +TERM=0 D  Q 0
    210  .W !,"Cannot set Reminder Term Status if the Reminder Term field is blank"
    211  .H 2
    212  I +TERM>0,$G(X)="" Q 2
    213  Q 1
    214  ;
    215 TEXT(NLINES,CNT,ATLEN,TEMP,NODE) ;
    216  N CNT1,NOUT,OUTPUT,WIDHT
    217  S WIDTH=IOM-(2+(CNT+ATLEN))
    218  S CNT1=1 D FORMATS^PXRMTEXT(1,WIDTH,TEMP,.NOUT,.OUTPUT)
    219  I NOUT>0 F CNT1=1:1:NOUT D
    220  .S NLINE=NLINE+1,^TMP(NODE,$J,NLINE,0)=$J("",2+(CNT+ATLEN))_OUTPUT(CNT1)
    221  Q
    222  ;
Note: See TracChangeset for help on using the changeset viewer.