PXRMAPI0 ; SLC/PJH - Reminder Package API's;08/28/2001
;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
;
;
;Store CATEGORY reminders in ARRAY ; DBIA #3333
;---------------------------------
CATREM(CIEN,ARRAY) ;
D STORE(CIEN,.ARRAY,0)
Q
;
STORE(CIEN,ARRAY,NREM) ;Add to output array
N DATA,NAME,RIEN,PNAME,SEQ,SUB,TEMP
;Sort Reminders from this category into display sequence
S SUB=0 K TEMP
F S SUB=$O(^PXRMD(811.7,CIEN,2,SUB)) Q:SUB="" D
.S DATA=$G(^PXRMD(811.7,CIEN,2,SUB,0)) Q:DATA=""
.S RIEN=$P(DATA,U) Q:RIEN=""
.S SEQ=$P(DATA,U,2)_0
.S DATA=$G(^PXD(811.9,RIEN,0))
.S NAME=$P(DATA,U),PNAME=$P(DATA,U,3)
.S TEMP(SEQ)=RIEN
;
;Re-save reminders in output array for display
;type^reminder ien^name
;
S SEQ=""
F S SEQ=$O(TEMP(SEQ)) Q:SEQ="" D
.S NREM=NREM+1,ARRAY(NREM)=TEMP(SEQ)
;
;Sort Sub-Categories for this category into display order
S SUB=0 K TEMP
F S SUB=$O(^PXRMD(811.7,CIEN,10,SUB)) Q:SUB="" D
.S DATA=$G(^PXRMD(811.7,CIEN,10,SUB,0)) Q:DATA=""
.S SEQ=$P(DATA,U,2),TEMP(SEQ)=SUB
;
;Process sub-sub categories in the same manner
S SEQ=""
F S SEQ=$O(TEMP(SEQ)) Q:SEQ="" D
.N IEN
.S SUB=TEMP(SEQ),IEN=$P($G(^PXRMD(811.7,CIEN,10,SUB,0)),U) Q:'IEN
.D STORE(IEN,.ARRAY,.NREM)
Q
;
OK(DIEN) ;Replaces DBA 3410 for TIU TEMPLATE REMINDER DIALOGS
;Must be a reminder dialog type
I $P($G(^PXRMD(801.41,DIEN,0)),U,4)'="R" Q 0
;And not disabled
I $P($G(^PXRMD(801.41,DIEN,0)),U,3)'="" Q 0
;Otherwise its OK
Q 1
PXRMAPI0 ; SLC/PJH - Reminder Package API's;08/28/2001
+1 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
+2 ;
+3 ;
+4 ;Store CATEGORY reminders in ARRAY ; DBIA #3333
+5 ;---------------------------------
CATREM(CIEN,ARRAY) ;
+1 DO STORE(CIEN,.ARRAY,0)
+2 QUIT
+3 ;
STORE(CIEN,ARRAY,NREM) ;Add to output array
+1 NEW DATA,NAME,RIEN,PNAME,SEQ,SUB,TEMP
+2 ;Sort Reminders from this category into display sequence
+3 SET SUB=0
KILL TEMP
+4 FOR
SET SUB=$ORDER(^PXRMD(811.7,CIEN,2,SUB))
IF SUB=""
QUIT
Begin DoDot:1
+5 SET DATA=$GET(^PXRMD(811.7,CIEN,2,SUB,0))
IF DATA=""
QUIT
+6 SET RIEN=$PIECE(DATA,U)
IF RIEN=""
QUIT
+7 SET SEQ=$PIECE(DATA,U,2)_0
+8 SET DATA=$GET(^PXD(811.9,RIEN,0))
+9 SET NAME=$PIECE(DATA,U)
SET PNAME=$PIECE(DATA,U,3)
+10 SET TEMP(SEQ)=RIEN
End DoDot:1
+11 ;
+12 ;Re-save reminders in output array for display
+13 ;type^reminder ien^name
+14 ;
+15 SET SEQ=""
+16 FOR
SET SEQ=$ORDER(TEMP(SEQ))
IF SEQ=""
QUIT
Begin DoDot:1
+17 SET NREM=NREM+1
SET ARRAY(NREM)=TEMP(SEQ)
End DoDot:1
+18 ;
+19 ;Sort Sub-Categories for this category into display order
+20 SET SUB=0
KILL TEMP
+21 FOR
SET SUB=$ORDER(^PXRMD(811.7,CIEN,10,SUB))
IF SUB=""
QUIT
Begin DoDot:1
+22 SET DATA=$GET(^PXRMD(811.7,CIEN,10,SUB,0))
IF DATA=""
QUIT
+23 SET SEQ=$PIECE(DATA,U,2)
SET TEMP(SEQ)=SUB
End DoDot:1
+24 ;
+25 ;Process sub-sub categories in the same manner
+26 SET SEQ=""
+27 FOR
SET SEQ=$ORDER(TEMP(SEQ))
IF SEQ=""
QUIT
Begin DoDot:1
+28 NEW IEN
+29 SET SUB=TEMP(SEQ)
SET IEN=$PIECE($GET(^PXRMD(811.7,CIEN,10,SUB,0)),U)
IF 'IEN
QUIT
+30 DO STORE(IEN,.ARRAY,.NREM)
End DoDot:1
+31 QUIT
+32 ;
OK(DIEN) ;Replaces DBA 3410 for TIU TEMPLATE REMINDER DIALOGS
+1 ;Must be a reminder dialog type
+2 IF $PIECE($GET(^PXRMD(801.41,DIEN,0)),U,4)'="R"
QUIT 0
+3 ;And not disabled
+4 IF $PIECE($GET(^PXRMD(801.41,DIEN,0)),U,3)'=""
QUIT 0
+5 ;Otherwise its OK
+6 QUIT 1