source: WorldVistAEHR/trunk/r/CLINICAL_REMINDERS-PXRM/PXRMRPCC.m@ 1177

Last change on this file since 1177 was 623, checked in by George Lilly, 15 years ago

revised back to 6/30/08 version

File size: 4.2 KB
Line 
1PXRMRPCC ;SLC/PJH - PXRM REMINDER DIALOG ;04/12/2002
2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
3 ;
4ACTIVE(ORY,ORREM) ;Check if active dialog exist for reminders
5 ;
6 ; input parameter ORREM is array of reminder ien [.01#811.9]
7 N DDIS,DIEN,OCNT,RIEN,RSTA
8 S OCNT=0,RIEN=0
9 ;Get reminder ien from array
10 F S RIEN=$O(ORREM(RIEN)) Q:'RIEN D
11 .;Dialog ien for reminder
12 .S DIEN=$P($G(^PXD(811.9,RIEN,51)),U),RSTA=0
13 .;Dialog status
14 .I DIEN S DDIS=$P($G(^PXRMD(801.41,DIEN,0)),U,3)
15 .;If dialog and dialog not disabled
16 .I DIEN,DDIS="" S RSTA=1
17 .;Return reminder and if active dialog exists
18 .S OCNT=OCNT+1,ORY(OCNT)=RIEN_U_RSTA
19 Q
20 ;
21 ;
22DIALOG(ORY,ORREM,DFN) ;Load reminder dialog associated with the reminder
23 ;
24 ; input parameter ORREM - reminder ien [.01,#811.9]
25 ;
26 S RIEN=ORREM
27 N DATA,DIEN
28 S DIEN=$G(^PXD(811.9,ORREM,51))
29 ;
30 ;Quit if no dialog for this reminder
31 I 'DIEN S ORY(1)="-1^no dialog for this reminder" Q
32 ;
33 ;Check if a reminder dialog and enabled
34 S DATA=$G(^PXRMD(801.41,DIEN,0))
35 ;
36 I $P(DATA,U,4)'="R" S ORY(1)="-1^reminder dialog invalid" Q
37 ;
38 I $P(DATA,U,3) S ORY(1)="-1^reminder dialog disabled" Q
39 ;
40 ;Load dialog lines into local array
41 D LOAD^PXRMDLL(DIEN,$G(DFN))
42 Q
43 ;
44HDR(ORY,ORLOC) ;Progress Note Header by location/service/user
45 N ORSRV,PASS
46 ;S ORSRV=$G(^VA(200,DUZ,5)) I +ORSRV>0 S ORSRV=$P(ORSRV,U)
47 S ORSRV=$$GET1^DIQ(200,DUZ,29,"I")
48 S PASS=DUZ_";VA(200,"
49 I +$G(ORLOC) S PASS=PASS_"^LOC.`"_ORLOC
50 I ORSRV>0 S PASS=PASS_"^SRV.`"_+$G(ORSRV)
51 S ORY=$$GET^XPAR(PASS_"^DIV^SYS^PKG","PXRM PROGRESS NOTE HEADERS",1,"Q")
52 Q
53 ;
54PROMPT(ORY,ORDLG,ORDCUR,ORFTYP) ;Load additional prompts for a dialog element
55 ;
56 ; input parameters
57 ;
58 ; ORDLG - dialog element ien [.01,#801.41]
59 ; ORDCUR - 0 = current, 1 = Historical for taxonomies only
60 ; ORFTYP - finding type (CPT/POV) for taxonomies only
61 ;
62 ; These fields can be found in the output array of DIALOG^PXRMRPCC
63 ;
64 D LOAD^PXRMDLLA(ORDLG,ORDCUR,$G(ORFTYP))
65 Q
66 ;
67RES(ORY,ORREM) ; Reminder Resources/Inquiry
68 ;
69 ; input parameter ORREM - reminder ien [.01,#811.9]
70 ;
71 D REMVAR^PXRMINQ(.ORY,ORREM)
72 Q
73 ;
74MH(ORY,OTEST) ; Mental Health dialog
75 ;
76 ; Input mental health instrument NAME
77 ;
78 N YS,ARRAY S YS("CODE")=OTEST D SHOWALL^YTAPI3(.ARRAY,.YS) ; DBIA #2895
79 ;
80 N FNODE,FSUB,IC,NODE,OCNT,SUB
81 S SUB="ARRAY",OCNT=0
82 F S SUB=$Q(@SUB) Q:SUB="" D
83 .S FSUB=$P($P(SUB,"(",2),")"),FNODE=""
84 .F IC=1:1 S NODE=$P(FSUB,",",IC) Q:NODE="" D
85 ..I $E(NODE)="""" S NODE=$P(NODE,"""",2)
86 ..S $P(FNODE,";",IC)=NODE
87 .Q:FNODE=""
88 .S OCNT=OCNT+1,ORY(OCNT)=FNODE_U_@SUB
89 Q
90 ;
91MHR(ORY,RESULT,ORES) ; Mental Health score and P/N text
92 ;
93 ; Input MH result IEN and mental health instrument response
94 ;
95 D ^PXRMDLR
96 ;
97 Q
98 ;
99MHS(ORY,YS) ; Mental Health save response
100 ;
101 ; Input mental health instrument response
102 N ARRAY
103 D SAVEIT^YTAPI1(.ARRAY,.YS) ; DBIA #2893
104 I ARRAY(1)'="[DATA]" S ORY(1)="-1^"_ARRAY(1)_ARRAY(2)
105 I ARRAY(1)="[DATA]" S ORY(1)=ARRAY(1)_ARRAY(2)
106 Q
107 ;
108MST(ORY,DFN,DGMSTDT,DGMSTSC,DGMSTPR,FTYP,FIEN,RESULT) ; File MST status
109 ;This is obsolete and can be removed when the GUI is changed not
110 ;to use it.
111 Q
112 ;
113WH(ORY,RESULT) ;
114 N CNT,CNT1,CNT2,NODE,PIECNT,PUR,TYPE,TYP1,WVIEN,WVRESULT,WVNOT,WVPURIEN
115 N PRINT
116 K ^TMP("WV RPT",$J)
117 I '$D(RESULT) Q
118 S (CNT2,WVPURIEN,PUR)=0
119 S CNT=0 F S CNT=$O(RESULT(CNT)) Q:CNT="" D
120 . I $P($G(RESULT(CNT)),U)["WHIEN" D
121 . . S CNT2=CNT2+1
122 . . S WVIEN=$P($P($G(RESULT(CNT)),U),":",2),WVRESULT(CNT2)=$G(WVIEN)
123 . . S WVRESULT(CNT2)=WVRESULT(CNT2)_U_$P($P($G(RESULT(CNT)),U,3),":",2)
124 . I $P($G(RESULT(CNT)),U)["WHPur" D
125 . . S NODE=$G(RESULT(CNT)),PUR=$P($P($G(NODE),U),":",2)
126 . . S CNT1=1,TYPE=$P($G(NODE),U,2)
127 . . I TYPE'[":" D
128 ...S WVNOT(PUR,CNT1)=$P($G(NODE),U,5)_U_$P($G(NODE),U,2)_U_$P($G(NODE),U,3)_U_$P($P($G(NODE),U,4),":",2)
129 ..I TYPE[":" D
130 ...S PIECNT=0
131 ...F X=1:1:$L(TYPE) I $E(TYPE,X)=":" S PIECNT=PIECNT+1 I PIECNT>0 D
132 ....S PRINT=""
133 ....S TYP1=$P($G(TYPE),":",PIECNT)
134 ....I TYP1="L" S PRINT=$P($G(NODE),U,3)
135 ....S WVNOT(PUR,CNT1)=$P($G(NODE),U,5)_U_$G(TYP1)_U_$G(PRINT)_U_$P($P($G(NODE),U,4),":",2),CNT1=CNT1+1
136 ...S PIECNT=PIECNT+1
137 ...S PRINT=""
138 ...S TYP1=$P($G(TYPE),":",PIECNT)
139 ...I TYP1="L" S PRINT=$P($G(NODE),U,3)
140 ...S WVNOT(PUR,CNT1)=$P($G(NODE),U,5)_U_$G(TYP1)_U_$G(PRINT)_U_$P($P($G(NODE),U,4),":",2)
141 K WHMUFIND,WHFIND,WHNAME
142 ;DBIA #4104
143 D NEW^WVRPCNO(.WVRESULT,.WVNOT)
144 Q
145 ;
Note: See TracBrowser for help on using the repository browser.