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

WorldVistAEHR overlayed on FOIAVistA

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

Legend:

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

    r628 r636  
    11SCAPMC14 ;ALB/REW - Team API's: PTPR ; JUN 30, 1995
    2  ;;5.3;Scheduling;**41,520**;AUG 13, 1993;Build 26
     2 ;;5.3;Scheduling;**41**;AUG 13, 1993
    33 ;;1.0
    44PTPR(SC200,SCDATES,SCPURPA,SCROLEA,SCLIST,SCERR,SCYESCL) ; -- list patients for a pract (scyescl NOT supported)
     
    6767 .Q:'SCOK
    6868 .Q:'SCYESCL
    69  .;S SC44=$P($G(^SCTM(404.57,+SCTP,0)),U,9)
    70  .;Q:'SC44
    71  .N CNAME,SC44
    72  .D SETASCL^SCRPRAC2(SCTP,.CNAME,.SC44)
    73  .N SCCNT S SCCNT=0
    74  .F  S SCCNT=$O(SC44(SCCNT)) Q:SCCNT=""  S SCOK=$$PTCL^SCAPMC(SC44(SCCNT),"SCDTPR",.SCLIST,.SCERR)
     69 .S SC44=$P($G(^SCTM(404.57,+SCTP,0)),U,9)
     70 .Q:'SC44
     71 .S SCOK=$$PTCL^SCAPMC(SC44,"SCDTPR",.SCLIST,.SCERR)
    7572PRACQ Q $G(@SCERR@(0))<1
    7673 ;
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCAPMC29.m

    r628 r636  
    11SCAPMC29 ;ALB/REW - TEAM APIs:CLPT  ; 2/17/00 1:33pm
    2  ;;5.3;Scheduling;**41,210,520**;AUG 13, 1993;Build 26
     2 ;;5.3;Scheduling;**41,210**;AUG 13, 1993
    33 ;;1.0
    44CLPT(DFN,SCDATES,SCTEAMA,SCLIST,SCERR) ;clinics for patient
     
    4848 .F SCX=1:1 S SCTP=+$G(SCPOSAX(SCX)) Q:'SCTP  S SCPOSA(SCTP)=""
    4949 .S:$D(@SCTEAMA@("EXCLUDE")) SCPOSA("EXCLUDE")=""
    50  ;S SCX=0 F  S SCX=$O(^DPT(DFN,"DE",SCX)) Q:'SCX  D
    51  ;.S SC44=+$G(^DPT(DFN,"DE",SCX,0))
    52  ;.Q:'SC44
    53  ;.Q:'$$OKCLIN(SC44,.SCPOSA)
    54  ;.S SCCLNM=$P($G(^SC(SC44,0)),U,1)
    55  ;.S SCS=0 F  S SCS=$O(^DPT(DFN,"DE",SCX,1,SCS)) Q:'SCS  D
    56  ;..S SCND=$G(^DPT(DFN,"DE",SCX,1,SCS,0))
    57  ;..S SCACT=$P(SCND,U,1)
    58  ;..S SCINACT=$P(SCND,U,3)
    59  ;..Q:'$$DTCHK^SCAPU1(SCBEGIN,SCEND,SCINCL,SCACT,SCINACT)
    60  ;..S SCACOPT=$P(SCND,U,2)
    61  ;..S SCREVDT=$P(SCND,U,5)
    62  ;..S SCN=$G(@SCLIST@(0),0)+1
    63  ;..;bp/ar nois brx-1298-12323 prevent undefined variable error
    64  ;..;New code begins
    65  ;..Q:'SCACT
    66  ;..Q:'SCN
    67  ;.;End of brx-1298-12323
    68  ;..S @SCLIST@(0)=SCN
    69  ;..S @SCLIST@(SCN)=SC44_U_SCCLNM_U_SCACT_U_SCINACT_U_SCACOPT_U_SCREVDT
    70  ;..S @SCLIST@("SCCL",SC44,SCACT,SCN)=""
     50 S SCX=0 F  S SCX=$O(^DPT(DFN,"DE",SCX)) Q:'SCX  D
     51 .S SC44=+$G(^DPT(DFN,"DE",SCX,0))
     52 .Q:'SC44
     53 .Q:'$$OKCLIN(SC44,.SCPOSA)
     54 .S SCCLNM=$P($G(^SC(SC44,0)),U,1)
     55 .S SCS=0 F  S SCS=$O(^DPT(DFN,"DE",SCX,1,SCS)) Q:'SCS  D
     56 ..S SCND=$G(^DPT(DFN,"DE",SCX,1,SCS,0))
     57 ..S SCACT=$P(SCND,U,1)
     58 ..S SCINACT=$P(SCND,U,3)
     59 ..Q:'$$DTCHK^SCAPU1(SCBEGIN,SCEND,SCINCL,SCACT,SCINACT)
     60 ..S SCACOPT=$P(SCND,U,2)
     61 ..S SCREVDT=$P(SCND,U,5)
     62 ..S SCN=$G(@SCLIST@(0),0)+1
     63 ..;bp/ar nois brx-1298-12323 prevent undefined variable error
     64 ..;New code begins
     65 ..Q:'SCACT
     66 ..Q:'SCN
     67 ..;End of brx-1298-12323
     68 ..S @SCLIST@(0)=SCN
     69 ..S @SCLIST@(SCN)=SC44_U_SCCLNM_U_SCACT_U_SCINACT_U_SCACOPT_U_SCREVDT
     70 ..S @SCLIST@("SCCL",SC44,SCACT,SCN)=""
    7171PTCLQ Q $G(@SCERR@(0))<1
    7272 ;
     
    7575 IF '$D(SCPOSA) S SCOK=1 G QTOKC
    7676 S (SCOK,SCTP)=0
    77  F  S SCTP=$O(^SCTM(404.57,"E",+SC44,SCTP)) Q:'SCTP  S:$$OKARRAY^SCAPU1(.SCPOSA,SCTP) SCOK=1
     77 F  S SCTP=$O(^SCTM(404.57,"D",+SC44,SCTP)) Q:'SCTP  S:$$OKARRAY^SCAPU1(.SCPOSA,SCTP) SCOK=1
    7878QTOKC Q SCOK
    7979 ;
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCAPMC30.m

    r628 r636  
    11SCAPMC30 ;ALB/REW - TEAM APIs:TPCL  ; 30 Jun 95
    2  ;;5.3;Scheduling;**41,520**;AUG 13, 1993;Build 26
     2 ;;5.3;Scheduling;**41**;AUG 13, 1993
    33 ;;1.0
    44TPCL(SC44,SCDATES,SCPOSA,SCUSRA,SCPURPA,SCROLEA,SCLIST,SCERR) ;  -- list of positions for a clinic
     
    5858 S SCOK=1
    5959 G:'$$OKDATA CLTPQ
    60  S SCTP=0 F  S SCTP=$O(^SCTM(404.57,"E",SC44,SCTP)) Q:'SCTP  D  Q:'SCOK
     60 S SCTP=0 F  S SCTP=$O(^SCTM(404.57,"D",SC44,SCTP)) Q:'SCTP  D  Q:'SCOK
    6161 .S SCTP0=$G(^SCTM(404.57,SCTP,0))
    6262 .IF '$L(SCTP0) D
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCAPMC9.m

    r628 r636  
    11SCAPMC9 ;ALB/REW - Team API's:PRCL ; JUN 26, 1995
    2  ;;5.3;Scheduling;**41,112,520**;AUG 13, 1993;Build 26
     2 ;;5.3;Scheduling;**41,112**;AUG 13, 1993
    33 ;;1.0
    44PRCL(SC44,SCDATES,SCPOSA,SCUSRA,SCROLEA,SCLIST,SCERR) ;-- list of practitioners for clinic
     
    5454 ; -- loop through team positions
    5555 S SCTP=0
    56  F  S SCTP=$O(^SCTM(404.57,"E",SC44,SCTP)) Q:SCTP=""  D
     56 F  S SCTP=$O(^SCTM(404.57,"D",SC44,SCTP)) Q:SCTP=""  D
    5757 .Q:'$$OKARRAY^SCAPU1(.SCPOSA,SCTP)
    5858 .S SCND=$G(^SCTM(404.57,SCTP,0))
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCMCDD2.m

    r628 r636  
    11SCMCDD2 ;ALB/REW - DD Calls used by PCMM ; 27 March 1996
    2  ;;5.3;Scheduling;**41,107,520**;AUG 13, 1993;Build 26
     2 ;;5.3;Scheduling;**41,107**;AUG 13, 1993
    33 ;1
    44USEPCDEF(SCCL) ;how should pc practitioner be used for clinic
     
    2424 S SCOK=0
    2525 S SCXTP=0
    26  F  S SCXTP=$O(^SCTM(404.57,"E",SCCL,SCXTP)) Q:('SCXTP)!(SCXTP=SCTP)  D
     26 F  S SCXTP=$O(^SCTM(404.57,"D",SCCL,SCXTP)) Q:('SCXTP)!(SCXTP=SCTP)  D
    2727 .I $P(^SCTM(404.57,SCXTP,0),U,2)'=SCTM Q
    2828 .S SCOK=1
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCMCHLB1.m

    r628 r636  
    1 SCMCHLB1 ;BPOI/DJB - PCMM HL7 Bld Segment Array Cont.;8/17/99
    2  ;;5.3;Scheduling;**177,515,524**;08/17/99;Build 29
     1SCMCHLB1 ;BP/DJB - PCMM HL7 Bld Segment Array Cont. ; 8/17/99 9:29am
     2 ;;5.3;Scheduling;**177,515**;May 01, 1999;Build 14
    33 ;
    44SEGMENTS(DFN,SUB) ;Build EVN & PID segments
     
    4646 ;   Array of ZPC segments
    4747 ;
    48  NEW DATA,DATE,ID,ID1,LINETAG,SUB,TYPE,VAFZPC
     48 NEW DATA,DATE,ID,ID1,LINETAG,NUM,TYPE,VAFZPC
    4949 ;
    50  S SUB=0
    51  F  S SUB=$O(ARRAY(SUB)) Q:'SUB  D  ;
     50 S NUM=0
     51 F  S NUM=$O(ARRAY(NUM)) Q:'NUM  D  ;
    5252 . S TYPE=""
    53  . F  S TYPE=$O(ARRAY(SUB,TYPE)) Q:TYPE=""  D  ;
     53 . F  S TYPE=$O(ARRAY(NUM,TYPE)) Q:TYPE=""  D  ;
    5454 .. S ID=""
    55  .. F  S ID=$O(ARRAY(SUB,TYPE,ID)) Q:ID=""  D  ;
    56  ... S DATA=$G(ARRAY(SUB,TYPE,ID))
     55 .. F  S ID=$O(ARRAY(NUM,TYPE,ID)) Q:ID=""  D  ;
     56 ... S DATA=$G(ARRAY(NUM,TYPE,ID))
    5757 ... I $G(DELETE) S DATA="^^^" ;A Delete type ZPC segment
    5858 ... E  D  ;....................A ZPC segment with data
     
    7474 ....S DATA=DATA_"^"_ROLE
    7575 ... ;
    76  ... D BLDZPC^SCMCHLS ;..Build segment ; og/sd/524
    77  ... D CPYZPC^SCMCHLS ;..Copy segment into array ; og/sd/524
     76 ... S LINETAG="BLDZPC"
     77 ... D @LINETAG^SCMCHLS ;..Build segment
     78 ... S LINETAG="CPYZPC"
     79 ... D @LINETAG^SCMCHLS ;..Copy segment into array
    7880 Q
    7981 ;
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCMCHLB2.m

    r628 r636  
    1 SCMCHLB2 ;BPOI/DJB - PCMM HL7 Bld Segment Array Deletes;3/6/00
    2  ;;5.3;Scheduling;**177,204,210,224,524**;08/13/93;Build 29
     1SCMCHLB2 ;BP/DJB - PCMM HL7 Bld Segment Array Deletes ; 3/6/00 8:41am
     2 ;;5.3;Scheduling;**177,204,210,224**;AUG 13, 1993
    33 ;
    44PTP ;Entry has been deleted from file 404.43. Send deletes to NPCD.
     
    2020 S ID=PTPI_"-"
    2121 F  S ID=$O(^SCPT(404.49,"B",ID)) Q:ID=""!($P(ID,"-",1)'=PTPI)  D  ;
    22  . N SUB  ; og/sd/524
    23  . S SUB=PTPI,DATA="^^^" ;........A Delete type ZPC segment
     22 . S DATA="^^^" ;........A Delete type ZPC segment
    2423 . ;djb/bp Patch 210. Eliminate indirection[rel 204]
    2524 . D BLDZPC^SCMCHLS ;..Build segment (needs ID & DATA)
     
    6564 .. S ID=""
    6665 .. F  S ID=$O(@POS@(DFN,PTPI,ID)) Q:ID=""  D  ;djb/bp BIG-1199-71271
    67  ... N SUB  ; og/sd/524
    68  ... S SUB=PTPI,DATA="^^^" ;........A Delete type ZPC segment
     66 ... S DATA="^^^" ;........A Delete type ZPC segment
    6967 ... ;djb/bp Patch 210. Eliminate indirection[rel 204]
    7068 ... D BLDZPC^SCMCHLS ;..Build segment (needs ID & DATA)
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCMCHLS.m

    r628 r636  
    1 SCMCHLS ;BPOI/DJB - PCMM HL7 Segment Utils;12/13/99
    2  ;;5.3;Scheduling;**177,210,212,293,515,524**;08/13/93;Build 29
     1SCMCHLS ;BP/DJB - PCMM HL7 Segment Utils ; 12/13/99 12:40pm
     2 ;;5.3;Scheduling;**177,210,212,293,515**;AUG 13, 1993;Build 14
    33 ;
    44 ;Ref rtn: SCDXMSG1
     
    3737 ; PATCH 515 DLL USE ORIG TRIG
    3838 ; old code = M @XMITARRY@($P(ID,"-",1),"ZPC",ID)=VAFZPC
    39  M @XMITARRY@(SUB,"ZPC",ID)=VAFZPC  ; og/sd/524
     39 M @XMITARRY@(NUM,"ZPC",ID)=VAFZPC
    4040 Q
    4141 ;
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCMCMU2.m

    r628 r636  
    1 SCMCMU2 ;ALBOI/MJK - PCMM Mass Team/Position Unassignment Processing;07/10/98
    2  ;;5.3;Scheduling;**148,177,524**;AUG 13, 1993;Build 29
     1SCMCMU2 ;ALB/MJK - PCMM Mass Team/Position Unassignment Processing ; 10-JUL-1998
     2 ;;5.3;Scheduling;**148,177**;AUG 13, 1993
    33 ;
    44QUE() ; -- queue mass unassignment
     
    169169 . ; -- if assignment date is in future then delete
    170170 . IF SCASDT>DT,SCASDT>SCDATE D  Q
    171  . . N DA,DIE,DIK,DR
    172  . . S DA=SCIEN,(DIE,DIK)="^SCPT(404.43,",DR=".04///"_DT D ^DIE  ; og/sd/524
     171 . . N DA,DIK
     172 . . S DA=SCIEN,DIK="^SCPT(404.43,"
    173173 . . D LOCK(SCNODE)
    174174 . . D ^DIK
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCMCPT2.m

    r628 r636  
    1 SCMCPT2 ; GENERATED FROM 'SCMC INCONSISTENT' PRINT TEMPLATE (#1448) ; 12/27/06 ; (FILE 404.57, MARGIN=132)
     1SCMCPT2 ; GENERATED FROM 'SCMC INCONSISTENT' PRINT TEMPLATE (#1467) ; 12/25/06 ; (FILE 404.57, MARGIN=132)
    22 G BEGIN
    33N W !
     
    1212BEGIN ;
    1313 S:'$D(DN) DN=1 S DISTP=$G(DISTP),DILCT=$G(DILCT)
    14  I $D(DXS)<9 M DXS=^DIPT(1448,"DXS")
     14 I $D(DXS)<9 M DXS=^DIPT(1467,"DXS")
    1515 S I(0)="^SCTM(404.57,",J(0)=404.57
    1616 W ?0 S X=$P($$GETPRTP^SCAPMCU2(D0,DT),U,2) W $E(X,1,8) K Y(404.57,304)
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCMCPT6.m

    r628 r636  
    1 SCMCPT6 ; GENERATED FROM 'SCMC DIRECT PC FTEE 1 CLN' PRINT TEMPLATE (#1452) ; 12/27/06 ; (FILE 404.52, MARGIN=132)
     1SCMCPT6 ; GENERATED FROM 'SCMC DIRECT PC FTEE 1 CLN' PRINT TEMPLATE (#1471) ; 12/25/06 ; (FILE 404.52, MARGIN=132)
    22 G BEGIN
    33CP G CP^DIO2
     
    2121BEGIN ;
    2222 S:'$D(DN) DN=1 S DISTP=$G(DISTP),DILCT=$G(DILCT)
    23  I $D(DXS)<9 M DXS=^DIPT(1452,"DXS")
     23 I $D(DXS)<9 M DXS=^DIPT(1471,"DXS")
    2424 S I(0)="^SCTM(404.52,",J(0)=404.52
    2525 S X=$G(^SCTM(404.52,D0,0)) W ?0 S Y=$P(X,U,3) S Y=$S(Y="":Y,$D(^VA(200,Y,0))#2:$P(^(0),U),1:Y) W $E(Y,1,15)
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCMCQK1.m

    r628 r636  
    1 SCMCQK1 ;ALBOI/REW - Single Pt Tm/Pt Tm Pos Assign and Discharge;11/07/02
    2  ;;5.3;Scheduling;**148,177,231,264,436,297,446,524**;AUG 13, 1993;Build 29
     1SCMCQK1 ;ALB/REW - Single Pt Tm/Pt Tm Pos Assign and Discharge ; 07 Oct 2002  12:10 PM  ; Compiled April 12, 2007 10:03:59
     2 ;;5.3;Scheduling;**148,177,231,264,436,297,446**;AUG 13, 1993;Build 77
    33 ;
    44 ;04/25/2006 SD*5.3*446 INTER-FACILITY TRANSFER
     
    1111 G:SCDISCH<1 QTUNTP
    1212 G:'$$CONFIRM() QTUNTP
    13  S OK=$$INPTSCTP^SCAPMC22(DFN,SCTP,SCDISCH,.SCER)  ; og/sd/524
     13 S OK=1 ;$$INPTSCTP^SCAPMC22(DFN,SCTP,SCDISCH,.SCER)
    1414 G:OK'>0 QTUNTP
    1515 S SCCL=$P($G(^SCTM(404.57,+$G(SCTP),0)),U,9)
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCMCTSK1.m

    r628 r636  
    1 SCMCTSK1 ;ALB/JDS - PCMM Inactivations; 18 Apr 2003  9:36 AM ; 10/24/07 12:24pm  ; Compiled January 25, 2008 12:11:43  ; Compiled March 26, 2008 22:27:26
    2  ;;5.3;Scheduling;**297,498,527,499**;AUG 13, 1993;Build 21
    3  Q
    4 INACTIVE ;
    5  ;Flag patients
    6  N I,CNT,SC297,TPZ,TYDT,TEAMN,STDT,Q,SDDT,STDD S CNT=0
    7  D DT^DICRW
    8  N SD1 S SDDT="" F SD1=DT,DT-1 I $D(^XTMP("SCMCTSK2-"_SD1,$J,"START")) S SDDT=SD1 Q
    9  I SDDT'>0 D DT^DICRW S SDDT=DT
    10  S %DT="",X="T-11M" D ^%DT S STDD=+Y
     1SCMCTSK1 ;ALB/JDS - PCMM Inactivations; 18 Apr 2003  9:36 AM ; 10/24/07 12:24pm
     2 ;;5.3;Scheduling;**297,498,527**;AUG 13, 1993;Build 6
     3 Q
     4INACTIVE ;run every night to determine if patient can be inactivated from
     5 ;team
     6 ;Inactivation happens for patients without activity for 24 months
     7 N I,CNT,SC297,TPZ,TYDT,TEAMN,STDT,Q S CNT=0
     8 D DT^DICRW S %DT="",X="T-11M" D ^%DT S STDT=Y
     9 S SC297=$$PDAT^SCMCGU("SD*5.3*297"),X1=DT,X2=SC297 D D^%DTC S SC297=X
     10 S X="T-"_$S(SC297>330:"11M",1:"23M") D ^%DT S TYDT=+Y
    1111 S A="^SCPT(404.43,""ADFN""",L=""""""
    1212 S Q=A_")"
     
    1414 .S ENTRY=+$P(Q,",",6)
    1515 .S ZERO=$G(^SCPT(404.43,+ENTRY,0))
    16  .I $P(ZERO,U,15) Q
    1716 .S POS=+$P(ZERO,U,2)
    18  .I $P(ZERO,U,4) Q  ;UNASS
    19  .I '$P(ZERO,U,5) Q  ;Not PC
    20  .I $P(ZERO,U,3)>STDD Q  ;<11 months
    21  .I $P(ZERO,U,17) Q  ;React
    22  .;get preceptor
     17 .S TEAM=$P(Q,",",4)
     18 .;I $P($G(^SCTM(404.51,+TEAM,0)),U,16) Q  ;no automatic for this team
     19 .;I $G(^DPT(DFN,.35)) D DIS Q  ;Patient is deceased
     20 .I $P(ZERO,U,3)>STDT Q  ;Later
     21 .I $P(ZERO,U,17) Q  ;Already reactivated
     22 .;get preceptor position
    2323 .S PREC=$$DATES^SCAPMCU1(404.53,+POS),PREC=$S(PREC:$P($G(^SCTM(404.53,+$P(PREC,U,4),0)),U,6),1:+POS)
     24 .;see if provider changed
     25 .I $O(^SCTM(404.52,"AIDT",+PREC,1,-STDT),-1) Q
     26 .I $P(ZERO,U,4) Q  ;Already unassigned
     27 .I '$P(ZERO,U,5) Q  ;Not primary care
     28 .;I $P(ZERO,U,16) Q  ;No Automatic unassign
     29 .;Check if any activity
    2430 .S DFN=$P(Q,",",3)
    2531 .I $G(XPDIDTOT),('(DFN#5)) D UPDATE^XPDID(DFN)
    2632 .S TEAM=$P(Q,",",4),TEAMNM=$P($G(^SCTM(404.51,+TEAM,0)),U)
    27  .N STDT S %DT="",X="T-12M" D ^%DT S STDT=+Y
    28  .;N-new or E-est
    29  .N NEW
    30  .I $P(ZERO,U,3)<STDT S NEW=0
    31  .E  S NEW=1
    32  .N TYDT
    33  .I NEW N STDT S %DT="",X="T-11M" D ^%DT S STDT=+Y D
    34  ..S X1=STDT,X2=-7 D C^%DTC S TYDT=X
    35  .I 'NEW N STDT S %DT="",X="T-23M" D ^%DT S STDT=+Y Q:$P(ZERO,U,3)'<STDT  D
    36  ..S X1=STDT,X2=-7 D C^%DTC S TYDT=X
    37  .N PROV,SEEN,PRECP D SEEN(DFN,POS,TYDT,SDDT,.PROV,.PRECP,.SEEN) Q:SEEN
    38  .;flag
    39  .S DIE="^SCPT(404.43,",DR=".15////"_SDDT,DA=ENTRY D ^DIE
    40  .S TPZ=$G(^SCTM(404.57,+POS,2))
    41  .I "TP"[$P(TPZ,U,9) I $G(PROV) S CNT=CNT+1,^TMP("SCF",$J,PROV,CNT,ENTRY)=""
    42  .I $P(TPZ,U,10),$G(PRECP) S CNT=CNT+1,^TMP("SCF",$J,PRECP,CNT,ENTRY)=""
    43  Q
    44 SEEN(DFN,POS,TYDT,SDDT,PROV,PROVP,SEEN) ;
    45  S SEEN=0,PROVP=""
    46  N SCPRO,I,PRO,X,SCPRDTS,SCPR,PREC
    47  S PROV=+$$GETPRTP^SCAPMCU2(POS,SDDT)
    48  S SCPRDTS("BEGIN")=TYDT,SCPRDTS("END")=SDDT,SCPRDTS("INCL")=0
     33 .D SEEN Q:SEEN
     34 .I '$P(ZERO,U,15) D
     35 ..S DIE="^SCPT(404.43,",DR=".15////"_DT,DA=ENTRY D ^DIE
     36 ..S TPZ=$G(^SCTM(404.57,+POS,2))
     37 ..I "TP"[$P(TPZ,U,10) I $G(PROV) S CNT=CNT+1,^TMP("SCF",$J,PROV,CNT,ENTRY)=""
     38 ..I $P(TPZ,U,9),$G(PRECP) S CNT=CNT+1,^TMP("SCF",$J,PRECP,CNT,ENTRY)=""
     39 Q
     40SEEN ;was patient seen
     41 S SEEN=0
     42 N SCPRO,I,PRECP,PRO
     43 N X,SCPRDTS,SCPR
     44 ;get list of providers for this position
     45 S PROV=+$$GETPRTP^SCAPMCU2(POS,DT) S SCPRO(+PROV)=""
     46 S SCPRDTS("BEGIN")=TYDT
     47 S SCPRDTS("END")=DT
    4948 S X=$$PRTP^SCAPMC(POS,"SCPRDTS","SCPR")
    50  S I=0 F  S I=$O(SCPR(I)) Q:'I  S SCPRO(+SCPR(I))="",SCPRO(+SCPR(I),I)=$P(SCPR(I),U,9,10) D
    51  .S PREC=$P(SCPR(I),U,12)
    52  .I PREC,PREC'=POS S PROVP=+$$GETPRTP^SCAPMCU2(PREC,SDDT) S SCPRO(+PROVP)="" S SCPRO(+PROVP,I)=$P(SCPR(I),U,9,10)
     49 F I=0:0 S I=$O(SCPR(I)) Q:'I  S SCPRO(+SCPR(I))=""
     50 S PRECP=0 I $G(PREC),$G(PREC)'=POS S PRECP=+$$GETPRTP^SCAPMCU2(PREC,DT),SCPRO(+PRECP)=""
    5351 F I=TYDT:0 S I=$O(^SCE("ADFN",DFN,I)) Q:'I  D  Q:SEEN
    54  .S J=0 F S J=$O(^SCE("ADFN",DFN,I,J)) Q:'J  D  Q:SEEN
     52 .F J=0:0 S J=$O(^SCE("ADFN",DFN,I,J)) Q:'J  D  Q:SEEN
    5553 ..N VISIT S VISIT=+$P($G(^SCE(J,0)),U,5) I $G(^SCE(J,0))<$G(TYDT) Q
    56  ..S PRO=0 F  S PRO=$O(SCPRO(PRO)) Q:'PRO  D  Q:SEEN
    57  ...I $D(^SDD(409.44,"AO",J,$G(PRO))) D CHK I SEEN=1 Q
    58  ...N V F V=0:0 S V=$O(^AUPNVPRV("AD",VISIT,V)) Q:'V  I PRO=(+$G(^AUPNVPRV(V,0))) D CHK I SEEN=1 Q
    59  Q
    60 CHK ;
    61  N SDX S SDX="" F  S SDX=$O(SCPRO(PRO,SDX)) Q:SDX=""  D  Q:SEEN
    62  .I $P(SCPRO(PRO,SDX),U,2)="" D  Q
    63  ..I I'<$P(SCPRO(PRO,SDX),U) S SEEN=1
    64  .I I'<TYDT&(I'>$P(SCPRO(PRO,SDX),U,2)) S SEEN=1
    65  Q
    66 DIS ;disch
     54 ..F PRO=0:0 S PRO=$O(SCPRO(PRO)) Q:'PRO  D  Q:SEEN
     55 ...I $D(^SDD(409.44,"AO",J,$G(PRO))) S SEEN=1 Q  ;GET THE PROVIDERJ
     56 ...N V F V=0:0 S V=$O(^AUPNVPRV("AD",VISIT,V)) Q:'V  I PRO=(+$G(^AUPNVPRV(V,0))) S SEEN=1 Q
     57 Q
     58DIS ;discharge
    6759 N ZERO S ZERO=$G(^SCPT(404.43,+ENTRY,0))
    68  I $P(ZERO,U,4) Q
     60 I $P(ZERO,U,4) Q  ;Already discharged
    6961 D DIS2^SCMCTSK7
    7062 Q
    71 CHKENR(DATA,INFO) ;check if patient enrolled in teamposition clinic
    72  S DATA(0)=-1
    73  Q
    74 EXTEND(DATA,SCTEAM) ;to inact. in next 60 days
     63EXTEND(DATA,SCTEAM) ;return list of patients to inactivate in next 60 days
    7564 ;IEN^POSITION^PATIENT^EXTENDED^REASON
    7665 K DATA,SCDATA,SDDATA
    7766 N CNT,I,J,K,A,POSA S CNT=1 S SCTEAM=$G(SCTEAM),DATA(1)="<DATA>"
    78  D DT^DICRW
    79  N SD1 S SDDT="" F SD1=DT,DT-1 I $D(^XTMP("SCMCTSK2-"_SD1,$J,"START")) S SDDT=SD1 Q
    80  I SDDT'>0 D DT^DICRW S SDDT=DT
    81  S X="T-9M" D ^%DT S STDT=Y
     67 D DT^DICRW S X="T-9M" D ^%DT S STDT=Y
    8268 S X="T-21M" D ^%DT S TYDT=+Y  ;MAKE THIS 21
    8369 S POSA=""
     
    9177 .S CNT=CNT+1
    9278 Q
    93 POS I '$$DATES^SCAPMCU1(404.59,POS) Q  ;Position inact
     79POS I '$$DATES^SCAPMCU1(404.59,POS) Q   ;Not an active position
    9480 I '$P($G(^SCTM(404.57,POS,0)),U,4) Q  ;Not PC
    95  ;patients for position
     81 ;get patients for this position
    9682 K ^TMP("SC TMP LIST",$J)
    9783 S X=$$PTTP^SCAPMC(POS,"",.SCLIST,.SCERR)
     
    10187 .I '$P($G(^SCPT(404.43,+$P(SCDATA,U,3),0)),U,15) Q
    10288 .S DFN=+SCDATA
    103  .D SEEN(DFN,POS,TYDT,SDDT,.PROV,.PRECP,.SEEN) Q:SEEN
     89 .D SEEN Q:SEEN
    10490 .S SDDATA($P($G(^SCTM(404.57,POS,0)),U),$P(SCDATA,U,2),+SCDATA)=SCDATA,CNT=CNT+1
    10591 K @SCLIST
     
    10793FILE(RES,DATA) ;File data on FTEE
    10894 N I
    109  F I=1:1 Q:'$D(DATA(I))  D
     95 F I=1:1 Q:'$D(DATA(I))   D
    11096 .S $P(DATA(I),U,7)=$TR($P(DATA(I),U,7),"[]")
    11197 .S ZERO=$G(^SCPT(404.43,+DATA(I),0))
     
    116102 I $O(FLDA(0)) D FILE^DIE("E","FLDA","ERR")
    117103 Q
    118 SCREEN ;Active assign. screen
     104SCREEN ;Screen for active assignments
    119105 N A S A=$G(^SCTM(404.52,D0,0))
    120106 N J S J=-(DT+1),J=$O(^SCTM(404.52,"AIDT",+A,1,J)) I J="" S X=0 Q
     
    124110 I '$D(^SCTM(404.52,"AIDT",+A,1,J,D0)) S X=0 Q
    125111 S X=1 Q
    126 SUM(PR,POSI) ;get pos for prov
     112SUM(PR,POSI) ; get positions for this provider
    127113 N I,INS,ZERO,SCA,TEAM,FTEE,Z
    128114 S I="",FTEE=0
     
    139125 .S FTEE=FTEE+$P(ZERO,U,9)
    140126 Q FTEE
    141 FTEECHK(DATA,PAIEN) ;check Ftee>1
     127FTEECHK(DATA,PAIEN) ;check Ftee greater than 1
    142128 N A S A=$G(^SCTM(404.52,+PAIEN,0)),FTEE=$$SUM(+$P(PAIEN,U,3),+A)
    143129 S DATA=0
    144130 S DATA=FTEE+$P(PAIEN,U,2)
    145131 Q
    146 SORT(DIPA,SDD) ;sort tmpl
    147  N DIC
     132SORT ;sort template
     133 N DIC,DIPA
    148134 S DIC=4,DIC(0)="ZME"
    149135 S DIC("S")="I $D(^SCTM(404.51,""AINST"",+Y))"
    150136 S DIR("A")="Start with Institution",DIR("B")="FIRST",DIR(0)="F" D ^DIR
    151  I X="FIRST" S DIPA("SI")="",DIPA("EI")="zzz",SDD=1 Q
    152  D ^DIC I Y<0 S DIPA("SI")=X S SDD=X Q:SDD[U  D
     137 I X="FIRST" S DIPA("SI")="",DIPA("EI")="zzz",X=1 Q
     138 D ^DIC I Y<0 S DIPA("SI")=X Q:X[U  D
    153139 .S DIR("A")="Go to Institutiton",DIR("B")="LAST" S DIR(0)="F" D ^DIR
    154140 .I X="LAST" S DIPA("EI")="zzz"
     
    156142 D ^DIC
    157143 I Y>0 S DIPA("EI")=$P(Y(0),U)
    158  I Y<0 S DIPA("EI")=X S SDD=X Q:SDD[U
    159  S SDD=1 Q
     144 I Y<0 S DIPA("EI")=X Q:X[U
     145 S X=1 Q
    160146FTEERPT ;FTEE REPORT
    161147 D FTERPT^SCMCTSK6 Q
     
    169155 S DATA=0
    170156 I ('INFO)!('$P(INFO,U,2)) Q
    171  ;Is provider role acceptable?
     157 ;Check if provider can be in this role.
    172158 S J=-(DT+1) S J=$O(^SCTM(404.52,"AIDT",+INFO,1,J)) Q:J=""
    173159 I $O(^SCTM(404.52,"AIDT",+INFO,0,-(DT+1)))<J Q
     
    191177 S SCDFN=+Y W !,SCDFN
    192178SCDFN S SC1="^SCPT(404.43,""APCPOS"",SCDFN,1)"
    193  ;quit if no PC assign
     179 ;
     180 ;quit if no PC assignments
    194181 Q:'$D(@SC1)
    195182 S SCADT=0
    196183 F  S SCADT=$O(@SC1@(SCADT)) Q:SCADT=""  D
    197  .S SCTP=0
    198  .F  S SCTP=$O(@SC1@(SCADT,SCTP)) Q:'SCTP  D
    199  ..; quit if team position does not exist
    200  ..Q:'$D(^SCTM(404.57,SCTP,0))
    201  ..S SCPAI=0
    202  ..F  S SCPAI=$O(@SC1@(SCADT,SCTP,SCPAI)) Q:'SCPAI  D
    203  ...S SCDDT=$P($G(^SCPT(404.43,SCPAI,0)),U,4)
    204  ...;quit if not active within date range
    205  ...Q:$$DTCHK^SCAPU1(SC177,DT,0,SCADT,SCDDT)<1
    206  ...N SCVAR S SCVAR=SCPAI_";SCPT(404.43,"
    207  ...;add to HL7 event file
    208  ...Q:$D(^SCPT(404.48,"AACXMIT",SCVAR))
    209  ...Q:$$CHECK^SCMCHLB1(SCVAR)'=1
    210  ...D ADD^SCMCHLE("NOW",SCVAR,SCDFN,SCTP)
     184 . S SCTP=0
     185 . F  S SCTP=$O(@SC1@(SCADT,SCTP)) Q:'SCTP  D
     186 . . ;
     187 . . ; quit if team position does not exist
     188 . . Q:'$D(^SCTM(404.57,SCTP,0))
     189 . . S SCPAI=0
     190 . . F  S SCPAI=$O(@SC1@(SCADT,SCTP,SCPAI)) Q:'SCPAI  D
     191 . . . S SCDDT=$P($G(^SCPT(404.43,SCPAI,0)),U,4)
     192 . . . ;
     193 . . . ; quit if not active within date range
     194 . . . Q:$$DTCHK^SCAPU1(SC177,DT,0,SCADT,SCDDT)<1
     195 . . . N SCVAR S SCVAR=SCPAI_";SCPT(404.43,"
     196 . . . ;
     197 . . . ; add to HL7 event file
     198 . . . Q:$D(^SCPT(404.48,"AACXMIT",SCVAR))
     199 . . . Q:$$CHECK^SCMCHLB1(SCVAR)'=1
     200 . . . D ADD^SCMCHLE("NOW",SCVAR,SCDFN,SCTP)
    211201 Q
    212202PRSEED ;seed practitioner
     
    214204 S SC177=$$PDAT^SCMCGU("SD*5.3*177")
    215205 I +SC177=0 D  Q
    216  . S SC2=" No SD*5.3*177 Installation Date."
     206 . S SC2="  Unable to obtain SD*5.3*177 Installation Date."
    217207 . D MSG^SCMCCV6(SC1,SC2)
     208 . Q
    218209 S DIC=200,DIC(0)="MEQA",DIC("A")="Select Provider: " D ^DIC Q:Y'>0
    219210 S SCPROV=+Y
     
    230221 . D ADD^SCMCHLE("NOW",SCVAR,,AH,1)
    231222 Q
    232 INCON ;inconsistent PC assignments
     223INCON ;get list of incositent provider assignments
    233224 N POS
    234225 D INCON^SCMCTSK3
     
    240231 D EN1^DIP
    241232 Q
     233CHKENR(DATA,INFO) ;check if patient enrolled in teamposition clinic
     234 S DATA(0)=-1
     235 N I
     236 N POS,DFN S DFN=+$G(INFO) Q:'DFN  S POS=+$P($G(INFO),U,2) Q:'POS
     237 F I=0:0 S I=$O(^SCTM(404.57,POS,5,I)) Q:'I  D CECHK^SCRPPAT2(I,.CNAME,DFN) I $L(CNAME) S:DATA(0)=-1 DATA(0)="" S DATA(0)=DATA(0)_CNAME_"."
     238 I DATA(0)'=-1 S DATA(0)=$E(DATA(0),1,$L(DATA(0))-2)
     239 Q
    242240INACTDT(PA) ;Scheduled inactivation date.
    243241 D INACT^SCMCTSK3 Q
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCMCTSK2.m

    r628 r636  
    1 SCMCTSK2 ;ALB/JDS - PCMM Inactivation Nightly Job; 18 Apr 2003  9:36 AM ; 10/24/07 12:23pm  ; Compiled November 21, 2007 13:32:47  ; Compiled March 17, 2008 15:27:15
    2  ;;5.3;Scheduling;**297,498,527,499**;AUG 13, 1993;Build 21
    3  Q
    4 NIGHT ;
    5  N ENDDT,NOINAC,SIXM,FLGDT,L,PATDT,SEEN,SDDT
    6  D DT^DICRW S SDDT=$P($G(^XTMP("SCMCTSK2-"_DT,0)),U,2)
    7  I SDDT="" S SDDT=DT
    8  S ALPHA=$G(^SCTM(404.44,1,1)),ALPHA=$P(ALPHA,U,8) I ALPHA<SDDT S ALPHA=0
    9  ;if 'ALPHA NOINAC=1 except 15th and the Last Day of a Month (LDoM)
    10  ;inact only on 15th and on LDoM
    11  S NOINAC=0
    12  I 'ALPHA  S X1=SDDT,X2=1 D C^%DTC I ($E(SDDT,6,7)'=15)&($E(SDDT,1,5)=$E(X,1,5)) S NOINAC=1
    13  I 'ALPHA D INACTIVE^SCMCTSK1
     1SCMCTSK2 ;ALB/JDS - PCMM Inactivation Nightly Job; 18 Apr 2003  9:36 AM ; 10/24/07 12:23pm
     2 ;;5.3;Scheduling;**297,498,527**;AUG 13, 1993;Build 6
     3 Q
     4NIGHT ;nightly task for inact.
     5 N ENDDT,NOINAC,SIXM,FLGDT,L,PATDT,SEEN
     6 K ^TMP("SCTSK",$J)
     7 D DT^DICRW
     8 S ALPHA=$G(^SCTM(404.44,1,1)),ALPHA=$P(ALPHA,U,8) I ALPHA<DT S ALPHA=0
     9 ;check if this is last day of month
     10 S X1=DT,X2=1 D C^%DTC I $E(DT,1,5)'=$E(X,1,5) I 'ALPHA D INACTIVE^SCMCTSK1
    1411 S SIXM=$P($G(^SCTM(404.44,1,1)),U,9)
    1512 I SIXM D PRFLAG
    1613 I ALPHA D INACTIVE^SCMCTSK1
    17  ;determine ENDDT-Inactn Date-30 days if flagged today
    18  F DATE=0:0 S DATE=$O(^SCPT(404.43,"AFLG",DATE)) Q:'DATE  D
     14 S NOINAC=0 I 'ALPHA  S X1=DT,X2=1 D C^%DTC I ($E(DT,6,7)'=15)&($E(DT,1,5)=$E(X,1,5)) S NOINAC=1
     15 ;check for 60 days after flagged for inact.
     16 S X1=DT,X2=$S(ALPHA:-2,1:-30) D C^%DTC S ENDDT=X
     17 F DATE=0:0 S DATE=$O(^SCPT(404.43,"AFLG",DATE)) Q:(('DATE)!(('NOINAC)&(DATE>ENDDT)))  D
    1918 .F ENTRY=0:0 S ENTRY=$O(^SCPT(404.43,"AFLG",DATE,ENTRY)) Q:'ENTRY  D
    2019 ..S ZERO=$G(^SCPT(404.43,ENTRY,0)) Q:'ZERO
    2120 ..S DFN=+$G(^SCPT(404.42,+ZERO,0)) Q:'DFN
    2221 ..S POS=$P(ZERO,U,2)
    23  ..I $P(ZERO,U,4) D UNFLG Q  ;unass.
    24  ..S X1=DATE,X2=$S(ALPHA:+2,1:+30) D C^%DTC S ENDDT=X
    25  ..N SDASS S SDASS=$P(ZERO,U,3)
    26  ..;N-new or E-stbl.
    27  ..;assig >12 months since flagging, not NEW, E-stbl)
    28  ..N NEW
    29  ..S NEW=0 S X1=DATE,X2=SDASS D ^%DTC I X<365 S NEW=1
    30  ..I NEW S %DT="",X="T-12M" D ^%DT S STDT=+Y D
    31  ...S X1=STDT,X2=-7 D C^%DTC S TYDT=X
    32  ..I 'NEW S %DT="",X="T-24M" D ^%DT S STDT=+Y D
    33  ...S X1=STDT,X2=-7 D C^%DTC S TYDT=X
    34  ..;
    35  ..I $P(ZERO,U,17) D UNFLG Q  ;react.
    36  ..;get prec
    37  ..;S %DT="",X="T-12M" D ^%DT S STDT=+Y
    38  ..;S PREC=$$DATES^SCAPMCU1(404.53,+POS),PREC=$S(PREC:$P($G(^SCTM(404.53,+$P(PREC,U,4),0)),U,6),1:+POS)
    39  ..I '$P(ZERO,U,5) D UNFLG Q  ;Not PC
    40  ..D SEEN^SCMCTSK1(DFN,POS,TYDT,SDDT,.PROV,.PRECP,.SEEN)
    41  ..;S PC=$$GET^XUA4A72(+PROV)
    42  ..I SEEN D UNFLG Q
    43  ..I $P(ZERO,U,13) S X1=DATE,X2=$S(ALPHA:4,1:90) D C^%DTC S FLGDT=X I FLGDT>SDDT Q  ;do not inactivate yet; extended
    44  ..I ('NOINAC)&(SDDT'<ENDDT) D DIS^SCMCTSK1
    45  ;flag prov 6m after install sd/297
    46  I NOINAC D:ALPHA BULL I '$D(^SCPT(404.43,"AFLG",SDDT)) K ^TMP($J,"SCMCTSK2") Q
    47  ;flag prov 6m after install sd/297
    48  I SIXM,SIXM'>SDDT D
     22 ..I $P(ZERO,U,4) D UNFLG Q  ;already unassigned
     23 ..I $P(ZERO,U,13) S X1=DATE,X2=$S(ALPHA:4,1:90) D C^%DTC S FLGDT=X I FLGDT>DT Q    ;ext
     24 ..;check if criteria still met
     25 ..I $P(ZERO,U,17) D UNFLG Q  ;Already reactivated
     26 ..;get preceptor position
     27 ..S %DT="",X="T-12M" D ^%DT S STDT=+Y
     28 ..S PREC=$$DATES^SCAPMCU1(404.53,+POS),PREC=$S(PREC:$P($G(^SCTM(404.53,+$P(PREC,U,4),0)),U,6),1:+POS)
     29 ..;see if provider changed
     30 ..I $O(^SCTM(404.52,"AIDT",+PREC,1,-STDT),-1) D UNFLG Q
     31 ..I '$P(ZERO,U,5) D UNFLG Q  ;Not primary care
     32 ..S PROV=+$$GETPRTP^SCAPMCU2(POS,DT)
     33 ..S PC=$$GET^XUA4A72(+PROV)
     34 ..S SC297=$$PDAT^SCMCGU("SD*5.3*297")
     35 ..N NEW S NEW=$S($P(ZERO,U,3)<SC297:0,1:1)   ;D D^%DTC S NEW=$S(X>330:0,1:1)
     36 ..S X1=DT,X2=SC297 D D^%DTC S SC297=X
     37 ..S X="T-"_$S(SC297>365:"11M",NEW:"11M",1:"23M") D ^%DT S TYDT=+Y D SEEN^SCMCTSK1 I $G(SEEN) D UNFLG Q
     38 ..S X="T-"_$S(SC297>365:"12M",NEW:"12M",1:"24M") D ^%DT S TYDT=+Y D SEEN^SCMCTSK1 I $G(SEEN) D:(DATE>ENDDT) UNFLG Q
     39 ..I ('NOINAC)&(DATE'>ENDDT) D DIS^SCMCTSK1
     40 ..;D MSG(POS,DFN)
     41 ;if 6 months after installation check to flag providers
     42 I NOINAC D:ALPHA BULL Q
     43 S PATDT=$$PDAT^SCMCGU("SD*5.3*297") Q:'PATDT
     44 I SIXM,SIXM'>DT D
    4945 .D PRINAC
    5046 .N FLDA
    5147 .S FLDA(404.44,"1,",19)=""
    5248 .D FILE^DIE("I","FLDA","ERR")
    53  D BULL K ^TMP($J,"SCMCTSK2")
    54  Q
    55 UNFLG ;Unflagging
     49 D BULL
     50 Q
     51UNFLG ;Remove the flag
    5652 N DR,DIE,DA
    5753 S DR=".15///@;.13///@;.12///@",DIE="^SCPT(404.43,",DA=ENTRY D ^DIE
    5854 Q
    59 PRFLAG ;flag incorrect provider pos
     55PRFLAG ;flag incorrect provider positions
    6056 N POS
    61  ;prov inact. has run once
     57 ;provider inactivation has run once
    6258 I $P($G(^SCTM(404.44,1,1)),U,11)'="" Q
    6359 D PRFLAG^SCMCTSK3
    6460 Q
    65 PRINAC ;inact. flagged providers
     61PRINAC ;inactivate flagged providers
    6662 N I,II
    67  ;Prov inact. run already
    68  I $G(SDDT)="" S SDDT=DT
    69  S II=$P($G(^SCTM(404.44,1,1)),U,11) I II'="",II'=SDDT Q
     63 ;Provider inactivation run already
     64 S II=$P($G(^SCTM(404.44,1,1)),U,11) I II'="",II'=DT Q
    7065 F I=0:0 S I=$O(^SCTM(404.52,I)) Q:'I  S ZERO=$G(^(I,0)) I $P(ZERO,U,10) D
    7166 .;I $P(ZERO,U,10)>$G(ENDT) Q   ;not time yet
    72  .I $O(^SCTM(404.52,"AIDT",+ZERO,0,-9999999))<(-$P(ZERO,U,2)) Q   ;inactivated
    73  .;Check valid criteria
     67 .I $O(^SCTM(404.52,"AIDT",+ZERO,0,-9999999))<(-$P(ZERO,U,2)) Q   ;already inactivated
     68 .;Check if criteria still valid
    7469 .S POS=+ZERO
    75  .S PROV=+$$GETPRTP^SCAPMCU2(POS,SDDT)
     70 .S PROV=+$$GETPRTP^SCAPMCU2(POS,DT)
    7671 .S PC=$$GET^XUA4A72(+PROV)
    7772 .S DR=".091///@",DIE="^SCTM(404.52,",DA=I D ^DIE  ;remove flag
    7873 .S ZERO1=$G(^SCTM(404.57,POS,0))
    7974 .I '$D(^SD(403.46,+$P(ZERO1,U,3),2,+PC)) D
    80  ..;inactivation
    81  ..S DIC="^SCTM(404.52,",X=+ZERO,DIC("DR")=".02////"_SDDT_";.03////"_$P(ZERO,U,3)_";.04////0;.05///EMPLOYEE LEAVES POSITION;.11////1"
     75 ..;enter the inactivation
     76 ..S DIC="^SCTM(404.52,",X=+ZERO,DIC("DR")=".02////"_DT_";.03////"_$P(ZERO,U,3)_";.04////0;.05///EMPLOYEE LEAVES POSITION;.11////1"
    8277 ..S DIC(0)="LM" D ^DIC
    83  ;only run inact. once
    84  S $P(^SCTM(404.44,1,1),U,11)=SDDT
    85  Q
    86 FUTAPP(DFN) ;print future appts
     78 ;only run the inactivation once.
     79 S $P(^SCTM(404.44,1,1),U,11)=DT
     80 Q
     81FUTAPP(DFN) ;print future appointments
    8782 N TAB,SCDT0 S TAB=$X
    88  I $G(SDDT)="" S SDDT=DT
    89  S SCDT=SDDT+.24
     83 S SCDT=DT+.24
    9084 F  S SCDT=$O(^DPT(DFN,"S",SCDT)) Q:'SCDT  D
    9185 . S SCDT0=$G(^DPT(DFN,"S",SCDT,0)) Q:$L($P(SCDT0,U,2))
     
    9387 . S Y=SCDT X ^DD("DD") W $E(Y_" ",1,17)_" "_$E($P($G(^SC(+CLIEN,0)),U),1,10)
    9488 Q
    95 GETASC(DATA,ENTRY) ;get assoc. clinics
     89GETASC(DATA,ENTRY) ;get associated clinics
    9690 N I,CNT S CNT=0
    9791 F I=0:0 S I=$O(^SCTM(404.57,+$G(ENTRY),5,I)) Q:'I  S CNT=CNT+1,DATA(CNT)=I_U_$P($G(^SC(I,0)),U)
    9892 Q
    99 SETASC(RESULT,DATA) ;set assoc. clinics
     93SETASC(RESULT,DATA) ;set associated clinics
    10094 D SETASC^SCMCTSK7(.RESULT,DATA) Q
    101 MSG(SCTP,DFN) ;send inact. message
    102  ;given valid positions get current practitioners
     95MSG(SCTP,DFN) ;send inactivation message
     96         ;given list of valid positions get current practitioners
    10397 S SCLIST="SCL"
    104  I $G(SDDT)="" S SDDT=DT
    10598 I "N"'[$P($G(^SCTM(404.57,SCTP,2)),U,9) D
    10699 .S SCOK=$$PRTP^SCAPMC(SCTP,"",.SCLIST,.SCERR)
    107100 .;if preceptor notice turned on for message type
    108101 I +$P($G(^SCTM(404.57,SCTP,2)),U,9) D
    109  .S SCX=+$$OKPREC2^SCMCLK(SCTP,SDDT)
     102 .S SCX=+$$OKPREC2^SCMCLK(SCTP,DT)
    110103 .;if preceptor duz returned, add to array
    111104 .I SCX S @SCLIST@("SCPR",SCX)=""
    112105 N XMY F I=0:0 S I=$O(@SCLIST@("SCPR",I)) Q:'I  S XMY(I)=""
    113  S SCTEXT(1,0)="PATIENT "_$P($G(^DPT(DFN,0)),U)_" has been inactivated from PC team position "_$P($G(^SCTM(404.57,SCTP,0)),U)
     106 S SCTEXT(1,0)="PATIENT "_$P($G(^DPT(DFN,0)),U)_" has been inactivated from primary care team position "_$P($G(^SCTM(404.57,SCTP,0)),U)
    114107 S XMSUB="Provider's Inactivated Primary Care Patients" D ^XMD
    115108 Q
    116 BULL ;EOM Bulletin
     109BULL ;end of Month Bulletin
    117110 N DISUPNO,BY,DHIT,HEAD
    118111 S DISUPNO=1,L=0
    119  S XMSUB="Patients Scheduled for Inactivation from PC Panel"
     112 S XMSUB="Patients Scheduled for Inactivation from Primary Care Panel"
    120113 S XMY("G.PCMM PATIENT/PROVIDER INACTIVE")=""
    121114 K ^TMP("SCMC",$J),^TMP("SCMCTXT",$J),^TMP("SCML",$J)
     
    130123 .K XMY S XMY(SCI)="" K ^TMP("SCMC",$J),^TMP("SCMCTXT",$J)
    131124 .M ^TMP("SCMC",$J)=^TMP("SCF",$J,SCI)
    132  .S XMSUB="Patients Scheduled for Inactivation from PC Panel"
     125 .S XMSUB="Patients Scheduled for Inactivation from Primary Care Panel"
    133126 .S XMTEXT="^TMP(""SCMCTXT"",$J,"
     127 .;D LINES(1) D ^XMD
    134128 S DISUPNO=1
    135129 K ^TMP("SCMC",$J),^TMP("SCMCTXT")
    136  I $G(NOINAC) K ^TMP($J,"SCMCTSK2") Q  ; SD/499
    137130 S XMSUB="Patients With Extended PCMM Inactivation Dates"
    138131 S XMY("G.PCMM PATIENT/PROVIDER INACTIVE")=""
     
    147140 S DISUPNO=1
    148141 K ^TMP("SCMC",$J),^TMP("SCMCTXT")
    149  S XMSUB="Patients Automated Inactivations from PC Panels"
     142 S XMSUB="Patients Automated Inactivations from Primary Care Panels"
    150143 S XMY("G.PCMM PATIENT/PROVIDER INACTIVE")=""
    151144 K ^TMP("SCMC",$J)
     
    160153 K ^TMP("SCMC",$J),^TMP("SCMCTXT")
    161154 I $P($G(^SCTM(404.44,1,1)),U,11)="" D
    162  . S XMSUB="PC Providers Scheduled for Inactivation"
     155 . S XMSUB="Primary Care Providers Scheduled for Inactivation"
    163156 . S XMY("G.PCMM PATIENT/PROVIDER INACTIVE")=""
    164157 . K ^TMP("SCMC",$J)
     
    189182INRPT  ; REPORT
    190183 N DIOEND,SCDHD
    191  D PROMPT^SCMCTSK3("** Date Range Selection **","DATE PATIENTS INACTIVATED FROM PC PANELS")
     184 D PROMPT^SCMCTSK3("**** Date Range Selection ****","DATE PATIENTS INACTIVATED FROM PRIMARY CARE PANELS")
    192185 Q:'$D(^TMP("SC",$J,"XR"))
    193186 D UNASSIGN^SCMCTSK3
     
    201194 D EN1^DIP
    202195 Q
    203 IN30 ;inact. last month
    204  N DIPA,SDD D SORT^SCMCTSK1(.DIPA,.SDD) Q:'SDD  ;SD/499
     196IN30 ;inactivated last month
     197 D SORT^SCMCTSK1 Q:'X
    205198 S Q=""""
    206199 S DIC="^SCPT(404.43,",L=0,BY="[SCMC INACTIVATION SORT]"
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCMCTSK3.m

    r628 r636  
    1 SCMCTSK3 ;ALB/JDS - PCMM Inactivation Reports ; 7/19/05 10:06am  ; Compiled June 7, 2007 13:57:55  ; Compiled February 12, 2008 11:46:47
    2  ;;5.3;Scheduling;**297,499**;AUG 13, 1993;Build 21
     1SCMCTSK3 ;ALB/JDS - PCMM Inactivation Reports ; 7/19/05 10:06am
     2 ;;5.3;Scheduling;**297**;AUG 13, 1993
    33 Q
    44SORTP  ;sort template
     
    7878 .D SUBT^SCRPW50(DATESORT)
    7979 .S SCBDT("B")="T-30",SCEDT("B")="TODAY"
    80  .I (DATESORT["Scheduled Ina")!(DATESORT["Scheduled for Inactivation") S SCEDT("B")="T+60"
     80 .I (DATESORT["Scheduled Ina")!(DATESORT["Scheduled for Inactivation") S SCEDT("B")="T+30"
    8181 S LIST="DIV,TEAM,POS,ASPR"
    8282 ;D SUBT^SCRPW50("**** Date Range Selection ****")
     
    210210 .I '$D(^SD(403.46,+$P(ZERO,U,3),2,+PC)) S ^TMP("SCMCTSK",$J,POSH)="Person Class is not valid for this role"
    211211 F POS=0:0 S POS=$O(^TMP("SCMCTSK",$J,POS)) Q:'POS  S FLDA(404.52,POS_",",.091)=DT
    212 VERPR ;verify already flagged positions; SD/499 replaced "AFLG" with "AFLAG"
    213  N II,POSH S II="" F  S II=$O(^SCTM(404.52,"AFLAG",II)) Q:'II  S POSH=""  F  S POSH=$O(^SCTM(404.52,"AFLAG",II,POSH)) Q:'POSH  D
    214  .N ZERO,ZEROTP S ZERO=$G(^SCTM(404.52,POSH,0))
     212 F I=0:0 S I=$O(^SCTM(404.52,"AFLG",I)) Q:'I  F POSH=0:0 S POSH=$O(^SCTM(404.52,"AFLG",I,POSH)) Q:'POSH  D
     213 .N ZERO S ZERO=$G(^SCTM(404.52,POSH,0))
    215214 .I '$P(ZERO,U,4) S FLDA(404.52,POSH_",",.091)="" Q
    216  .;SD/499; added verification of the POSSIBLE PRIMARY PRACTITIONER field
    217  .;in the TEAM POSITION file
    218  .N TP S TP=$P(ZERO,U) S ZEROTP=$G(^SCTM(404.57,TP,0))
    219  .I '$P(ZEROTP,U,4) S FLDA(404.52,POSH_",",.091)="" Q
    220215 .I (-$O(^SCTM(404.52,"AIDT",+ZERO,0,-9999999)))>$P(ZERO,U,2) S FLDA(404.52,POSH_",",.091)=""
    221216 I $O(FLDA(0)) D FILE^DIE("I","FLDA","ERR")
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCMCTSK4.m

    r628 r636  
    11SCMCTSK4 ;ALB/JDS - PCMM Inactivation Reports ; 18 Apr 2003  9:36 AM
    2  ;;5.3;Scheduling;**297,526**;AUG 13, 1993;Build 8
     2 ;;5.3;Scheduling;**297**;AUG 13, 1993
    33 Q
    44POSCHK ;
     
    3030 W !,"   Field Name              Explanation of field name"
    3131 W !,"   Patient Name            Name of patient scheduled to be inactivated from their primary care team and position/provider"
    32  W !,"   SSN                     Patient SSN."
     32 W !,"   SSN                     Patient's last 4 Social Security numbers."
    3333 W !,"   PC Team                 Patient's assigned Primary Care team in PCMM."
    3434 W !,"   Provider                Name of primary care practitioner/provider currently assigned to the patient.  This will be an"
     
    5656 W !,"  Field Name              Explanation of field name"
    5757 W !,"  Patient Name            Name of patient scheduled to be inactivated from their primary care team and position/provider."
    58  W !,"  SSN                     Patient SSN."
     58 W !,"  SSN                     Patient's last 4 SSN numbers."
    5959 W !,"  Institution             Institution name, previously called Division, in which patient receives primary care."
    6060 W !,"  PC Team                 Patient's assigned Primary Care team in PCMM."
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCMCTSK9.m

    r628 r636  
    11SCMCTSK9 ;;BP/DMR - PCMM ; 18 Apr 2003  9:36 AM
    2  ;;5.3;Scheduling;**297,526**;AUG 13, 1993;Build 8
     2 ;;5.3;Scheduling;**297**;AUG 13, 1993
    33 Q
    44EXTKEY ;
     
    1010 W !
    1111 W !,"Patient Name          Name of patient scheduled to be inactivated from their primary care team and position/provider."
    12  W !,"SSN                   SSN number."
     12 W !,"SSN                   Patient's last 4 SSN numbers."
    1313 W !,"Institution           Institution name, previously called Division, in which patient receives primary care."
    1414 W !,"PC Team               The patient's assigned Primary Care team in PCMM."
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCMCYPC.m

    r628 r636  
    1 SCMCYPC ; GENERATED FROM 'SCMC DIRECT PC FTEE' PRINT TEMPLATE (#1320) ; 12/27/06 ; (FILE 404.52, MARGIN=132)
     1SCMCYPC ; GENERATED FROM 'SCMC DIRECT PC FTEE' PRINT TEMPLATE (#1320) ; 12/25/06 ; (FILE 404.52, MARGIN=132)
    22 G BEGIN
    33CP G CP^DIO2
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCMSVUT2.m

    r628 r636  
    11SCMSVUT2 ;ALB/JLU;Utility routine for AMBCARE;06/28/99
    2  ;;5.3;Scheduling;**66,180,254,293,325,466,521**;AUG 13,1993;Build 1
     2 ;;5.3;Scheduling;**66,180,254,293,325,466**;AUG 13,1993;Build 2
    33 ;06/28/99 ACS Added CPT modifier validation
    44 ;
     
    195195 I STDT="" Q 0
    196196 S STDT=$$FMDATE^HLFNC(STDT)
    197  S X=STDT,%DT="X" D ^%DT I Y=-1 Q 0  ;SD/521 added %DT
     197 S X=STDT D ^%DT I Y=-1 Q 0
    198198 I ENDT="" Q 1
    199199 S ENDT=$$FMDATE^HLFNC(ENDT)
    200  S X=ENDT,%DT="X" D ^%DT I Y=-1 Q 0  ;SD/521 added %DT
     200 S X=ENDT D ^%DT I Y=-1 Q 0
    201201 I $$FMDIFF^XLFDT(ENDT,STDT,1)<0 Q 0
    202202 Q 1
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCRPBK11.m

    r628 r636  
    11SCRPBK11 ;MJK/ALB - RPC Broker Utilities ; 27 FEB 96
    2  ;;5.3;Scheduling;**41,520**;AUG 13, 1993;Build 26
     2 ;;5.3;Scheduling;**41**;AUG 13, 1993
    33 ;
    44GETSEL(SCDATA,SCTYPE,SCIEN) ;
     
    8383 D SET("    Division: "_$S($G(SC(SCFLE,SCIEN,3.5))]"":SC(SCFLE,SCIEN,3.5),1:SCDEF),.SCINC,.SCDATA)
    8484 D SET(" ",.SCINC,.SCDATA)
    85  D SET("Associated Teams and Positions:",.SCINC,.SCDATA)
     85 D SET("Assoicated Teams and Positions:",.SCINC,.SCDATA)
    8686 D SET("-------------------------------",.SCINC,.SCDATA)
    87  S SCI=0 F  S SCI=$O(^SCTM(404.57,"E",SCID,SCI)) Q:'SCI  D
     87 S SCI=0 F  S SCI=$O(^SCTM(404.57,"D",SCID,SCI)) Q:'SCI  D
    8888 . S X=$G(^SCTM(404.57,SCI,0))
    8989 . D SET("      Team: "_$P($G(^SCTM(404.51,+$P(X,U,2),0)),U),.SCINC,.SCDATA)
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCRPEC.m

    r628 r636  
    11SCRPEC ;ALB/CMM - Detail List of Pts & Enroll Clinics ; 29 Jun 99  04:11PM
    2  ;;5.3;Scheduling;**41,140,174,177,431,526,520**;AUG 13, 1993;Build 26
     2 ;;5.3;Scheduling;**41,140,174,177,431**;AUG 13, 1993
    33 ;
    44 ;Detailed Listing of Patients and Their Enrolled Clinics Report
     
    8080 Q
    8181 ;
    82 PDATA(DFN,CLNEN,CNAME,FLAG) ;
     82PDATA(DFN,CLNEN,FLAG) ;
    8383 ;Collect and format data for report
    8484 ;
    85  N NODE,NAME,PID,PELIG,MT,PSTAT,STATD,DATA,LAST,NEXT
     85 N NODE,NAME,PID,PELIG,MT,PSTAT,STATD,DATA,LAST,NEXT,CEN,CNAME
    8686 S DATA=""
    8787 S NODE=$G(^DPT(DFN,0))
     
    9090 S MT=$$LST^DGMTU(DFN),MT=$P(MT,"^",4)  ;means test status SD*5.3*431
    9191 S PELIG=$$ELIG^SCRPU3(DFN) ;primary eligibility
    92  S PSTAT="N/A"
    93  S STATD=""
    94  S LAST=$$GETLAST^SCRPU3(DFN,.CLNEN) ;last Clinic appointment
    95  S NEXT=$$GETNEXT^SCRPU3(DFN,.CLNEN) ;next clinic appointment
    96  ;I '$D(FLAG) S DATA=$$FORMAT^SCRPEC2(PTIEN,INS,TIEN,PDATA,CNAME,CIEN)
    97  I '$D(FLAG) S DATA=$$FORMAT^SCRPEC2(NAME,PID,MT,PELIG,PSTAT,STATD,LAST,NEXT,CNAME),DATA=$E(NAME,1,12)_"^"_DATA
    98  I $D(FLAG) S DATA=$E(NAME,1,12)_"^"_PID_"^"_MT_"^"_PELIG_"^"_PSTAT_"^"_STATD_"^"_LAST_"^"_NEXT
     92 ;
     93 S CNAME=$P($G(^SC(CLNEN,0)),"^")
     94 S CEN=+$O(^DPT(DFN,"DE","B",CLNEN,""))
     95 S NODE=$G(^DPT(DFN,"DE",CEN,1,1,0))
     96 S PSTAT=$P(NODE,"^",2) S PSTAT=PSTAT_$S(PSTAT="A":"C",PSTAT="O":"PT",1:"") ;opt or ac status
     97 I $P(NODE,"^")="" S STATD=""
     98 I $P(NODE,"^")'="" S STATD=$TR($$FMTE^XLFDT($P(NODE,"^"),"5DF")," ","0") ;enrollment date
     99 S LAST=$$GETLAST^SCRPU3(DFN,CLNEN) ;last clinic appointment
     100 S NEXT=$$GETNEXT^SCRPU3(DFN,CLNEN) ;next clinic appointment
     101 I '$D(FLAG) S DATA=$$FORMAT^SCRPEC2(NAME,PID,MT,PELIG,PSTAT,STATD,LAST,NEXT,CNAME),DATA=$E(NAME,1,20)_"^"_DATA
     102 I $D(FLAG) S DATA=$E(NAME,1,20)_"^"_PID_"^"_MT_"^"_PELIG_"^"_PSTAT_"^"_STATD_"^"_LAST_"^"_NEXT
    99103 Q DATA
    100104 ;
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCRPEC2.m

    r628 r636  
    11SCRPEC2 ;ALB/CMM - Detail List of Pts & Enroll Clinics Continued ; 29 Jun 99  04:11PM
    2  ;;5.3;Scheduling;**41,140,174,177,526**;AUG 13, 1993;Build 8
     2 ;;5.3;Scheduling;**41,140,174,177**;AUG 13, 1993
    33 ;
    44 ;Detailed Listing of Patients and Their Enrolled Clinics Report
     
    106106 S HLD="H1"
    107107 S @STORE@("SUBHEADER",HLD)="Patient Name"
    108  S $E(@STORE@("SUBHEADER",HLD),16)="Pt ID"
     108 S $E(@STORE@("SUBHEADER",HLD),18)="Pt ID"
    109109 S $E(@STORE@("SUBHEADER",HLD),25)="Stat"
    110110 S $E(@STORE@("SUBHEADER",HLD),31)="Elig"
     
    129129 ;CIEN - clinic ien
    130130 ;
    131  S @STORE@(INS,TIEN,CIEN,PTIEN)=$E($P(PDATA,"^"),1,12) ;patient name
    132  S $E(@STORE@(INS,TIEN,CIEN,PTIEN),14)=$P(PDATA,"^",2) ;primary long id 9 digit
    133  S $E(@STORE@(INS,TIEN,CIEN,PTIEN),26)=$P(PDATA,"^",3) ;means test category
     131 S @STORE@(INS,TIEN,CIEN,PTIEN)=$E($P(PDATA,"^"),1,15) ;patient name
     132 S $E(@STORE@(INS,TIEN,CIEN,PTIEN),18)=$E($P(PDATA,"^",2),6,10) ;primary long id last 4 plus P
     133 S $E(@STORE@(INS,TIEN,CIEN,PTIEN),25)=$P(PDATA,"^",3) ;means test category
    134134 S $E(@STORE@(INS,TIEN,CIEN,PTIEN),31)=$P(PDATA,"^",4) ;primary eligibility
    135135 ;Removed by patch 174
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCRPITP.m

    r628 r636  
    11SCRPITP ;ALB/CMM - Individual Team Profile ; 29 Jun 99  04:11PM
    2  ;;5.3;Scheduling;**41,52,177,520**;AUG 13, 1993;Build 26
     2 ;;5.3;Scheduling;**41,52,177**;AUG 13, 1993
    33 ;
    44 ;Individual Team Profile
     
    105105 ;
    106106PRINTIT(STORE,TITL) ;
    107  N INST,EINST,ETEAM,TEM,NEW,PAGE,TNAME,TIEN,EN,SUB,POS,CIEN,INF,ACL
     107 N INST,EINST,ETEAM,TEM,NEW,PAGE,TNAME,TIEN,EN,SUB,POS,CIEN,INF
    108108 S (INST,EINST)="",STOP=0,(PAGE,NEW)=1 W:$E(IOST)="C" @IOF
    109109 D FORHEAD^SCRPITP2
     
    136136 ..I $Y<IOSL-10 D COLUMN^SCRPITP2
    137137 ..F  S POS=$O(@STORE@(INST,TIEN,"P",POS)) Q:POS=""!(STOP)  D
     138 ...I IOST'?1"C-".E,$Y>(IOSL-5) D NEWP1^SCRPU3(.PAGE,TITL,132) Q:STOP  D CONT^SCRPITP2
     139 ...I IOST?1"C-".E,$Y>(IOSL-5) D HOLD^SCRPU3(.PAGE,TITL,132) Q:STOP  D CONT^SCRPITP2
     140 ...I STOP Q
    138141 ...W !,$G(@STORE@(INST,TIEN,"P",POS))
    139  ...S ACL=""
    140  ...F  S ACL=$O(@STORE@(INST,TIEN,"P",POS,ACL)) Q:ACL=""!(STOP)  D
    141  ....W !,$G(@STORE@(INST,TIEN,"P",POS,ACL))
    142  ....I IOST'?1"C-".E,$Y>(IOSL-5) D NEWP1^SCRPU3(.PAGE,TITL,132) Q:STOP  D CONT^SCRPITP2
    143  ....I IOST?1"C-".E,$Y>(IOSL-5) D HOLD^SCRPU3(.PAGE,TITL,132) Q:STOP  D CONT^SCRPITP2
    144  ....I STOP Q
    145  ...;W !,$G(@STORE@(INST,TIEN,"P",POS))
    146  ...;W !,$G(@STORE@(INST,TIEN,"P",POS,ACL))
    147  ...W !
     142 ..W !
    148143 I 'STOP,$E(IOST)="C" N DIR S DIR(0)="E" W ! D ^DIR
    149144 Q
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCRPITP2.m

    r628 r636  
    11SCRPITP2 ;ALB/CMM - Individual Team Profile Continued ;7/25/99  18:24
    2  ;;5.3;Scheduling;**41,177,520**;AUG 13, 1993;Build 26
     2 ;;5.3;Scheduling;**41,177**;AUG 13, 1993
    33 ;
    44 ;Individual Team Profile
     
    1616 S POS=$P(TNODE,"^") ;position name
    1717 S ROL=$P($G(^SD(403.46,+$P(TNODE,"^",3),0)),"^") ;standard position
    18  S PPC=$S($P(TNODE,"^",4)'=1:"NPC",+$$OKPREC3^SCMCLK(TPOS,DT)>0:" AP",1:"PCP") ;primary care position
     18 S PPC=$S($P(TNODE,"^",4)'=1:"NPC",+$$OKPREC3^SCMCLK(TPOS,DT)>1:" AP",1:"PCP") ;primary care position
    1919 S MAX=$P(TNODE,"^",8)
    2020 ;
     
    2424 S SCPTASS=$$PCPOSCNT^SCAPMCU1(TPOS,DT,0)
    2525 ;
    26  ;D FORMAT(POS,PPC,MAX,DIV,TM,TPOS,ROL,SCPROV,SCPTASS)
     26 S CIEN=+$P(TNODE,"^",9) ;clinic ien
     27 S PCLIN=""
     28 I CIEN>0 S PCLIN=$P($G(^SC(CIEN,0)),"^") ;associated clinic
    2729 ;
    28  D SETASCL^SCRPRAC2(TPOS,.CNAME,.CLIEN)
    29  S CNAME=$G(CNAME(0))
    30  ;S CIEN=+$P(TNODE,"^",9) ;clinic ien ;USING MULTIPLE WITH SD*5.3*520
    31  ;S PCLIN=""
    32  ;I CIEN>0 S PCLIN=$P($G(^SC(CIEN,0)),"^") ;associated clinic
     30 D FORMAT(POS,PPC,MAX,DIV,TM,TPOS,ROL,PCLIN,SCPROV,SCPTASS)
    3331 ;
    34  D FORMAT(POS,PPC,MAX,DIV,TM,TPOS,ROL,CNAME,SCPROV,SCPTASS)
    35  N AC
    36  S AC=0
    37  F  S AC=$O(CNAME(AC)) Q:AC=""  D FORMATAC(POS,DIV,TM,TPOS,CNAME(AC))
    38  K CNAME
    3932 Q
    4033 ;
     
    10194 S $E(@STORE@(DIV,TM,"P",POS),82)=$J(MAX,6,0) ;number of patients allowed
    10295 S $E(@STORE@(DIV,TM,"P",POS),92)=$J(SCPTASS,6,0) ;patients assigned
    103  S $E(@STORE@(DIV,TM,"P",POS),103)=$E(CNAME,1,30)
    104  Q
    105  ;
    106 FORMATAC(POS,DIV,TM,TPOS,CNAME) ;clinic name
    107  S $E(@STORE@(DIV,TM,"P",POS,AC),103)=$E(CNAME,1,30)
     96 S $E(@STORE@(DIV,TM,"P",POS),103)=$E(CNAME,1,30) ;clinic name
    10897 Q
    10998 ;
  • 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
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCRPPAT3.m

    r628 r636  
    11SCRPPAT3 ;ALB/CMM - Practitioner's Patients ; 8/30/99 3:14pm
    2  ;;5.3;Scheduling;**41,52,148,174,181,177,297,526,520**;AUG 13, 1993;Build 26
     2 ;;5.3;Scheduling;**41,52,148,174,181,177,297**;AUG 13, 1993
    33 ;
    44 ;Listing of Practitioner's Patients
     
    1212 .S PT=0
    1313 .F  S PT=$O(@STORE@("PT",INS,SEC,TRD,POS,PTN,PT)) Q:'PT!(STOP)  D
     14 ..I (IOST'?1"C-".E),$Y>(IOSL-5) S MORE=0 D NEWP1^SCRPU3(.PAGE,TITL) D:'STOP HEAD2(INS,SEC,TRD,SEC3,ST3,ST4,POS) D:(('FIRST&'STOP)!($G(SORT)=3)) HEADER
     15 ..I (IOST?1"C-".E),$Y>(IOSL-5) S MORE=0 D HOLD^SCRPU3(.PAGE,TITL) D:'STOP HEAD2(INS,SEC,TRD,SEC3,ST3,ST4,POS) D:'FIRST&'STOP HEADER
     16 ..Q:STOP
    1417 ..I FIRST D HEADER S FIRST=0
    1518 ..W !,$G(@STORE@(INS,SEC,TRD,POS,PT)) ;print patient detail line
    16  ..;I FIRST D HEADER S FIRST=0
    17  ..N SCCN
    18  ..S SCCN=""
    19  ..F  S SCCN=$O(@STORE@(INS,SEC,TRD,POS,PT,SCCN)) Q:SCCN=""  D
    20  ...W !,$G(@STORE@(INS,SEC,TRD,POS,PT,SCCN)) ;print patient detail line
    21  ...I (IOST'?1"C-".E),$Y>(IOSL-5) S MORE=0 D NEWP1^SCRPU3(.PAGE,TITL) D:'STOP HEAD2(INS,SEC,TRD,SEC3,ST3,ST4,POS) D:(('FIRST&'STOP)!($G(SORT)=3)) HEADER
    22  ...I (IOST?1"C-".E),$Y>(IOSL-5) S MORE=0 D HOLD^SCRPU3(.PAGE,TITL) D:'STOP HEAD2(INS,SEC,TRD,SEC3,ST3,ST4,POS) D:'FIRST&'STOP HEADER
    23  ...Q:STOP
    24  ...;I FIRST D HEADER S FIRST=0
    25  ...Q
    2619 ..Q
    2720 .Q
     
    7467SHEAD ;
    7568 S @STORE@("H2")="Pt Name"
    76  S $E(@STORE@("H2"),15)="Pt ID"
     69 S $E(@STORE@("H2"),18)="Pt ID"
    7770 S $E(@STORE@("H1"),25)="M.T."
    7871 S $E(@STORE@("H2"),25)="Stat"
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCRPRAC2.m

    r628 r636  
    11SCRPRAC2 ;ALB/CMM - Practitioner Demographics continued ; 29 Jun 99  04:11PM
    2  ;;5.3;Scheduling;**41,177,520**;AUG 13, 1993;Build 26
     2 ;;5.3;Scheduling;**41,177**;AUG 13, 1993
    33 ;
    44 ;Practitioner Demographics Report
     
    4040 .S MAX=$P(NODE,"^",8) ;max patient assignments to position
    4141 .S ASSIGN=+$$PCPOSCNT^SCAPMCU1(PIEN,DT,0) ;assigned patients
    42  .N CNAME,SCCLIEN
    43  .D SETASCL(PIEN,.CNAME,.SCCLIEN) ;associated clinics
     42 .S CNAME=$P($G(^SC(+$P(NODE,U,9),0)),U) ;associated clinic
    4443 .;
    4544 .;Get preceptor
     
    5756 .D SET1("Phone",PHONE),SET2("Pts. Assigned",ASSIGN)
    5857 .I $L($G(PRCP)) D SET3(1,"Preceptor: "_PRCP)
    59  .D SET3(4,"Assoc. Clinic: ")
    60  .D SETCNAME(.CNAME)
     58 .D SET3(4,"Assoc.")
     59 .D SET3(4,"Clinic: "_CNAME)
    6160 .I $L(PCLASS(1)) D
    6261 ..D SET3(4,"Person"),SET3(5,"Class: "_PCLASS(1)) D
     
    8382 Q
    8483 ;
    85 SETASCL(PIEN,CNAME,SCCLIEN) ;SET ASSOCIATED CLINICS
    86  N I,CNT1
    87  S CNT1=0,I=0
    88  F  S I=$O(^SCTM(404.57,PIEN,5,I)) Q:'I  D
    89  .S SCCLIEN(CNT1)=I,CNAME(CNT1)=$P($G(^SC(I,0)),U),CNT1=CNT1+1
    90  Q
    9184SET1(LABEL,VALUE) ;Set output line
    9285 S SCLN=SCLN+1
     
    109102 Q
    110103 ;
    111 SETCNAME(CNAME) ;associated clinics
    112  N A
    113  S A="" F  S A=$O(CNAME(A)) Q:A=""  D SET3(12,CNAME(A))
    114  Q
    115  ;
    116104PINFO(VAE,PRACT,OPH,ROOM,SERV) ;
    117  ;practitioner information from new person file
     105 ;practitioner information form new person file
    118106 S PRACT=$P($G(^VA(200,VAE,0)),"^") ;practitioner name
    119107 S OPH=$P($G(^VA(200,VAE,.13)),"^",2) ;office phone
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCRPSLT.m

    r628 r636  
    11SCRPSLT ;ALB/CMM - Summary Listing of Teams ; 29 Jun 99  04:11PM
    2  ;;5.3;Scheduling;**41,52,177,231,520**;AUG 13, 1993;Build 26
     2 ;;5.3;Scheduling;**41,52,177,231**;AUG 13, 1993
    33 ;
    44 ;Summary Listing of Teams Report
     
    105105 ;
    106106PRINTIT(STORE,TITL) ;
    107  N INST,EINST,ETEAM,TEM,EPRACT,PRACT,NXT,PAGE,NPAGE,NEW,POS,SCAC
     107 N INST,EINST,ETEAM,TEM,EPRACT,PRACT,NXT,PAGE,NPAGE,NEW,POS
    108108 S (INST,EINST)="",(NPAGE,STOP)=0,PAGE=1 W:$E(IOST)="C" @IOF
    109109 D TITLE^SCRPU3(.PAGE,TITL)
     
    130130 ...S POS=""
    131131 ...F  S POS=$O(@STORE@(INST,TEM,PRACT,POS)) Q:POS=""!(STOP)  D
    132  ....W !,$G(@STORE@(INST,TEM,PRACT,POS))
    133  ....S SCAC=""
    134  ....F  S SCAC=$O(@STORE@(INST,TEM,PRACT,POS,SCAC)) Q:SCAC=""!(STOP)  D
    135  .....W !,$G(@STORE@(INST,TEM,PRACT,POS,SCAC))
    136  .....I IOST'?1"C-".E,$Y>(IOSL-4) D NEWP^SCRPSLT2(INST,TEM,TITL,.PAGE)
    137  .....I IOST?1"C-".E,$Y>(IOSL-4) D HOLD1^SCRPSLT2(.PAGE,TITL,INST,TEM)
    138  .....I STOP Q
    139  ....;W !,$G(@STORE@(INST,TEM,PRACT,POS)) ;writes info
     132 ....I IOST'?1"C-".E,$Y>(IOSL-4) D NEWP^SCRPSLT2(INST,TEM,TITL,.PAGE)
     133 ....I IOST?1"C-".E,$Y>(IOSL-4) D HOLD1^SCRPSLT2(.PAGE,TITL,INST,TEM)
     134 ....I STOP Q
     135 ....W !,$G(@STORE@(INST,TEM,PRACT,POS)) ;writes info
    140136 ..Q:STOP
    141137 ..I IOST'?1"C-".E,$Y>(IOSL-8) D NEWP^SCRPSLT2(INST,TEM,TITL,.PAGE,1)
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCRPSLT2.m

    r628 r636  
    11SCRPSLT2 ;ALB/CMM - Summary Listing of Teams Continued ; 9/15/99 10:43am
    2  ;;5.3;Scheduling;**41,174,177,231,520**;AUG 13, 1993;Build 26
     2 ;;5.3;Scheduling;**41,174,177,231**;AUG 13, 1993
    33 ;
    44 ;Summary Listing of Teams Report
     
    2323 S POS=$P(TNODE,"^") ;position name
    2424 ;SD*5.3*231 - call SCMCLK to determine in AP or not
    25  S PPC=$S($P(TNODE,"^",4)<1:"NPC",+$$OKPREC3^SCMCLK(APOS,DT)>0:" AP",1:"PCP") ;PC?
    26  ;S PCLIN=$P($G(^SC(+$P(TNODE,"^",9),0)),"^") ;associated clinic
    27  D SETASCL^SCRPRAC2(APOS,.PCLIN)
    28  S PCLIN=$G(PCLIN(0))
     25 S PPC=$S($P(TNODE,"^",4)<1:"NPC",+$$OKPREC3^SCMCLK(APOS,DT)>1:" AP",1:"PCP") ;PC?
     26 S PCLIN=$P($G(^SC(+$P(TNODE,"^",9),0)),"^") ;associated clinic
    2927 S ROLN=$P($G(^SD(403.46,+ROL,0)),U) ;role name
    3028 ;
     
    5755 ;
    5856 D FORMAT(APOS,POS,PCLIN,VAE,PRACT,PPC,DIV,TM,NPC,MAX,PCN,XDAT)
    59  N SCAC
    60  S SCAC=0
    61  F  S SCAC=$O(PCLIN(SCAC)) Q:SCAC=""  D FORMATAC(APOS,POS,PCLIN(SCAC),VAE,DIV,TM)
    6257 Q
    6358 ;
     
    9994 S $E(@STORE@(DIV,TM,VAE,APOS),128)=$J(TMP(2),5,0) ;precepted NPC
    10095 ;New code ends
    101  Q
    102 FORMATAC(APOS,POS,PCLIN,VAE,DIV,TM) ;clinic multiples
    103  S $E(@STORE@(DIV,TM,VAE,APOS,SCAC),72)=$E(PCLIN,1,30)
    10496 Q
    10597 ;
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCRPTA.m

    r628 r636  
    11SCRPTA ;ALB/CMM - Patient Listing w/Team Assignment Data ; 29 Jun 99  04:11PM
    2  ;;5.3;Scheduling;**41,48,52,114,174,181,177,526**;AUG 13, 1993;Build 8
     2 ;;5.3;Scheduling;**41,48,52,114,174,181,177**;AUG 13, 1993
    33 ;
    44 ;Patient Listing w/Team Assignment Data Report
     
    149149 ;setup column headers
    150150 S @STORE@("H2")="Patient Name"
    151  S $E(@STORE@("H2"),19)="Pt ID"
     151 S $E(@STORE@("H2"),24)="Pt ID"
    152152 S $E(@STORE@("H1"),31)="Date"
    153153 S $E(@STORE@("H2"),31)="Assigned"
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCRPTA2.m

    r628 r636  
    11SCRPTA2 ;ALB/CMM - Patient Listing w/Team Assignment Data ; 30 Jun 99  1:33 PM
    2  ;;5.3;Scheduling;**41,88,140,148,174,181,177,526**;AUG 13, 1993;Build 8
     2 ;;5.3;Scheduling;**41,88,140,148,174,181,177**;AUG 13, 1993
    33 ;
    44 ;Patient Listing w/Team Assignment Data Report continued
     
    7070 S PTNAME=$P($G(^DPT(PIEN,0)),"^") ;patient name
    7171 S PID=$P($G(^DPT(PIEN,.36)),"^",3),PID=$TR(PID,"-","")
    72  ;9 digit ssn SD*5.3*526 - dmr
    73  ;S PID=$E(PID,6,10) ;last four pid include 5th for pseudo notation
     72 S PID=$E(PID,6,10) ;last four pid include 5th for pseudo notation
    7473 ;
    7574 S ADATE=$P(NODE,"^",3) ;position assignment date - fm format
     
    119118 S $E(@STORE@(IIEN,TIEN),40)="Primary Care Team: "_$S(PC=1:"YES",1:"NO")
    120119 ;
    121  S @STORE@(IIEN,TIEN,PIEN,TPIEN,PTNAME,PTIEN)=$E(PTNAME,1,17)
    122  S $E(@STORE@(IIEN,TIEN,PIEN,TPIEN,PTNAME,PTIEN),19)=PID
     120 S @STORE@(IIEN,TIEN,PIEN,TPIEN,PTNAME,PTIEN)=$E(PTNAME,1,21)
     121 S $E(@STORE@(IIEN,TIEN,PIEN,TPIEN,PTNAME,PTIEN),24)=PID
    123122 S $E(@STORE@(IIEN,TIEN,PIEN,TPIEN,PTNAME,PTIEN),31)=ADATE
    124123 S $E(@STORE@(IIEN,TIEN,PIEN,TPIEN,PTNAME,PTIEN),43)=PCAP
     
    140139 S PTNAME=$E($P($G(^DPT(PIEN,0)),"^"),1,20) ;patient name
    141140 S PID=$P($G(^DPT(PIEN,.36)),"^",3),PID=$TR(PID,"-","")
    142  ;S PID=$E(PID,6,10) ;9 digit ssn patch 526
     141 S PID=$E(PID,6,10) ;last 4 plus 5th for psuedo
    143142 ;
    144143 S TIEN=+$P($G(^SCPT(404.42,PTIEN,0)),"^",3) ;team ien
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCRPTM.m

    r628 r636  
    11SCRPTM ;ALB/CMM - List of Team's Members Report ; 29 Jun 99  04:11PM
    2  ;;5.3;Scheduling;**41,48,52,181,177,520**;AUG 13, 1993;Build 26
     2 ;;5.3;Scheduling;**41,48,52,181,177**;AUG 13, 1993
    33 ;
    44 ;List of Team's Members Report
     
    154154PRNTD(INST,TEM,PRACT,POS,TITL,PAGE,HEAD) ;
    155155 ;
    156  N CNT,SCAC
     156 N CNT
    157157 S CNT=""
    158158 I IOST'?1"C-".E,$Y>(IOSL-11) D NEWP^SCRPTM2(INST,TEM,TITL,.PAGE,.HEAD)
     
    161161 F  S CNT=$O(@STORE@(INST,TEM,PRACT,POS,CNT)) Q:CNT=""!(STOP)  D
    162162 .W !,$G(@STORE@(INST,TEM,PRACT,POS,CNT))
    163  .S SCAC="" I CNT=4  D
    164  ..F  S SCAC=$O(@STORE@(INST,TEM,PRACT,POS,4,SCAC)) Q:SCAC=""!(STOP)  D
    165  ...W !,$G(@STORE@(INST,TEM,PRACT,POS,4,SCAC))
    166163 Q
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCRPTM2.m

    r628 r636  
    11SCRPTM2 ;ALB/CMM - List of Team's Members Report Continued;01/29/96 ; 29 Jun 99  04:11PM
    2  ;;5.3;Scheduling;**41,140,177,520**;AUG 13, 1993;Build 26
     2 ;;5.3;Scheduling;**41,140,177**;AUG 13, 1993
    33 ;
    44 ;List of Team's Members Report
     
    3131 .;
    3232 .S TPNODE=$G(^SCTM(404.57,+TPIEN,0))
    33  .D SETASCL^SCRPRAC2(TPIEN,.PCLIN)
    34  .S PCLIN=$G(PCLIN(0))
    35  .;S PCLIN=+$P(TPNODE,"^",9) ;associated clinic ien
    36  .;S PCLIN=$P($G(^SC(PCLIN,0)),"^") ;associated clinic name
     33 .S PCLIN=+$P(TPNODE,"^",9) ;associated clinic ien
     34 .S PCLIN=$P($G(^SC(PCLIN,0)),"^") ;associated clinic name
    3735 .;
    3836 .;Get preceptor
     
    5351 .;
    5452 .D FORMAT(PNAME,TPIEN,PCLIN,RNAME,UNAME,ACT,INACT,PRIEN,PRNAME,OPH,ROOM,SERV,INS,TIEN,PRCP,.PCLASS)
    55  .N SCAC
    56  .S SCAC=0
    57  .F  S SCAC=$O(PCLIN(SCAC)) Q:SCAC=""  D FORMATAC(INS,TIEN,PRIEN,TPIEN,PCLIN(SCAC))
    5853 Q
    5954 ;
     
    110105 Q
    111106 ;
    112 FORMATAC(DIV,TEM,PIEN,TPIEN,PCLIN) ;
    113  S $E(@STORE@(DIV,TEM,PIEN,TPIEN,4,SCAC),49)=$E(PCLIN,1,30)
    114  Q
    115  ;
    116107NEWP(INST,TEM,TITL,PAGE,HEAD) ;
    117108 ;new page
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCRPTP.m

    r628 r636  
    11SCRPTP ;ALB/CMM - List of Team's Patients ; 29 Jun 99  04:11PM
    2  ;;5.3;Scheduling;**41,48,174,177,526,520**;AUG 13, 1993;Build 26
     2 ;;5.3;Scheduling;**41,48,174,177**;AUG 13, 1993
    33 ;
    44PROMPTS ;Prompt for Institution, Team, Role, Patient Status and Print device
     
    2020 ;ROLE - roles selected (variable and array)
    2121 ;PSTAT - patient status - 1=all or OPT or AC
    22  ;SORT - 1=d,t,ptname 2=d,t,Pt ID 3=d,t,pract,pt name 4=d,t,pract,Pt ID
     22 ;SORT - 1=d,t,ptname 2=d,t,last 4 Pt ID 3=d,t,pract,pt name 4=d,t,pract,last 4 Pt ID
    2323 N ZTSAVE,II
    2424 F II="INST","TEAM","ROLE","ROLE(","SORT","PSTAT","INST(","TEAM(" S ZTSAVE(II)=""
     
    3131 ;ROLE - roles selected (variable and array)
    3232 ;PSTAT - patient status - 1=all or OPT or AC
    33  ;SORT - 1=d,t,ptname 2=d,t,Pt ID 3=d,t,pract,pt name 4=d,t,pract,Pt ID
     33 ;SORT - 1=d,t,ptname 2=d,t,last 4 Pt ID 3=d,t,pract,pt name 4=d,t,pract,last 4 Pt ID
    3434 ;IOP - print device
    3535 ;ZTDTH - queue time (optional)
     
    114114 Q FOUND
    115115 ;
    116 FORMAT(INS,TIEN,PTIEN,PTNAME,PID,PIEN,PNAME,CNAME,PINF,ROLN,PCAP) ;Format column information
    117  ;INS - Institution ien
    118  ;TIEN - team ien
    119  ;PTIEN - patient ien
    120  ;PTNAME - patient name
    121  ;PID - SSN
    122  ;PIEN - practitioner ien
    123  ;PNAME - practitioner name
    124  ;CNAME - clinic name
    125  ;LAST - last appointment
    126  ;NEXT - next appointment
    127  ;ROLN - role name
    128  ;PCAP - PC?
    129  ;
    130  N SEC,TRD
    131  I PNAME="" S PNAME="[BAD DATA]"
    132  I PTNAME="" S PTNAME="[BAD DATA]"
    133  I PID="" S PID="*********"
    134  S @STORE@("P",INS,TIEN,PNAME,PIEN)="" ;practitioner
    135  S @STORE@("PT",INS,TIEN,PTNAME,PTIEN)="" ;patient
    136  S @STORE@("PID",INS,TIEN,PID,PTIEN)=""
    137  I (SORT=1)!(SORT=2) S SEC=PTIEN,TRD=PIEN ;sort doesn't include practitioner
    138  I (SORT=3)!(SORT=4) S SEC=PIEN,TRD=PTIEN ;sort includes practitioner
    139  S @STORE@(INS,TIEN,SEC,TRD)=$E(PTNAME,1,15) ;patient name
    140  S $E(@STORE@(INS,TIEN,SEC,TRD),18)=PID ;9 digit pid
    141  S $E(@STORE@(INS,TIEN,SEC,TRD),32)=$E(PNAME,1,22) ;practitioner name
    142  S $E(@STORE@(INS,TIEN,SEC,TRD),56)=$E($G(ROLN),1,22) ;role name
    143  S $E(@STORE@(INS,TIEN,SEC,TRD),80)=$G(PCAP) ;PC?
    144  S $E(@STORE@(INS,TIEN,SEC,TRD),85)=$P(PINF,"^",8) ;last appointment
    145  S $E(@STORE@(INS,TIEN,SEC,TRD),97)=$P(PINF,"^",9) ;next appointment
    146  S $E(@STORE@(INS,TIEN,SEC,TRD),109)=$E(CNAME,1,24) ;clinic name
    147  Q
    148 FORMATAC(SCCNT,CNAME,PINF,INS,TIEN,PTIEN,PTNAME,PID,PIEN,PNAME,ROLN,PCAP) ;Format MULTIPLES
     116FORMAT(INS,TIEN,PTIEN,PTNAME,PID,PIEN,PNAME,CNAME,LAST,NEXT,ROLN,PCAP) ;Format column information
    149117 ;INS - Institution ien
    150118 ;TIEN - team ien
     
    170138 I (SORT=1)!(SORT=2) S SEC=PTIEN,TRD=PIEN ;sort doesn't include practitioner
    171139 I (SORT=3)!(SORT=4) S SEC=PIEN,TRD=PTIEN ;sort includes practitioner
    172  I '$D(@STORE@(INS,TIEN,SEC,TRD,SCCNT))  D
    173  .S $E(@STORE@(INS,TIEN,SEC,TRD,SCCNT),85)=$P(PINF,"^",8) ;last appointment
    174  .S $E(@STORE@(INS,TIEN,SEC,TRD,SCCNT),97)=$P(PINF,"^",9) ;next appointment
    175  .S $E(@STORE@(INS,TIEN,SEC,TRD,SCCNT),109)=$E(CNAME,1,24) ;clinic name
    176  .Q
     140 S @STORE@(INS,TIEN,SEC,TRD)=$E(PTNAME,1,22) ;patient name
     141 S $E(@STORE@(INS,TIEN,SEC,TRD),25)=PID ;last 4 pid
     142 S $E(@STORE@(INS,TIEN,SEC,TRD),32)=$E(PNAME,1,22) ;practitioner name
     143 S $E(@STORE@(INS,TIEN,SEC,TRD),56)=$E($G(ROLN),1,22) ;role name
     144 S $E(@STORE@(INS,TIEN,SEC,TRD),80)=$G(PCAP) ;PC?
     145 S $E(@STORE@(INS,TIEN,SEC,TRD),85)=LAST ;last appointment
     146 S $E(@STORE@(INS,TIEN,SEC,TRD),97)=NEXT ;next appointment
     147 S $E(@STORE@(INS,TIEN,SEC,TRD),109)=$E(CNAME,1,24) ;clinic name
    177148 Q
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCRPTP2.m

    r628 r636  
    11SCRPTP2 ;ALB/CMM - List of Team's Patients ; 29 Jun 99  04:11PM
    2  ;;5.3;Scheduling;**41,53,52,174,177,231,526,520**;AUG 13, 1993;Build 26
     2 ;;5.3;Scheduling;**41,53,52,174,177,231**;AUG 13, 1993
    33 ;
    44 ;List of Team's Patients Report
     
    7373 . . . . Q:STOP
    7474 . . . . I $D(@STORE@(INST,TIEN,PIEN,TRDI)) W !,$G(@STORE@(INST,TIEN,PIEN,TRDI)) ;write column data
    75  . . . . N SCACL
    76  . . . . S SCACL="" F  S SCACL=$O(@STORE@(INST,TIEN,PIEN,TRDI,SCACL)) Q:SCACL=""  D
    77  . . . . . W !,$G(@STORE@(INST,TIEN,PIEN,TRDI,SCACL))
    7875 . S NEW=0
    7976 Q
     
    10299 . . . . Q:STOP
    103100 . . . . I $D(@STORE@(INST,TIEN,TRDI,PIEN)) W !,$G(@STORE@(INST,TIEN,TRDI,PIEN)) ;write column data
    104  . . . . N SCACL
    105  . . . . S SCACL="" F  S SCACL=$O(@STORE@(INST,TIEN,TRDI,PIEN,SCACL)) Q:SCACL=""  D
    106  . . . . . W !,$G(@STORE@(INST,TIEN,TRDI,PIEN,SCACL))
    107101 . S NEW=0
    108102 Q
     
    137131SETH ;sets column headings
    138132 S @STORE@("H2")="Patient Name"
    139  S $E(@STORE@("H2"),18)="Pt ID"
     133 S $E(@STORE@("H2"),25)="Pt ID"
    140134 S $E(@STORE@("H2"),32)="Practitioner"
    141135 S $E(@STORE@("H2"),56)="Role"
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCRPTP3.m

    r628 r636  
    11SCRPTP3 ;ALB/CMM - List of Team's Patients ; 29 Jun 99  04:11PM
    2  ;;5.3;Scheduling;**41,48,98,177,231,433,526,520**;AUG 13, 1993;Build 26
    3  ;;DMR BP-OIFO Patch SD*5.3*526
     2 ;;5.3;Scheduling;**41,48,98,177,231,433**;AUG 13, 1993
    43 ;
    54 ;List of Team's Patients Report
     
    2524 .S DFN=PTIEN
    2625 .D PID^VADPT6
    27  .;S PID=VA("BID")
    28  .S PID=$E(VA("PID"),1,3)_$E(VA("PID"),5,6)_$E(VA("PID"),8,12)
     26 .S PID=VA("BID")
    2927 .;
    30  .N CNAME,PINF,CLIEN
     28 .S TPA=$$TPAR(PTAI,"")
     29 .I TPA'=-1 D
     30 ..S PIEN=$P(TPA,"^")
     31 ..S PNAME=$P(TPA,"^",2)
     32 ..S CNAME=$P(TPA,"^",3)
     33 ..S LAST=$P(TPA,"^",4)
     34 ..S NEXT=$P(TPA,"^",5)
     35 ..;
     36 ..S FLAG="Y"
     37 ..S TINFO=$$TINF^SCRPTP(TIEN) ;team information
     38 ..S INST=+$P(TINFO,"^") ;institution ien
     39 ..S INAME=$P($G(^DIC(4,INST,0)),"^") ;institution name
     40 ..S PHONE=$P(TINFO,"^",4) ;team phone
     41 ..S PC=$P(TINFO,"^",3) ;primary care?
     42 ..S TNAME=$P(TINFO,"^",2) ;team name
     43 ..;
     44 ..D TFORMAT^SCRPTP2(INST,INAME,TIEN,TNAME,PHONE,PC)
     45 ..D FORMAT^SCRPTP(INST,TIEN,PTIEN,PTNAME,PID,PIEN,PNAME,CNAME,LAST,NEXT)
     46 .;
     47 .;check for other assignments
     48 .N TPIN
    3149 .S CNT=""
    3250 .F  S CNT=$O(^SCPT(404.43,"B",PTAI,CNT)) Q:CNT=""!(CNT'?.N)  D
    33  ..D TPAR(PTAI,CNT,.PINF,.CNAME,.CLIEN,.PNAME,.ROLN,.PCAP)
     51 ..S TPIN=$$TPAR(PTAI,CNT)
     52 ..Q:TPIN=-1
     53 ..S PIEN=$P(TPIN,"^")
     54 ..S PNAME=$P(TPIN,"^",2)
     55 ..S CNAME=$P(TPIN,"^",3)
     56 ..S LAST=$P(TPIN,"^",4)
     57 ..S NEXT=$P(TPIN,"^",5)
     58 ..S ROLN=$P(TPIN,U,6)
     59 ..S PCAP=$P(TPIN,U,7)
     60 ..I '$D(FLAG) D
     61 ...S TINFO=$$TINF^SCRPTP(TIEN) ;team information
     62 ...S INST=+$P(TINFO,"^") ;institution ien
     63 ...S INAME=$P($G(^DIC(4,INST,0)),"^") ;institution name
     64 ...S PHONE=$P(TINFO,"^",4) ;team phone
     65 ...S PC=$P(TINFO,"^",3) ;primary care?
     66 ...S TNAME=$P(TINFO,"^",2) ;team name
     67 ...;
     68 ...D TFORMAT^SCRPTP2(INST,INAME,TIEN,TNAME,PHONE,PC)
     69 ..D FORMAT^SCRPTP(INST,TIEN,PTIEN,PTNAME,PID,PIEN,PNAME,CNAME,LAST,NEXT,ROLN,PCAP)
     70 I INACTIVE S @STORE@(INST,TIEN,"INACT")=""
    3471 Q
    3572 ;
    36 TPAR(PTAI,START,PINF,CNAME,CLIEN,PNAME,ROLN,PCAP) ;
    37  N PTPA,TPIEN,TPNODE,ROL,CIEN,ENROLL,OKAY,NEXT,LAST,PAIEN
     73TPAR(PTAI,START) ;
     74 N PTPA,TPIEN,TPNODE,ROL,CNAME,CIEN,ENROLL,OKAY,PNAME,NEXT,LAST,PAIEN
     75 N ROLN,PCAP
    3876 I '$D(^SCPT(404.43,"B",PTAI)) Q "0^[Not Assigned]"
    3977 ; ^ no patient team position assignment
     
    4381 .S PTPA=START
    4482 I PTPA="" Q "0^[Not Assigned]"
    45  S PTPAN=$G(^SCPT(404.43,PTPA,0))  ;patient team assignment
     83 S PTPAN=$G(^SCPT(404.43,PTPA,0)) ;patient team position assignment node
    4684 I PTPAN=""!(PTPAN=0) Q "0^[Not Assigned]"
    4785 I $P(PTPAN,"^",4)'="",$P(PTPAN,"^",4)<DT Q -1
     
    5795 S PCAP=$S($P(PTPAN,U,5)<1:"NPC",+$$OKPREC3^SCMCLK(TPIEN,DT)>0:" AP",1:"PCP") ;PC?
    5896 ;
    59  D SETASCL^SCRPRAC2(TPIEN,.CNAME,.CLIEN)
     97 S CIEN=+$P(TPNODE,"^",9) ;associated clinic ien
     98 S CNAME=$P($G(^SC(CIEN,0)),"^") ;clinic name
     99 ;check patient status
     100 S OKAY=""
     101 I CIEN>0&(PSTAT'=1) S OKAY=$$PST^SCRPTP(PTIEN,CIEN)
     102 Q:(CIEN>0)&('OKAY)&(PSTAT'=1) -1
     103 ; ^ not selected patient status
     104 ;
    60105 ;next two lines commented off - SD*5.3*433
    61106 ;S ENROLL=$$ENRL(PTIEN,CIEN) ;enrolled in associated clinic
     
    67112 I +PAIEN=0 S PIEN=0,PNAME="[Inactive Position]"
    68113 ;
    69  D GETPINF^SCRPPAT2(PTIEN,.CLIEN,.PINF)  ;get patient info
    70  S CNAME=$G(CNAME(0))
    71  S PINF=$G(PINF(0))
    72  I PINF="" D
    73  .S PINF=PIEN_"^"_$$PDATA^SCRPEC(PIEN,CNAME,CNAME,1)
    74  I INACTIVE S @STORE@(INS,TIEN,"INACT")=""
    75  S FLAG="Y"
    76  S TINFO=$$TINF^SCRPTP(TIEN) ;team information
    77  S INST=+$P(TINFO,"^") ;institution ien
    78  S INAME=$P($G(^DIC(4,INST,0)),"^") ;institution name
    79  S PHONE=$P(TINFO,"^",4) ;team phone
    80  S PC=$P(TINFO,"^",3) ;primary care?
    81  S TNAME=$P(TINFO,"^",2) ;team name
    82  D TFORMAT^SCRPTP2(INST,INAME,TIEN,TNAME,PHONE,PC)
    83  D FORMAT^SCRPTP(INS,TIEN,PTIEN,PTNAME,PID,PIEN,PNAME,CNAME,PINF,ROLN,PCAP)
    84  N SCCNT
    85  S SCCNT=0 F  S SCCNT=$O(CNAME(SCCNT)) Q:SCCNT=""  D FORMATAC^SCRPTP(SCCNT,CNAME(SCCNT),PINF(SCCNT),INS,TIEN,PTIEN,PTNAME,PID,PIEN,PNAME,ROLN,PCAP)
    86  Q
     114 S (NEXT,LAST)=""
     115 I +CIEN>0 S NEXT=$$GETNEXT^SCRPU3(PTIEN,CIEN) ;next appointment
     116 I +CIEN>0 S LAST=$$GETLAST^SCRPU3(PTIEN,CIEN) ;last appointment
    87117 ;
    88 ENRL(PTIEN,CLIEN) ;FUNCTIONALITY DISABLED
     118 Q PIEN_U_PNAME_U_CNAME_U_LAST_U_NEXT_U_ROLN_U_PCAP
    89119 ;
    90  ;N FOUND,ENODE,EN,NXT
    91  ;S FOUND=0
    92  ;Q:'$D(^DPT(PTIEN,"DE","B",CLIEN)) FOUND
    93  ;S EN=$O(^DPT(PTIEN,"DE","B",CLIEN,""))
    94  ;Q:EN=""!'$D(^DPT(PTIEN,"DE",EN,1)) FOUND
    95  ;S NXT=""
    96  ;F  S NXT=$O(^DPT(PTIEN,"DE",EN,1,NXT)) Q:(FOUND)!(NXT="")!(NXT'?.N)  D
    97  ;check if active enrollment
    98  ;S ENODE=$G(^DPT(PTIEN,"DE",EN,1,NXT,0))
    99  ;I $P(ENODE,"^",3)'="",$P(ENODE,"^",3)<DT+1!$P(ENODE,"^")>DT Q  ;not active enrollment
    100  ;;                      ^ discharge date     ^ enrollment date
     120ENRL(PTIEN,CLIEN) ;
     121 ;
     122 N FOUND,ENODE,EN,NXT
    101123 S FOUND=0
     124 Q:'$D(^DPT(PTIEN,"DE","B",CLIEN)) FOUND
     125 S EN=$O(^DPT(PTIEN,"DE","B",CLIEN,""))
     126 Q:EN=""!'$D(^DPT(PTIEN,"DE",EN,1)) FOUND
     127 S NXT=""
     128 F  S NXT=$O(^DPT(PTIEN,"DE",EN,1,NXT)) Q:(FOUND)!(NXT="")!(NXT'?.N)  D
     129 .;check if active enrollment
     130 .S ENODE=$G(^DPT(PTIEN,"DE",EN,1,NXT,0))
     131 .I $P(ENODE,"^",3)'="",$P(ENODE,"^",3)<DT+1!$P(ENODE,"^")>DT Q  ;not active enrollment
     132 .;                      ^ discharge date     ^ enrollment date
     133 .S FOUND=1
    102134 Q FOUND
    103135 ;
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCRPU1.m

    r628 r636  
    11SCRPU1 ;ALB/CMM - GENERIC PROMPTS FOR PCMM REPORTS ;1/12/96
    2  ;;5.3;Scheduling;**41,45,130,520**;AUG 13, 1993;Build 26
     2 ;;5.3;Scheduling;**41,45,130**;AUG 13, 1993
    33 ;
    44INST ;Prompt for institution
     
    109109 N TRUE,EN,TEAM
    110110 S TRUE=0,EN=""
    111  F  S EN=$O(^SCTM(404.57,"E",+Y,EN)) Q:EN=""!(TRUE)  D
     111 F  S EN=$O(^SCTM(404.57,"D",+Y,EN)) Q:EN=""!(TRUE)  D
    112112 .S TEAM=+$P($G(^SCTM(404.57,EN,0)),"^",2)
    113113 .I $D(VAUTT(TEAM))!(VAUTT=1) S TRUE=1
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCRPU2.m

    r628 r636  
    11SCRPU2 ;ALB/CMM - GENERIC PROMPTS FOR PCMM REPORTS ; 12 Jan 99  1:23 PM
    2  ;;5.3;Scheduling;**41,174,297,526,520**;AUG 13, 1993;Build 26
     2 ;;5.3;Scheduling;**41,174,297**;AUG 13, 1993
    33 ;
    44DTRANG(FIRST,SECOND) ;Date Range - begin date ^ end date => fileman format
     
    2929 N TPEN,FOUND,TEAM
    3030 S TPEN="",FOUND=0
    31  F  S TPEN=$O(^SCTM(404.57,"E",CLN,TPEN)) Q:TPEN=""!(FOUND)  D
     31 F  S TPEN=$O(^SCTM(404.57,"D",CLN,TPEN)) Q:TPEN=""!(FOUND)  D
    3232 .S TEAM=$P(^SCTM(404.57,TPEN,0),"^",2)
    3333 .I $D(^SCPT(404.42,"APTTM",DFN,TEAM)) S FOUND=1
     
    122122SORT2() ;Prompt for sorting by:
    123123 ;   [1] Division, Team, Patient Name
    124  ;or [2] Division, Team, SSN
     124 ;or [2] Division, Team, Last 4 Pt ID
    125125 ;or [3] Division, Team, Practitioner, Patient Name
    126  ;or [4] Division, Team, Practitioner, SSN
     126 ;or [4] Division, Team, Practitioner, Last 4 Pt ID
    127127 ;
    128128EN4 ;
    129129 N X
    130130 W !,"Sort By:",!?10,"[1] Division, Team, Patient Name"
    131  W !?10,"[2] Division, Team, SSN"
     131 W !?10,"[2] Division, Team, Last 4 Pt ID"
    132132 W !?10,"[3] Division, Team, Practitioner, Patient Name"
    133  W !?10,"[4] Division, Team, Practitioner, SSN"
     133 W !?10,"[4] Division, Team, Practitioner, Last 4 Pt ID"
    134134 W !!,"Select 1, 2, 3, or 4: "
    135135 R X:DTIME
     
    141141 ;help prompt
    142142 W !,"Enter: ",!?5,"- 1 to sort by Division, Team, Patient Name"
    143  W !?10,"- 2 to sort by Division, Team, SSN"
     143 W !?10,"- 2 to sort by Division, Team, Last 4 Pt ID"
    144144 W !?10,"- 3 to sort by Division, Team, Practitioner, Patient Name"
    145  W !?10,"- 4 to sort by Division, Team, Practitioner, SSN"
     145 W !?10,"- 4 to sort by Division, Team, Practitioner, Last 4 Pt ID"
    146146 Q
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCRPW24.m

    r628 r636  
    11SCRPW24 ;RENO/KEITH - ACRP Ad Hoc Report (cont.) ;06/19/99
    2  ;;5.3;Scheduling;**144,163,180,254,243,295,329,351,510**;AUG 13, 1993;Build 3
     2 ;;5.3;Scheduling;**144,163,180,254,243,295,329,351**;AUG 13, 1993
    33 ;06/19/99 ACS - Added CPT modifier API calls
    44 ;
     
    189189 ;
    190190ENROL(SDATE)  ;Get enrollment record (most recent to encounter date)
    191  N SDY,SDI,X1,X2,X,%Y S:SDATE#1=0 SDATE=SDATE+.9999 S SDI=0 F  S SDI=$O(^DGEN(27.11,"C",+$P(SDOE0,U,2),SDI)) Q:'SDI  S SDY=$G(^DGEN(27.11,SDI,0)),SDY($P($P(^DGEN(27.11,SDI,"U"),U,1),".",1))=SDY  ;SD/510 changed logic to use date/time entered
     191 N SDY,SDI,X1,X2,X,%Y S:SDATE#1=0 SDATE=SDATE+.9999 S SDI=0 F  S SDI=$O(^DGEN(27.11,"C",+$P(SDOE0,U,2),SDI)) Q:'SDI  S SDY=$G(^DGEN(27.11,SDI,0)),SDY(+SDY)=SDY
    192192 S SDI=$O(SDY(SDATE),-1) Q:'SDI ""  S X1=$P($P(SDOE0,U),"."),X2=SDI D ^%DTC Q SDY(SDI)
    193193 ;
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCRPW6.m

    r628 r636  
    11SCRPW6 ;RENO/KEITH - Trend of Facility Uniques by 12 Month Date Ranges ; 15 Jul 98  02:38PM
    2  ;;5.3;Scheduling;**139,144,466,510**;AUG 13, 1993;Build 3
     2 ;;5.3;Scheduling;**139,144,466**;AUG 13, 1993;Build 2
    33 N SDDIV,SDI,SDSTA,DIR D TITL^SCRPW50("Trend of Facility Uniques by 12 Month Date Ranges") G:'$$DIVA^SCRPW17(.SDDIV) EXIT
    44 D SUBT^SCRPW50("**** Status Selection ****")
     
    77 S SDSTA=$S(Y=1:2,Y=2:8,1:"2^8")
    88QUE W !!,"This report requires 132 column output.",!
    9  N ZTSAVE F X="SDDIV","SDDIV(","SDDNU(","SDSTA" S ZTSAVE(X)=""
     9 N ZTSAVE F X="SDDIV","SDDIV(","SDDNU(",SDSTA S ZTSAVE(X)=""
    1010 D EN^XUTMDEVQ("UNIQ^SCRPW6","Trend Facility Uniques",.ZTSAVE),DISP0^SCRPW23 Q
    1111UNIQ ;Calculate/print uniques
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCRPW8.m

    r628 r636  
    11SCRPW8 ;RENO/KEITH - Outpatient Encounter Workload Statistics ; 04 Feb 99  4:53 PM
    2  ;;5.3;Scheduling;**139,145,144,176,339,466,510**;AUG 13, 1993;Build 3
     2 ;;5.3;Scheduling;**139,145,144,176,339,466**;AUG 13, 1993;Build 2
    33QS ;Queue outpatient encounter workload report
    44 D PARM^SCRPW9 Q
     
    2828PRPT ;Print statistics page
    2929 D STOP Q:SDOUT
    30  S SDCT=0 F SDI=1,2,3,11,14,"8-CC" S SDCT=SDCT+$G(^TMP(SDS1,$J,SDS2,SDI))
     30 S SDCT=0 F SDI=1,2,3,11,14,8 S SDCT=SDCT+$G(^TMP(SDS1,$J,SDS2,SDI))
    3131 D XHDR Q:SDOUT  D SHDR("O U T P A T I E N T   E N C O U N T E R   W O R K L O A D") Q:SDOUT  F SDI=11,14,3,1 D LIST(SDI) Q:SDOUT
    3232 I $D(^TMP(SDS1,$J,SDS2,2)) D:$Y>(IOSL-4) XHDR Q:SDOUT  W !?10,"CHECKED OUT" S SDI=0 F  S SDI=$O(^TMP(SDS1,$J,SDS2,2,SDI)) Q:'SDI!SDOUT  S SDSTAT=$O(^TMP(SDS1,$J,SDS2,2,SDI,"")) D COT
    33  I $D(^TMP(SDS1,$J,SDS2,"8-CC")) D:$Y>(IOSL-4) XHDR Q:SDOUT  W !?10,"INPATIENT APPOINTMENT" S SDI=0 F  S SDI=$O(^TMP(SDS1,$J,SDS2,"8-CC",SDI)) Q:'SDI!SDOUT  S SDSTAT=$O(^TMP(SDS1,$J,SDS2,"8-CC",SDI,"")) D IAP
    34  D TOT S (SDI,SDCT)=0 F SDI=4,5,6,7,"8-NC",9,12,13 S SDCT=SDCT+$G(^TMP(SDS1,$J,SDS2,SDI))
    35  W !! D SHDR("N O N - W O R K L O A D") Q:SDOUT  F SDI="8-NC",12,4,6,5,7,9,10,13 D LIST(SDI) Q:SDOUT
     33 I $D(^TMP(SDS1,$J,SDS2,8)) D:$Y>(IOSL-4) XHDR Q:SDOUT  W !?10,"INPATIENT APPOINTMENT" S SDI=0 F  S SDI=$O(^TMP(SDS1,$J,SDS2,8,SDI)) Q:'SDI!SDOUT  S SDSTAT=$O(^TMP(SDS1,$J,SDS2,8,SDI,"")) D IAP
     34 D TOT S (SDI,SDCT)=0 F SDI=4,5,6,7,9,12,13 S SDCT=SDCT+$G(^TMP(SDS1,$J,SDS2,SDI))
     35 W !! D SHDR("N O N - W O R K L O A D") Q:SDOUT  F SDI=12,4,6,5,7,9,10,13 D LIST(SDI) Q:SDOUT
    3636 D TOT W !! D SHDR(($$HD2()_"   O U T P A T I E N T   V I S I T S")) Q:SDOUT  S SDCT=^TMP(SDS1,$J,SDS2,"VISIT","NWK")+^TMP(SDS1,$J,SDS2,"VISIT","OWK")
    3737 D:$Y>(IOSL-4) XHDR Q:SDOUT  W !?10,"Act. Req./not accepted visits",?47,$J(^TMP(SDS1,$J,SDS2,"VISIT","NWK"),12),?62,$J($S(SDCT=0:0,1:(^TMP(SDS1,$J,SDS2,"VISIT","NWK")*100/SDCT)),8,2)
     
    5252EXIT K SDTOE0,SDUNCO,SDUNAR,SDCT,DFN,SDDT,SDDTF,SDDTL,SDDTPF,SDDTPL,SDI,SDLINE,SDOE,SDOE0,SDPNOW,SDSTAT,SDSTX,SDTOE,SDTOEE,SDTOE1,SDTX,SDTXS,SDX,SDZ,DTOUT,X,Y,ZTDESC,ZTRTN,ZTSAVE
    5353 D KVA^VADPT K X1,X2,SDH,SDHL,SDPNAM,SDSSN,SDPAGE,SDPT0,SDUL,DUOUT,SDARCT,SDST,SDPNOW,SDMD,SDMC,SDDIV,SDDNAM,SDS1,SDS2,SDCG,SDCLGR F I="SCRPW","SCRPWD","SCRPWC" K ^TMP(I,$J)
    54  K I,SDFF,SDOUT,SDSTOP,SDNCOU D END^SCRPW50 Q
     54 K I,SDFF,SDOUT,SDSTOP D END^SCRPW50 Q
    5555 ;
    5656HD1() ;Report subheader 1
     
    8383 ;
    8484LIST(SDI) Q:'$D(^TMP(SDS1,$J,SDS2,SDI))  D:$Y>(IOSL-4) XHDR Q:SDOUT
    85  W !?10,$P(^SD(409.63,+SDI,0),U),?47,$J(^TMP(SDS1,$J,SDS2,SDI),12),?62,$J($S(SDCT=0:0,1:(^TMP(SDS1,$J,SDS2,SDI)*100/SDCT)),8,2)
     85 W !?10,$P(^SD(409.63,SDI,0),U),?47,$J(^TMP(SDS1,$J,SDS2,SDI),12),?62,$J($S(SDCT=0:0,1:(^TMP(SDS1,$J,SDS2,SDI)*100/SDCT)),8,2)
    8686 Q
    8787 ;
    8888COT D:$Y>(IOSL-4) XHDR Q:SDOUT  W !?15,SDSTAT,?47,$J(^TMP(SDS1,$J,SDS2,2,SDI,SDSTAT),12),?62,$J($S(SDCT=0:0,1:(^TMP(SDS1,$J,SDS2,2,SDI,SDSTAT)*100/SDCT)),8,2) Q
    8989 ;
    90 IAP D:$Y>(IOSL-4) XHDR Q:SDOUT  W !?15,SDSTAT,?47,$J(^TMP(SDS1,$J,SDS2,"8-CC",SDI,SDSTAT),12),?62,$J($S(SDCT=0:0,1:(^TMP(SDS1,$J,SDS2,"8-CC",SDI,SDSTAT)*100/SDCT)),8,2) Q
     90IAP D:$Y>(IOSL-4) XHDR Q:SDOUT  W !?15,SDSTAT,?47,$J(^TMP(SDS1,$J,SDS2,8,SDI,SDSTAT),12),?62,$J($S(SDCT=0:0,1:(^TMP(SDS1,$J,SDS2,8,SDI,SDSTAT)*100/SDCT)),8,2) Q
    9191STOP ;Check for stop task request
    9292 S:$G(ZTQUEUED) (SDOUT,ZTSTOP)=$S($$S^%ZTLOAD:1,1:0) Q
    9393 ;
    9494COUNT ;Count encounters
    95  S SDNCOU=$P($G(^SC(+$P(SDOE0,U,4),0)),U,17),SDNCOU=$S(SDNCOU="Y":1,1:0)
    9695 S SDSTOP=SDSTOP+1 I SDSTOP#3000=0 D STOP Q:SDOUT
    9796 D C1("SCRPW",SDDNAM) D:SDMD C1("SCRPWD",SDDIV) D:SDCLGR C1("SCRPWC",SDCG) Q
     
    9998C1(SDS1,SDS2) ;Set ^TMP global
    10099 ;Required input: SDS1,SDS2=subscript values
    101  ;Because there is only 1 status (8) for INPATIENTS, 8-NC is used to
    102  ;distinguish the non-count clinics from the count clinics, 8-CC.
    103  S DFN=$P(SDOE0,U,2),SDSTAT=+$P(SDOE0,U,12) I SDSTAT=8 S SDSTAT=$S(SDNCOU:SDSTAT_"-NC",1:SDSTAT_"-CC")
    104  I SDZ(0),SDZ(4)=SDDIV,SDS1="SCRPW" D DETAIL
     100 S DFN=$P(SDOE0,U,2),SDSTAT=+$P(SDOE0,U,12) I SDZ(0),SDZ(4)=SDDIV,SDS1="SCRPW" D DETAIL
    105101 S ^TMP(SDS1,$J,SDS2,SDSTAT)=$G(^TMP(SDS1,$J,SDS2,SDSTAT))+1
    106  Q:SDSTAT=4  Q:(+SDSTAT=8)&($P(SDSTAT,"-",2)="NC")  D:"114238"[+SDSTAT VIS Q
     102 Q:SDSTAT=4  D:"114238"[SDSTAT VIS Q
    107103 ;
    108 VIS S ^TMP(SDS1,$J,SDS2,"VISIT",$S(SDSTAT=2:"OWK",(+SDSTAT=8)&('SDNCOU):"OWK",1:"NWK"),DFN,$P(SDDT,"."))="" Q:(+SDSTAT'=2)&(+SDSTAT'=8)
    109  I +SDSTAT=8,$P(SDOE0,U,7)="" D  Q
    110  .S ^TMP(SDS1,$J,SDS2,SDSTAT,10,"Action Required")=$G(^TMP(SDS1,$J,SDS2,SDSTAT,10,"Action Required"))+1
     104VIS S ^TMP(SDS1,$J,SDS2,"VISIT",$S(SDSTAT=2:"OWK",SDSTAT=8:"OWK",1:"NWK"),DFN,$P(SDDT,"."))="" Q:(SDSTAT'=2)&(SDSTAT'=8)
    111105 S SDSTX=$$STX(SDOE,SDOE0),^TMP(SDS1,$J,SDS2,SDSTAT,$P(SDSTX,U),$P(SDSTX,U,2))=$G(^TMP(SDS1,$J,SDS2,SDSTAT,$P(SDSTX,U),$P(SDSTX,U,2)))+1
    112106 Q:$P(SDSTX,U)'=8  S ^TMP(SDS1,$J,SDS2,"VISIT","ACC",DFN,$P(SDDT,"."))=""
     
    129123 ;
    130124DETAIL ;Set global for detailed list
    131  N SDIF S SDIF=0
    132125 D ^VADPT S SDPNAM=VADM(1),SDSSN=$P(VADM(2),U)
    133  I SDZ(1)="U",+SDSTAT'=4,'SDNCOU S:"114238"[+SDSTAT ^TMP(SDS1,$J,SDS2,"DETAIL",SDPNAM,DFN,SDSSN)="" Q
    134  I SDZ(1)="V",+SDSTAT'=4,'SDNCOU S:"114238"[+SDSTAT ^TMP(SDS1,$J,SDS2,"DETAIL",SDPNAM,DFN,SDSSN,$P(SDDT,"."))="" Q
     126 I SDZ(1)="U",SDSTAT'=4 S:"114238"[SDSTAT ^TMP(SDS1,$J,SDS2,"DETAIL",SDPNAM,DFN,SDSSN)="" Q
     127 I SDZ(1)="V",SDSTAT'=4 S:"114238"[SDSTAT ^TMP(SDS1,$J,SDS2,"DETAIL",SDPNAM,DFN,SDSSN,$P(SDDT,"."))="" Q
    135128 Q:'$D(SDZ(2))  ; SD*5.3*339
    136  I SDZ(2)'=2,SDZ(2)=+SDSTAT D  I SDIF Q
    137  .I (SDZ(2)=8) Q:$P(SDSTAT,"-",2)="CC"  I SDZ(3)'=9 S SDIF=1 Q
    138  .D DSET S SDIF=1
    139  Q:("28"'[SDZ(2))!("28"'[+SDSTAT)  Q:SDZ(2)'=+SDSTAT  D  I SDIF Q
    140  .I +SDSTAT=8,$P(SDSTAT,"-",2)="NC" S SDIF=1 Q
    141  .I 'SDZ(3) D DSET S SDIF=1
     129 I (SDZ(2)'=2)&(SDZ(2)'=8),SDZ(2)=SDSTAT D DSET Q
     130 Q:("28"'[SDZ(2))!("28"'[SDSTAT)!(SDZ(2)'=SDSTAT)  I 'SDZ(3) D DSET Q
    142131 D:+$$STX(SDOE,SDOE0)=SDZ(3) DSET Q
    143132 ;
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SCRPW9.m

    r628 r636  
    11SCRPW9 ;RENO/KEITH - Outpatient Encounter Workload Statistics (cont.) ; 15 Jul 98  02:38PM
    2  ;;5.3;Scheduling;**139,144,339,466,510**;AUG 13, 1993;Build 3
     2 ;;5.3;Scheduling;**139,144,339,466**;AUG 13, 1993;Build 2
    33UNARL(SDS1,SDS2) ;Print list of 'action required'/not accepted uniques
    44 ;Required input: SDS1,SDS2=subscript values
     
    3434 S DIR(0)="S^A:All transmission statuses;1:No transmission record;2:Not required, not transmitted;3:Rejected for transmission;4:Awaiting transmission;"
    3535 S DIR(0)=DIR(0)_"5:Transmitted, no acknowledgment;6:Transmitted, rejected;7:Transmitted, error;8:Transmitted, accepted"
    36  I SDZ(2)=8 S DIR(0)=DIR(0)_";9:Non-Count (not transmitted)"
    3736 W ! D ^DIR I $D(DTOUT)!$D(DUOUT) S SDZ(0)=-1 Q  ;SD*5.3*339 add sub-zero
    3837 S SDZ(3)=+Y
     
    4746 K SDH S SDPAGE=1,SDH(1)="<*>  DETAILED LIST OF DIVISION "_$S(SDZ(1)="U":"UNIQUES",SDZ(1)="V":"VISITS",1:"ENCOUNTERS")_"  <*>",SDH(2)="For division: "_SDZ(4)
    4847 I $G(SDZ(2)) S SDH(3)="Encounters with "_$P(^SD(409.63,SDZ(2),0),U)_" status"
    49  I $G(SDZ(2))'="","28"[SDZ(2) S SDH(4)="Transmission status: "_$P($T(TXS+SDZ(3)),";",2)
     48 I "28"[$G(SDZ(2)) S SDH(4)="Transmission status: "_$P($T(TXS+SDZ(3)),";",2)
    5049 D DHDR Q:SDOUT  I '$D(^TMP(SDS1,$J,SDS2,"DETAIL")) W !,"No records found in this category." Q
    5150 S SDCT=0 D @SDZ(1) Q
     
    9089 ;Transmitted, error
    9190 ;Transmitted, accepted
    92  ;Non-Count (not transmitted)
    9391 ;
    9492PARM ;Prompt for report parameters
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SDAMBAE2.m

    r628 r636  
    11SDAMBAE2 ;ALB/BOK - ADD/EDIT CON'T ;11/21/91  12:15 ;
    2  ;;5.3;Scheduling;**15,79,111,132**;Aug 13, 1993
     2 ;;5.3;Scheduling;**15,79,111,132**;Aug 13, 1993;Build 1
    33 ;
    44APP ; -- screen on APPOINTMENT TYPE field in VISIT file CLINIC STOP multiple
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SDAMBAE3.m

    r628 r636  
    11SDAMBAE3 ;ALB/BOK/MJK - ADD/EDIT CON'T ;7/8/91  12:18 ;
    2  ;;5.3;Scheduling;**18,29,40,111,132**;Aug 13, 1993
     2 ;;5.3;Scheduling;**18,29,40,111,132**;Aug 13, 1993;Build 1
    33 ;
    44DUP ; -- inp transform to check for duplicate CPTs in ^DD(409.51,21:25,0)
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SDAMODO3.m

    r628 r636  
    11SDAMODO3 ;ALB/SCK - PROVIDER DIAGNOSTICS REPORT OUTPUT ; 05 Oct 98  8:44 PM
    2  ;;5.3;Scheduling;**11,25,46,49,159,529**;Aug 13, 1993;Build 3
     2 ;;5.3;Scheduling;**11,25,46,49,159**;Aug 13, 1993
    33 Q
    44REPORT ;
     
    9696 N Y S Y=1
    9797 I PDIAG=1 G SELDXQ
    98  S DIC="^ICD9(",DIC(0)="XMS",X=DX_" "  ;SD/529
     98 S DIC="^ICD9(",DIC(0)="MZ",X=DX
    9999 D ^DIC K DIC I Y<0 S Y=0 G SELDXQ
    100100 I $D(PDIAG($P(Y,U))) G SELDXQ
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SDBT.m

    r628 r636  
    1 SDBT ; GENERATED FROM 'SDB' INPUT TEMPLATE(#485), FILE 44;05/05/06
     1SDBT ; GENERATED FROM 'SDB' INPUT TEMPLATE(#485), FILE 44;10/02/06
    22 D DE G BEGIN
    33DE S DIE="^SC(",DIC=DIE,DP=44,DL=1,DIEL=0,DU="" K DG,DE,DB Q:$O(^SC(DA,""))=""
     
    148148C12 G C12S:$D(DE(12))[0 K DB
    149149C12S S X="" G:DG(DQ)=X C12F1 K DB
    150 C12F1 N X,X1,X2 S DIXR=458 D C12X1(U) K X2 M X2=X D C12X1("O") K X1 M X1=X
     150C12F1 N X,X1,X2 S DIXR=473 D C12X1(U) K X2 M X2=X D C12X1("O") K X1 M X1=X
    151151 I $G(X(1))]"" D
    152152 . K ^SC("AST",X,DA)
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SDBT1.m

    r628 r636  
    1 SDBT1 ; ;05/05/06
     1SDBT1 ; ;10/02/06
    22 S X=DE(19),DIC=DIE
    33 K ^SC("ALTP",$E(X,1,30),DA)
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SDBT10.m

    r628 r636  
    1 SDBT10 ; ;05/05/06
     1SDBT10 ; ;10/02/06
    22 D DE G BEGIN
    33DE S DIE="^SC(",DIC=DIE,DP=44,DL=1,DIEL=0,DU="" K DG,DE,DB Q:$O(^SC(DA,""))=""
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SDBT11.m

    r628 r636  
    1 SDBT11 ; ;04/26/05
     1SDBT11 ; ;11/16/05
    22 D DE G BEGIN
    33DE S DIE="^SC(",DIC=DIE,DP=44,DL=1,DIEL=0,DU="" K DG,DE,DB Q:$O(^SC(DA,""))=""
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SDBT2.m

    r628 r636  
    1 SDBT2 ; ;05/05/06
     1SDBT2 ; ;10/02/06
    22 S X=DG(DQ),DIC=DIE
    33 S ^SC("ALTP",$E(X,1,30),DA)=""
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SDBT3.m

    r628 r636  
    1 SDBT3 ; ;05/05/06
     1SDBT3 ; ;10/02/06
    22 S X=DE(20),DIC=DIE
    33 K ^SC("ALTC",$E(X,1,30),DA)
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SDBT4.m

    r628 r636  
    1 SDBT4 ; ;05/05/06
     1SDBT4 ; ;10/02/06
    22 S X=DG(DQ),DIC=DIE
    33 S ^SC("ALTC",$E(X,1,30),DA)=""
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SDBT5.m

    r628 r636  
    1 SDBT5 ; ;05/05/06
     1SDBT5 ; ;10/02/06
    22 D DE G BEGIN
    33DE S DIE="^SC(",DIC=DIE,DP=44,DL=1,DIEL=0,DU="" K DG,DE,DB Q:$O(^SC(DA,""))=""
     
    141141C16 G C16S:$D(DE(16))[0 K DB
    142142C16S S X="" G:DG(DQ)=X C16F1 K DB
    143 C16F1 N X,X1,X2 S DIXR=457 D C16X1(U) K X2 M X2=X D C16X1("O") K X1 M X1=X
     143C16F1 N X,X1,X2 S DIXR=472 D C16X1(U) K X2 M X2=X D C16X1("O") K X1 M X1=X
    144144 I $G(X(1))]"" D
    145145 . K ^SC("ACST",X,DA)
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SDBT6.m

    r628 r636  
    1 SDBT6 ; ;05/05/06
     1SDBT6 ; ;10/02/06
    22 D DE G BEGIN
    33DE S DIE="^SC(D0,""PR"",",DIC=DIE,DP=44.1,DL=2,DIEL=1,DU="" K DG,DE,DB Q:$O(^SC(D0,"PR",DA,""))=""
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SDBT7.m

    r628 r636  
    1 SDBT7 ; ;05/05/06
     1SDBT7 ; ;10/02/06
    22 D DE G BEGIN
    33DE S DIE="^SC(D0,""DX"",",DIC=DIE,DP=44.11,DL=2,DIEL=1,DU="" K DG,DE,DB Q:$O(^SC(D0,"DX",DA,""))=""
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SDBT8.m

    r628 r636  
    1 SDBT8 ; ;05/05/06
     1SDBT8 ; ;10/02/06
    22 D DE G BEGIN
    33DE S DIE="^SC(D0,""SDPRIV"",",DIC=DIE,DP=44.04,DL=2,DIEL=1,DU="" K DG,DE,DB Q:$O(^SC(D0,"SDPRIV",DA,""))=""
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SDBT9.m

    r628 r636  
    1 SDBT9 ; ;05/05/06
     1SDBT9 ; ;10/02/06
    22 D DE G BEGIN
    33DE S DIE="^SC(D0,""SI"",",DIC=DIE,DP=44.03,DL=2,DIEL=1,DU="" K DG,DE,DB Q:$O(^SC(D0,"SI",DA,""))=""
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SDC.m

    r628 r636  
    11SDC ;MAN/GRR,ALB/LDB - CANCEL A CLINIC'S AVAILABILITY ; 3/2/05 2:11pm
    2  ;;5.3;Scheduling;**15,32,79,132,167,478,487,523**;Aug 13, 1993;Build 6
     2 ;;5.3;Scheduling;**15,32,79,132,167,478,487**;Aug 13, 1993
    33 N SDATA,SDCNHDL ; for evt dvr
    44SDC1 K SDLT,SDCP S NOAP="" D LO^DGUTL
     
    3939 D S S ^(1)="   "_$E(SD,6,7)_"    **CANCELLED**",FR=SD,TO=SD+.9 ;NAKED REFERENCE - ^SC(IFN,"ST",Date,1)
    4040C S FR=$O(^SC(SC,"S",FR)) I FR<1!(FR'<TO) W !!,"CANCELLED!  " K SDX G CHKEND^SDC0
    41  N TDH,TMPD,DIE,DR,NODE
     41 N TDH,TMPD,DIE,DR
    4242 F I=0:0 S I=$O(^SC(SC,"S",FR,1,I)) Q:I'>0  D
    4343 .S DFN=+^SC(SC,"S",FR,1,I,0),SDCNHDL=$$HANDLE^SDAMEVT(1)
    4444 .D BEFORE^SDAMEVT(.SDATA,DFN,FR,SC,I,SDCNHDL)
    4545 .S $P(^SC(SC,"S",FR,1,I,0),"^",9)="C"
    46  .S:$D(^DPT(DFN,"S",FR,0)) NODE=^(0)  ;added SD/523
    47  .Q:$P(NODE,U,1)'=SC                  ;added SD/523
    4846 .S ^DPT("ASDCN",SC,FR,DFN)=""
    4947 .S SDSC=SC,SDTTM=FR,SDPL=I,TDH=DH,TMPD=CANREM D CANCEL^SDCNSLT S DH=TDH ;SD/478
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SDCLAS.m

    r628 r636  
    11SDCLAS ;ALB/TMP,MRY - Clinic Assignment List Extract ;12/23/92  11:42
    2  ;;5.3;Scheduling;**63,243,517,523**;Aug 13, 1993;Build 6
     2 ;;5.3;Scheduling;**63,243,517**;Aug 13, 1993;Build 4
    33 ;SD/517 CORRECTED ALL $NEXT FUNCTIONAL COMMANDS
    44 S DIV="" D DIV^SDUTL I $T D CALST^SDDIV Q:Y<0
     
    1414 S PGM="START^SDCLAS",VAR="SDIFN^SDSRT^DIV^SDTS^SDSAV^SDFAST",VAL=SDIFN_"^"_SDSRT_"^"_DIV_"^"_SDTS_"^"_SDSAV_"^"_SDFAST D ZIS^DGUTQ Q:POP
    1515START K ^UTILITY($J) S SDSTOP=$S(SDSRT="S":SDIFN,1:""),SD1="",U="^" U IO G:SDIFN="ALL"!(SDSRT="S")!(SDSAV]"") ALL
    16 ONE S ONE=1 D INIT F SDAPPT=SDTS:0 S SDAPPT=$O(^SC(SDIFN,"S",SDAPPT)) Q:SDAPPT'>0  D PT
     16ONE S ONE=1 D INIT S SDAPPT=0 F  S SDAPPT=$O(^SC(SDIFN,"S",SDAPPT)) Q:'SDAPPT  D PT
    1717 D:'SDFAST AEB^SDCLAS0 G ^SDCLAS1
    1818ALL S ONE=0 I SDSAV']"" S SDIFN=0 F  S SDIFN=$O(^SC(SDIFN)) Q:'SDIFN  I $P(^(SDIFN,0),"^",3)="C" D APPT
    1919 I SDSAV]"" D APART S SDIFN=0 F  S SDIFN=$O(SDZ(SDIFN)) Q:'SDIFN  I $D(^SC(SDIFN,0)),$P(^(0),"^",3)="C" D APPT
    2020 G ^SDCLAS1
    21 APPT D CHECK I 'POP K ^UTILITY($J,"PAT",SDIFN) D INIT F SDAPPT=SDTS:0 S SDAPPT=$O(^SC(SDIFN,"S",SDAPPT)) D:SDAPPT>0 PT I SDAPPT'>0 D:'SDFAST AEB^SDCLAS0 Q
     21APPT D CHECK I 'POP K ^UTILITY($J,"PAT",SDIFN) D INIT S SDAPPT=0 F  S SDAPPT=$O(^SC(SDIFN,"S",SDAPPT)) D:SDAPPT PT I 'SDAPPT D:'SDFAST AEB^SDCLAS0 Q
    2222 Q
    2323PT S SD=0 F  S SD=$O(^SC(SDIFN,"S",SDAPPT,1,SD)) Q:'SD  Q:'$D(^(SD,0))  S DFN=+^(0) D PT1
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SDCLAV0.m

    r628 r636  
    11SDCLAV0 ;ALB/LDB - OUTPUT PATTERNS (cont.) ; 05 Mar 99 11:31 AM
    2  ;;5.3;Scheduling;**184,439,490,517,529**;Aug 13, 1993;Build 3
     2 ;;5.3;Scheduling;**184,439,490,517**;Aug 13, 1993;Build 4
    33 ;SD/517 CHANGED FOR LOOPS
    44 I 'VAUTC S SDC=0 F  S SDC=$O(VAUTC(SDC)) Q:'SDC  S SDV=VAUTC(SDC) D:VAUTD!($D(VAUTD(+$P(^SC(SDC,0),"^",15))))!('$P(^(0),"^",15)&$D(VAUTD($P(^DG(43,1,"GL"),"^",3)))) S1
    55 I VAUTC S SDC=0 F  S SDC=$O(^SC(SDC)) Q:'SDC  I $P(^(SDC,0),"^",3)="C" D:VAUTD!($D(VAUTD(+$P(^(0),"^",15))))!('$P(^(0),"^",15)&$D(VAUTD($P(^DG(43,1,"GL"),"^",3)))) S1
    66 I $D(^UTILITY($J,"SDNMS")) D S2^SDCLAV1
    7  ;following line commented off per SD*529
    8  ;S DGTCH="CLINIC AVAILABILITY REPORT^CLINIC^PAGE#" D:$E(IOST,1,2)="P-" TP^DGUTL K SDBD,SDCI,SDED D END^SDCLAV Q
    9  D END^SDCLAV Q
     7 S DGTCH="CLINIC AVAILABILITY REPORT^CLINIC^PAGE#" D:$E(IOST,1,2)="P-" TP^DGUTL K SDBD,SDCI,SDED D END^SDCLAV Q
    108S1 S SD=^SC(SDC,0),D=$S($P(SD,"^",15):$P(SD,"^",15),1:$P(^DG(43,1,"GL"),"^",3)),SD5=0,SDNM=$P(SD,"^")
    119 S $P(^UTILITY($J,"SDNMS",D,SDNM),"^",3)=SDC
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SDCWL2.m

    r628 r636  
    11SDCWL2 ;ALB/MLI - CONTINUATION OF CLINIC WORKLOAD REPORTS ; 07 Mar 99  6:41 PM
    2  ;;5.3;Scheduling;**140,132,171,184,529**;Aug 13, 1993;Build 3
     2 ;;5.3;Scheduling;**140,132,171,184**;Aug 13, 1993
    33PRO S SDAS=$S($P(^SC(I,"S",J,1,K,0),U,9)="C":"C",1:$P(^DPT(DFN,"S",J,0),U,2)) S SDP=$P(^DPT(DFN,"S",J,0),U,7)
    44PRO1 S SDP=$P(^DPT(DFN,"S",J,0),U,7) S:SDS="C" ^(SDN)=$S($D(^TMP($J,"CL",'$D(SDFL),SDN)):^(SDN),1:0)
     
    99 Q:$D(SDFL)!(SDRT="B")  S SDAPT=$S(SDF="D":J\1,1:J\100) S:'$D(^TMP($J,1,SDN,SDAPT)) (^(SDAPT,"CA"),^("NS"),^("IN"),^("OB"),^("UN"),^("SD"))=0
    1010 S TIME=$E($P(J,".",2)_"0000",1,4),TIME=$E(TIME,1,2)_":"_$E(TIME,3,4)
    11  S:SDNAM SDPN=$E($P(^DPT(DFN,0),U),1,20),SDSSN=$S($P(^(0),U,9)]"":$P(^(0),U,9),1:0),^TMP($J,1,SDN,SDAPT,"NM",SDPN,SDSSN,TIME,$S(SDAS]"":SDAS,SDOB:"OB",SDP=1:"S",SDP=3:"S",SDP=4:"U",1:" "))=""  ;added SDP=1 SD*529
     11 S:SDNAM SDPN=$E($P(^DPT(DFN,0),U),1,20),SDSSN=$S($P(^(0),U,9)]"":$P(^(0),U,9),1:0),^TMP($J,1,SDN,SDAPT,"NM",SDPN,SDSSN,TIME,$S(SDAS]"":SDAS,SDOB:"OB",SDP=3:"S",SDP=4:"U",1:" "))=""
    1212 K TIME I SDAS["C" S ^("CA")=^TMP($J,1,SDN,SDAPT,"CA")+1 Q
    1313 I SDAS="N"!(SDAS="NA") S ^("NS")=^TMP($J,1,SDN,SDAPT,"NS")+1 Q
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SDD0.m

    r628 r636  
    11SDD0 ;SF/GFT,ALB/BOK,JSH,LDB - REMAP A CLINIC ; 26 JAN 84  3:00 pm
    2  ;;5.3;Scheduling;**167,401,529**;Aug 13, 1993;Build 3
     2 ;;5.3;Scheduling;**167,401**;Aug 13, 1993
    33SETX ;
    44 N SDDIV
     
    88 S:SI=1 SI=4 S:SI=2 SI=4 S SDSOH=$S($P(SDSL,U,8)']"":0,1:1)
    99 K SDIN,SDRE,SDRE1 N SDNODE I $D(^SC(SC,"I")) S SDIN=+^("I"),SDRE=+$P(^("I"),"^",2),Y=SDRE D DTS^SDUTL S SDRE1=Y
    10  F DATE=$$FMADD^XLFDT(SDBD,-1):0 S X1=DATE,X2=1 N X D C^%DTC S DATE=X S SDNODE=$D(^SC(SC,"ST",DATE)) Q:DATE'>0!(DATE>SDED)  I $S('$D(SDIN):1,'SDIN:1,SDIN>DATE:1,SDRE'>DATE&(SDRE):1,1:0) K SM,SDHOL D CHECK  ;changed 1st part of For loop SD*529
     10 F DATE=SDBD-1:0 S X1=DATE,X2=1 N X D C^%DTC S DATE=X S SDNODE=$D(^SC(SC,"ST",DATE)) Q:DATE'>0!(DATE>SDED)  I $S('$D(SDIN):1,'SDIN:1,SDIN>DATE:1,SDRE'>DATE&(SDRE):1,1:0) K SM,SDHOL D CHECK
    1111 Q
    1212CHECK S X=DATE D DW^%DTC S DAY=$P("SUN^MON^TUES^WEDNES^THURS^FRI^SATUR",U,Y+1),DOW=Y
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SDLT.m

    r628 r636  
    11SDLT ;ALB/LDB - CANCELLATION LETTERS ; 14 Feb 2003
    2  ;;5.3;Scheduling;**185,213,281,330,398,523**;Aug 13, 1993;Build 6
     2 ;;5.3;Scheduling;**185,213,281,330,398**;Aug 13, 1993
    33 ;
    44 ;**************************************************************************
     
    1414 ;
    1515 ;WRITE GREETING AND OPENING TEXT OF LETTER
    16 PRT S DFN=$P(A,U,1)  ;SD*523
    17  I $D(SDNOSH) I $D(^DPT(DFN,.1)) S POP=1 Q:POP  ;SD/523
    18  S Y=DT D DTS^SDUTL
     16PRT S Y=DT D DTS^SDUTL
    1917 I +$G(SDFIRST)=0 W @IOF ;SD*5.3*330 Form feed only after letter #1
    2018 K SDFIRST
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SDN1.m

    r628 r636  
    11SDN1 ;BSN/GRR - NO-SHOW LETTERS ; 17 AUG 84  4:34 pm
    2  ;;5.3;Scheduling;**330,340,398,455,523**;Aug 13, 1993;Build 6
     2 ;;5.3;Scheduling;**330,340,398,455**;Aug 13, 1993
    33 N SDBAD
    44 I ANS["Y"&($D(C)) F A=0:0 S A=$O(^UTILITY($J,A)) Q:A'>0  F C=0:0 S C=$O(^(A,C)) Q:C'>0  S SC=+^(C),SDLET="" S:$D(^SC(SC,"LTR")) SDLET=+^("LTR") S:SDLET ^UTILITY($J,"SDLT",SDLET,A,C)=^UTILITY($J,A,C) S:'SDLET ^UTILITY($J,"NO",A,C)=SC D KLL
     
    99LST1 F C=0:0 S C=$O(^SC(C)) Q:C'>0  D LT,CHECK1 I $T,$S(SDV1="":1,SDV=SDV1:1,SDV="":1,1:0),'$D(SDVAUTC(+C)),$D(^SC(C,"S")) D OVER
    1010LST N SDFIRST S SDFIRST=1
    11  F SDLET=0:0 S SDLET=$O(^UTILITY($J,"SDLT",SDLET)) Q:SDLET'>0  F A=0:0 S A=$O(^UTILITY($J,"SDLT",SDLET,A)) Q:A'>0  I $S('$D(^DPT(A,.35)):1,$P(^(.35),"^",1)']"":1,1:0) N POP S POP=0 D ^SDLT Q:POP  D WR  ;SD*523 added quit
     11 F SDLET=0:0 S SDLET=$O(^UTILITY($J,"SDLT",SDLET)) Q:SDLET'>0  F A=0:0 S A=$O(^UTILITY($J,"SDLT",SDLET,A)) Q:A'>0  I $S('$D(^DPT(A,.35)):1,$P(^(.35),"^",1)']"":1,1:0) D ^SDLT,WR
    1212 I $D(^UTILITY($J,"NO")) W @IOF F A=0:0 S A=$O(^UTILITY($J,"NO",A)) Q:A'>0  F A1=0:0 S A1=$O(^(A,A1)) Q:A1'>0  Q:$$BADADR^DGUTL3(A)  W !,$P(^DPT(A,0),"^")," ",$P(^(0),"^",9)," has failed to keep the following appointment(s):" D NDT
    1313 W:$D(^UTILITY($J,"NO")) !,"However, there are no letters assigned to the clinic(s).",!!
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SDNOS0.m

    r628 r636  
    11SDNOS0 ;ALB/LDB - NO SHOW REPORT ; 07 May 99 10:21 AM
    2  ;;5.3;Scheduling;**20,194,410,517,523**;Aug 13, 1993;Build 6
     2 ;;5.3;Scheduling;**20,194,410,517**;Aug 13, 1993;Build 4
    33 D END1^SDNOS
    44 S (SDV1,SDIN,SDNM,SDNM1)=0,SDDIVO=SDDIV
     
    3333 Q
    3434 ;Added 2nd Quit below SD/517
    35  ;SD/523 - added Q:SDPAT="" to For loop
    36 CHK S SDAPP=0 F  S SDAPP=$O(^SC(SDCL,"S",SDBEG1,1,SDAPP)) Q:'SDAPP  Q:'$D(^(SDAPP,0))  I $D(^SC(SDCL,"S",SDBEG1,1,SDAPP))=10,$P(^(SDAPP,0),U,9)'="C" S SDPAT=$P(^SC(SDCL,"S",SDBEG1,1,SDAPP,0),U,1) Q:SDPAT=""  I $D(^DPT(SDPAT,"S",SDBEG1)) D CHK1
     35CHK S SDAPP=0 F  S SDAPP=$O(^SC(SDCL,"S",SDBEG1,1,SDAPP)) Q:'SDAPP  Q:'$D(^(SDAPP,0))  I $D(^SC(SDCL,"S",SDBEG1,1,SDAPP))=10,$P(^(SDAPP,0),U,9)'="C" S SDPAT=$P(^SC(SDCL,"S",SDBEG1,1,SDAPP,0),U,1) I $D(^DPT(SDPAT,"S",SDBEG1)) D CHK1
    3736 Q
    3837 ;
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SDPFSS.m

    r628 r636  
    1 SDPFSS ;ALB/SCK - Patient Financial Services System  ;22-APR-2005
    2  ;;5.3;Scheduling;**430**;Aug 13, 1993
     1SDPFSS ;ALB/SCK - Patient Financial Services System  ;11/24/0622-APR-2005
     2 ;;5.3;Scheduling;**430,502**;Aug 13, 1993  ;Build 14
     3 ; Modified from FOIA VISTA,
     4 ; Copyright (C) 2007 WorldVistA
     5 ;
     6 ; This program is free software; you can redistribute it and/or modify
     7 ; it under the terms of the GNU General Public License as published by
     8 ; the Free Software Foundation; either version 2 of the License, or
     9 ; (at your option) any later version.
     10 ;
     11 ; This program is distributed in the hope that it will be useful,
     12 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
     13 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     14 ; GNU General Public License for more details.
     15 ;
     16 ; You should have received a copy of the GNU General Public License
     17 ; along with this program; if not, write to the Free Software
     18 ; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
     19 ;
    320 ;
    421 Q
     
    1128 ; Check conditions before proceeding
    1229 Q:'$G(DFN)
     30 ; VWSD LOCAL MOD HERE SDVWNVAI VARIABLE, SEE DEFINITION AT VWSD LOCAL MOD BELOW
     31 I $D(SDVWNVAI) G OVER
    1332 Q:'$$CHECK
     33OVER ;
     34 ;END LOCAL MOD
    1435 Q:$$TESTPAT^VADPT(DFN)
    15  ;
     36 ;VWSD LOCAl MOD
    1637 ; Call the ICN API to generate an ICN if one does not exist for the patient.
     38 ;VWSD SDVWNVAI VARIABLE -LOCAL MOD FOR disabling the need for ICN or use of other ICN system for non-VA system
    1739 S SDOK=$$ICNLC^MPIF001(DFN)
    18  I SDOK<0 D
     40 I $D(SDVWNVAI) G OVER1
     41 I (SDOK<0) D
    1942 . D ERRMSG^SDPFSS2(SDOK)
    2043 ;
     44OVER1 ;
     45 ;END LOCAL MOD
    2146 ; Get event type
    2247 S SDEVENT=$S($D(SDAMEVT):$$GET1^DIQ(409.66,SDAMEVT,.01),1:"OTHER")
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SDWLE.m

    r628 r636  
    1 SDWLE ;BPOI/TEH - WAITING LIST-ENTER/EDIT;06/12/2002
    2  ;;5.3;scheduling;**263,415,446,524**;08/13/93;Build 29
     1SDWLE ;;IOFO BAY PINES/TEH - WAITING LIST-ENTER/EDIT;06/12/2002 ; 20 Aug 2002  2:10 PM
     2 ;;5.3;scheduling;**263,446**;AUG 13 1993;Build 77
    33 ;
    44 ;
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SDWLI.m

    r628 r636  
    1 SDWLI ;BPOI/TEH - DISPLAY PENDING APPOINTMENTS;6/1/05
    2  ;;5.3;scheduling;**263,327,394,446,524**;08/13/93;Build 29
     1SDWLI ;IOFO BAY PINES/TEH - DISPLAY PENDING APPOINTMENTS ; 6/1/05 12:56pm  ; Compiled April 16, 2007 10:00:47
     2 ;;5.3;scheduling;**263,327,394,446**;AUG 13 1993;Build 77
    33 ;
    44 ;
     
    3030 ;PATIENT LOOK-UP FROM WAIT LIST PATIENT FILE (^SDWL(409.3,IEN,0).
    3131 ;
    32  D SEL G EN:$D(DUOUT)
    3332 D PAT Q:'$D(SDWLDFN)
    3433 G END:SDWLDFN<0,END:SDWLDFN=""
    3534 Q:$D(DUOUT)
    3635EN1 K DIR,DIC,DR,DIE,SDWLDRG
     36 D SEL G EN:$D(DUOUT)
    3737 D GETFILE
    3838 D DISP G EN:'$D(DUOUT)
     
    4040 Q
    4141PAT ;PATIENT LOOK-UP
    42  ;PATCH SD*5.3*524 - SET DIC("S") FOR SCREEN OF OPEN/CLOSED ENTRIES
    43  S DIC("S")="I $D(SDWLY),SDWLY,$P(^SDWL(409.3,+Y,0),U,17)=""O"""
    4442 S DIC(0)="EMNQA",DIC=409.3 D ^DIC S (SDWLDFN,DFN)=$P(Y,U,2)
    4543 G PATEND:SDWLDFN=""
     
    5149 ;PROMPT FOR DISPLAY 'OPEN' WAITING LIST ONLY OR PROMPT FOR BEGINNING AND ENDING DATES
    5250 ;
    53 SEL K SDWLDRG S DIR(0)="Y" S DIR("A")="Do You Want to View Only 'OPEN' Wait Lists",DIR("B")="YES"
     51SEL K SDWLDRG S DIR(0)="YAO^^" S DIR("A")="Do You Want to View Only 'OPEN' Wait Lists? Yes// "
    5452 S DIR("?")="'Yes' for 'Open' and these Patient Record have not been dispositioned and 'No' for all Records."
    5553 W ! D ^DIR S SDWLY=Y W !
     
    104102 .S X=$G(^TMP("SDWLI",$J,SDWLCNT)),SDWLDA=$P(X,"~",2),SDWLIN=$P(X,U,3),SDWLCL=$P(X,U,4),SDWLTY=$P(X,U,5),SDWLPRI=$P(X,U,11)
    105103 .S SDWLTYP=$S(SDWLTY=1:$P(X,U,6),SDWLTY=2:$P(X,U,7),SDWLTY=3:$P(X,U,8),SDWLTY=4:$P(X,U,9),1:"")
    106  .S SDWLTYN=$S(SDWLTY=1:5,SDWLTY=2:6,SDWLTY=3:7,SDWLTY=4:8),SDWLCOM=$P($P(X,U,18),"~",1)
     104 .S SDWLTYN=$S(SDWLTY=1:5,SDWLTY=2:6,SDWLTY=3:7,SDWLTY=4:8,1:0),SDWLCOM=$P($P(X,U,18),"~",1)
    107105 .S SDWLDUZ=$P(X,U,10),SDWLPRV=$P(X,U,12),SDWLPROV=$P(X,U,13),SDWLX=$P(X,"~",3) D
    108106 ..I $D(SDWLDISX) S SDWLDIS=$P(SDWLDISX,U,1),SDWLDDUZ=$P(SDWLDISX,U,2),SDWLDIDT=$P(SDWLDISX,U,3)
     
    165163 K SDWLDRG,SDWLDT,SDWLDTD,SDWLDTP,SDWLDUZ,SDLWEDT,SDWLIN,SDLWP,SDWLPRI,SDWLPROV,SDLWPRV,SDWLSC,SDWLSP,SDWLSS,SDLWST,SDWLTY
    166164 K SDWLTYN,SDSWLTYP,SDLWX,SDWLY,SDWRB,SDWLBDT,SDWLDISC,SDWLERR,SDWLPRON,SDXSCAT,SDWLP,SDWLTYP
    167  K SDREMD,SDREMDD,SDREMR,SDREMRC,SDREMU,MM,SDWLEDT,SDWLLIST,SDWLST,SDWLX,VA,X,Y,YY
    168165 Q
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SDWLQSR.m

    r628 r636  
    1 SDWLQSR ;BPOI/TEH - WAIT LIST STAT REPORT;06/12/02
    2  ;;5.3;scheduling;**263,425,448,524**;08/13/93;Build 29
     1SDWLQSR ;;IOFO BAY PINES/TEH/WAIT LIST STAT REPORT
     2 ;;5.3;scheduling;**263,425,448**;AUG 13 1993
    33 ;
    44 ;
     
    77 ;
    88EN N ZCODE,ZTDESC,ZTDTH,ZTIO,ZTQUEDED,ZTREQ,ZTRTN,ZTSAVE,ZTSK,POP
    9  K ^TMP("SDWLQSR",$J)
    109 D HD
    11101 D INS G END:$D(DUOUT)
    12112 D DATE G END:$D(DUOUT)
    13 3 D EXCL G END:$D(DUOUT)
    1412 D QUE G END:$D(DUOUT)
    1513 Q
     
    3533 S ^TMP("SDWLQSR",$J,"DATE")=SDWLBDT_"^"_SDWLEDT K DIR,DIC,DIE,%DT Q
    3634 Q
    37 EXCL ;EXCLUDE # REMAINING =0 - PATCH SD*5.3*524
    38  S SDWLEXCL=0,^TMP("SDWLQSR",$J,"EXCL")=0
    39  S DIR("A",1)="Do you wish to exclude any Teams, Specialities or Specific"
    40  S DIR("A")="Clinics where ALL values are zero"
    41  S DIR("B")="YES",DIR(0)="Y^A0" D ^DIR
    42  I X["^" S DUOUT=1 Q
    43  I Y<0 S DUOUT=1 Q
    44 EXCL1 I Y S SDWLEXCL=1,^TMP("SDWLQSR",$J,"EXCL")=SDWLEXCL
    45  K DIR,X,Y,SDWLEXCL
    46  Q
    4735QUE ;Queue Report
    4836 N ZTQUEUED,POP
     
    6048 D ^%ZISC S:$D(ZTQUEUED) ZTREQ="@"
    6149 Q
    62 END D EN^SDWLKIL
    63  K DUOUT,SDWLBDT,SDWLEDT,SDWLERR,SDWLIST,SDWLPROM,SDWLTK
    64  Q
     50END D EN^SDWLKIL Q
    6551HD ;
    6652 W:$D(IOF) @IOF W !,?80-$L("Wait List Stat Report")\2,"Wait List Stat Report",!
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SDWLRP4.m

    r628 r636  
    11SDWLRP4 ;IOFO BAY PINES/TEH - WAITING LIST - MERGE RPC;06/28/2002 ; 26 Aug 2002  1:25 PM
    2  ;;5.3;scheduling;**263,485,497**;AUG 13 1993;Build 3
     2 ;;5.3;scheduling;**263**;AUG 13 1993;Build 4
     3 ;Modified from FOIA VISTA,
     4 ;Copyright 2008 WorldVistA.  Licensed under the terms of the GNU
     5 ;General Public License See attached copy of the License.
     6 ;
     7 ;This program is free software; you can redistribute it and/or modify
     8 ;it under the terms of the GNU General Public License as published by
     9 ;the Free Software Foundation; either version 2 of the License, or
     10 ;(at your option) any later version.
     11 ;
     12 ;This program is distributed in the hope that it will be useful,
     13 ;but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 ;GNU General Public License for more details.
     16 ;
     17 ;You should have received a copy of the GNU General Public License along
     18 ;with this program; if not, write to the Free Software Foundation, Inc.,
     19 ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
    320 ;
    421INPUT(SDWLRES,SDWLSTR) ;
     
    83100 ;SDWLE=4 = UNDETERMINED
    84101 ;
    85  S SDWLDE=+$H,SDWLE=0,(SDWLEE,SDWLRNED,SDWLDB)=0 D SB1
     102 S SDWLDE=+$H,SDWLE=1,SDWLEE=0 D SB1
    86103 G SB0:SDWLE=2
    87  S SDWLRNE=$$ENROLL^EASWTAPI(SDWLDFN) G SB0:$P(SDWLRNE,U,4)="A" S SDWLRNED=$P(SDWLRNE,U,3)
     104 S SDWLRNE=$$ENROLL^EASWTAPI(SDWLDFN) S SDWLRNED=$P(SDWLRNE,U,3)
    88105 I SDWLRNED S X=SDWLRNED D H^%DTC S SDWLDS=%H S SDWLDE=+$H,SDWLDET=SDWLDE-SDWLDS I SDWLDET<366 S SDWLE=1
    89106 I $D(SDWLDET),SDWLDET>365 S SDWLE=3
    90107 I 'SDWLRNE S SDWLE=4
    91 SB0 I $D(SDWLRNE),$P(SDWLRNE,U,4)="A" D
    92  .I 'SDWLEE.SDWLEE>730!(SDWLEE=730) S SDWLE=4 Q
    93  .I 'SDWLEE S SDWLE=4 Q
    94  S SDWLRNE=$S(SDWLE=1:"N",SDWLE=2:"E",SDWLE=3:"P",SDWLE=4:"U",1:"U")
     108SB0 S SDWLRNE=$S(SDWLE=1:"N",SDWLE=2:"E",SDWLE=3:"P",SDWLE=4:"U")
    95109 ;-Code here for filling in 409.3
    96110 S DR="27////^S X=SDWLRNE",DIE="^SDWL(409.3,",DA=SDWLDA D ^DIE
    97  S DR="27.1////^S X=$S($G(SDWLRNED):SDWLRNED,$G(SDWLD):SDWLD,1:"""")" D ^DIE
    98  S DR="27.2////^S X=SDWLDB" D ^DIE
    99111 S DR="9////^S X=DUZ" D ^DIE K DIE,DA,DR,%H
    100  K SDWLRNE,SDWLD,SDWLDE,SDWLEE,SDWLDET,DIC,DIR,DR,DIE,SDWLDS,SDWLE,SDWLRNED
    101112 Q
    102 SB1 I '$D(^DGCN(391.91,"B",SDWLDFN)) N SDWLDB S SDWLE=3 Q
     113SB1 I '$D(^DGCN(391.91,"B",SDWLDFN)) S SDWLE=3 Q
    103114 S SDWLX="" F  S SDWLX=$O(^DGCN(391.91,"B",SDWLDFN,SDWLX)) Q:SDWLX=""  D
    104  .S SDWLY=$G(^DGCN(391.91,SDWLX,0)) D
    105  ..;CHECK FOR TREATING FACILITY
    106  ..I $$TF^XUAF4(+$P(SDWLY,U,2)) D
    107  ...;SORT FOR LAST TREATMENT DATE
    108  ...S SDWLD=$P(SDWLY,U,3) I SDWLD S SDWLDTF(9999999-SDWLD)=SDWLX
    109  I '$D(SDWLDTF) Q
    110  S SDWLDTF=$O(SDWLDTF(0)) I SDWLDTF S (SDWLD,X)=9999999-SDWLDTF D H^%DTC S SDWLEE=SDWLDE-%H,SDWLDB=1 I SDWLEE<730 S SDWLE=2
    111  I $D(SDWLEE),SDWLEE>730 S SDWLE=3
    112  K SDWLDTF
     115 .S SDWLY=$G(^DGCN(391.91,SDWLX,0)),SDWLD=$P(^(0),U,3) I SDWLD S X=SDWLD D H^%DTC S SDWLEE=SDWLDE-%H I SDWLEE<730 S SDWLE=2
     116 .I $D(SDWLEE),SDWLEE>730 S SDWLE=3
    113117 Q
    114118FDA ;Get data from SDWLSTR string and set FDA.
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SDWLRSR.m

    r628 r636  
    1 SDWLRSR ;BPOI/TEH - WAIT LIST STAT REPORT;10/01/02
    2  ;;5.3;scheduling;**263,273,399,412,425,415,524**;08/13/93;Build 29
     1SDWLRSR ;;IOFO BAY PINES/TEH/WAIT LIST STAT REPORT ; 01 Oct 2002  4:42 PM  ; Compiled December 21, 2006 15:32:50
     2 ;;5.3;scheduling;**263,273,399,412,425,415,446**;AUG 13 1993;Build 77
    33 ;
    44 ; Removed Sort logic as routine exceeded SACC maximum size of 10000
     
    1515 I $D(DATE) S SDWLDATE=DATE
    1616 I $D(INS) S SDWLINS=INS
    17  I $D(EXCL) S SDWLEXCL=EXCL
    1817 I $D(ZTSAVE) D
    19  .S SDWLCT=$G(ZTSAVE("CT")),SDWLDATE=$G(ZTSAVE("DATE")),SDWLINS=$G(ZTSAVE("INS")),SDWLEXCL=$G(ZTSAVE("EXCL"))
     18 .S SDWLCT=$G(ZTSAVE("CT")),SDWLDATE=$G(ZTSAVE("DATE")),SDWLINS=$G(ZTSAVE("INS"))
    2019 I SDWLINS'="ALL" F I=1:1 S SDWL=$P(SDWLINS,";",I) Q:SDWL=""  S SDWL("INS",+SDWL)=""
    2120 S SDWLBD=$P(SDWLDATE,U,1),SDWLED=$P(SDWLDATE,U,2),SDWLPG=0
     
    2423 Q
    2524PRT ;PRINT REPORT
    26  S (TT1,TT2,TT3,TT4,TT5,TT6,TT7,TT8,TT9,TT10,TT11,TT12,SDWLPG)=0 D HD,HD1 ;SD*5.3*415
     25 S (T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13)=0  ;SD*5.3*446
     26 S (TT1,TT2,TT3,TT4,TT5,TT6,TT7,TT8,TT9,TT10,TT11,TT12,TT13,SDWLPG)=0 D HD,HD1  ;SD*5.3*415,446
    2727 I '$D(^TMP("SDWLRSR1")) W !!,"No Wait List Data to Report" Q
    28  S SDWLINS="" F  S SDWLINS=$O(^TMP("SDWLRSR1",$J,SDWLINS)) Q:SDWLINS=""  D  Q:POP  D T2  Q:POP  W !,"________________" I $Y>(IOSL-5) D:$D(SDWLSPT) SCR Q:POP  D HD,HD1  ;SD*5.3*412 added Quit for early exit
    29  .I $$S^%ZTLOAD S DUOUT="" Q
    30  .W !!,"INSTITUTION: ",SDWLINS,! K ^XTMP("SDWLRSR")
     28 S SDWLINS="" F  S SDWLINS=$O(^TMP("SDWLRSR1",$J,SDWLINS)) Q:SDWLINS=""  D  Q:POP  D T2  Q:POP  W !,"________________" I $Y>(IOSL-8) D:$D(SDWLSPT) SCR Q:POP  D HD,HD1  ;SD*5.3*412 added Quit for early exit; 446
     29 .I $$S^%ZTLOAD S DUOUT="" Q 
     30 .W !!,"INSTITUTION: ",SDWLINS,!
    3131 .S SDWLTY="" F  S SDWLTY=$O(^TMP("SDWLRSR1",$J,SDWLINS,SDWLTY)) Q:SDWLTY=""  D  Q:POP  ;SD*5.3*412 added Quit for early exit
    32  ..S SDWLTNM=$$EXTERNAL^DILFD(409.3,4,,SDWLTY)
     32 ..S SDWLTNM=$$EXTERNAL^DILFD(409.3,4,,SDWLTY) W !,$E(SDWLTNM,1,15)
    3333 ..S SDWLSCN="" F  S SDWLSCN=$O(^TMP("SDWLRSR1",$J,SDWLINS,SDWLTY,SDWLSCN)) Q:SDWLSCN=""  D  Q:POP  ;SD*5.3*412 added Quit for early exit
    34  ...S (T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12)=0 ;SD*5.3*415
    3534 ...S SDWLSCNM="" F  S SDWLSCNM=$O(^TMP("SDWLRSR1",$J,SDWLINS,SDWLTY,SDWLSCN,SDWLSCNM)) Q:SDWLSCNM=""  D  Q:POP  D T1  Q:POP  ;SD*5.3*412 added Quit
    3635 ....S SDWLPRI="" F  S SDWLPRI=$O(^TMP("SDWLRSR1",$J,SDWLINS,SDWLTY,SDWLSCN,SDWLSCNM,SDWLPRI)) Q:SDWLPRI=""  D  Q:POP  ;SD*5.3*412 added Quit
    37  .....S SDWLFLG=0
    38  .....S SDWLPR=+$G(^TMP("SDWLRSR1",$J,SDWLINS,SDWLTY,SDWLSCN,SDWLSCNM,SDWLPRI,"PR")) I SDWLEXCL,SDWLPR S SDWLFLG=1
    39  .....S SDWLCL=+$G(^TMP("SDWLRSR1",$J,SDWLINS,SDWLTY,SDWLSCN,SDWLSCNM,SDWLPRI,"CL")) I 'SDWLFLG,SDWLEXCL,SDWLCL S SDWLFLG=1
    40  .....S SDWLD=+$G(^TMP("SDWLRSR1",$J,SDWLINS,SDWLTY,SDWLSCN,SDWLSCNM,SDWLPRI,"SDWLD")) I 'SDWLFLG,SDWLEXCL,SDWLD S SDWLFLG=1 ;SD*5.3*415
    41  .....S SDWLNC=+$G(^TMP("SDWLRSR1",$J,SDWLINS,SDWLTY,SDWLSCN,SDWLSCNM,SDWLPRI,"SDWLNC")) I 'SDWLFLG,SDWLEXCL,SDWLNC S SDWLFLG=1 ;SD*5.3*415
    42  .....S SDWLSA=+$G(^TMP("SDWLRSR1",$J,SDWLINS,SDWLTY,SDWLSCN,SDWLSCNM,SDWLPRI,"SDWLSA")) I 'SDWLFLG,SDWLEXCL,SDWLSA S SDWLFLG=1 ;SD*5.3*415
    43  .....S SDWLCC=+$G(^TMP("SDWLRSR1",$J,SDWLINS,SDWLTY,SDWLSCN,SDWLSCNM,SDWLPRI,"SDWLCC")) I 'SDWLFLG,SDWLEXCL,SDWLCC S SDWLFLG=1 ;SD*5.3*415
    44  .....S SDWLNN=+$G(^TMP("SDWLRSR1",$J,SDWLINS,SDWLTY,SDWLSCN,SDWLSCNM,SDWLPRI,"SDWLNN")) I 'SDWLFLG,SDWLEXCL,SDWLNN S SDWLFLG=1 ;SD*5.3*415
    45  .....S SDWLER=+$G(^TMP("SDWLRSR1",$J,SDWLINS,SDWLTY,SDWLSCN,SDWLSCNM,SDWLPRI,"SDWLER")) I 'SDWLFLG,SDWLEXCL,SDWLER S SDWLFLG=1 ;SD*5.3*415
    46  .....S SDWLTR=+$G(^TMP("SDWLRSR1",$J,SDWLINS,SDWLTY,SDWLSCN,SDWLSCNM,SDWLPRI,"SDWLTR"))  I 'SDWLFLG,SDWLEXCL,SDWLTR S SDWLFLG=1 ;SD*5.3*415
    47  .....S SDWLAD=+$G(^TMP("SDWLRSR1",$J,SDWLINS,SDWLTY,SDWLSCN,SDWLSCNM,SDWLPRI,"AD")) I 'SDWLFLG,SDWLEXCL,SDWLAD S SDWLFLG=1 ;SD*5.3*415
    48  .....S SDWLRR=+$G(^TMP("SDWLRSR1",$J,SDWLINS,SDWLTY,SDWLSCN,SDWLSCNM,SDWLPRI,"RR")) I 'SDWLFLG,SDWLEXCL,SDWLRR S SDWLFLG=1 ;SD*5.3*415
    49  .....S SDWLNR=+$G(^TMP("SDWLRSR1",$J,SDWLINS,SDWLTY,SDWLSCN,SDWLSCNM,SDWLPRI,"NR")) I 'SDWLFLG,SDWLEXCL,SDWLNR S SDWLFLG=1 ;W ?72,$J(SDWLNR,3)
    50  .....I 'SDWLEXCL,'SDWLFLG S SDWLFG=1
    51  .....I SDWLEXCL,'SDWLFLG Q
    52  .....I '$D(^XTMP("SDWLRSR",$J,SDWLTNM)) W !,$E(SDWLTNM,1,15) S ^XTMP("SDWLRSR",$J,SDWLTNM)=""
    53  .....W !?2,$E(SDWLSCNM_" "_$S(SDWLPRI="A":"ASAP",SDWLPRI="F":"FUTURE",1:""),1,17)
    54  .....S T1=T1+SDWLPR,TT1=TT1+SDWLPR W ?21,$J(SDWLPR,3)
    55  .....S T2=T2+SDWLCL,TT2=TT2+SDWLCL W ?26,$J(SDWLCL,3)
    56  .....S T3=T3+SDWLD,TT3=TT3+SDWLD W ?31,$J(SDWLD,3)
    57  .....S T4=T4+SDWLNC,TT4=TT4+SDWLNC W ?36,$J(SDWLNC,3)
    58  .....S T5=T5+SDWLSA,TT5=TT5+SDWLSA W ?41,$J(SDWLSA,3)
    59  .....S T6=T6+SDWLCC,TT6=TT6+SDWLCC W ?46,$J(SDWLCC,3)
    60  .....S T7=T7+SDWLNN,TT7=TT7+SDWLNN W ?51,$J(SDWLNN,3)
    61  .....S T8=T8+SDWLER,TT8=TT8+SDWLER W ?56,$J(SDWLER,3)
    62  .....S T9=T9+SDWLTR,TT9=TT9+SDWLTR W ?61,$J(SDWLTR,3) ;SD*5.3*415
    63  .....S T10=T10+SDWLAD,TT10=TT10+SDWLAD W ?66,$J(SDWLAD,3) ;SD*5.3*415
    64  .....S T11=T11+SDWLRR,TT11=TT11+SDWLRR W ?71,$J(SDWLRR,3) ;SD*5.3*415
    65  .....S T12=T12+SDWLNR,TT12=TT12+SDWLNR W ?76,$J(SDWLNR,3) ;SD*5.3*415
    66  .....I $Y>(IOSL-5) D:$D(SDWLSPT) SCR Q:POP  D HD,HD1  ;SD*5.3*412
     36 .....N SDWLCLO  ; SD*5.3*446
     37 .....W !,?2,$E(SDWLSCNM,1,10)," ",$S(SDWLPRI="A":"ASAP",SDWLPRI="F":"FUTURE",1:"")
     38 .....S SDWLPR=+$G(^TMP("SDWLRSR1",$J,SDWLINS,SDWLTY,SDWLSCN,SDWLSCNM,SDWLPRI,"PR")) W ?20,SDWLPR
     39 .....S SDWLCLO=+$G(^TMP("SDWLRSR1",$J,SDWLINS,SDWLTY,SDWLSCN,SDWLSCNM,SDWLPRI,"CL")) W ?27,SDWLCLO  ;SD*5.3*446
     40 .....S SDWLD=+$G(^TMP("SDWLRSR1",$J,SDWLINS,SDWLTY,SDWLSCN,SDWLSCNM,SDWLPRI,"SDWLD")) W ?34,SDWLD  ;SD*5.3*415,446
     41 .....S SDWLNC=+$G(^TMP("SDWLRSR1",$J,SDWLINS,SDWLTY,SDWLSCN,SDWLSCNM,SDWLPRI,"SDWLNC")) W ?41,SDWLNC  ;SD*5.3*415,446
     42 .....S SDWLSA=+$G(^TMP("SDWLRSR1",$J,SDWLINS,SDWLTY,SDWLSCN,SDWLSCNM,SDWLPRI,"SDWLSA")) W ?48,SDWLSA  ;SD*5.3*415,446
     43 .....S SDWLCC=+$G(^TMP("SDWLRSR1",$J,SDWLINS,SDWLTY,SDWLSCN,SDWLSCNM,SDWLPRI,"SDWLCC")) W ?55,SDWLCC  ;SD*5.3*415,446
     44 .....S SDWLNN=+$G(^TMP("SDWLRSR1",$J,SDWLINS,SDWLTY,SDWLSCN,SDWLSCNM,SDWLPRI,"SDWLNN")) W ?62,SDWLNN  ;SD*5.3*415,446
     45 .....S SDWLER=+$G(^TMP("SDWLRSR1",$J,SDWLINS,SDWLTY,SDWLSCN,SDWLSCNM,SDWLPRI,"SDWLER")) W ?69,SDWLER  ;SD*5.3*415,446
     46 .....S SDWLCL=+$G(^TMP("SDWLRSR1",$J,SDWLINS,SDWLTY,SDWLSCN,SDWLSCNM,SDWLPRI,"SDWLCL")) W ?76,SDWLCL  ;SD*5.3*415,446
     47 .....S SDWLTR=+$G(^TMP("SDWLRSR1",$J,SDWLINS,SDWLTY,SDWLSCN,SDWLSCNM,SDWLPRI,"SDWLTR")) W ?83,SDWLTR  ;SD*5.3*415,446
     48 .....S SDWLAD=+$G(^TMP("SDWLRSR1",$J,SDWLINS,SDWLTY,SDWLSCN,SDWLSCNM,SDWLPRI,"AD")) W ?90,SDWLAD  ;SD*5.3*415,446
     49 .....S SDWLRR=+$G(^TMP("SDWLRSR1",$J,SDWLINS,SDWLTY,SDWLSCN,SDWLSCNM,SDWLPRI,"RR")) W ?97,SDWLRR  ;SD*5.3*415,446
     50 .....S SDWLNR=+$G(^TMP("SDWLRSR1",$J,SDWLINS,SDWLTY,SDWLSCN,SDWLSCNM,SDWLPRI,"NR")) W ?104,SDWLNR  ;SD*5.3*446
     51 .....S T1=T1+SDWLPR,TT1=TT1+SDWLPR
     52 .....S T2=T2+SDWLCLO,TT2=TT2+SDWLCLO  ;SD*5.3*446
     53 .....S T3=T3+SDWLD,TT3=TT3+SDWLD
     54 .....S T4=T4+SDWLNC,TT4=TT4+SDWLNC
     55 .....S T5=T5+SDWLSA,TT5=TT5+SDWLSA
     56 .....S T6=T6+SDWLCC,TT6=TT6+SDWLCC
     57 .....S T7=T7+SDWLNN,TT7=TT7+SDWLNN
     58 .....S T8=T8+SDWLER,TT8=TT8+SDWLER
     59 .....S T9=T9+SDWLCL,TT9=TT9+SDWLCL  ;SD*5.3*446
     60 .....S T10=T10+SDWLTR,TT10=TT10+SDWLTR  ;SD*5.3*446
     61 .....S T11=T11+SDWLAD,TT11=TT11+SDWLAD  ;SD*5.3*446
     62 .....S T12=T12+SDWLRR,TT12=TT12+SDWLRR  ;SD*5.3*446
     63 .....S T13=T13+SDWLNR,TT13=TT13+SDWLNR  ;SD*5.3*446
     64 .....I $Y>(IOSL-8) D:$D(SDWLSPT) SCR Q:POP  D HD,HD1  ;SD*5.3*412,446
    6765 Q
    6866SCR S DIR(0)="E" D ^DIR S:X="^" POP=1  ;SD*5.3*412
    6967 Q
    7068T1 ;
    71  I 'SDWLFLG,SDWLEXCL Q
    72  W !?20,"---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----"  ;SD*5.3*415
    73  W !,"Sub-Totals:"
    7469 ;write sub-totals
    75  W ?21,$J(T1,3),?26,$J(T2,3),?31,$J(T3,3),?36,$J(T4,3),?41,$J(T5,3),?46,$J(T6,3),?51,$J(T7,3),?56,$J(T8,3),?61,$J(T9,3),?66,$J(T10,3),?71,$J(T11,3),?76,$J(T12,3),!  ;SD*5.3*415
    76  S (T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12)=0  ;SD*5.3*415
    77  I $Y>(IOSL-5) D:$D(SDWLSPT) SCR Q:POP  D HD,HD1  ;SD*5.3*412
     70 W !?20,"------ ------ ------ ------ ------ ------ ------ ------ ------ ------ ------ ------ ------"  ;SD*5.3*446
     71 W !,"Sub-Totals:",?20,T1,?27,T2,?34,T3,?41,T4,?48,T5,?55,T6,?62,T7,?69,T8,?76,T9,?83,T10,?90,T11,?97,T12,?104,T13  ;SD*5.3*446
     72 S (T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13)=0  ;SD*5.3*415,446
     73 I $Y>(IOSL-8) D:$D(SDWLSPT) SCR Q:POP  D HD,HD1  ;SD*5.3*412,446
    7874 Q
    7975T2 W !,"Institution Totals:"
    80  W ?21,$J(TT1,3),?26,$J(TT2,3),?31,$J(TT3,3),?36,$J(TT4,3),?41,$J(TT5,3),?46,$J(TT6,3),?51,$J(TT7,3),?56,$J(TT8,3),?61,$J(TT9,3),?66,$J(TT10,3),?71,$J(TT11,3),?76,$J(TT12,3),!  ;SD*5.3*415
    81  S (TT1,TT2,TT3,TT4,TT5,TT6,TT7,TT8,TT9,TT10,TT11,TT12)=0  ;SD*5.3*415
    82  I $Y>(IOSL-5) D:$D(SDWLSPT) SCR Q:POP  D HD,HD1  ;SD*5.3*412
     76 W ?20,TT1,?27,TT2,?34,TT3,?41,TT4,?48,TT5,?55,TT6,?62,TT7,?69,TT8,?76,TT9,?83,TT10,?90,TT11,?97,TT12,?104,TT13,!  ;SD*5.3*446
     77 S (TT1,TT2,TT3,TT4,TT5,TT6,TT7,TT8,TT9,TT10,TT11,TT12,TT13)=0  ;SD*5.3*415,446
     78 I $Y>(IOSL-8) D:$D(SDWLSPT) SCR Q:POP  D HD,HD1  ;SD*5.3*412,446
    8379 Q
    8480HD W:$D(IOF) @IOF S SDWLPG=SDWLPG+1 W !!,SDWLDTP,?80-$L("Wait List (Sch/PCMM) Stat Report")\2,"Wait List (Sch/PCMM) Stat Report",?65,"Page: ",SDWLPG
     
    8783 Q
    8884HD1 ;
    89  W !,?20,"PREV"
    90  W ?65,"#"
    91  W ?75,"# NOT"
    92  W !,"WAIT LIST TYPE"
    93  W ?20,"REMN",?25,"CLSD",?31,"DTH",?37,"NC",?42,"SA",?47,"CC",?52,"NN",?57,"ER",?61,"TR",?65,"ADD",?70,"REMN",?75,"REMVD",!  ;SD*5.3*415
     85 W !,?20,"PREV",?90,"#",?97,"#",?104,"# NOT"  ;SD*5.3*415,446
     86 W !,"WAIT LIST TYPE",?20,"REMN",?27,"CLSD",?34,"DTH",?41,"NC",?48,"SA",?55,"CC",?62,"NN",?69,"ER",?76,"CL",?83,"TR",?90,"ADD",?97,"REMN",?104,"REMVD"  ;SD*5.3*446
    9487 Q
    9588END D EN^SDWLKIL
    9689 K ^TMP("SDWLRSR1",$J),^TMP("SDWLRSR2",$J),SDWLY1,SDWLX1,SDWLRDT,CT,I
    97  K T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,SDWLAD,SDWLBD,SDWLCC,SDWLCT,SDWLDFDT,SDWLDP,SDWLED,SDWLER,SDWLERR,SDWLFLD,X1,X2,DATE  ;SD*5.3*415
    98  K TT1,TT2,TT3,TT4,TT5,TT6,TT7,TT8,TT9,TT10,TT11,TT12,SDWLINSN,SDWLINST,SDWLNC,SDWLNN,SDWLNR,SDWLOFDT,SDWLOK1,SDWLOK2,SDWLTYPN  ;SD*5.3*415
    99  K SDWLOK3,SDWLPR,SDWLPR,SDWLPROM,SDWLRE,SDWLRFDT,SDWLRR,SDWLSA,SDWLSCN,SDWLSCNM,SDWLTASK,SDWLTK,SDWLTNM,SDWLTYNM,SDWLTYP,X4,SDWLTR  ;SD*5.3*415
     90 K T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,SDWLAD,SDWLBD,SDWLCC,SDWLCT,SDWLDFDT,SDWLDP,SDWLED,SDWLER,SDWLERR,SDWLFLD,X1,X2,DATE  ;SD*5.3*415,446
     91 K TT1,TT2,TT3,TT4,TT5,TT6,TT7,TT8,TT9,TT10,TT11,TT12,TT13,SDWLINSN,SDWLINST,SDWLNC,SDWLNN,SDWLNR,SDWLOFDT,SDWLOK1,SDWLOK2,SDWLTYPN  ;SD*5.3*415,446
     92 K SDWLOK3,SDWLPR,SDWLPR,SDWLPROM,SDWLRE,SDWLRFDT,SDWLRR,SDWLSA,SDWLSCN,SDWLSCNM,SDWLTASK,SDWLTK,SDWLTNM,SDWLTYNM,SDWLTYP,X4,SDWLTR,SDWLCL  ;SD*5.3*415,446
    10093 Q
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SDXA.m

    r628 r636  
    1 SDXA ; GENERATED FROM 'SDAMBT' INPUT TEMPLATE(#491), FILE 409.5;05/28/97
     1SDXA ; GENERATED FROM 'SDAMBT' INPUT TEMPLATE(#491), FILE 409.5;12/25/06
    22 D DE G BEGIN
    33DE S DIE="^SDV(",DIC=DIE,DP=409.5,DL=1,DIEL=0,DU="" K DG,DE,DB Q:$O(^SDV(DA,""))=""
     
    1414B G @DQ
    1515RE G PR:$D(DE(DQ)) D W,TR
    16 N I X="" G A:DV'["R",X:'DV,X:D'>0,A
     16N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
    1717RD G QS:X?."?" I X["^" D D G ^DIE17
    1818 I X="@" D D G Z^DIE2
     
    2020T G M^DIE17:DV,^DIE3:DV["V",P:DV'["S" X:$D(^DD(DP,DIFLD,12.1)) ^(12.1) I X?.ANP D SET I 'DDER X:$D(DIC("S")) DIC("S") I  W:'$D(DB(DQ)) "  "_% G V
    2121 K DDER G X
    22 P I DV["P" S DIC=U_DU,DIC(0)=$E("EN",$D(DB(DQ))+1)_"M"_$E("L",DV'["'") S:DIC(0)["L" DLAYGO=+$P(DV,"P",2) I DV'["*" D ^DIC S X=+Y,DIC=DIE G X:X<0
     22P I DV["P" S DIC=U_DU,DIC(0)=$E("EN",$D(DB(DQ))+1)_"M"_$E("L",DV'["'") S:DIC(0)["L" DLAYGO=+$P(DV,"P",2) G:DV["*" AST^DIED D NOSCR^DIED S X=+Y,DIC=DIE G X:X<0
    2323 G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z
    2424 I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X
    2525V D @("X"_DQ) K YS
    26 Z K DIC("S"),DLAYGO I $D(X),X'=U S DG(DW)=X S:DV["d" ^DISV(DUZ,"DIE",DLB)=X G A
     26Z K DIC("S"),DLAYGO I $D(X),X'=U D:$G(DE(DW,"INDEX")) SAVEVALS G:'$$KEYCHK UNIQFERR^DIE17 S DG(DW)=X S:DV["d" ^DISV(DUZ,"DIE",DLB)=X G A
    2727X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
    2828 S X="?BAD"
     
    4242 D ^DIR I 'DDER S %=Y(0),X=Y
    4343 Q
     44SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ))
     45 I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")=""
     46 E  K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")
     47 Q
     48NKEY W:'$D(ZTQUEUED) "??  Required key field" S X="?BAD" G QS
     49KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
    4450BEGIN S DNM="SDXA",DQ=1
    45  S:$D(DTIME)[0 DTIME=300 S D0=DA,DIEZ=491,U="^"
     51 N DIEZTMP,DIEZAR,DIEZRXR,DIIENS,DIXR K DIEFIRE,DIEBADK S DIEZTMP=$$GETTMP^DIKC1("DIEZ")
     52 M DIEZAR=^DIE(491,"AR") S DICRREC="TRIG^DIE17"
     53 S:$D(DTIME)[0 DTIME=300 S D0=DA,DIIENS=DA_",",DIEZ=491,U="^"
    46541 S D=0 K DE(1) ;10
    47  S DIFLD=10,DGO="^SDXA1",DC="14^409.51P^CS^",DV="409.51P40.7'",DW="0;1",DOW="CLINIC STOP CODE",DLB="Select "_DOW S:D DC=DC_D
     55 S DIFLD=10,DGO="^SDXA1",DC="15^409.51P^CS^",DV="409.51P40.7'",DW="0;1",DOW="CLINIC STOP CODE",DLB="Select "_DOW S:D DC=DC_D
    4856 S DU="DIC(40.7,"
    4957 I $D(DSC(409.51))#2,$P(DSC(409.51),"I $D(^UTILITY(",1)="" X DSC(409.51) S D=$O(^(0)) S:D="" D=-1 G M1
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SDXA1.m

    r628 r636  
    1 SDXA1 ; ;05/28/97
     1SDXA1 ; ;12/25/06
    22 D DE G BEGIN
    33DE S DIE="^SDV(D0,""CS"",",DIC=DIE,DP=409.51,DL=2,DIEL=1,DU="" K DG,DE,DB Q:$O(^SDV(D0,"CS",DA,""))=""
    44 I $D(^(0)) S %Z=^(0) S %=$P(%Z,U,2) S:%]"" DE(1)=% S %=$P(%Z,U,3) S:%]"" DE(2)=% S %=$P(%Z,U,4) S:%]"" DE(3)=% S %=$P(%Z,U,5) S:%]"" DE(4)=% S %=$P(%Z,U,7) S:%]"" DE(5)=%
     5 I $D(^("PR")) S %Z=^("PR") S %=$P(%Z,U,1) S:%]"" DE(6)=% S %=$P(%Z,U,2) S:%]"" DE(7)=% S %=$P(%Z,U,3) S:%]"" DE(8)=% S %=$P(%Z,U,4) S:%]"" DE(9)=% S %=$P(%Z,U,5) S:%]"" DE(10)=%
    56 K %Z Q
    67 ;
     
    1516B G @DQ
    1617RE G PR:$D(DE(DQ)) D W,TR
    17 N I X="" G A:DV'["R",X:'DV,X:D'>0,A
     18N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
    1819RD G QS:X?."?" I X["^" D D G ^DIE17
    1920 I X="@" D D G Z^DIE2
     
    2122T G M^DIE17:DV,^DIE3:DV["V",P:DV'["S" X:$D(^DD(DP,DIFLD,12.1)) ^(12.1) I X?.ANP D SET I 'DDER X:$D(DIC("S")) DIC("S") I  W:'$D(DB(DQ)) "  "_% G V
    2223 K DDER G X
    23 P I DV["P" S DIC=U_DU,DIC(0)=$E("EN",$D(DB(DQ))+1)_"M"_$E("L",DV'["'") S:DIC(0)["L" DLAYGO=+$P(DV,"P",2) I DV'["*" D ^DIC S X=+Y,DIC=DIE G X:X<0
     24P I DV["P" S DIC=U_DU,DIC(0)=$E("EN",$D(DB(DQ))+1)_"M"_$E("L",DV'["'") S:DIC(0)["L" DLAYGO=+$P(DV,"P",2) G:DV["*" AST^DIED D NOSCR^DIED S X=+Y,DIC=DIE G X:X<0
    2425 G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z
    2526 I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X
    2627V D @("X"_DQ) K YS
    27 Z K DIC("S"),DLAYGO I $D(X),X'=U S DG(DW)=X S:DV["d" ^DISV(DUZ,"DIE",DLB)=X G A
     28Z K DIC("S"),DLAYGO I $D(X),X'=U D:$G(DE(DW,"INDEX")) SAVEVALS G:'$$KEYCHK UNIQFERR^DIE17 S DG(DW)=X S:DV["d" ^DISV(DUZ,"DIE",DLB)=X G A
    2829X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
    2930 S X="?BAD"
     
    4344 D ^DIR I 'DDER S %=Y(0),X=Y
    4445 Q
     46SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ))
     47 I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")=""
     48 E  K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")
     49 Q
     50NKEY W:'$D(ZTQUEUED) "??  Required key field" S X="?BAD" G QS
     51KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
    4552BEGIN S DNM="SDXA1",DQ=1
    46531 S DW="0;2",DV="P200'",DU="",DLB="EDITED LAST BY",DIFLD=2
     
    4855 S X=$S($D(DUZ):DUZ,1:"")
    4956 S Y=X
    50  S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
     57 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
    5158 G RD:X="@",Z
    5259X1 Q
     
    5562 S X=$S($D(SDCL):SDCL,1:"")
    5663 S Y=X
    57  S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
     64 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
    5865 G RD:X="@",Z
    5966X2 Q
     
    6370 S X=$S(+SDEMP:+SDEMP,'+VAEL(1):"",1:+VAEL(1))
    6471 S Y=X
    65  S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
     72 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
    6673 G RD:X="@",Z
    67 C3 G C3S:$D(DE(3))[0 K DB S X=DE(3),DIC=DIE
     74C3 G C3S:$D(DE(3))[0 K DB
     75 S X=DE(3),DIC=DIE
    6876 ;
    69 C3S S X="" Q:DG(DQ)=X  K DB S X=DG(DQ),DIC=DIE
     77C3S S X="" G:DG(DQ)=X C3F1 K DB
     78 S X=DG(DQ),DIC=DIE
    7079 K DIV S DIV=X,D0=DA(1),DIV(0)=D0,D1=DA X ^DD(409.51,4,1,1,89.2) S Y(101)=$S($D(^SCE(D0,0)):^(0),1:"") S X=$S('$D(^DIC(8,+$P(Y(101),U,13),0)):"",1:$P(^(0),U,1)) S D0=I(0,0) S D1=I(1,0) S DIU=X K Y S X=DIV S X=X X ^DD(409.51,4,1,1,1.4)
    71  Q
     80C3F1 Q
    7281X3 Q
    73824 D:$D(DG)>9 F^DIE17,DE S DQ=4,DW="0;5",DV="R*P409.1'",DU="",DLB="APPOINTMENT TYPE",DIFLD=5
     
    7685 S X=SDAPTYP
    7786 S Y=X
    78  S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
     87 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
    7988 G RD:X="@",Z
    80 C4 G C4S:$D(DE(4))[0 K DB S X=DE(4),DIC=DIE
     89C4 G C4S:$D(DE(4))[0 K DB
     90 S X=DE(4),DIC=DIE
    8191 K DIV S DIV=X,D0=DA(1),DIV(0)=D0,D1=DA,DIV(1)=D1 S Y(0)=X S X="369"'[X I X S X=DIV S Y(1)=$S($D(^SDV(D0,"CS",D1,0)):^(0),1:"") S X=$P(Y(1),U,4),X=X S DIU=X K Y S X="" X ^DD(409.51,5,1,1,2.4)
    8292 S X=DE(4),DIC=DIE
     
    8696 S X=DE(4),DIC=DIE
    8797 ;
    88 C4S S X="" Q:DG(DQ)=X  K DB S X=DG(DQ),DIC=DIE
     98C4S S X="" G:DG(DQ)=X C4F1 K DB
     99 S X=DG(DQ),DIC=DIE
    89100 K DIV S DIV=X,D0=DA(1),DIV(0)=D0,D1=DA,DIV(1)=D1 S Y(0)=X S X="369"'[X I X S X=DIV S Y(1)=$S($D(^SDV(D0,"CS",D1,0)):^(0),1:"") S X=$P(Y(1),U,4),X=X S DIU=X K Y X ^DD(409.51,5,1,1,1.1) X ^DD(409.51,5,1,1,1.4)
    90101 S X=DG(DQ),DIC=DIE
     
    94105 S X=DG(DQ),DIC=DIE
    95106 K DIV S DIV=X,D0=DA(1),DIV(0)=D0,D1=DA X ^DD(409.51,5,1,4,89.2) S Y(101)=$S($D(^SCE(D0,0)):^(0),1:"") S X=$S('$D(^SD(409.1,+$P(Y(101),U,10),0)):"",1:$P(^(0),U,1)) S D0=I(0,0) S D1=I(1,0) S DIU=X K Y S X=DIV S X=X X ^DD(409.51,5,1,4,1.4)
    96  Q
     107C4F1 Q
    97108X4 Q
    981095 D:$D(DG)>9 F^DIE17,DE S DQ=5,DW="0;7",DV="D",DU="",DLB="DATE ENTRY MADE",DIFLD=7
    99110 S X=DT
    100111 S Y=X
    101  S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
     112 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
    102113 G RD:X="@",Z
    103114X5 Q
    104 6 D:$D(DG)>9 F^DIE17 G ^SDXA2
     1156 S DW="PR;1",DV="*P81'X",DU="",DLB="PROCEDURE 1",DIFLD=21
     116 S DU="ICPT("
     117 S X=$S($D(SDNEW(1)):SDNEW(1),1:"")
     118 S Y=X
     119 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
     120 G RD:X="@",Z
     121X6 Q
     1227 S DW="PR;2",DV="*P81'X",DU="",DLB="PROCEDURE 2",DIFLD=22
     123 S DU="ICPT("
     124 S X=$S($D(SDNEW(2)):SDNEW(2),1:"")
     125 S Y=X
     126 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
     127 G RD:X="@",Z
     128X7 Q
     1298 S DW="PR;3",DV="*P81'X",DU="",DLB="PROCEDURE 3",DIFLD=23
     130 S DU="ICPT("
     131 S X=$S($D(SDNEW(3)):SDNEW(3),1:"")
     132 S Y=X
     133 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
     134 G RD:X="@",Z
     135X8 Q
     1369 S DW="PR;4",DV="*P81'X",DU="",DLB="PROCEDURE 4",DIFLD=24
     137 S DU="ICPT("
     138 S X=$S($D(SDNEW(4)):SDNEW(4),1:"")
     139 S Y=X
     140 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
     141 G RD:X="@",Z
     142X9 Q
     14310 S DW="PR;5",DV="*P81'X",DU="",DLB="PROCEDURE 5",DIFLD=25
     144 S DU="ICPT("
     145 S X=$S($D(SDNEW(5)):SDNEW(5),1:"")
     146 S Y=X
     147 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
     148 G RD:X="@",Z
     149X10 Q
     15011 G 1^DIE17
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SDXACSE.m

    r628 r636  
    1 SDXACSE ; GENERATED FROM 'SDXACSE' INPUT TEMPLATE(#490), FILE 409.5;05/28/97
     1SDXACSE ; GENERATED FROM 'SDXACSE' INPUT TEMPLATE(#490), FILE 409.5;12/25/06
    22 D DE G BEGIN
    33DE S DIE="^SDV(",DIC=DIE,DP=409.5,DL=1,DIEL=0,DU="" K DG,DE,DB Q:$O(^SDV(DA,""))=""
     
    1414B G @DQ
    1515RE G PR:$D(DE(DQ)) D W,TR
    16 N I X="" G A:DV'["R",X:'DV,X:D'>0,A
     16N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
    1717RD G QS:X?."?" I X["^" D D G ^DIE17
    1818 I X="@" D D G Z^DIE2
     
    2020T G M^DIE17:DV,^DIE3:DV["V",P:DV'["S" X:$D(^DD(DP,DIFLD,12.1)) ^(12.1) I X?.ANP D SET I 'DDER X:$D(DIC("S")) DIC("S") I  W:'$D(DB(DQ)) "  "_% G V
    2121 K DDER G X
    22 P I DV["P" S DIC=U_DU,DIC(0)=$E("EN",$D(DB(DQ))+1)_"M"_$E("L",DV'["'") S:DIC(0)["L" DLAYGO=+$P(DV,"P",2) I DV'["*" D ^DIC S X=+Y,DIC=DIE G X:X<0
     22P I DV["P" S DIC=U_DU,DIC(0)=$E("EN",$D(DB(DQ))+1)_"M"_$E("L",DV'["'") S:DIC(0)["L" DLAYGO=+$P(DV,"P",2) G:DV["*" AST^DIED D NOSCR^DIED S X=+Y,DIC=DIE G X:X<0
    2323 G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z
    2424 I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X
    2525V D @("X"_DQ) K YS
    26 Z K DIC("S"),DLAYGO I $D(X),X'=U S DG(DW)=X S:DV["d" ^DISV(DUZ,"DIE",DLB)=X G A
     26Z K DIC("S"),DLAYGO I $D(X),X'=U D:$G(DE(DW,"INDEX")) SAVEVALS G:'$$KEYCHK UNIQFERR^DIE17 S DG(DW)=X S:DV["d" ^DISV(DUZ,"DIE",DLB)=X G A
    2727X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
    2828 S X="?BAD"
     
    4242 D ^DIR I 'DDER S %=Y(0),X=Y
    4343 Q
     44SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ))
     45 I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")=""
     46 E  K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")
     47 Q
     48NKEY W:'$D(ZTQUEUED) "??  Required key field" S X="?BAD" G QS
     49KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
    4450BEGIN S DNM="SDXACSE",DQ=1
    45  S:$D(DTIME)[0 DTIME=300 S D0=DA,DIEZ=490,U="^"
    46 1 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=1 D X1 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
     51 N DIEZTMP,DIEZAR,DIEZRXR,DIIENS,DIXR K DIEFIRE,DIEBADK S DIEZTMP=$$GETTMP^DIKC1("DIEZ")
     52 M DIEZAR=^DIE(490,"AR") S DICRREC="TRIG^DIE17"
     53 S:$D(DTIME)[0 DTIME=300 S D0=DA,DIIENS=DA_",",DIEZ=490,U="^"
     541 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=1 D X1 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
    4755X1 I '$D(SDAPTYP)!('$D(SDAPTYPR))!('$D(SDCPT))!('$D(SDJ)) W !,*7,"Variables must be defined, edit using option." S Y="@89"
    4856 Q
    49 2 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=2 D X2 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
     572 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=2 D X2 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
    5058X2 I '$S($D(SDUZ):1,$D(DUZ):1,1:0) W !,*7,"User not defined." S Y="@89"
    5159 Q
    52603 S D=0 K DE(1) ;10
    53  S DIFLD=10,DGO="^SDXACSE1",DC="14^409.51P^CS^",DV="409.51P40.7'",DW="0;1",DOW="CLINIC STOP CODE",DLB="Select "_DOW S:D DC=DC_D
     61 S DIFLD=10,DGO="^SDXACSE1",DC="15^409.51P^CS^",DV="409.51P40.7'",DW="0;1",DOW="CLINIC STOP CODE",DLB="Select "_DOW S:D DC=DC_D
    5462 S DU="DIC(40.7,"
    5563 I $D(DSC(409.51))#2,$P(DSC(409.51),"I $D(^UTILITY(",1)="" X DSC(409.51) S D=$O(^(0)) S:D="" D=-1 G M3
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SDXACSE1.m

    r628 r636  
    1 SDXACSE1 ; ;05/28/97
     1SDXACSE1 ; ;12/25/06
    22 D DE G BEGIN
    33DE S DIE="^SDV(D0,""CS"",",DIC=DIE,DP=409.51,DL=2,DIEL=1,DU="" K DG,DE,DB Q:$O(^SDV(D0,"CS",DA,""))=""
    4  I $D(^(0)) S %Z=^(0) S %=$P(%Z,U,2) S:%]"" DE(1)=% S %=$P(%Z,U,3) S:%]"" DE(2)=% S %=$P(%Z,U,4) S:%]"" DE(3)=% S %=$P(%Z,U,5) S:%]"" DE(4)=%
     4 I $D(^(0)) S %Z=^(0) S %=$P(%Z,U,2) S:%]"" DE(1)=% S %=$P(%Z,U,3) S:%]"" DE(2)=% S %=$P(%Z,U,4) S:%]"" DE(3)=% S %=$P(%Z,U,5) S:%]"" DE(4)=% S %=$P(%Z,U,6) S:%]"" DE(8)=%
     5 I $D(^(1)) S %Z=^(1) S %=$P(%Z,U,1) S:%]"" DE(6)=%
     6 I $D(^("PR")) S %Z=^("PR") S %=$P(%Z,U,1) S:%]"" DE(10)=% S %=$P(%Z,U,2) S:%]"" DE(12)=% S %=$P(%Z,U,3) S:%]"" DE(14)=% S %=$P(%Z,U,4) S:%]"" DE(16)=%
    57 K %Z Q
    68 ;
     
    1517B G @DQ
    1618RE G PR:$D(DE(DQ)) D W,TR
    17 N I X="" G A:DV'["R",X:'DV,X:D'>0,A
     19N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
    1820RD G QS:X?."?" I X["^" D D G ^DIE17
    1921 I X="@" D D G Z^DIE2
     
    2123T G M^DIE17:DV,^DIE3:DV["V",P:DV'["S" X:$D(^DD(DP,DIFLD,12.1)) ^(12.1) I X?.ANP D SET I 'DDER X:$D(DIC("S")) DIC("S") I  W:'$D(DB(DQ)) "  "_% G V
    2224 K DDER G X
    23 P I DV["P" S DIC=U_DU,DIC(0)=$E("EN",$D(DB(DQ))+1)_"M"_$E("L",DV'["'") S:DIC(0)["L" DLAYGO=+$P(DV,"P",2) I DV'["*" D ^DIC S X=+Y,DIC=DIE G X:X<0
     25P I DV["P" S DIC=U_DU,DIC(0)=$E("EN",$D(DB(DQ))+1)_"M"_$E("L",DV'["'") S:DIC(0)["L" DLAYGO=+$P(DV,"P",2) G:DV["*" AST^DIED D NOSCR^DIED S X=+Y,DIC=DIE G X:X<0
    2426 G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z
    2527 I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X
    2628V D @("X"_DQ) K YS
    27 Z K DIC("S"),DLAYGO I $D(X),X'=U S DG(DW)=X S:DV["d" ^DISV(DUZ,"DIE",DLB)=X G A
     29Z K DIC("S"),DLAYGO I $D(X),X'=U D:$G(DE(DW,"INDEX")) SAVEVALS G:'$$KEYCHK UNIQFERR^DIE17 S DG(DW)=X S:DV["d" ^DISV(DUZ,"DIE",DLB)=X G A
    2830X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
    2931 S X="?BAD"
     
    4345 D ^DIR I 'DDER S %=Y(0),X=Y
    4446 Q
     47SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ))
     48 I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")=""
     49 E  K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")
     50 Q
     51NKEY W:'$D(ZTQUEUED) "??  Required key field" S X="?BAD" G QS
     52KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
    4553BEGIN S DNM="SDXACSE1",DQ=1
    46541 S DW="0;2",DV="P200'",DU="",DLB="EDITED LAST BY",DIFLD=2
     
    4856 S X=$S($D(SDUZ):SDUZ,1:DUZ)
    4957 S Y=X
    50  S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
     58 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
    5159 G RD:X="@",Z
    5260X1 Q
     
    5563 S X=$P(SDCPT(SDJ),U,2)
    5664 S Y=X
    57  S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
     65 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
    5866 G RD:X="@",Z
    5967X2 Q
     
    6371 S X=$S($G(SDOEP):$P($G(^SCE(SDOEP,0)),U,13),1:"")
    6472 S Y=X
    65  S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
     73 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
    6674 G RD:X="@",Z
    67 C3 G C3S:$D(DE(3))[0 K DB S X=DE(3),DIC=DIE
     75C3 G C3S:$D(DE(3))[0 K DB
     76 S X=DE(3),DIC=DIE
    6877 ;
    69 C3S S X="" Q:DG(DQ)=X  K DB S X=DG(DQ),DIC=DIE
     78C3S S X="" G:DG(DQ)=X C3F1 K DB
     79 S X=DG(DQ),DIC=DIE
    7080 K DIV S DIV=X,D0=DA(1),DIV(0)=D0,D1=DA X ^DD(409.51,4,1,1,89.2) S Y(101)=$S($D(^SCE(D0,0)):^(0),1:"") S X=$S('$D(^DIC(8,+$P(Y(101),U,13),0)):"",1:$P(^(0),U,1)) S D0=I(0,0) S D1=I(1,0) S DIU=X K Y S X=DIV S X=X X ^DD(409.51,4,1,1,1.4)
    71  Q
     81C3F1 Q
    7282X3 Q
    73834 D:$D(DG)>9 F^DIE17,DE S DQ=4,DW="0;5",DV="R*P409.1'",DU="",DLB="APPOINTMENT TYPE",DIFLD=5
     
    7686 S X=SDAPTYP
    7787 S Y=X
    78  S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
     88 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
    7989 G RD:X="@",Z
    80 C4 G C4S:$D(DE(4))[0 K DB S X=DE(4),DIC=DIE
     90C4 G C4S:$D(DE(4))[0 K DB
     91 S X=DE(4),DIC=DIE
    8192 K DIV S DIV=X,D0=DA(1),DIV(0)=D0,D1=DA,DIV(1)=D1 S Y(0)=X S X="369"'[X I X S X=DIV S Y(1)=$S($D(^SDV(D0,"CS",D1,0)):^(0),1:"") S X=$P(Y(1),U,4),X=X S DIU=X K Y S X="" X ^DD(409.51,5,1,1,2.4)
    8293 S X=DE(4),DIC=DIE
     
    8697 S X=DE(4),DIC=DIE
    8798 ;
    88 C4S S X="" Q:DG(DQ)=X  K DB S X=DG(DQ),DIC=DIE
     99C4S S X="" G:DG(DQ)=X C4F1 K DB
     100 S X=DG(DQ),DIC=DIE
    89101 K DIV S DIV=X,D0=DA(1),DIV(0)=D0,D1=DA,DIV(1)=D1 S Y(0)=X S X="369"'[X I X S X=DIV S Y(1)=$S($D(^SDV(D0,"CS",D1,0)):^(0),1:"") S X=$P(Y(1),U,4),X=X S DIU=X K Y X ^DD(409.51,5,1,1,1.1) X ^DD(409.51,5,1,1,1.4)
    90102 S X=DG(DQ),DIC=DIE
     
    94106 S X=DG(DQ),DIC=DIE
    95107 K DIV S DIV=X,D0=DA(1),DIV(0)=D0,D1=DA X ^DD(409.51,5,1,4,89.2) S Y(101)=$S($D(^SCE(D0,0)):^(0),1:"") S X=$S('$D(^SD(409.1,+$P(Y(101),U,10),0)):"",1:$P(^(0),U,1)) S D0=I(0,0) S D1=I(1,0) S DIU=X K Y S X=DIV S X=X X ^DD(409.51,5,1,4,1.4)
    96  Q
     108C4F1 Q
    97109X4 Q
    98 5 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=5 D X5 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
     1105 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=5 D X5 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
    99111X5 I $D(SDNOTCG) S Y="@1"
    100112 Q
    101 6 D:$D(DG)>9 F^DIE17 G ^SDXACSE2
     1136 D:$D(DG)>9 F^DIE17,DE S DQ=6,DW="1;1",DV="SI",DU="",DLB="COMPUTER GENERATED?",DIFLD=11
     114 S DE(DW)="C6^SDXACSE1"
     115 S DU="1:YES;"
     116 S X=1
     117 S Y=X
     118 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
     119 G RD:X="@",Z
     120C6 G C6S:$D(DE(6))[0 K DB
     121 S X=DE(6),DIC=DIE
     122 K:X ^SDV("AG",DA(1),DA)
     123C6S S X="" G:DG(DQ)=X C6F1 K DB
     124 S X=DG(DQ),DIC=DIE
     125 S:X ^SDV("AG",DA(1),DA)=""
     126C6F1 Q
     127X6 Q
     1287 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=7 D X7 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
     129X7 I 'SDAPTYPR S Y="@1"
     130 Q
     1318 D:$D(DG)>9 F^DIE17,DE S DQ=8,DW="0;6",DV="S",DU="",DLB="UNRESOLVED APPT TYPE REASON",DIFLD=6
     132 S DU="1:DUAL ELIGIBILITY;2:POSSIBLE COMP & PEN;"
     133 S X=SDAPTYPR
     134 S Y=X
     135 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
     136 G RD:X="@",Z
     137X8 Q
     1389 S DQ=10 ;@1
     13910 S DW="PR;1",DV="*P81'X",DU="",DLB="PROCEDURE 1",DIFLD=21
     140 S DU="ICPT("
     141 S X=$P(SDCPT(SDJ),U,3)
     142 S Y=X
     143 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
     144 G RD:X="@",Z
     145X10 Q
     14611 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=11 D X11 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
     147X11 I $P(SDCPT(SDJ),U,4)']"" S Y="@99"
     148 Q
     14912 S DW="PR;2",DV="*P81'X",DU="",DLB="PROCEDURE 2",DIFLD=22
     150 S DU="ICPT("
     151 S X=$P(SDCPT(SDJ),U,4)
     152 S Y=X
     153 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
     154 G RD:X="@",Z
     155X12 Q
     15613 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=13 D X13 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
     157X13 I $P(SDCPT(SDJ),U,5)']"" S Y="@99"
     158 Q
     15914 S DW="PR;3",DV="*P81'X",DU="",DLB="PROCEDURE 3",DIFLD=23
     160 S DU="ICPT("
     161 S X=$P(SDCPT(SDJ),U,5)
     162 S Y=X
     163 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
     164 G RD:X="@",Z
     165X14 Q
     16615 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=15 D X15 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
     167X15 I $P(SDCPT(SDJ),U,6)']"" S Y="@99"
     168 Q
     16916 S DW="PR;4",DV="*P81'X",DU="",DLB="PROCEDURE 4",DIFLD=24
     170 S DU="ICPT("
     171 S X=$P(SDCPT(SDJ),U,6)
     172 S Y=X
     173 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
     174 G RD:X="@",Z
     175X16 Q
     17617 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=17 D X17 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
     177X17 I $P(SDCPT(SDJ),U,7)']"" S Y="@99"
     178 Q
     17918 D:$D(DG)>9 F^DIE17 G ^SDXACSE2
  • FOIAVistA/tag/r/SCHEDULING-SD-SC/SDXACSE2.m

    r628 r636  
    1 SDXACSE2 ; ;05/28/97
     1SDXACSE2 ; ;12/25/06
    22 D DE G BEGIN
    33DE S DIE="^SDV(D0,""CS"",",DIC=DIE,DP=409.51,DL=2,DIEL=1,DU="" K DG,DE,DB Q:$O(^SDV(D0,"CS",DA,""))=""
    4  I $D(^(0)) S %Z=^(0) S %=$P(%Z,U,6) S:%]"" DE(3)=%
    5  I $D(^(1)) S %Z=^(1) S %=$P(%Z,U,1) S:%]"" DE(1)=%
    6  I $D(^("PR")) S %Z=^("PR") S %=$P(%Z,U,1) S:%]"" DE(5)=% S %=$P(%Z,U,2) S:%]"" DE(7)=% S %=$P(%Z,U,3) S:%]"" DE(9)=% S %=$P(%Z,U,4) S:%]"" DE(11)=% S %=$P(%Z,U,5) S:%]"" DE(13)=%
     4 I $D(^("PR")) S %Z=^("PR") S %=$P(%Z,U,5) S:%]"" DE(1)=%
    75 K %Z Q
    86 ;
     
    1715B G @DQ
    1816RE G PR:$D(DE(DQ)) D W,TR
    19 N I X="" G A:DV'["R",X:'DV,X:D'>0,A
     17N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
    2018RD G QS:X?."?" I X["^" D D G ^DIE17
    2119 I X="@" D D G Z^DIE2
     
    2321T G M^DIE17:DV,^DIE3:DV["V",P:DV'["S" X:$D(^DD(DP,DIFLD,12.1)) ^(12.1) I X?.ANP D SET I 'DDER X:$D(DIC("S")) DIC("S") I  W:'$D(DB(DQ)) "  "_% G V
    2422 K DDER G X
    25 P I DV["P" S DIC=U_DU,DIC(0)=$E("EN",$D(DB(DQ))+1)_"M"_$E("L",DV'["'") S:DIC(0)["L" DLAYGO=+$P(DV,"P",2) I DV'["*" D ^DIC S X=+Y,DIC=DIE G X:X<0
     23P I DV["P" S DIC=U_DU,DIC(0)=$E("EN",$D(DB(DQ))+1)_"M"_$E("L",DV'["'") S:DIC(0)["L" DLAYGO=+$P(DV,"P",2) G:DV["*" AST^DIED D NOSCR^DIED S X=+Y,DIC=DIE G X:X<0
    2624 G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z
    2725 I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X
    2826V D @("X"_DQ) K YS
    29 Z K DIC("S"),DLAYGO I $D(X),X'=U S DG(DW)=X S:DV["d" ^DISV(DUZ,"DIE",DLB)=X G A
     27Z K DIC("S"),DLAYGO I $D(X),X'=U D:$G(DE(DW,"INDEX")) SAVEVALS G:'$$KEYCHK UNIQFERR^DIE17 S DG(DW)=X S:DV["d" ^DISV(DUZ,"DIE",DLB)=X G A
    3028X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
    3129 S X="?BAD"
     
    4543 D ^DIR I 'DDER S %=Y(0),X=Y
    4644 Q
     45SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ))
     46 I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")=""
     47 E  K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")
     48 Q
     49NKEY W:'$D(ZTQUEUED) "??  Required key field" S X="?BAD" G QS
     50KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
    4751BEGIN S DNM="SDXACSE2",DQ=1
    48 1 D:$D(DG)>9 F^DIE17,DE S DQ=1,DW="1;1",DV="SI",DU="",DLB="COMPUTER GENERATED?",DIFLD=11
    49  S DE(DW)="C1^SDXACSE2"
    50  S DU="1:YES;"
    51  S X=1
    52  S Y=X
    53  S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
    54  G RD:X="@",Z
    55 C1 G C1S:$D(DE(1))[0 K DB S X=DE(1),DIC=DIE
    56  K:X ^SDV("AG",DA(1),DA)
    57 C1S S X="" Q:DG(DQ)=X  K DB S X=DG(DQ),DIC=DIE
    58  S:X ^SDV("AG",DA(1),DA)=""
    59  Q
    60 X1 Q
    61 2 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=2 D X2 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
    62 X2 I 'SDAPTYPR S Y="@1"
    63  Q
    64 3 D:$D(DG)>9 F^DIE17,DE S DQ=3,DW="0;6",DV="S",DU="",DLB="UNRESOLVED APPT TYPE REASON",DIFLD=6
    65  S DU="1:DUAL ELIGIBILITY;2:POSSIBLE COMP & PEN;"
    66  S X=SDAPTYPR
    67  S Y=X
    68  S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
    69  G RD:X="@",Z
    70 X3 Q
    71 4 S DQ=5 ;@1
    72 5 S DW="PR;1",DV="*P81'X",DU="",DLB="PROCEDURE 1",DIFLD=21
    73  S DU="ICPT("
    74  S X=$P(SDCPT(SDJ),U,3)
    75  S Y=X
    76  S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
    77  G RD:X="@",Z
    78 X5 Q
    79 6 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=6 D X6 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
    80 X6 I $P(SDCPT(SDJ),U,4)']"" S Y="@99"
    81  Q
    82 7 S DW="PR;2",DV="*P81'X",DU="",DLB="PROCEDURE 2",DIFLD=22
    83  S DU="ICPT("
    84  S X=$P(SDCPT(SDJ),U,4)
    85  S Y=X
    86  S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
    87  G RD:X="@",Z
    88 X7 Q
    89 8 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=8 D X8 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
    90 X8 I $P(SDCPT(SDJ),U,5)']"" S Y="@99"
    91  Q
    92 9 S DW="PR;3",DV="*P81'X",DU="",DLB="PROCEDURE 3",DIFLD=23
    93  S DU="ICPT("
    94  S X=$P(SDCPT(SDJ),U,5)
    95  S Y=X
    96  S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
    97  G RD:X="@",Z
    98 X9 Q
    99 10 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=10 D X10 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
    100 X10 I $P(SDCPT(SDJ),U,6)']"" S Y="@99"
    101  Q
    102 11 S DW="PR;4",DV="*P81'X",DU="",DLB="PROCEDURE 4",DIFLD=24
    103  S DU="ICPT("
    104  S X=$P(SDCPT(SDJ),U,6)
    105  S Y=X
    106  S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
    107  G RD:X="@",Z
    108 X11 Q
    109 12 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=12 D X12 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
    110 X12 I $P(SDCPT(SDJ),U,7)']"" S Y="@99"
    111  Q
    112 13 S DW="PR;5",DV="*P81'X",DU="",DLB="PROCEDURE 5",DIFLD=25
     521 S DW="PR;5",DV="*P81'X",DU="",DLB="PROCEDURE 5",DIFLD=25
    11353 S DU="ICPT("
    11454 S X=$P(SDCPT(SDJ),U,7)
    11555 S Y=X
    116  S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
     56 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
    11757 G RD:X="@",Z
    118 X13 Q
    119 14 S DQ=15 ;@99
    120 15 G 1^DIE17
     58X1 Q
     592 S DQ=3 ;@99
     603 G 1^DIE17
Note: See TracChangeset for help on using the changeset viewer.