source: Scheduling/branches/Radiology-Support/m/BSDX19.m@ 1164

Last change on this file since 1164 was 1116, checked in by Sam Habiel, 14 years ago

Alpha 3 version files

File size: 2.4 KB
Line 
1BSDX19 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ;
2 ;;1.5V3;BSDX;;Mar 16, 2011
3 ;
4 ;
5ADDRGD(BSDXY,BSDXVAL) ;EP
6 ;Entry point for debugging
7 ;
8 ;D DEBUG^%Serenji("ADDRG^BSDX19(.BSDXY,BSDXVAL)")
9 Q
10 ;
11ADDRG(BSDXY,BSDXVAL) ;EP
12 ;Called by BSDX ADD/EDIT RESOURCE GROUP
13 ;Add a new BSDX RESOURCE GROUP entry
14 ;BSDXVAL is IEN|NAME of the entry
15 ;Returns IEN of added/edited entry or 0 if error
16 ;
17 S X="ERROR^BSDX19",@^%ZOSF("TRAP")
18 N BSDXIENS,BSDXFDA,BSDXMSG,BSDXIEN,BSDX,BSDXNAM
19 S BSDXY="^BSDXTMP("_$J_")"
20 S ^BSDXTMP($J,0)="I00020RESOURCEGROUPID^T00030ERRORTEXT"_$C(30)
21 I BSDXVAL="" D ERR(0,"BSDX16: Invalid null input Parameter") Q
22 S BSDXIEN=$P(BSDXVAL,"|")
23 S BSDXNAM=$P(BSDXVAL,"|",2)
24 I +BSDXIEN D
25 . S BSDX="EDIT"
26 . S BSDXIENS=BSDXIEN_","
27 E D
28 . S BSDX="ADD"
29 . S BSDXIENS="+1,"
30 ;
31 ;Prevent adding entry with duplicate name
32 I $D(^BSDXDEPT("B",BSDXNAM)),$O(^BSDXDEPT("B",BSDXNAM,0))'=BSDXIEN D Q
33 . D ERR(0,"BSDX19: Cannot have two Resource Groups with the same name.")
34 . Q
35 ;
36 S BSDXFDA(9002018.2,BSDXIENS,.01)=BSDXNAM ;NAME
37 I BSDX="ADD" D
38 . K BSDXIEN
39 . D UPDATE^DIE("","BSDXFDA","BSDXIEN","BSDXMSG")
40 . S BSDXIEN=+$G(BSDXIEN(1))
41 E D
42 . D FILE^DIE("","BSDXFDA","BSDXMSG")
43 S ^BSDXTMP($J,1)=$G(BSDXIEN)_"^"_$C(30)_$C(31)
44 Q
45 ;
46DELRGD(BSDXY,BSDXGRP) ;EP
47 ;Entry point for debugging
48 ;
49 ;D DEBUG^%Serenji("DELRG^BSDX19(.BSDXY,BSDXGRP)")
50 Q
51 ;
52DELRG(BSDXY,BSDXGRP) ;EP
53 ;Deletes entry name BSDXGRP from BSDX RESOURCE GROUP file
54 ;Return recordset containing error message or "" if no error
55 ;Called by BSDX DELETE RESOURCE GROUP
56 ;Test Line:
57 ;D DELRU^BSDX18(.RES,99)
58 ;
59 N BSDXI,DIK,DA,BSDXIEN
60 S BSDXI=0
61 S BSDXY="^BSDXTMP("_$J_")"
62 S ^BSDXTMP($J,0)="I00020RESOURCEGROUPID^T00030ERRORTEXT"_$C(30)
63 I BSDXGRP="" D ERR(0,"DELRG~BSDX19: Invalid null Resource Group Name") Q
64 S BSDXIEN=$O(^BSDXDEPT("B",BSDXGRP,0))
65 I '+BSDXIEN D ERR(0,"DELRG~BSDX19: Invalid Resource Group Name") Q
66 I '$D(^BSDXDEPT(BSDXIEN,0)) D ERR(0,"DELRG~BSDX19: Invalid Resource Group IEN") Q
67 ;Delete entry BSDXIEN
68 S DIK="^BSDXDEPT("
69 S DA=BSDXIEN
70 D ^DIK
71 ;
72 S BSDXI=BSDXI+1
73 S ^BSDXTMP($J,BSDXI)=BSDXIEN_"^"_$C(30)_$C(31)
74 Q
75 ;
76ERR(BSDXERID,ERRTXT) ;Error processing
77 S:'+$G(BSDXI) BSDXI=999999
78 S BSDXI=BSDXI+1
79 S ^BSDXTMP($J,BSDXI)=BSDXERID_"^"_ERRTXT_$C(30)
80 S BSDXI=BSDXI+1
81 S ^BSDXTMP($J,BSDXI)=$C(31)
82 Q
83 ;
84ERROR ;
85 D ^%ZTER
86 I '+$G(BSDXI) N BSDXI S BSDXI=999999
87 S BSDXI=BSDXI+1
88 D ERR(0,"BSDX19 M Error: <"_$G(%ZTERROR)_">")
89 Q
Note: See TracBrowser for help on using the repository browser.