SCMCTSK7 ;ALB/JDS - PCMM FTEE REPORT ; 8/23/05 11:46am
;;5.3;Scheduling;**297,1015**;AUG 13, 1993;Build 21
Q
DIOEND ;End of FTEE report
N XX
W @IOF
W !!!,"REPORT KEY",!!
F I=1:1 S A=$P($T(TIOEND+I),";;",2) Q:'$L(A) W !,A I $Y>(IOSL-4) I $G(IOST)["C-" R XX:DTIME W @IOF
Q
TIOEND ;
;;Column Heading Explanation of column heading
;;
;;Providers Name The name of the primary care Provider
;;Institution Institution name, previously called Division, where patient receives primary care
;;PC TEAM The name of the primary care team to which this position (and therefore provider) is assigned.
;;Provider's Team Position The name of the Primary care team position to which this provider's assigned
;;AP or PCP This column displays whether this provider is an Associate Primary Care Provider
;; (AP) or a Primary Care Provider (PCP)
;;Associated Clinic(s) The scheduling clinic(s) associated with this position/provider in the PCMM software
;;Direct PC FTEE The number of hours the provider spends providing direct primary care expressed as a Full-Time Employee
;; Equivalent Examples: One FTEE=1.00=40 hours per week. 0.75 FTEE=30 hours per week. 0.50 FTEE=20 hours
;; per week. Percent FTEE is equal to 100 x the FTEE number on this report. For example FTEE=0.75= 75%
;;Patients for Position This represents the total maximum number of patients this provider is expected to care for on this panel
;; Allowed This number is entered in the PCMM GUI 'Primary Care Team Position Setup' window on the 'Settings' tab
;; Additional patients above this number may be assigned to the provider depending on local management policy
;;Patients for Position The actual current number of active patients assigned to this provider in PCMM at the time of this report
;; Actual This number displays on the PCMM GUI 'Primary Care Team Position Setup' window on the 'Settings' tab
;;Available Patient Openings The difference in the number of patients allowed and the actual number of patients currently assigned
;; If this is a positive number, additional patient assignments may be made
;; If this is a negative number (in parentheses,) the maximum number of patient assignments exceeds what is
;; indicated in PCMM. Local management decides whether to assign patients over the maximum number.
;;Adjusted Panel Size The Adjusted Panel Size column is the result of the Active Patients column divided by the FTEE (when not
;; 0) and is an attempt to standardize the panel size so comparisons can be made for providers that have
;; different FTEE values. Example, Active patients 500/0.85 FTEE=588. This is the number of patients this
;; provider would be expected to provide primary care for if their FTEE=1.0
;;FTEE and Panel Size Total The total number of FTEE, patients for positions allowed, patients for positions actual, and available
;; patient opening for this report. If this report is sorted on Associated Clinic, then subtotals for each
;; clinic and a total for the entire report print. If this report is sorted on PC Team, then subtotals for
;; each team and a total for the entire report print
Q
SETASC(RESULT,DATA) ;set associated clinics
N ENTRY,OLD S ENTRY=+$G(DATA(0))
I ENTRY I '$D(^SCTM(404.57,+ENTRY,5,0)) S ^(0)="^404.575PA^^"
F I=0:0 S I=$O(^SCTM(404.57,+ENTRY,5,I)) Q:'I S OLD(I)=""
F I=1:1 Q:'$D(DATA(I)) S A=$P(DATA(I),U,2) K OLD(+A) I '$D(^SCTM(404.57,+ENTRY,5,+A)) D
.S DIC(0)="LM",DIC="^SCTM(404.57,"_ENTRY_",5,",X=(+A),DA(1)=ENTRY K OLD(+A) D ^DICN
;get rid of deleted
F I=0:0 S I=$O(OLD(I)) Q:'I S DIK="^SCTM(404.57,"_ENTRY_",5,",DA(1)=ENTRY,DA=I D ^DIK
Q
DIS2 ;continue inactivation stuff
; Existing varibles
; ZERO = zero node of 404.43
; ENTRY = ien in 404.43
; Newed at this line lable
; DA = iens in 404.43 and 404.42
; DIE = file numbers 404.43 and 404.42
; DR = dr edit strings
; SCV1 = patient dfn
; SCV2 = is there team data 1 or 0
; SCV3 = team ien
; SCV4 = looper
N DA,DIE,DR,SCV1,SCV2,SCV3,SCV4
;original code has next line commented
;I $P(ZERO,U,16)=1 Q
;next inactivate the patient team position assignment
S DA=ENTRY,DIE="^SCPT(404.43,",DR=".04////"_DT_";.12////NA;.15///@;.13///@"
D ^DIE K DIE
;check toggle for automatic team inactivations - site level
;if not 1 do not inactivate from team automatically (all teams)
I $P($G(^SCTM(404.44,1,1)),U,10)'=1 Q
S DA=$P(ZERO,U) Q:'DA
;check toggle for automatic team inactivations - team level
;if not 1 do not inactivate from team automaticaly (this team only)
I $P($G(^SCPT(404.42,DA,0)),U,16)=1 Q
S DIE="^SCPT(404.42,",DR=".09////"_DT_";.15////IU" D ^DIE K DIE
S SCV1=$P($G(^SCPT(404.42,+$P(ZERO,U),0)),U) Q:SCV1=""
;make a call to GETALL^SCAPMCA(DFN)
;team info returned at ^TMP("SC",$J,DFN,"TM",IEN 404.51,IEN 404.42,"POS",IEN 404.43)
S SCV2=$$GETALL^SCAPMCA(SCV1) Q:'1
S SCV3=$P($G(^SCTM(404.57,+$P(ZERO,U,2),0)),U,2) Q:SCV3=""
;loop thru and inactivate all positions associated with this patient on this team
S SCV4=0 F S SCV4=$O(^TMP("SC",$J,SCV1,"TM",SCV3,"POS",SCV4)) Q:'SCV4 D
. S DA=SCV4
. ;check for previous unassignment and quit if one exsists
. I $P($G(^SCPT(404.43,SCV4,0)),U,4) Q
. S DIE=404.43
. S DR=".04////"_DT_";.12////NA;.15///@;.13///@"
. D ^DIE K DIE
K ^TMP("SC",$J,SCV1)
Q
SCMCTSK7 ;ALB/JDS - PCMM FTEE REPORT ; 8/23/05 11:46am
+1 ;;5.3;Scheduling;**297,1015**;AUG 13, 1993;Build 21
+2 QUIT
DIOEND ;End of FTEE report
+1 NEW XX
+2 WRITE @IOF
+3 WRITE !!!,"REPORT KEY",!!
+4 FOR I=1:1
SET A=$PIECE($TEXT(TIOEND+I),";;",2)
IF '$LENGTH(A)
QUIT
WRITE !,A
IF $Y>(IOSL-4)
IF $GET(IOST)["C-"
READ XX:DTIME
WRITE @IOF
+5 QUIT
TIOEND ;
+1 ;;Column Heading Explanation of column heading
+2 ;;
+3 ;;Providers Name The name of the primary care Provider
+4 ;;Institution Institution name, previously called Division, where patient receives primary care
+5 ;;PC TEAM The name of the primary care team to which this position (and therefore provider) is assigned.
+6 ;;Provider's Team Position The name of the Primary care team position to which this provider's assigned
+7 ;;AP or PCP This column displays whether this provider is an Associate Primary Care Provider
+8 ;; (AP) or a Primary Care Provider (PCP)
+9 ;;Associated Clinic(s) The scheduling clinic(s) associated with this position/provider in the PCMM software
+10 ;;Direct PC FTEE The number of hours the provider spends providing direct primary care expressed as a Full-Time Employee
+11 ;; Equivalent Examples: One FTEE=1.00=40 hours per week. 0.75 FTEE=30 hours per week. 0.50 FTEE=20 hours
+12 ;; per week. Percent FTEE is equal to 100 x the FTEE number on this report. For example FTEE=0.75= 75%
+13 ;;Patients for Position This represents the total maximum number of patients this provider is expected to care for on this panel
+14 ;; Allowed This number is entered in the PCMM GUI 'Primary Care Team Position Setup' window on the 'Settings' tab
+15 ;; Additional patients above this number may be assigned to the provider depending on local management policy
+16 ;;Patients for Position The actual current number of active patients assigned to this provider in PCMM at the time of this report
+17 ;; Actual This number displays on the PCMM GUI 'Primary Care Team Position Setup' window on the 'Settings' tab
+18 ;;Available Patient Openings The difference in the number of patients allowed and the actual number of patients currently assigned
+19 ;; If this is a positive number, additional patient assignments may be made
+20 ;; If this is a negative number (in parentheses,) the maximum number of patient assignments exceeds what is
+21 ;; indicated in PCMM. Local management decides whether to assign patients over the maximum number.
+22 ;;Adjusted Panel Size The Adjusted Panel Size column is the result of the Active Patients column divided by the FTEE (when not
+23 ;; 0) and is an attempt to standardize the panel size so comparisons can be made for providers that have
+24 ;; different FTEE values. Example, Active patients 500/0.85 FTEE=588. This is the number of patients this
+25 ;; provider would be expected to provide primary care for if their FTEE=1.0
+26 ;;FTEE and Panel Size Total The total number of FTEE, patients for positions allowed, patients for positions actual, and available
+27 ;; patient opening for this report. If this report is sorted on Associated Clinic, then subtotals for each
+28 ;; clinic and a total for the entire report print. If this report is sorted on PC Team, then subtotals for
+29 ;; each team and a total for the entire report print
+30 QUIT
SETASC(RESULT,DATA) ;set associated clinics
+1 NEW ENTRY,OLD
SET ENTRY=+$GET(DATA(0))
+2 IF ENTRY
IF '$DATA(^SCTM(404.57,+ENTRY,5,0))
SET ^(0)="^404.575PA^^"
+3 FOR I=0:0
SET I=$ORDER(^SCTM(404.57,+ENTRY,5,I))
IF 'I
QUIT
SET OLD(I)=""
+4 FOR I=1:1
IF '$DATA(DATA(I))
QUIT
SET A=$PIECE(DATA(I),U,2)
KILL OLD(+A)
IF '$DATA(^SCTM(404.57,+ENTRY,5,+A))
Begin DoDot:1
+5 SET DIC(0)="LM"
SET DIC="^SCTM(404.57,"_ENTRY_",5,"
SET X=(+A)
SET DA(1)=ENTRY
KILL OLD(+A)
DO ^DICN
End DoDot:1
+6 ;get rid of deleted
+7 FOR I=0:0
SET I=$ORDER(OLD(I))
IF 'I
QUIT
SET DIK="^SCTM(404.57,"_ENTRY_",5,"
SET DA(1)=ENTRY
SET DA=I
DO ^DIK
+8 QUIT
DIS2 ;continue inactivation stuff
+1 ; Existing varibles
+2 ; ZERO = zero node of 404.43
+3 ; ENTRY = ien in 404.43
+4 ; Newed at this line lable
+5 ; DA = iens in 404.43 and 404.42
+6 ; DIE = file numbers 404.43 and 404.42
+7 ; DR = dr edit strings
+8 ; SCV1 = patient dfn
+9 ; SCV2 = is there team data 1 or 0
+10 ; SCV3 = team ien
+11 ; SCV4 = looper
+12 NEW DA,DIE,DR,SCV1,SCV2,SCV3,SCV4
+13 ;original code has next line commented
+14 ;I $P(ZERO,U,16)=1 Q
+15 ;next inactivate the patient team position assignment
+16 SET DA=ENTRY
SET DIE="^SCPT(404.43,"
SET DR=".04////"_DT_";.12////NA;.15///@;.13///@"
+17 DO ^DIE
KILL DIE
+18 ;check toggle for automatic team inactivations - site level
+19 ;if not 1 do not inactivate from team automatically (all teams)
+20 IF $PIECE($GET(^SCTM(404.44,1,1)),U,10)'=1
QUIT
+21 SET DA=$PIECE(ZERO,U)
IF 'DA
QUIT
+22 ;check toggle for automatic team inactivations - team level
+23 ;if not 1 do not inactivate from team automaticaly (this team only)
+24 IF $PIECE($GET(^SCPT(404.42,DA,0)),U,16)=1
QUIT
+25 SET DIE="^SCPT(404.42,"
SET DR=".09////"_DT_";.15////IU"
DO ^DIE
KILL DIE
+26 SET SCV1=$PIECE($GET(^SCPT(404.42,+$PIECE(ZERO,U),0)),U)
IF SCV1=""
QUIT
+27 ;make a call to GETALL^SCAPMCA(DFN)
+28 ;team info returned at ^TMP("SC",$J,DFN,"TM",IEN 404.51,IEN 404.42,"POS",IEN 404.43)
+29 SET SCV2=$$GETALL^SCAPMCA(SCV1)
IF '1
QUIT
+30 SET SCV3=$PIECE($GET(^SCTM(404.57,+$PIECE(ZERO,U,2),0)),U,2)
IF SCV3=""
QUIT
+31 ;loop thru and inactivate all positions associated with this patient on this team
+32 SET SCV4=0
FOR
SET SCV4=$ORDER(^TMP("SC",$JOB,SCV1,"TM",SCV3,"POS",SCV4))
IF 'SCV4
QUIT
Begin DoDot:1
+33 SET DA=SCV4
+34 ;check for previous unassignment and quit if one exsists
+35 IF $PIECE($GET(^SCPT(404.43,SCV4,0)),U,4)
QUIT
+36 SET DIE=404.43
+37 SET DR=".04////"_DT_";.12////NA;.15///@;.13///@"
+38 DO ^DIE
KILL DIE
End DoDot:1
+39 KILL ^TMP("SC",$JOB,SCV1)
+40 QUIT