source: WorldVistAEHR/trunk/r/SCHEDULING-SD-SC/SCAPMC1.m@ 1211

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

initial load of WorldVistAEHR

File size: 2.9 KB
RevLine 
[613]1SCAPMC1 ;ALB/REW - Team API's: PRTM ; JUN 26, 1995
2 ;;5.3;Scheduling;**41**;AUG 13, 1993
3 ;;1.0
4PRTM(SCTEAM,SCDATES,SCUSRA,SCROLEA,SCLIST,SCERR) ; -- practitioners for team
5 ; input:
6 ; SCTEAM = ien of TEAM [required]
7 ; SCDATES("BEGIN") = begin date to search (inclusive)
8 ; [default: TODAY]
9 ; ("END") = end date to search (inclusive)
10 ; [default: TODAY]
11 ; ("INCL") = 1: only use pracitioners who were on
12 ; team for entire date range
13 ; 0: anytime in date range
14 ; [default: 1]
15 ; SCUSRA = array of usr classes to use/exclude
16 ; if $d(@scusra@('exclude')) -> list to exclude
17 ; SCROLEA = array of roles to use/exclude
18 ; SCERR = array NAME to store error messages.
19 ; [ex. ^TMP("ORXX",$J
20 ; Output:
21 ; SCLIST() = array of practitioners
22 ; Format:
23 ; Subscript: Sequential # from 1 to n
24 ; Piece Description
25 ; 1 IEN of NEW PERSON file entry (#200)
26 ; 2 Name of person
27 ; 3 IEN of TEAM POSITION file (#404.57)
28 ; 4 Name of Position
29 ; 5 IEN OF USR CLASS(#8930) of POSITION (#404.57)
30 ; 6 USR Class Name
31 ; 7 IEN of STANDARD POSITION (#403.46)
32 ; 8 Standard Role (Position) Name
33 ; 9 Activation Date for 404.52 (not 404.59!)
34 ; 10 Inactivation Date for 404.52
35 ; 11 IEN of Position Ass History (404.52)
36 ; 12 IEN of Preceptor Position
37 ; 13 Name of Preceptor Position
38 ;
39 ; SCERR() = Array of DIALOG file messages(errors) .
40 ; @SCERR(0)= Number of error(s), UNDEFINED if no errors
41 ; Foramt:
42 ; Subscript: Sequential # from 1 to n
43 ; Piece Description
44 ; 1 IEN of DIALOG file
45 ; Returned: 1 if ok, 0 if error
46 ;
47 ; -- initialize control variables
48 ;
49ST N SCPOSNM,SCTP,SCPOS0,SCOK,SCND,SCU,SCR,SCPRTM
50 N SCLSEQ,SCN,SCESEQ,SCPARM,SCP,SCBEGIN,SCEND,SCINCL,SCDTS
51 G:'$$OKDATA PRACQ ; setup/check variables
52 ; -- loop through team positions
53 S SCTP=0
54 F S SCTP=$O(^SCTM(404.57,"C",SCTEAM,SCTP)) Q:'SCTP D
55 .S SCND=$G(^SCTM(404.57,SCTP,0))
56 .S SCU=$P(SCND,U,13)
57 .Q:'$$OKUSRCL^SCAPU1(.SCUSRA,.SCU)
58 .S SCR=$P(SCND,U,3)
59 .Q:'$$OKARRAY^SCAPU1(.SCROLEA,.SCR)
60 .Q:'$$ACTHIST^SCAPMCU2(404.52,SCTP,SCDATES,.SCERR,"SCPRTM")
61 .Q:'$$PRTP^SCAPMC8(SCTP,SCDATES,.SCLIST,.SCERR)
62PRACQ Q $G(@SCERR@(0))<1
63OKDATA() ; setup/check variables - return 1 if ok; 0 if error
64 N SCOK
65 S SCOK=1
66 D INIT^SCAPMCU1(.SCOK) ; default dates & error array if undefined
67 IF '$D(^SCTM(404.51,+$G(SCTEAM),0)) D S SCOK=0
68 . S SCPARM("TEAM")=$G(SCTEAM,"Undefined")
69 . D ERR^SCAPMCU1(.SCESEQ,4045101,.SCPARM,"",.SCERR)
70 Q SCOK
Note: See TracBrowser for help on using the repository browser.