source: WorldVistAEHR/trunk/r/CLINICAL_REMINDERS-PXRM/PXRMAPI0.m@ 1806

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

initial load of WorldVistAEHR

File size: 1.4 KB
Line 
1PXRMAPI0 ; SLC/PJH - Reminder Package API's;08/28/2001
2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
3 ;
4 ;
5 ;Store CATEGORY reminders in ARRAY ; DBIA #3333
6 ;---------------------------------
7CATREM(CIEN,ARRAY) ;
8 D STORE(CIEN,.ARRAY,0)
9 Q
10 ;
11STORE(CIEN,ARRAY,NREM) ;Add to output array
12 N DATA,NAME,RIEN,PNAME,SEQ,SUB,TEMP
13 ;Sort Reminders from this category into display sequence
14 S SUB=0 K TEMP
15 F S SUB=$O(^PXRMD(811.7,CIEN,2,SUB)) Q:SUB="" D
16 .S DATA=$G(^PXRMD(811.7,CIEN,2,SUB,0)) Q:DATA=""
17 .S RIEN=$P(DATA,U) Q:RIEN=""
18 .S SEQ=$P(DATA,U,2)_0
19 .S DATA=$G(^PXD(811.9,RIEN,0))
20 .S NAME=$P(DATA,U),PNAME=$P(DATA,U,3)
21 .S TEMP(SEQ)=RIEN
22 ;
23 ;Re-save reminders in output array for display
24 ;type^reminder ien^name
25 ;
26 S SEQ=""
27 F S SEQ=$O(TEMP(SEQ)) Q:SEQ="" D
28 .S NREM=NREM+1,ARRAY(NREM)=TEMP(SEQ)
29 ;
30 ;Sort Sub-Categories for this category into display order
31 S SUB=0 K TEMP
32 F S SUB=$O(^PXRMD(811.7,CIEN,10,SUB)) Q:SUB="" D
33 .S DATA=$G(^PXRMD(811.7,CIEN,10,SUB,0)) Q:DATA=""
34 .S SEQ=$P(DATA,U,2),TEMP(SEQ)=SUB
35 ;
36 ;Process sub-sub categories in the same manner
37 S SEQ=""
38 F S SEQ=$O(TEMP(SEQ)) Q:SEQ="" D
39 .N IEN
40 .S SUB=TEMP(SEQ),IEN=$P($G(^PXRMD(811.7,CIEN,10,SUB,0)),U) Q:'IEN
41 .D STORE(IEN,.ARRAY,.NREM)
42 Q
43 ;
44OK(DIEN) ;Replaces DBA 3410 for TIU TEMPLATE REMINDER DIALOGS
45 ;Must be a reminder dialog type
46 I $P($G(^PXRMD(801.41,DIEN,0)),U,4)'="R" Q 0
47 ;And not disabled
48 I $P($G(^PXRMD(801.41,DIEN,0)),U,3)'="" Q 0
49 ;Otherwise its OK
50 Q 1
Note: See TracBrowser for help on using the repository browser.