- SCAPMC9 ;ALB/REW - Team API's:PRCL ; JUN 26, 1995
- ;;5.3;Scheduling;**41,112,520**;AUG 13, 1993;Build 26
- ;;1.0
- PRCL(SC44,SCDATES,SCPOSA,SCUSRA,SCROLEA,SCLIST,SCERR) ;-- list of practitioners for clinic
- ; input:
- ; SC44 = ien of CLINIC <FILE#44> [required]
- ; SCDATES("BEGIN") = begin date to search (inclusive)
- ; [default: TODAY]
- ; ("END") = end date to search (inclusive)
- ; [default: TODAY]
- ; ("INCL") = 1: only use pracitioners who were on
- ; team for entire date range
- ; 0: anytime in date range
- ; [default: 1]
- ; SCPOSA= array of positions to include reverse with scposa('exclude')
- ; SCUSRA= array of usr classes included reverse with scusra('exclude')
- ; SCROLEA= array of roles included reverse with SCROLEA('exclude')
- ; SCERR = array NAME to store error messages.
- ; [ex. ^TMP("ORXX",$J)]
- ;
- ; Output:
- ; SCLIST() = array of practitioners
- ; Format:
- ; Subscript: Sequential # from 1 to n
- ; Piece Description
- ; 1 IEN of NEW PERSON file entry (#200)
- ; 2 Name of person
- ; 3 IEN of TEAM POSITION file (#404.57)
- ; 4 Name of Position
- ; 5 IEN OF USR CLASS(#8930) of POSITION (#404.57)
- ; 6 USR Class Name
- ; 7 IEN of STANDARD POSITION (#403.46)
- ; 8 Standard Role (Position) Name
- ; 9 Activation Date for 404.52 (not 404.59!)
- ; 10 Inactivation Date for 404.52
- ; 11 IEN of Position Ass History (404.52)
- ; 12 IEN of Preceptor Position
- ; 13 Name of Preceptor Position
- ; @sclist@('scpr',sc200,sctp,scact,scn)=""
- ;
- ; SCERR() = Array of DIALOG file messages(errors) .
- ; Foramt:
- ; @SCERR@(0) = Number of errors, undefined if none
- ; Subscript: Sequential # from 1 to n
- ; Piece Description
- ; 1 IEN of DIALOG file
- ; Returned: 1 if ok, 0 if error
- ;
- ;
- ST N SCPOSNM,SCTP,SCPOS0,SCOK,SCND,SCU,SCR,SCPRCL
- N SCLSEQ,SCN,SCESEQ,SCPARM,SCP,SCBEGIN,SCEND,SCINCL,SCDTS
- ; -- initialize control variables
- G:'$$OKDATA PRACQ ; check/setup variables
- ; -- loop through team positions
- S SCTP=0
- F S SCTP=$O(^SCTM(404.57,"E",SC44,SCTP)) Q:SCTP="" D
- .Q:'$$OKARRAY^SCAPU1(.SCPOSA,SCTP)
- .S SCND=$G(^SCTM(404.57,SCTP,0))
- .S SCU=$P(SCND,U,13)
- .Q:'$$OKUSRCL^SCAPU1(.SCUSRA,SCU)
- .S SCR=$P(SCND,U,3)
- .Q:'$$OKARRAY^SCAPU1(.SCROLEA,.SCR)
- .IF 'SCTP D Q
- ..S SCPARM("Position")=$G(SCTP,"Undefined")
- ..D ERR^SCAPMCU1(.SCESEQ,4045101,.SCPARM,"",SCERR)
- .ELSE D
- ..S SCX=$$ACTHIST^SCAPMCU2(404.52,SCTP,SCDATES,.SCERR,"SCPRCL")
- ..S:SCX X=$$PRTP^SCAPMC8(SCTP,SCDATES,.SCLIST,.SCERR)
- PRACQ Q $G(@SCERR@(0))<1
- OKDATA() ;check/setup variables - return 1 if ok/ 0 if error
- N SCOK
- S SCOK=1
- D INIT^SCAPMCU1(.SCOK) ; set default dates & error array (if undefined)
- ;
- IF '$D(^SC(+$G(SC44),0)) D S SCOK=0
- . S SCPARM("CLINIC")=$G(SC44,"Undefined")
- . D ERR^SCAPMCU1(.SCESEQ,4045101,.SCPARM,"",.SCERR)
- Q SCOK
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSCAPMC9 3328 printed Feb 19, 2025@00:04:43 Page 2
- SCAPMC9 ;ALB/REW - Team API's:PRCL ; JUN 26, 1995
- +1 ;;5.3;Scheduling;**41,112,520**;AUG 13, 1993;Build 26
- +2 ;;1.0
- PRCL(SC44,SCDATES,SCPOSA,SCUSRA,SCROLEA,SCLIST,SCERR) ;-- list of practitioners for clinic
- +1 ; input:
- +2 ; SC44 = ien of CLINIC <FILE#44> [required]
- +3 ; SCDATES("BEGIN") = begin date to search (inclusive)
- +4 ; [default: TODAY]
- +5 ; ("END") = end date to search (inclusive)
- +6 ; [default: TODAY]
- +7 ; ("INCL") = 1: only use pracitioners who were on
- +8 ; team for entire date range
- +9 ; 0: anytime in date range
- +10 ; [default: 1]
- +11 ; SCPOSA= array of positions to include reverse with scposa('exclude')
- +12 ; SCUSRA= array of usr classes included reverse with scusra('exclude')
- +13 ; SCROLEA= array of roles included reverse with SCROLEA('exclude')
- +14 ; SCERR = array NAME to store error messages.
- +15 ; [ex. ^TMP("ORXX",$J)]
- +16 ;
- +17 ; Output:
- +18 ; SCLIST() = array of practitioners
- +19 ; Format:
- +20 ; Subscript: Sequential # from 1 to n
- +21 ; Piece Description
- +22 ; 1 IEN of NEW PERSON file entry (#200)
- +23 ; 2 Name of person
- +24 ; 3 IEN of TEAM POSITION file (#404.57)
- +25 ; 4 Name of Position
- +26 ; 5 IEN OF USR CLASS(#8930) of POSITION (#404.57)
- +27 ; 6 USR Class Name
- +28 ; 7 IEN of STANDARD POSITION (#403.46)
- +29 ; 8 Standard Role (Position) Name
- +30 ; 9 Activation Date for 404.52 (not 404.59!)
- +31 ; 10 Inactivation Date for 404.52
- +32 ; 11 IEN of Position Ass History (404.52)
- +33 ; 12 IEN of Preceptor Position
- +34 ; 13 Name of Preceptor Position
- +35 ; @sclist@('scpr',sc200,sctp,scact,scn)=""
- +36 ;
- +37 ; SCERR() = Array of DIALOG file messages(errors) .
- +38 ; Foramt:
- +39 ; @SCERR@(0) = Number of errors, undefined if none
- +40 ; Subscript: Sequential # from 1 to n
- +41 ; Piece Description
- +42 ; 1 IEN of DIALOG file
- +43 ; Returned: 1 if ok, 0 if error
- +44 ;
- +45 ;
- ST NEW SCPOSNM,SCTP,SCPOS0,SCOK,SCND,SCU,SCR,SCPRCL
- +1 NEW SCLSEQ,SCN,SCESEQ,SCPARM,SCP,SCBEGIN,SCEND,SCINCL,SCDTS
- +2 ; -- initialize control variables
- +3 ; check/setup variables
- if '$$OKDATA
- GOTO PRACQ
- +4 ; -- loop through team positions
- +5 SET SCTP=0
- +6 FOR
- SET SCTP=$ORDER(^SCTM(404.57,"E",SC44,SCTP))
- if SCTP=""
- QUIT
- Begin DoDot:1
- +7 if '$$OKARRAY^SCAPU1(.SCPOSA,SCTP)
- QUIT
- +8 SET SCND=$GET(^SCTM(404.57,SCTP,0))
- +9 SET SCU=$PIECE(SCND,U,13)
- +10 if '$$OKUSRCL^SCAPU1(.SCUSRA,SCU)
- QUIT
- +11 SET SCR=$PIECE(SCND,U,3)
- +12 if '$$OKARRAY^SCAPU1(.SCROLEA,.SCR)
- QUIT
- +13 IF 'SCTP
- Begin DoDot:2
- +14 SET SCPARM("Position")=$GET(SCTP,"Undefined")
- +15 DO ERR^SCAPMCU1(.SCESEQ,4045101,.SCPARM,"",SCERR)
- End DoDot:2
- QUIT
- +16 IF '$TEST
- Begin DoDot:2
- +17 SET SCX=$$ACTHIST^SCAPMCU2(404.52,SCTP,SCDATES,.SCERR,"SCPRCL")
- +18 if SCX
- SET X=$$PRTP^SCAPMC8(SCTP,SCDATES,.SCLIST,.SCERR)
- End DoDot:2
- End DoDot:1
- PRACQ QUIT $GET(@SCERR@(0))<1
- OKDATA() ;check/setup variables - return 1 if ok/ 0 if error
- +1 NEW SCOK
- +2 SET SCOK=1
- +3 ; set default dates & error array (if undefined)
- DO INIT^SCAPMCU1(.SCOK)
- +4 ;
- +5 IF '$DATA(^SC(+$GET(SC44),0))
- Begin DoDot:1
- +6 SET SCPARM("CLINIC")=$GET(SC44,"Undefined")
- +7 DO ERR^SCAPMCU1(.SCESEQ,4045101,.SCPARM,"",.SCERR)
- End DoDot:1
- SET SCOK=0
- +8 QUIT SCOK