Changeset 636 for FOIAVistA/tag/r/SCHEDULING-SD-SC/SCRPPAT2.m
- Timestamp:
- Dec 4, 2009, 8:26:01 PM (14 years ago)
- Location:
- FOIAVistA/tag/r
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
FOIAVistA/tag/r/SCHEDULING-SD-SC/SCRPPAT2.m
r628 r636 1 1 SCRPPAT2 ;ALB/CMM - Practitioner's Patients ; 12/12/00 3:46pm 2 ;;5.3;Scheduling;**41,48,174,181,177,231,433,297 ,526,520**;AUG 13, 1993;Build 262 ;;5.3;Scheduling;**41,48,174,181,177,231,433,297**;AUG 13, 1993 3 3 ; 4 4 ;Listing of Practitioner's Patients … … 26 26 ;ARY - array of patients for selected practitioner 27 27 ;PRAC - practitioner ien 28 N NXT,PIEN,TPIEN,PNAME,TPIEN,NODE,PTP,TPI,TPN,CLIEN, PTA,PTAN,TIEN29 N PC,TNODE,TNAME,PINF,POSN,PRCP ,CNAME28 N NXT,PIEN,TPIEN,PNAME,TPIEN,NODE,PTP,TPI,TPN,CLIEN,CNAME,PTA,PTAN,TIEN 29 N PC,TNODE,TNAME,PINF,POSN,PRCP 30 30 S NXT=0 31 31 F S NXT=$O(@ARY@(NXT)) Q:NXT=""!(NXT'?.N) D … … 49 49 .I $G(ROLE)'=1,'$D(ROLE(+$P(TPN,U,3))) Q ;not a selected role 50 50 .S POSN=$P(TPN,"^") ;position name 51 .D SETASCL^SCRPRAC2(TPI,.CNAME,.CLIEN) ;get clinics from multiple 52 .;S CLIEN=+$P(TPN,"^",9) ;associated clinic ien 51 .S CLIEN=+$P(TPN,"^",9) ;associated clinic ien 53 52 .;commented next line off - clinic enrollment no longer needed SD*5.3*433 54 53 .;D CECHK(CLIEN,.CNAME,PIEN) ;is patient enrolled in associated clinic? 55 . ;S CNAME=$P($G(^SC(CLIEN,0)),"^") ; SD*5.3*433 remove enroll check54 .S CNAME=$P($G(^SC(CLIEN,0)),"^") ; SD*5.3*433 remove enroll check 56 55 .S PC=$S($P(PTP,"^",5)=0:0,1:1) ;primary care position 1or2-yes/0-no 57 56 .S PNAME=$P($G(^VA(200,+PRAC,0)),"^") ;practitioner name 58 57 .Q:PNAME="" 59 58 .S PRCP=$P($$OKPREC2^SCMCLK(TPI,DT),U,2) 60 .D GETPINF(PIEN,.CLIEN,.PINF) ;get patient information and appointments 61 .S CNAME=$G(CNAME(0)) ;first line will capture position information 62 .S PINF=$G(PINF(0)) 63 .I PINF="" D 64 ..S PINF=PIEN_"^"_$$PDATA^SCRPEC(PIEN,CNAME,CNAME,1) 65 .D FORMAT(CNAME,PINF,PC,TIEN,TNAME,PRAC,PNAME,POSN,TPI,PRCP) 66 .D SETFORM(PIEN,.CNAME,.PINF) 67 SETFORM(PIEN,CNAME,PINF) ;Format for clinic info only for multiples 68 N SCCNT 69 S SCCNT=0 F S SCCNT=$O(PINF(SCCNT)) Q:SCCNT="" D FORMATAC(CNAME(SCCNT),PINF(SCCNT),PC,TIEN,TNAME,PRAC,PNAME,POSN,TPI,PRCP) 70 Q 71 GETPINF(PIEN,CLIEN,PINF) ;get patient info 72 N SCCNT 73 S SCCNT="" F S SCCNT=$O(CLIEN(SCCNT)) Q:SCCNT="" D 74 .S PINF(SCCNT)=PIEN_"^"_$$PDATA^SCRPEC(PIEN,CLIEN(SCCNT),CNAME(SCCNT),1) 59 .S PINF=PIEN_"^"_$$PDATA^SCRPEC(PIEN,CLIEN,1) 60 .;$$PDATA returns pt name,pid,mt,pelig,status,status date,last appt,nxt appt 61 .D FORMAT(CNAME,PINF,PC,TIEN,TNAME,PRAC,PNAME,POSN,TPI,PRCP) ;formats data for display 75 62 Q 76 63 ; 77 CECHK(CLIEN,CNAME,PIEN) ; should no longer be used as of patch SD*5.3*43364 CECHK(CLIEN,CNAME,PIEN) ; 78 65 ;CLIEN - clinic ien 79 66 ;CNAME - clinic name returned if patient is enrolled in clien clinic … … 112 99 Q 113 100 ; 114 FORMATAC(CNAME,PINF,PC,TIEN,TNAME,PRAC,PNAME,POSN,TPI,PRCP) ; format data for display 115 ;CNAME - clinic name 116 ;PINF - patient/clinic data 117 ;PC - primary care 1/0 118 ;TIEN - team file ien (#404.51) 119 ;TNAME - team name 120 ;PRAC - practitioner ien (#200) 121 ;PNAME - practitioner name 122 ;POSN - position name 123 ;TPI - team position ien (#404.57) 124 ;PRCP - preceptor name 125 ; 126 N IIEN,INAME,ERR 127 S ERR=$$SETUP^SCRPPAT3(.IIEN,.INAME,TIEN,TNAME,PRAC,PNAME,POSN,TPI,PRCP) 128 I ERR Q 129 ; 130 I SORT=1 D STORA(IIEN,TIEN,PRAC,PINF,PNAME,TNAME,TPI,SCCNT) ;sort division,team,practitioner 131 I SORT=2 D STORA(IIEN,PRAC,TIEN,PINF,PNAME,TNAME,TPI,SCCNT) ;sort division,practitioner,team 132 I SORT=3 D STORA(1,PRAC,1,PINF,PNAME,"T3",TPI,SCCNT) 133 Q 134 ; 135 STOR(IIEN,SEC,TRD,PINF,PNAME,TNAME,TPI,SCCNT) ; 101 STOR(IIEN,SEC,TRD,PINF,PNAME,TNAME,TPI) ; 136 102 ;IIEN - ien institution 137 103 ;SEC - second sort subscript, IEN team or IEN practitioner … … 144 110 N PIEN,PTNAME,PID 145 111 S PIEN=+$P(PINF,"^") ;patient ien 146 S PTNAME=$E($P(PINF,"^",2),1,1 0) ;patient name112 S PTNAME=$E($P(PINF,"^",2),1,15) ;patient name 147 113 Q:$D(@STORE@("PT",IIEN,SEC,TRD,TPI,PTNAME,PIEN)) 148 114 S @STORE@("PT",IIEN,SEC,TRD,TPI,PTNAME,PIEN)="" 115 ; 149 116 I 'SUMM,'$D(@STORE@("PTOT",IIEN,SEC,TRD,PIEN)) D 150 117 .;count each unique patient for any given practitioner for grand total … … 157 124 S @STORE@(IIEN,SEC,TRD,TPI,PIEN)=PTNAME 158 125 S PID=$P(PINF,"^",3),PID=$TR(PID,"-","") 159 S $E(@STORE@(IIEN,SEC,TRD,TPI,PIEN),1 3)=PID ;ssn126 S $E(@STORE@(IIEN,SEC,TRD,TPI,PIEN),18)=$E(PID,6,10) ;last 4 pid - 5 places is for any pseudo 160 127 S $E(@STORE@(IIEN,SEC,TRD,TPI,PIEN),25)=$P(PINF,"^",4) ;means test status 161 128 S $E(@STORE@(IIEN,SEC,TRD,TPI,PIEN),31)=$P(PINF,"^",5) ;eligibility … … 166 133 S $E(@STORE@(IIEN,SEC,TRD,TPI,PIEN),66)=$E(CNAME,1,15) ;clinic 167 134 Q 168 STORA(IIEN,SEC,TRD,PINF,PNAME,TNAME,TPI,SCCNT) ;169 I '$D(@STORE@(IIEN,SEC,TRD,TPI,PIEN,SCCNT)) D170 .S $E(@STORE@(IIEN,SEC,TRD,TPI,PIEN,SCCNT),42)=$P(PINF,"^",8) ;last appt171 .S $E(@STORE@(IIEN,SEC,TRD,TPI,PIEN,SCCNT),54)=$P(PINF,"^",9) ;nxt appt172 .S $E(@STORE@(IIEN,SEC,TRD,TPI,PIEN,SCCNT),66)=$E(CNAME,1,15) ;clinic173 .Q174 Q
Note:
See TracChangeset
for help on using the changeset viewer.