source: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORLP3C1.m@ 949

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

initial load of WorldVistAEHR

File size: 5.1 KB
RevLine 
[613]1ORLP3C1 ; slc/CLA - Utilities to convert OE/RR 2.5 lists ;12/15/97 [ 04/03/97 10:50 AM ]
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**9**;Dec 17, 1997
3 Q
4POSTORLP ;convert user defaults for pt from ^VA(200 to Parameters
5 N ORLPC,ERR
6 S ORLPC=$$GET^XPAR("SYS","ORLPC CONVERSION",1,"Q")
7 I +$G(ORLPC)>0 D BMES^XPDUTL("User pt selection defaults already converted.") Q
8 D BMES^XPDUTL("Converting user pt selection defaults to parameters...")
9 D USERDEF
10 D EN^XPAR("SYS","ORLPC CONVERSION",1,"1",.ERR) ;1:conversion done
11 S ORLPC=$$GET^XPAR("SYS","ORLPC CONVERSION",1,"Q")
12 D BMES^XPDUTL("Conversion of user pt selection defaults completed.")
13 Q
14USERDEF ;move pt selection defaults from file 200 to parameter file [#8989.5]
15 N NAME,ORDUZ,ORPDUZ,OR1,OR2,WARD,TEAM,FROM,CLIN,BEG,END,SORT,PROV,SPEC,ERR,ORCT
16 S XPDIDTOT=$P(^VA(200,0),U,4),ORCT=0
17 D UPDATE^XPDID(0)
18 S ORDUZ=0,NAME=""
19 F S NAME=$O(^VA(200,"B",NAME)) Q:NAME="" S ORDUZ=0,ORDUZ=$O(^(NAME,ORDUZ)) D
20 .Q:'$L($G(ORDUZ))
21 .S ORPDUZ="USR.`"_ORDUZ
22 .S (WARD,TEAM,FROM,CLIN,BEG,END,SORT,PROV,SPEC)=""
23 .S OR1=$G(^VA(200,ORDUZ,100.1)),OR2=$G(^VA(200,ORDUZ,100.2))
24 .D:$L($G(OR1)) OR1
25 .D:$L($G(OR2)) OR2
26 .S ORCT=ORCT+1
27 .I '(ORCT#100) D UPDATE^XPDID(ORCT)
28 K XPDIDTOT
29 Q
30OR1 ;set defaults from ^VA(200,ORDUZ,100.1)
31 N X
32 S WARD=$P(OR1,U,4),TEAM=$P(OR1,U,5),FROM=$P(OR1,U,6),CLIN=$P(OR1,U,7)
33 S BEG=$P(OR1,U,8),END=$P(OR1,U,9)
34 I $L($G(WARD)) D
35 .Q:$L($$GET^XPAR(ORPDUZ,"ORLP DEFAULT WARD",1,"Q"))
36 .D EN^XPAR(ORPDUZ,"ORLP DEFAULT WARD",1,"`"_WARD,.ERR)
37 .I +ERR>0 S X="Error: "_ERR_" - converting default WARD "_WARD_" for user "_$G(NAME)_"!" D BMES^XPDUTL(X)
38 I $L($G(TEAM)) D
39 .Q:$L($$GET^XPAR(ORPDUZ,"ORLP DEFAULT TEAM",1,"Q"))
40 .D EN^XPAR(ORPDUZ,"ORLP DEFAULT TEAM",1,"`"_TEAM,.ERR)
41 .I +ERR>0 S X="Error: "_ERR_" - converting default TEAM "_TEAM_" for user "_$G(NAME)_"!" D BMES^XPDUTL(X)
42 I $L($G(FROM)) D
43 .S FROM=$S(FROM="P":"T",FROM="V":"P",1:FROM) ;convert to param codes
44 .Q:$L($$GET^XPAR(ORPDUZ,"ORLP DEFAULT LIST SOURCE",1,"Q"))
45 .D EN^XPAR(ORPDUZ,"ORLP DEFAULT LIST SOURCE",1,FROM,.ERR)
46 .I +ERR>0 S X="Error: "_ERR_" - converting default LIST SRC "_FROM_" for user "_$G(NAME)_"!" D BMES^XPDUTL(X)
47 I $L($G(CLIN)) D
48 .Q:$L($$GET^XPAR(ORPDUZ,"ORLP DEFAULT CLINIC MONDAY",1,"Q"))
49 .D EN^XPAR(ORPDUZ,"ORLP DEFAULT CLINIC MONDAY",1,"`"_CLIN,.ERR)
50 .I +ERR>0 S X="Error: "_ERR_" - converting default CLINIC MON "_CLIN_" for user "_$G(NAME)_"!" D BMES^XPDUTL(X)
51 .Q:$L($$GET^XPAR(ORPDUZ,"ORLP DEFAULT CLINIC TUESDAY",1,"Q"))
52 .D EN^XPAR(ORPDUZ,"ORLP DEFAULT CLINIC TUESDAY",1,"`"_CLIN,.ERR)
53 .I +ERR>0 S X="Error: "_ERR_" - converting default CLINIC TUE "_CLIN_" for user "_$G(NAME)_"!" D BMES^XPDUTL(X)
54 .Q:$L($$GET^XPAR(ORPDUZ,"ORLP DEFAULT CLINIC WEDNESDAY",1,"Q"))
55 .D EN^XPAR(ORPDUZ,"ORLP DEFAULT CLINIC WEDNESDAY",1,"`"_CLIN,.ERR)
56 .I +ERR>0 S X="Error: "_ERR_" - converting default CLINIC WED "_CLIN_" for user "_$G(NAME)_"!" D BMES^XPDUTL(X)
57 .Q:$L($$GET^XPAR(ORPDUZ,"ORLP DEFAULT CLINIC THURSDAY",1,"Q"))
58 .D EN^XPAR(ORPDUZ,"ORLP DEFAULT CLINIC THURSDAY",1,"`"_CLIN,.ERR)
59 .I +ERR>0 S X="Error: "_ERR_" - converting default CLINIC THU "_CLIN_" for user "_$G(NAME)_"!" D BMES^XPDUTL(X)
60 .Q:$L($$GET^XPAR(ORPDUZ,"ORLP DEFAULT CLINIC FRIDAY",1,"Q"))
61 .D EN^XPAR(ORPDUZ,"ORLP DEFAULT CLINIC FRIDAY",1,"`"_CLIN,.ERR)
62 .I +ERR>0 S X="Error: "_ERR_" - converting default CLINIC FRI "_CLIN_" for user "_$G(NAME)_"!" D BMES^XPDUTL(X)
63 .Q:$L($$GET^XPAR(ORPDUZ,"ORLP DEFAULT CLINIC SATURDAY",1,"Q"))
64 .D EN^XPAR(ORPDUZ,"ORLP DEFAULT CLINIC SATURDAY",1,"`"_CLIN,.ERR)
65 .I +ERR>0 S X="Error: "_ERR_" - converting default CLINIC SAT "_CLIN_" for user "_$G(NAME)_"!" D BMES^XPDUTL(X)
66 .Q:$L($$GET^XPAR(ORPDUZ,"ORLP DEFAULT CLINIC SUNDAY",1,"Q"))
67 .D EN^XPAR(ORPDUZ,"ORLP DEFAULT CLINIC SUNDAY",1,"`"_CLIN,.ERR)
68 .I +ERR>0 S X="Error: "_ERR_" - converting default CLINIC SUN "_CLIN_" for user "_$G(NAME)_"!" D BMES^XPDUTL(X)
69 I $L($G(BEG)) D
70 .Q:$L($$GET^XPAR(ORPDUZ,"ORLP DEFAULT CLINIC START DATE",1,"Q"))
71 .D EN^XPAR(ORPDUZ,"ORLP DEFAULT CLINIC START DATE",1,BEG,.ERR)
72 .I +ERR>0 S X="Error: "_ERR_" - converting default CLIN STRT DATE "_BEG_" for user "_$G(NAME)_"!" D BMES^XPDUTL(X)
73 I $L($G(END)) D
74 .Q:$L($$GET^XPAR(ORPDUZ,"ORLP DEFAULT CLINIC STOP DATE",1,"Q"))
75 .D EN^XPAR(ORPDUZ,"ORLP DEFAULT CLINIC STOP DATE",1,END,.ERR)
76 .I +ERR>0 S X="Error: "_ERR_" - converting default CLIN STOP DATE "_END_" for user "_$G(NAME)_"!" D BMES^XPDUTL(X)
77 Q
78OR2 ;set defaults from ^VA(200,ORDUZ,100.2)
79 N X
80 S SORT=$P(OR2,U,2),PROV=$P(OR2,U,5),SPEC=$P(OR2,U,6)
81 I $L($G(SORT)) D
82 .Q:$L($$GET^XPAR(ORPDUZ,"ORLP DEFAULT LIST ORDER",1,"Q"))
83 .D EN^XPAR(ORPDUZ,"ORLP DEFAULT LIST ORDER",1,SORT,.ERR)
84 .I +ERR>0 S X="Error: "_ERR_" - converting default LIST ORDER "_SORT_" for user "_$G(NAME)_"!" D BMES^XPDUTL(X)
85 I $L($G(PROV)) D
86 .Q:$L($$GET^XPAR(ORPDUZ,"ORLP DEFAULT PROVIDER",1,"Q"))
87 .D EN^XPAR(ORPDUZ,"ORLP DEFAULT PROVIDER",1,"`"_PROV,.ERR)
88 .I +ERR>0 S X="Error: "_ERR_" - converting default PROVIDER "_PROV_" for user "_$G(NAME)_"!" D BMES^XPDUTL(X)
89 I $L($G(SPEC)) D
90 .Q:$L($$GET^XPAR(ORPDUZ,"ORLP DEFAULT SPECIALTY",1,"Q"))
91 .D EN^XPAR(ORPDUZ,"ORLP DEFAULT SPECIALTY",1,"`"_SPEC,.ERR)
92 .I +ERR>0 S X="Error: "_ERR_" - converting default SPECIALTY "_SPEC_" for user "_$G(NAME)_"!" D BMES^XPDUTL(X)
93 Q
Note: See TracBrowser for help on using the repository browser.