source: WorldVistAEHR/trunk/r/AUTOMATED_INFO_COLLECTION_SYS-IBD/IBDFFSMP.m@ 1639

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

initial load of WorldVistAEHR

File size: 2.3 KB
Line 
1IBDFFSMP ;ALB/MAF -- Print a sample of all encounter forms. - Dec 12 1995@800
2 ;;3.0;AUTOMATED INFO COLLECTION SYS;;APR 24, 1997
3 ;
4 S (IBDFFLG,IBQUIT)=0
5 S (IBPM,WITHDATA)=1
6 K ^TMP("IBFRMS",$J)
7 ;
8 ; -- Ask patient name
9 D PATIENT G:IBQUIT EXIT
10 ;
11 ; -- Loop thru Print Manager Clinic Setup to find active forms used by
12 ; clinics.
13 S IBCLINIC="" F S IBCLINIC=$O(^SD(409.95,"B",IBCLINIC)) Q:IBCLINIC']"" D
14 .S SETUP=$O(^SD(409.95,"B",IBCLINIC,""))
15 .S NAME=$P($G(^SC(IBCLINIC,0)),"^")
16 .D SET
17 I '$D(^TMP("IBFRMS",$J)) W !!,"There are no forms set up for clinics...",!! G EXIT
18 D NOW^IBDF1A,DEVICE ;sets IBAPPT to NOW
19 G:IBQUIT EXIT
20 I 'IBDFFLG U IO D QUEUED
21 G EXIT
22 ;
23SET ; -- Build list into array IBFORMS. Make sure EF is one that is active
24 ; Will print form only once.
25 I $O(^SD(409.95,"B",IBCLINIC,0)) D
26 .S IBDFNODE=^SD(409.95,SETUP,0)
27 .S IBQUIT=0
28 .F X=2,3,4,5,6,8,9 S:$P(IBDFNODE,"^",X)&('$D(^TMP("IBFRMS",$J,+$P(IBDFNODE,"^",X)))) ^TMP("IBFRMS",$J,$P(IBDFNODE,"^",X))=IBCLINIC ;Loop thru the clinic setup node to find the active EF.
29 .Q
30 Q
31 ;
32PATIENT ; -- gets the patient to print the form for
33 W !!
34 S DIR(0)="P^2:EM",DIR("A")="Select PATIENT NAME for Samples" D ^DIR K DIR I $D(DIRUT)!(+Y<1)!('(+Y)) S IBQUIT=1 Q
35 S DFN=+Y
36 Q
37 ;
38QUEUED ;
39 ;input - DFN,IBAPPT,IBCLINIC
40 N IBDEVICE
41 ;
42 D DEVICE^IBDFUA(0,.IBDEVICE)
43 S IBDSAMP=1 ;printing sample forms don't update forms tracking, print form in name/ssn block
44 F IBFORM=0:0 S IBFORM=$O(^TMP("IBFRMS",$J,IBFORM)) Q:'IBFORM D
45 .S IBCLINIC=+$G(^TMP("IBFRMS",$J,IBFORM))
46 .D DRWFORM^IBDF2A(IBFORM,WITHDATA,.IBDEVICE)
47 ;
48EXIT ;
49 K IBDSAMP
50 I $D(ZTQUEUED) S ZTREQ="@" Q
51 D ^%ZISC
52 K ^TMP("IBFRMS",$J)
53 D KPRNTVAR^IBDFUA ;kills the screen and graphics parameters
54 K CLINIC,DFN,FORMS,IBAPPT,IBCLINIC,IBFORM,IBDFNODE,IBDFFLG,IBPM,IBQUIT,NAME,POP,SETUP,WITHDATA,X,Y,I
55 Q
56 ;
57DEVICE ;
58 I $D(ZTQUEUED) Q
59 W !,$C(7),"** Encounter Forms require a page size of 80 lines and 132 columns. **"
60 K %IS,%ZIS,IOP S %ZIS="MQ" D ^%ZIS I POP S IBQUIT=1 Q
61 I $D(IO("Q")) D
62 .S ZTRTN="QUEUED^IBDFFSMP",(ZTSAVE("WITHDATA"),ZTSAVE("IB*"),ZTSAVE("DFN"),ZTSAVE("FORMS"))="",ZTSAVE("^TMP(""IBFRMS"",$J,")=""
63 .S ZTDESC="IBD - PRINT SAMPLE ENCOUNTER FORM" D ^%ZTLOAD
64 .W !,$S($D(ZTSK):"REQUEST QUEUED TASK="_ZTSK,1:"REQUEST CANCELLED")
65 .I $D(ZTSK) S IBDFFLG=1
66 .D HOME^%ZIS S IBQUIT=1 Q
67 Q
Note: See TracBrowser for help on using the repository browser.