source: WorldVistAEHR/trunk/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RARTST3.m@ 1763

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

initial load of WorldVistAEHR

File size: 2.7 KB
Line 
1RARTST3 ;HISC/CAH,FPT,GJC AISC/RMO-Distribution Reports ;11/24/97 12:16
2 ;;5.0;Radiology/Nuclear Medicine;;Mar 16, 1998
3 ;
4SELECT ; Called from 6^RARTST1 (Clinic Dist. List) & 7^RARTST1 (Ward Dist List)
5 ; variables passed in: DIC, RAB & RAWC.
6 K BY,FR,RADIC,RAINPUT,RAQUIT,RAUTIL,TO
7 S RADIC=DIC,RADIC(0)="QEAMZ",RADIC("A")="Select "_RAWC_": "
8 S RAINPUT=1,RAUTIL="RA "_RAWC K ^TMP($J,RAUTIL)
9 D EN1^RASELCT(.RADIC,RAUTIL,"",RAINPUT)
10 I RAQUIT K RADIC,RAINPUT,RAQUIT,RAUTIL GOTO Q ; clean up, exit option
11 S FR=$O(^TMP($J,RAUTIL,"")),TO=$O(^TMP($J,RAUTIL,""),-1)
12 ;----------------------------------------------------------------------
13 K ^TMP($J,RAUTIL),RADIC,RAINPUT,RAQUIT,RAUTIL
14 K DIC,DIE,DR,D0,DA,DHIT,DIS,L,DHD,D,DIK,C,DIR,DIU,DIWL,DO
15 S RARD("A")="Report Selection: ",RARD(1)="PRINTED^",RARD(2)="UNPRINTED^",RARD("B")=2 W !!,"Printed/Unprinted Report Selection",!,"----------------------------------",! D SET^RARD K RARD G Q:X="^"
16 S DHD=$S(X="UNPRINTED":"Unprinted",1:"Printed")_" Reports by "_RAWC,FLDS="[RA "_X_" REPORTS]",BY="[RA "_$S(RAWC="Clinic":"CLINIC",1:"WARD")_" BY PRINT DATE]"
17 S:X="UNPRINTED" FR="@,A,"_FR,TO="@,Z,"_TO I X="PRINTED" D DATE^RAUTL S:RAPOP X="^" G Q:X="^" S FR=BEGDATE_",A,"_FR,TO=ENDDATE+.9999_",Z,"_TO
18 S DIS(0)="I $P($G(^RABTCH(74.4,D0,0)),U,11)=RAB S (RARPT,Y)=+^(0),RARDIFN=D0,RAY3=$G(^RABTCH(74.4,RARDIFN,0)) I RAY3]"""" S RADFN=+$P($G(^RARPT(RARPT,0)),U,2) D UPDLOC^RAUTL10 I $D(RAPRTOK)"
19DIP S L=0,DIC="^RABTCH(74.4," W ! D EN1^DIP K DHD,L,DIC,FLDS,BY,FR,IOP,TO,DIS(0),RAPRTOK,RABTY,RACN,RADATE,RADTE,RARPT,RACNI,RADFN,RADTI,RAY3
20Q K RAWC,RAB,BEGDATE,ENDDATE,RAWC,DIC,Y,RAB,X,RARDIFN,RAPOP
21 K DISH,F,O,X1,W
22 K BY,DHD,DDH,DISYS,FLDS,FR,I,J,POP,TO
23 Q
24DATX(X) ;external output function for date format
25 ;Called by: [RA ALL UNPRINTED REPORTS] Print Template
26 ;INPUT = FM internal date format (time optional)
27 ;OUTPUT = date/time with slashes
28 ;'RARPTFLG' is set in the subroutine '5+1^RARTST1'.
29 N B,E,Y,YY S Y=$P(X,".",2),B=-1,E=0,YY="" I +Y,($L(Y)#2) S Y=Y_0
30 I $L(Y)=2 S Y=Y_"00"
31 I Y]"" F S B=B+2,E=E+2,YY=YY_$E(Y,B,E) Q:E=($L(Y)) S YY=YY_":"
32 Q $S(X'=+X:"",1:$E(X,4,5)_"/"_$S($E(X,6,7)="00":$E(X,2,3),1:$E(X,6,7)_"/"_$E(X,2,3)_$S('Y!($D(RARPTFLG)):"",1:"@"_YY)))
33 ;
34IMG() ; Allows the user to select one-many-all i-types. Builds the
35 ; local 'RAIMG(' array for all user selected imaging types.
36 ; RAIMAG=$S(If 'RAIMAG' array properly defined:1,Else:0)
37 K RAIMAG N RADIC,RAUTIL,RAX,RAY S RAX=""
38 S RADIC="^RA(79.2,",RADIC(0)="QEAMZ",RADIC("A")="Select Imaging Type: "
39 S RADIC("B")="All",RAUTIL="RA DIST I-TYPE" W !!
40 D EN1^RASELCT(.RADIC,RAUTIL,"RAY") K ^TMP($J,RAUTIL)
41 Q:'($D(RAY)\10) 0 ; no i-type data
42 F S RAX=$O(RAY(RAX)) Q:RAX="" S RAIMAG(+$O(RAY(RAX,0)))=""
43 Q:+$O(RAIMAG(0))=0 0
44 Q 1
Note: See TracBrowser for help on using the repository browser.