Changeset 636 for FOIAVistA/tag/r/CLINICAL_REMINDERS-PXRM/PXRMDLG5.m
- Timestamp:
- Dec 4, 2009, 8:26:01 PM (14 years ago)
- 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/20072 ;;2.0;CLINICAL REMINDERS;**4 ,6**;Feb 04, 2005;Build 1231 PXRMDLG5 ; SLC/PJH - Reminder Dialog Edit/Inquiry ;05/17/2006 2 ;;2.0;CLINICAL REMINDERS;**4**;Feb 04, 2005;Build 21 3 3 ; 4 ALT(DIEN,LEV,DSEQ,NODE,VIEW,NLINE,CNT,ALTLEN) ;5 ;Display branching logic text in dialog summary view6 N DATA,DNAM,DTYP,IEN,TERM,TNAME,TSTAT,TEMP7 S DATA=$G(^PXRMD(801.41,DIEN,49))8 I '+$P(DATA,U)!($P($G(DATA),U,2)="") Q9 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 D12 .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 "_TSTAT15 I $G(DNAM)'="" S TEMP="Replaced by "_DNAM_" if Reminder Term "_TNAME_" evaluates as "_TSTAT16 D TEXT(.NLINES,CNT,ALTLEN,TEMP,NODE)17 Q18 4 ; 19 5 ASK(YESNO,PIEN) ;Confirm … … 36 22 S VALMBCK="R" 37 23 Q 24 ; 25 MSEL(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 ; 29 ALT(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 ; 44 OTERM(DA) ; 45 K OTERM 46 S OTERM=$P($G(^PXRMD(801.41,DA,49)),U) Q 47 ; 48 NTERM(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 ; 56 TERMS(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 38 64 ; 39 65 BHELP(VALUE) ; … … 59 85 I VALUE=4 D 60 86 .;Patient Specific field 61 .S HTEXT(1)="Enter either 1 for true or 0 for false. This value must be set to 87 .S HTEXT(1)="Enter either 1 for true or 0 for false. This value must be set totrue" 62 88 .S HTEXT(2)="if item in this dialog will be using reminder term to either replace an item" 63 89 .S HTEXT(3)="or to suppress an item." … … 65 91 Q 66 92 ; 93 TEXT(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 ; 67 101 INQ(DIEN) ;INQ Inquiry/Print option 102 ; 68 103 ; Used by 801.41 print templates 69 104 ; [PXRM REMINDER DIALOG] … … 84 119 K ^TMP(NODE,$J) 85 120 Q 86 ;87 MH(IEN) ;Allow IEN=109 (HX2) as a place holder for 601 entries that do not88 ;have a corresponding 601.71 entry.89 I IEN=109 Q 190 I $G(PXRMINST)=1 Q 191 N MAXNUM92 S MAXNUM=+$P($G(^PXRM(800,1,"MH")),U)93 I MAXNUM=0 S MAXNUM=2594 Q $$ONECR^YTQPXRM5(IEN,MAXNUM)95 ;96 MHLICR(IEN) ;Called by input template PXRM EDIT ELEMENT. Preserve Y so template97 ;branching works.98 N Y99 ;DBIA #5042100 I $$RL^YTQPXRM3(IEN)="Y" D101 .W !,"This MH test requires a license."102 .W !,"The question text will not appear in the progress note.",!103 .H 1104 Q105 ;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 0108 Q 1109 ;110 MHREQHLP ;111 N TEXT112 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 Q126 ;127 NTERM(DA,OTERM,NTERM) ;128 I +OTERM=0 S OTERM=$P($G(DA),U)129 I +NTERM=0 K OTERM Q 2130 I +OTERM=0,+NTERM>0 K OTERM Q 1131 I +OTERM'=+NTERM K OTERM Q 0132 K OTERM133 Q 1134 ;135 OTERM(DA) ;136 K OTERM137 S OTERM=$P($G(^PXRMD(801.41,DA,49)),U)138 Q139 ;140 RESCHK(IEN) ;Called by input template PXRM EDIT ELEMENT. Preserve Y so template141 ;branching works.142 N CNT,FDA,MSG,RG,RGIEN,VALID,Y143 S CNT=0144 F S CNT=$O(^PXRMD(801.41,IEN,51,CNT)) Q:CNT'>0 D145 .S RGIEN=$P($G(^PXRMD(801.41,IEN,51,CNT,0)),U) I +RGIEN'>0 Q146 .S RG=$P($G(^PXRMD(801.41,RGIEN,0)),U,1)147 .I RG="" Q148 .S VALID=$$RGLSCR(IEN,RG,RGIEN)149 .I VALID Q150 .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=1154 .I $D(MSG) D AWRITE^PXRMUTIL("MSG")155 Q156 ;157 RSELEDIT(DA) ;158 N NODE,RESULT159 ;RESULT=0 EDIT NOTHING160 ;RESULT=1 EDIT INFORMATIONAL TEXT161 ;RESULT=2 EDIT EVERYTHING162 S RESULT=2163 I $G(PXRMINST)=1,DUZ(0)="@" Q RESULT164 S NODE=$G(^PXRMD(801.41,DA,100))165 I $P(NODE,U)="N" S RESULT=0166 I RESULT=0,+$P(NODE,U,4)=0 S RESULT=1167 Q RESULT168 ;169 RGLSCR(DA,X,IEN) ;Input transform/screen for RESULT GROUP LIST170 I $G(PXRMINST)=1 Q 1171 I $G(PXRMEXCH)=1 Q 1172 N HELP,MHTEST,TEXT,VALID,Y173 S NMATCH=0174 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+1176 ;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=1179 ;Make sure the TYPE is a result group180 I '$D(^PXRMD(801.41,"TYPE","S",IEN)) D181 . I HELP S TEXT(1)="TYPE must be a result group."182 . S VALID=0183 ;Make sure the finding item for the element matches the184 ;MH Test assigned to the Result Group185 S MHTEST=+$P($G(^PXRMD(801.41,DA,1)),U,5) I MHTEST="" D186 . I HELP S TEXT(2)="The MH test is missing."187 . S VALID=0188 I +$P($G(^PXRMD(801.41,IEN,50)),U)'=MHTEST D189 . I HELP S TEXT(3)="The finding item does not match the MH Test assigned to the Result Group"190 . S VALID=0191 ;Make sure a scale has been defined.192 I +$P($G(^PXRMD(801.41,IEN,50)),U,2)'>0 D193 . I HELP S TEXT(4)="An MH Scale must be defined."194 . S VALID=0195 ;Make sure it is not disabled.196 I $P($G(^PXRMD(801.41,IEN,0)),U,3)'="" D197 . S VALID=0198 . I HELP D199 .. N EM,TYPE200 .. 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 VALID205 ;206 TERMS(DA,X) ;207 N TERM208 S TERM=$P($G(^PXRMD(801.41,DA,49)),U)209 I +TERM=0 D Q 0210 .W !,"Cannot set Reminder Term Status if the Reminder Term field is blank"211 .H 2212 I +TERM>0,$G(X)="" Q 2213 Q 1214 ;215 TEXT(NLINES,CNT,ATLEN,TEMP,NODE) ;216 N CNT1,NOUT,OUTPUT,WIDHT217 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 D220 .S NLINE=NLINE+1,^TMP(NODE,$J,NLINE,0)=$J("",2+(CNT+ATLEN))_OUTPUT(CNT1)221 Q222 ;
Note:
See TracChangeset
for help on using the changeset viewer.