1 | PXRMXTE ; SLC/PJH - Reminder Reports Template Edit ;11/27/2006
|
---|
2 | ;;2.0;CLINICAL REMINDERS;**4,6**;Feb 04, 2005;Build 123
|
---|
3 | ;
|
---|
4 | ; Called from PXRMYD,PXRMXD
|
---|
5 | ;
|
---|
6 | ;Option to Edit
|
---|
7 | ;--------------
|
---|
8 | EDIT ;
|
---|
9 | N DIDEL,DIE,DR K DTOUT,DUOUT
|
---|
10 | ;Edit report name, title and PXRMSEL (patient sample)
|
---|
11 | S DIE=810.1,DA=$P(PXRMTMP,U),DR=".01T;1.9;1.2",DIDEL=810.1
|
---|
12 | D ^DIE I $D(Y) S DUOUT=1 Q
|
---|
13 | ;Check if template has been deleted
|
---|
14 | I '$D(DA) Q
|
---|
15 | ;Get updated value of PXRMXSEL
|
---|
16 | N PXRMSEL,PXRMFUT S PXRMSEL=X
|
---|
17 | ;Needed for 1.6 validation - Prior/Future or Current/Admissions
|
---|
18 | ;N PXRMINP
|
---|
19 | ;Further fields depend on value in PXRMXSEL
|
---|
20 | I PXRMSEL="I" S DR="6T~R",PXRMINP=0
|
---|
21 | I PXRMSEL="R" S DR="14T",PXRMINP=0
|
---|
22 | I PXRMSEL="L" D Q:$D(DUOUT)
|
---|
23 | .;Get location report type
|
---|
24 | .S DR="3T;1.5R" D ^DIE I $D(Y) S DUOUT=1 Q
|
---|
25 | .N PXRMLCSC S PXRMLCSC=X,DR="",PXRMINP=0
|
---|
26 | .;All location reports - prompt for prior/future/current/admissions
|
---|
27 | .I PXRMLCSC="HAI" S PXRMINP=1,DR="1.6" Q
|
---|
28 | .I PXRMLCSC="HA" S PXRMINP=0,DR="1.6"
|
---|
29 | .I PXRMLCSC="CA" S PXRMINP=0,DR="1.6"
|
---|
30 | .D ^DIE I $D(Y) S DUOUT=1 Q
|
---|
31 | .S PXRMFUT=X,DR=""
|
---|
32 | .;Selected Location/Stop Code/Clinic Group fields
|
---|
33 | .I PXRMLCSC="HS" D Q:$D(DUOUT)
|
---|
34 | ..S DR="10T~R"
|
---|
35 | ..D ^DIE I $D(Y) S DUOUT=1 Q
|
---|
36 | ..;Determine if locations input are all wards
|
---|
37 | ..S PXRMINP=$$INP^PXRMXAP(PXRMLCSC,.PXRMLOCN)
|
---|
38 | ..;Select Prior/Future or Current Inpatient/Admissions
|
---|
39 | ..S DR="1.6"
|
---|
40 | ..D ^DIE I $D(Y) S DUOUT=1 Q
|
---|
41 | ..S PXRMFUT=X,DR=""
|
---|
42 | .;Clinic Stop input and prior/future
|
---|
43 | .I PXRMLCSC="CS" S PXRMINP=0,DR="11T~R;1.6" D I $G(DUOUT)=1 Q
|
---|
44 | ..D ^DIE I $D(Y) S DUOUT=1 Q
|
---|
45 | ..S PXRMFUT=X,DR=""
|
---|
46 | .;Clinic Group input and prior/future
|
---|
47 | .I PXRMLCSC="GS" S PXRMINP=0,DR="12T~R;1.6" D I $G(DUOUT)=1 Q
|
---|
48 | ..D ^DIE I $D(Y) S DUOUT=1 Q
|
---|
49 | ..S PXRMFUT=X,DR=""
|
---|
50 | .;Service categories (except for inpatient reports)
|
---|
51 | .I PXRMINP=0,PXRMFUT'="F",PXRMFUT'="C" S DR=DR_";9T~R"
|
---|
52 | ;OE/RR teams
|
---|
53 | I PXRMSEL="O" S DR="7T~R"
|
---|
54 | ;PCMM Provider and Primary care/All
|
---|
55 | I PXRMSEL="P" S DR="4T~R;1.3"
|
---|
56 | ;PCMM teams
|
---|
57 | I PXRMSEL="T" S DR="3T~R;8T~R"
|
---|
58 | ;Report type (detail or summary)
|
---|
59 | S DR=DR_";1.4"
|
---|
60 | ;Print Locations without patients
|
---|
61 | S DR=DR_";1.7"
|
---|
62 | ;Reminder Categories
|
---|
63 | I $D(^PXRMPT(810.1,DA,12,0))>0 D
|
---|
64 | .N IEN,CNT,NODE
|
---|
65 | .S CNT=0,IEN=0 F S IEN=$O(^PXRMPT(810.1,DA,12,IEN)) Q:IEN'>0 D
|
---|
66 | ..S CNT=CNT+1,NODE=$G(^PXRMPT(810.1,DA,12,IEN,0))
|
---|
67 | ..S PXRMTCAT(DA,CNT)=$P(NODE,U)_U_$P($G(^PXRMD(811.7,$P(NODE,U),0)),U)_U_$P(NODE,U,2)
|
---|
68 | S DR=DR_";13T"
|
---|
69 | ;Reminders
|
---|
70 | I $D(^PXRMPT(810.1,DA,1,0))>0 D
|
---|
71 | .N IEN,CNT,NODE,REMNODE
|
---|
72 | .S CNT=0,IEN=0 F S IEN=$O(^PXRMPT(810.1,DA,1,IEN)) Q:IEN'>0 D
|
---|
73 | ..S CNT=CNT+1,NODE=$G(^PXRMPT(810.1,DA,1,IEN,0))
|
---|
74 | ..S REMNODE=$G(^PXD(811.9,$P(NODE,U),0))
|
---|
75 | ..S PXRMTREM(DA,CNT)=$P(NODE,U)_U_$P(REMNODE,U)_U_$P(NODE,U,2)_U_$P($G(REMNODE),U,3)
|
---|
76 | S DR=DR_";2T"
|
---|
77 | ;
|
---|
78 | ;Strip of any leading semi-colons
|
---|
79 | I $E(DR)=";" S DR=$P(DR,";",2,99)
|
---|
80 | ;
|
---|
81 | D ^DIE I $D(Y) S DUOUT=1 Q
|
---|
82 | ;
|
---|
83 | ;If all reminders have been deleted from the template disallow save
|
---|
84 | I +$P($G(^PXRMPT(810.1,DA,1,0)),U,4)=0 D
|
---|
85 | .;Check categories also
|
---|
86 | .I +$P($G(^PXRMPT(810.1,DA,12,0)),U,4)>0 D Q
|
---|
87 | .. N CAT,CATIEN
|
---|
88 | .. S CAT=0 F S CAT=$O(^PXRMPT(810.1,DA,12,CAT)) Q:+CAT'>0 D
|
---|
89 | ... S CATIEN=$P($G(^PXRMPT(810.1,DA,12,CAT,0)),U)
|
---|
90 | ... I +$P($G(^PXRMD(811.7,CATIEN,2,0)),U,4)<1 W !!,"** WARNING **",!,"Reminder Category "_$P($G(^PXRMD(811.7,CATIEN,0)),U)_" does not have any reminders assigned to it"
|
---|
91 | .S DUOUT=1
|
---|
92 | .W !!,"No reminders defined"
|
---|
93 | Q
|
---|
94 | ;
|
---|