source: Scheduling/trunk/m/BSDX12.m@ 872

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

more i18n work

File size: 2.3 KB
Line 
1BSDX12 ; IHS/OIT/HMW - WINDOWS SCHEDULING RPCS ; 7/6/10 6:33am
2 ;;1.3;IHS WINDOWS SCHEDULING;;NOV 01, 2007
3 ; v 1.3 - i18n support
4 ; BSDXSTART and BSDXEND passed in FM Dates, not US dates
5 ;
6 ;
7AVADD(BSDXY,BSDXSTART,BSDXEND,BSDXTYPID,BSDXRES,BSDXSLOTS,BSDXNOTE) ;EP
8 ;Called by BSDX ADD NEW AVAILABILITY
9 ;Create entry in BSDX ACCESS BLOCK
10 ;
11 ;BSDXRES is Resource Name
12 ;Returns recordset having fields
13 ; AvailabilityID and ErrorNumber
14 ;
15 ;Test lines:
16 ;D AVADD^BSDX12(.RES,"3091227.09","3091227.0930","1","WHITT",2,"SCRATCH AV NOTE") ZW RES
17 ;BSDX ADD NEW AVAILABILITY^3091227.09^3091227.0930^1^WHITT^2^SCRATCH AVAILABILITY NOTE
18 ;
19 N BSDXERR,BSDXIEN,BSDXDEP,BSDXI,BSDXAVID,BSDXI,BSDXERR,BSDXFDA,BSDXMSG,BSDXRESD
20 K ^BSDXTMP($J)
21 S BSDXERR=0
22 S BSDXI=0
23 S BSDXY="^BSDXTMP("_$J_")"
24 S ^BSDXTMP($J,0)="I00020AVAILABILITYID^I00020ERRORID"_$C(30)
25 ;Check input data for errors
26 ; i18n - FM Dates passed in
27 ; S:BSDXSTART["@0000" BSDXSTART=$P(BSDXSTART,"@")
28 ; S:BSDXEND["@0000" BSDXEND=$P(BSDXEND,"@")
29 ; S %DT="T",X=BSDXSTART D ^%DT S BSDXSTART=Y
30 ; I BSDXSTART=-1 D ERR(70) Q
31 ; S %DT="T",X=BSDXEND D ^%DT S BSDXEND=Y
32 ; I BSDXEND=-1 D ERR(70) Q
33 I $L(BSDXEND,".")=1 D ERR(70) Q
34 I BSDXSTART>BSDXEND S BSDXTMP=BSDXEND,BSDXEND=BSDXSTART,BSDXSTART=BSDXTMP
35 ;Validate Access Type
36 I '+BSDXTYPID,'$D(^BSDXTYPE(BSDXTYPID,0)) D ERR(70) Q
37 ;Validate Resource
38 I '$D(^BSDXRES("B",BSDXRES)) S BSDXERR=70 D ERR(BSDXERR) Q
39 S BSDXRESD=$O(^BSDXRES("B",BSDXRES,0)) I '+BSDXRESD S BSDXERR=70 D ERR(BSDXERR) Q
40 ;
41 ;Create entry in BSDX ACCESS BLOCK
42 S BSDXFDA(9002018.3,"+1,",.01)=BSDXRESD
43 S BSDXFDA(9002018.3,"+1,",.02)=BSDXSTART
44 S BSDXFDA(9002018.3,"+1,",.03)=BSDXEND
45 S BSDXFDA(9002018.3,"+1,",.04)=BSDXSLOTS
46 S BSDXFDA(9002018.3,"+1,",.05)=BSDXTYPID
47 K BSDXIEN,BSDXMSG
48 D UPDATE^DIE("","BSDXFDA","BSDXIEN","BSDXMSG")
49 S BSDXAVID=+$G(BSDXIEN(1))
50 I 'BSDXAVID D ERR(70) Q
51 ;
52 ;Add WP field
53 I BSDXNOTE]"" S BSDXNOTE(.5)=BSDXNOTE,BSDXNOTE=""
54 I $D(BSDXNOTE(0)) S BSDXNOTE(.5)=BSDXNOTE(0) K BSDXNOTE(0)
55 I $D(BSDXNOTE(.5)) D
56 . D WP^DIE(9002018.3,BSDXAVID_",",1,"","BSDXNOTE","BSDXMSG")
57 ;
58 ;Return Recordset
59 S BSDXI=BSDXI+1
60 S ^BSDXTMP($J,BSDXI)=BSDXAVID_"^-1"_$C(30)
61 S BSDXI=BSDXI+1
62 S ^BSDXTMP($J,BSDXI)=$C(31)
63 Q
64 ;
65ERR(ERRNO) ;Error processing
66 S BSDXERR=ERRNO+134234112 ;vbObjectError
67 S BSDXI=BSDXI+1
68 S ^BSDXTMP($J,BSDXI)="0^"_BSDXERR_$C(30)
69 S BSDXI=BSDXI+1
70 S ^BSDXTMP($J,BSDXI)=$C(31)
71 Q
Note: See TracBrowser for help on using the repository browser.