Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: SDWLAHRE

SDWLAHRE.m

Go to the documentation of this file.
SDWLAHRE ;;IOFO BAY PINES/TEH - EWL REPORT - REPORT EDIT;06/12/2002 ; 20 Aug 2002 2:10 PM
 ;;5.3;scheduling;**419,1015**;AUG 13 1993;Build 21
 ;
 ;
 ;
 ;
 ;
 ;
 ;
EDT ;EDIT TEMPLATE
 K DIR
 W ! S DIR(0)="Y",DIR("B")="YES",DIR("A")="Is this SORT template correct" D ^DIR
 I Y Q
 I 'Y D
 .S SDWLSTC=1
 .K DIR S DIR(0)="Y",DIR("B")="NO",DIR("A")="Delete ALL of the SORT template(s)" D ^DIR
 .I Y D
 ..K ^XTMP("SDWLAHR",$J),SDWLSTC W *7," Sort Template deleted." S SDWLC=0 Q
 G END:'SDWLC
 I SDWLC=1,'SDWLSTC S SDWLID=SDWLC
 K DIR I SDWLC>1 S DIR("A")="Delete Which ID: ",DIR(0)="NAO^1:"_SDWLC_":0" D ^DIR D
 .I Y="",X Q
 .I Y["^" Q
 .I Y<1 Q
 .I Y["^" Q
 .S SDWLID=Y
 .S SDWLS0="",SDWLS1=""
 .S SDWLS0=$O(^XTMP("SDWLAHR",$J,SDWLID,SDWLS0)),SDWLS1=$O(^XTMP("SDWLAHR",$J,SDWLID,SDWLS0,SDWLS1))
 .S SDWLS3=+$G(^XTMP("SDWLAHR",$J,SDWLID,SDWLS0,SDWLS1))
 K ^XTMP("SDWLAHR",$J,SDWLID),^XTMP("SDWLAHR",$J,"B"),^XTMP("SDWLAHR",$J,"C")
SET S SDWLM=0,SDWLS=0
 F  S SDWLM=$O(^XTMP("SDWLAHR",$J,SDWLM)) Q:SDWLM<1  D
 .S SDWLM0="" F  S SDWLM0=$O(^XTMP("SDWLAHR",$J,SDWLM,SDWLM0)) Q:SDWLM0=""  D
 ..S SDWLM1="" F  S SDWLM1=$O(^XTMP("SDWLAHR",$J,SDWLM,SDWLM0,SDWLM1)) Q:SDWLM1=""  D
 ...S X=$G(^XTMP("SDWLAHR",$J,SDWLM,SDWLM0,SDWLM1))
 ...S SDWLM2="" F  S SDWLM2=$O(^XTMP("SDWLAHR",$J,SDWLM,SDWLM0,SDWLM1,SDWLM2)) Q:SDWLM2=""  D
 ....S Y=$G(^XTMP("SDWLAHR",$J,SDWLM,SDWLM0,SDWLM1,SDWLM2))
 ....S SDWLS=SDWLS+1,^XTMP("SDWLAHR",$J,SDWLS,SDWLM0,SDWLM1)=X,^XTMP("SDWLAHR",$J,SDWLS,SDWLM0,SDWLM1,SDWLM2)=Y
 ....S ^XTMP("SDWLAHR",$J,"B",SDWLM0,SDWLM1,Y,SDWLM2,SDWLS)="",^XTMP("SDWLAHR",$J,"C",+X,SDWLS)=""
 ....K ^XTMP("SDWLAHR",$J,SDWLM) S SDWLC=SDWLS D DIS
END K SDWLCC,SDWLF,SDWLID,SDWLM,SDWLMO,SDWLM1,SDWLM2,SDWLMN,SDWLMX,SDWLS,SDWLS0,SDWLS1,SDWLS2,SDWLS3,SDWLX Q
DIS W:$D(IOF) @IOF W !,?80-$L("EWL AD HOC Report Sort Display")\2,"EWL AD HOC Report Sort Display",!
 W !,"Sort ID",?9,"Sort Field ID",?30,"Sort Field Name",?50,"Sort Field Condition"
 W !,"-------",?9,"-------------",?30,"---------------",?50,"-----------------------",!
 S (SDWLS0,SDWLS1,SDWLS2,SDWLS3,SDWLCC)="" N SDWLIENS
 F  S SDWLCC=$O(^XTMP("SDWLAHR",$J,SDWLCC)) Q:SDWLCC<1  D
 .F  S SDWLS0=$O(^XTMP("SDWLAHR",$J,SDWLCC,SDWLS0)) Q:SDWLS0=""  D
 ..F  S SDWLS1=$O(^XTMP("SDWLAHR",$J,SDWLCC,SDWLS0,SDWLS1)) Q:SDWLS1=""  D
 ...S SDWLX=$G(^XTMP("SDWLAHR",$J,SDWLCC,SDWLS0,SDWLS1))
 ...W !,?3,SDWLCC,?13,$J($P(SDWLX,";"),3),?30,$E(SDWLS1,1,18)
 ...S SDWLS2="" F  S SDWLS2=$O(^XTMP("SDWLAHR",$J,SDWLCC,SDWLS0,SDWLS1,SDWLS2)) Q:SDWLS2=""  D
 ....I SDWLS0["DAT" D  Q
 .....S Y=$P(SDWLS2,U) D DD^%DT W ?50,"Begin Date: ",Y S Y=$P(SDWLS2,U,2) D DD^%DT W !,?50,"End Date: ",Y
 ....I SDWLS0["NUM" D  Q
 .....S SDWLMN=$P(SDWLS2,U) W ?50,"Minimun: ",SDWLMN S SDWLMX=$P(SDWLS2,U,2) W !,?50,"Maximun: ",SDWLMX
 ....I SDWLS0["PRT" D  Q
 .....S SDWLF=+$P($P(SDWLX,U,2),"P",2)
 .....S SDWLIENS=$G(^XTMP("SDWLAHR",$J,SDWLCC,SDWLS0,SDWLS1,SDWLS2)) W ?50,$$GET1^DIQ(SDWLF,SDWLIENS_",",".01"),!
 ....I SDWLS0["RS" D  Q
 .....W ?50,SDWLS2,!
 ....I SDWLS0["FT" D  Q
 .....F  S SDWLS3=$O(^XTMP("SDWLAHR",$J,SDWLCC,SDWLS0,SDWLS1,SDWLS2,SDWLS3)) Q:SDWLS3=""  D
 ......W:SDWLS2#2>0 ?50,"L-",SDWLS2,?55,SDWLS3
 ......W:SDWLS2#2=0 !,?50,"L-",SDWLS2,?55,SDWLS3
 Q