Ignore:
Timestamp:
Dec 4, 2009, 8:26:01 PM (14 years ago)
Author:
George Lilly
Message:

WorldVistAEHR overlayed on FOIAVistA

Location:
FOIAVistA/tag/r
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCRPPAT2.m

    r628 r636  
    11SCRPPAT2 ;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 26
     2 ;;5.3;Scheduling;**41,48,174,181,177,231,433,297**;AUG 13, 1993
    33 ;
    44 ;Listing of Practitioner's Patients
     
    2626 ;ARY - array of patients for selected practitioner
    2727 ;PRAC - practitioner ien
    28  N NXT,PIEN,TPIEN,PNAME,TPIEN,NODE,PTP,TPI,TPN,CLIEN,PTA,PTAN,TIEN
    29  N PC,TNODE,TNAME,PINF,POSN,PRCP,CNAME
     28 N NXT,PIEN,TPIEN,PNAME,TPIEN,NODE,PTP,TPI,TPN,CLIEN,CNAME,PTA,PTAN,TIEN
     29 N PC,TNODE,TNAME,PINF,POSN,PRCP
    3030 S NXT=0
    3131 F  S NXT=$O(@ARY@(NXT)) Q:NXT=""!(NXT'?.N)  D
     
    4949 .I $G(ROLE)'=1,'$D(ROLE(+$P(TPN,U,3))) Q  ;not a selected role
    5050 .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
    5352 .;commented next line off - clinic enrollment no longer needed SD*5.3*433
    5453 .;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 check
     54 .S CNAME=$P($G(^SC(CLIEN,0)),"^")  ; SD*5.3*433 remove enroll check
    5655 .S PC=$S($P(PTP,"^",5)=0:0,1:1) ;primary care position 1or2-yes/0-no
    5756 .S PNAME=$P($G(^VA(200,+PRAC,0)),"^") ;practitioner name
    5857 .Q:PNAME=""
    5958 .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
    7562 Q
    7663 ;
    77 CECHK(CLIEN,CNAME,PIEN) ;should no longer be used as of patch SD*5.3*433
     64CECHK(CLIEN,CNAME,PIEN) ;
    7865 ;CLIEN - clinic ien
    7966 ;CNAME - clinic name returned if patient is enrolled in clien clinic
     
    11299 Q
    113100 ;
    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) ;
     101STOR(IIEN,SEC,TRD,PINF,PNAME,TNAME,TPI) ;
    136102 ;IIEN - ien institution
    137103 ;SEC - second sort subscript, IEN team or IEN practitioner
     
    144110 N PIEN,PTNAME,PID
    145111 S PIEN=+$P(PINF,"^") ;patient ien
    146  S PTNAME=$E($P(PINF,"^",2),1,10) ;patient name
     112 S PTNAME=$E($P(PINF,"^",2),1,15) ;patient name
    147113 Q:$D(@STORE@("PT",IIEN,SEC,TRD,TPI,PTNAME,PIEN))
    148114 S @STORE@("PT",IIEN,SEC,TRD,TPI,PTNAME,PIEN)=""
     115 ;
    149116 I 'SUMM,'$D(@STORE@("PTOT",IIEN,SEC,TRD,PIEN)) D
    150117 .;count each unique patient for any given practitioner for grand total
     
    157124 S @STORE@(IIEN,SEC,TRD,TPI,PIEN)=PTNAME
    158125 S PID=$P(PINF,"^",3),PID=$TR(PID,"-","")
    159  S $E(@STORE@(IIEN,SEC,TRD,TPI,PIEN),13)=PID ;ssn
     126 S $E(@STORE@(IIEN,SEC,TRD,TPI,PIEN),18)=$E(PID,6,10) ;last 4 pid - 5 places is for any pseudo
    160127 S $E(@STORE@(IIEN,SEC,TRD,TPI,PIEN),25)=$P(PINF,"^",4) ;means test status
    161128 S $E(@STORE@(IIEN,SEC,TRD,TPI,PIEN),31)=$P(PINF,"^",5) ;eligibility
     
    166133 S $E(@STORE@(IIEN,SEC,TRD,TPI,PIEN),66)=$E(CNAME,1,15) ;clinic
    167134 Q
    168 STORA(IIEN,SEC,TRD,PINF,PNAME,TNAME,TPI,SCCNT) ;
    169  I '$D(@STORE@(IIEN,SEC,TRD,TPI,PIEN,SCCNT))  D
    170  .S $E(@STORE@(IIEN,SEC,TRD,TPI,PIEN,SCCNT),42)=$P(PINF,"^",8) ;last appt
    171  .S $E(@STORE@(IIEN,SEC,TRD,TPI,PIEN,SCCNT),54)=$P(PINF,"^",9) ;nxt appt
    172  .S $E(@STORE@(IIEN,SEC,TRD,TPI,PIEN,SCCNT),66)=$E(CNAME,1,15) ;clinic
    173  .Q
    174  Q
Note: See TracChangeset for help on using the changeset viewer.