source: WorldVistAEHR/trunk/r/AUTOMATED_INFO_COLLECTION_SYS-IBD/IBDFC.m@ 1696

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

initial load of WorldVistAEHR

File size: 4.2 KB
Line 
1IBDFC ;ALB/CJM - ENCOUNTER FORM - CONVERSION UTILTY ;FEB 30,1995
2 ;;3.0;AUTOMATED INFO COLLECTION SYS;;APR 24, 1997
3 ;
4FORMLIST ;
5 N IBDEVICE
6 N IBFASTXT ;set to 1 for fast exit from system
7 S IBFASTXT=0
8 D DEVICE^IBDFUA(1,.IBDEVICE)
9 K XQORS,VALMEVL
10 D VALMSG
11 D EN^VALM("IBDFC CONVERSION UTILITY")
12 Q
13ONENTRY ;
14 S VALMCNT=0 K @VALMAR
15 Q
16ONEXIT ;
17 D KILL^%ZISS
18 K ^TMP("IB",$J),^TMP("IBDF",$J),VALMY,IBQUIT,VALMBCK,X,Y,I,DA,D0
19 Q
20 ;
21HDR ;
22 S VALMHDR(1)=" *** LIST OF FORMS TO CONVERT FOR SCANNING ***"
23 I $O(^IBD(359,0)) S VALMHDR(2)=" Converted Forms Exist, Use'View Conversion Log' to view converted forms"
24 Q
25REMOVE ;allows user to select a form, then deletes it
26 N SEL,FORM,LAST
27 K DIR
28 D EN^VALM2($G(XQORNOD(0)),"S")
29 S SEL=$O(VALMY(""))
30 I SEL K @VALMAR@(SEL),@VALMAR@("IDX",SEL)
31 ;fill in the hole with the last form on the list
32 S LAST=$S(VALMCNT<2:0,SEL=VALMCNT:0,1:VALMCNT)
33 I LAST D
34 .S FORM=@VALMAR@("IDX",LAST,LAST)
35 .K @VALMAR@(LAST),@VALMAR@("IDX",LAST)
36 .S VALMCNT=VALMCNT-1
37 .D DISPLAY(SEL,FORM)
38 S VALMCNT=VALMCNT-1
39 D VALMSG
40 S VALMBCK="R"
41 Q
42 ;
43ADDONE ;adds a single form to the list for conversion
44 N FORM,NODE,CNV,CNVNM,PREV,IBQUIT
45 S NODE="",IBQUIT=0
46 S VALMBCK="R"
47 S FORM=$$SLCTFORM^IBDFU4("",.NODE) Q:'FORM
48 I +$P(NODE,"^",17)>2 W !,"This form is already a version "_$P(NODE,"^",17)_" form!" D PAUSE^IBDFU5,VALMSG Q
49 ;
50 ; -- see if form already converted
51 S CNV=0 F S CNV=$O(^IBD(359,"AORIG",FORM,CNV)) Q:'CNV D
52 .S PREV=+$G(^IBD(359,CNV,0))
53 .I PREV W !,"This form previously converted, new form name = "_$P($G(^IBE(357,PREV,0)),"^") S IBQUIT=1
54 I $O(^IBE(357,"B","CNV."_$E($P(NODE,"^"),1,41),0)) W !!,"Form Name "_"CNV."_$E($P(NODE,"^"),1,41)_" already exists. Form must be renamed first!" D PAUSE^IBDFU5 Q
55 D VALMSG
56 I IBQUIT D PAUSE^IBDFU5
57 ;
58 D DISPLAY(VALMCNT+1,FORM)
59 D VALMSG
60 Q
61 ;
62DISPLAY(IDX,FORM) ;
63 N NODE
64 S NODE=$G(^IBE(357,FORM,0)) Q:NODE=""
65 S VALMCNT=VALMCNT+1
66 S @VALMAR@(IDX,0)=$J(IDX,3)_" "_$$PADRIGHT^IBDFU($P(NODE,"^"),30)_" "_$E($P(NODE,"^",3),1,80),@VALMAR@("IDX",IDX,IDX)=FORM D FLDCTRL^VALM10(IDX)
67 Q
68 ;
69CNVTLIST ;
70 N IBFORM,IDX,QUIT,PRINT,DIR,DIRUT,DUOUT,DTOUT
71 S (QUIT,PRINT)=0
72 S VALMBCK="R"
73 D FULL^VALM1
74 ;
75 I $O(@VALMAR@("IDX",0))="" W !!,"No forms on List to convert!" D PAUSE^IBDFU5,VALMSG Q
76 ;
77 W !!,"Each form on the list will be made scannable. However, the results should be",!,"carefully reviewed before putting the form into use.",!
78 K DIR S DIR(0)="Y",DIR("A")="Do you want to print the form(s) after they have been converted",DIR("B")="YES"
79 D ^DIR Q:(Y<0)!($D(DIRUT)) K DIR I Y=1 D Q:QUIT
80 .S PRINT=1
81 .D DEVICE
82 ;
83 S IBDASK("ADDOTHER")=$$ASKOTH^IBDFC2B Q:IBDASK("ADDOTHER")<0
84 S IBDASK("AUTOCHG")=$$ASKAUTO^IBDFC2B Q:IBDASK("AUTOCHG")<0
85 ;
86 S IDX=0 F S IDX=$O(@VALMAR@("IDX",IDX)) Q:'IDX S IBFORM=$G(@VALMAR@("IDX",IDX,IDX)) Q:'IDX S IBFORM=$$CONVERT^IBDFC2(IBFORM) D:PRINT QUEUE
87 I PRINT D ^%ZISC
88 K @VALMAR
89 D VALMSG
90 Q
91 ;
92DEVICE ;
93 W !,"** You must queue the form to print. **"
94 W !,$C(7),"** Forms require 132 columns and a page length of 80 lines. **",!
95 ;
96 ;queuing is automatic - the device is not opened
97 K %IS,%ZIS,IOP S %ZIS="N0Q",%ZIS("A")="Printer to queue to: ",%ZIS("B")="",%ZIS("S")="I $E($P($G(^%ZIS(2,+$G(^%ZIS(1,Y,""SUBTYPE"")),0)),U),1,2)=""P-""" D ^%ZIS
98 I POP S QUIT=1
99 Q
100 ;
101QUEUE S ZTRTN="PRINT^IBDFC",ZTSAVE("IBFORM")="",ZTDESC="ENCOUNTER FORM - FROM CONVERSION",ZTDTH=$H D ^%ZTLOAD W !,$S($D(ZTSK):"Request Queued Task="_ZTSK,1:"Request Canceled")
102 Q
103 ;
104PRINT ;
105 D FORM^IBDF2A(IBFORM,0)
106 Q
107 ;
108VALMSG ;
109 I $O(^IBD(359,0)) S VALMSG="Use 'View Conversion Log' to view converted forms."
110 I '$O(^IBD(359,0)) S VALMSG="Use 'Add Form to List' to convert a form"
111 Q
112 ;
113HELP ;
114 D FULL^VALM1
115 W !!,"To convert a form follow the following steps:"
116 W !," 1. Use 'Add Form to List' to select the form. Add all the forms to"
117 W !," the list you wish to at this time."
118 W !," 2. Use 'Convert List' to convert the forms."
119 W !," 3. Use 'View Conversion Log' to review the conversion process and "
120 W !," assign the converted form to a clinic.",!
121 W !,"Hint: The conversion creates a new copy of your form with the same name"
122 W !," as the original but prefixed with 'CNV.'. (i.e. form PRIM CARE"
123 W !," would be renamed CNV.PRIM CARE)"
124 S X="?" D DISP^XQORM1 W !
Note: See TracBrowser for help on using the repository browser.