SDECXML5 ;ALB/JCH - SCHEDULING ENHANCEMENTS 3 (cont) ;11/03/14 10:59am
;;5.3;Scheduling;**628**;Aug 13, 1993;Build 371
;
; ALL CLINICS
Q
ALLCLIN(SDLCNT,SDRPTYP,SDAT,SDFAC,SDIV,SDGRP,DTINC,CLNTAG,ALLCLDIV,SDCALL,SDNODE,GRPFLG,SDEBUG,XMLNODE) ; All Clinic
N SDCLDIV,APPDEM,ADJDIFF,ADJDEM,APPTOT,SDDATA,APPDEM,ADJDEM,APPLEN,ADJDIFF,SDSTP
N APPOVR,APPNEW,APPEST,ACTOT,DTNAM,GRPTOT,PRGDTOT,SDACTAP,SDFILT,SDCLIN,SDPRV,SDRESCH
D DTNAM^SDECXUTL(DTINC,.DTNAM)
;
; If the first clinic in this group, and more than one clinic, create an "All" clinic grouping
I $G(SDGRP),($G(SDCALL)<1),'($G(ALLCLDIV)=1) D
.I '$G(GRPFLG) S SDFILT=$$GRP^SDECXML(SDGRP) D SETTMPF^SDECXML(.SDLCNT,SDFILT,13)
.I $G(CLNTAG) D OUTPUT^SDECXUTL("</Rs>",15,.SDLCNT,SDEBUG,.CLNTAG,.GRPFLG,.DIVTAG,XMLNODE)
.S SDFILT=$$CLIN^SDECXML("All",1) D SETTMPF^SDECXML(.SDLCNT,SDFILT,15)
;
; Supply
N APPTOT
I ($G(ALLCLDIV)=1) S APPTOT=$G(^XTMP(SDNODE,DTNAM,SDRPTYP,SDAT,SDFAC,"APP","SUP"))
I ($G(ALLCLDIV)=2) S APPTOT=$G(^XTMP(SDNODE,"GROUP",DTNAM,SDRPTYP,SDAT,SDFAC,SDGRP,"APP","SUP"))
I '$G(ALLCLDIV) S APPTOT=$G(^XTMP(SDNODE,DTNAM,SDRPTYP,SDAT,SDFAC,SDIV,SDGRP,"APP","SUP"))
S SDDATA=$$PROV^SDECXML("All")_" "_$$RCASUP^SDECXML($P(APPTOT,"^"))
D SETREC^SDECXML(.SDLCNT,SDDATA,16)
;
; Totals at the group level - sum of all clinics in the group
; Appointments - Group at Facility level, Demand, Lengths
S APPTOT="",APPLEN="",SDACTAP="",APPDEM="",ACTOT="",ADJDEM="",ADJDIFF="",SDSTP=""
; Appointments - Group Level totals Demand, Length
I $G(SDIV) D
.S APPLEN="" F S APPLEN=$O(^XTMP(SDNODE,DTNAM,SDRPTYP,SDAT,SDFAC,SDIV,SDGRP,"APP","LEN",APPLEN)) Q:'APPLEN D
..S SDSTP="" F S SDSTP=$O(^XTMP(SDNODE,DTNAM,SDRPTYP,SDAT,SDFAC,SDIV,SDGRP,"APP","LEN",APPLEN,SDSTP)) Q:SDSTP="" D
...Q:SDSTP="STAT"
...S APPTOT=$G(^XTMP(SDNODE,DTNAM,SDRPTYP,SDAT,SDFAC,SDIV,SDGRP,"APP","LEN",APPLEN,SDSTP))
...Q:(APPTOT="")
...S APPDEM=APPDEM+$P(APPTOT,"^")
..S SDRESCH="" F S SDRESCH=$O(^XTMP(SDNODE,DTNAM,SDRPTYP,SDAT,SDFAC,SDIV,SDGRP,"APP","LEN",APPLEN,"STAT",SDRESCH)) Q:SDRESCH="" D
...Q:'($P(SDRESCH,";")="NSR"!($P(SDRESCH,";")="CPR")!($P(SDRESCH,";")="CCR"))
...S ADJDIFF=ADJDIFF+(^XTMP(SDNODE,DTNAM,SDRPTYP,SDAT,SDFAC,SDIV,SDGRP,"APP","LEN",APPLEN,"STAT",SDRESCH)*APPLEN)
.I ADJDIFF&APPDEM S ADJDEM=APPDEM-ADJDIFF
.S ADJDEM=$S($G(ADJDEM):ADJDEM,1:APPDEM) S:ADJDEM<0 ADJDEM=0
.D PARSE^SDECXML2(APPDEM,"All","All","DEM",+$G(APPLEN),+$G(SDSTP),$G(ADJDEM))
.S APPLEN="" F S APPLEN=$O(^XTMP(SDNODE,DTNAM,SDRPTYP,SDAT,SDFAC,SDIV,SDGRP,"APP","LEN",APPLEN)) Q:APPLEN="" D
..S SDSTP="" F S SDSTP=$O(^XTMP(SDNODE,DTNAM,SDRPTYP,SDAT,SDFAC,SDIV,SDGRP,"APP","LEN",APPLEN,SDSTP)) Q:SDSTP="" D
...S ACTOT=""
...S APPTOT=$G(^XTMP(SDNODE,DTNAM,SDRPTYP,SDAT,SDFAC,SDIV,SDGRP,"APP","LEN",APPLEN,SDSTP))
...S APPOVR=$P(APPTOT,"^",2),APPNEW=$P(APPTOT,"^",3),APPEST=$P(APPTOT,"^",4),ACTOT=APPNEW+APPEST
...I ACTOT D PARSE^SDECXML2(ACTOT,"All","All","APPACT",APPLEN,SDSTP)
...I APPOVR S SDDATA=$$PROV^SDECXML("All")_" "_$$OVRAP^SDECXML2(APPOVR,APPLEN,SDSTP) D SETREC^SDECXML(.SDLCNT,SDDATA,15)
...I APPNEW S SDDATA=$$PROV^SDECXML("All")_" "_$$NEWAP^SDECXML2(APPNEW,APPLEN,SDSTP) D SETREC^SDECXML(.SDLCNT,SDDATA,15)
...I APPEST S SDDATA=$$PROV^SDECXML("All")_" "_$$ESTAP^SDECXML2(APPEST,APPLEN,SDSTP) D SETREC^SDECXML(.SDLCNT,SDDATA,15)
.;
.; Appointments - Group Level totals Demand, Length
S APPTOT="",APPDEM="",ADJDIFF="",ADJDEM=""
I '$G(SDIV) D
.S APPLEN="" F S APPLEN=$O(^XTMP(SDNODE,"GROUP",DTNAM,SDRPTYP,SDAT,SDFAC,SDGRP,"APP","LEN",APPLEN)) Q:'APPLEN D
..S SDSTP="" F S SDSTP=$O(^XTMP(SDNODE,"GROUP",DTNAM,SDRPTYP,SDAT,SDFAC,SDGRP,"APP","LEN",APPLEN,SDSTP)) Q:SDSTP="" D
...Q:SDSTP="STAT"
...S APPTOT=$G(^XTMP(SDNODE,"GROUP",DTNAM,SDRPTYP,SDAT,SDFAC,SDGRP,"APP","LEN",APPLEN,SDSTP))
...Q:(APPTOT="")
...S APPDEM=APPDEM+$P(APPTOT,"^")
..S SDRESCH="" F S SDRESCH=$O(^XTMP(SDNODE,"GROUP",DTNAM,SDRPTYP,SDAT,SDFAC,SDGRP,"APP","LEN",APPLEN,"STAT",SDRESCH)) Q:SDRESCH="" D
...Q:'($P(SDRESCH,";")="NSR"!($P(SDRESCH,";")="CPR")!($P(SDRESCH,";")="CCR"))
...S ADJDIFF=ADJDIFF+(^XTMP(SDNODE,"GROUP",DTNAM,SDRPTYP,SDAT,SDFAC,SDGRP,"APP","LEN",APPLEN,"STAT",SDRESCH)*APPLEN)
...I ADJDIFF>APPDEM
.I ADJDIFF&APPDEM S ADJDEM=APPDEM-ADJDIFF
.S ADJDEM=$S($G(ADJDEM):ADJDEM,1:APPDEM) S:ADJDEM<0 ADJDEM=0
.D PARSE^SDECXML2(APPDEM,"All","All","DEM",APPLEN,SDSTP,ADJDEM)
.S APPLEN="" F S APPLEN=$O(^XTMP(SDNODE,"GROUP",DTNAM,SDRPTYP,SDAT,SDFAC,SDGRP,"APP","LEN",APPLEN)) Q:APPLEN="" D
..S SDSTP="" F S SDSTP=$O(^XTMP(SDNODE,"GROUP",DTNAM,SDRPTYP,SDAT,SDFAC,SDGRP,"APP","LEN",APPLEN,SDSTP)) Q:SDSTP="" D
...S ACTOT=""
...S APPTOT=$G(^XTMP(SDNODE,"GROUP",DTNAM,SDRPTYP,SDAT,SDFAC,SDGRP,"APP","LEN",APPLEN,SDSTP))
...S APPOVR=$P(APPTOT,"^",2),APPNEW=$P(APPTOT,"^",3),APPEST=$P(APPTOT,"^",4),ACTOT=APPNEW+APPEST
...I ACTOT D PARSE^SDECXML2(ACTOT,"All","All","APPACT",APPLEN,SDSTP)
...I APPOVR S SDDATA=$$PROV^SDECXML("All")_" "_$$OVRAP^SDECXML2(APPOVR,APPLEN,SDSTP) D SETREC^SDECXML(.SDLCNT,SDDATA,15)
...I APPNEW S SDDATA=$$PROV^SDECXML("All")_" "_$$NEWAP^SDECXML2(APPNEW,APPLEN,SDSTP) D SETREC^SDECXML(.SDLCNT,SDDATA,15)
...I APPEST S SDDATA=$$PROV^SDECXML("All")_" "_$$ESTAP^SDECXML2(APPEST,APPLEN,SDSTP) D SETREC^SDECXML(.SDLCNT,SDDATA,15)
;
; Encounters
I $G(SDIV) S GRPTOT=$G(^XTMP(SDNODE,DTNAM,SDRPTYP,SDAT,SDFAC,SDIV,SDGRP))
I '$G(SDIV) S GRPTOT=$G(^XTMP(SDNODE,"GROUP",DTNAM,SDRPTYP,SDAT,SDFAC,SDGRP))
I '(GRPTOT="") N SDI F SDI=1:1:4 D
.S SDDATA=$$PROV^SDECXML("All")_" "_$S(SDI=1:$$ENC^SDECXML($P(GRPTOT,"^",SDI)),SDI=2:$$NEW^SDECXML($P(GRPTOT,"^",SDI)),SDI=3:$$EST^SDECXML($P(GRPTOT,"^",SDI)),SDI=4:$$TEL^SDECXML($P(GRPTOT,"^",SDI)),1:"")
.Q:($TR(SDDATA,"^","")="")
.I '$G(GRPFLG) S SDFILT=$$GRP^SDECXML(SDGRP) D SETTMPF^SDECXML(.SDLCNT,SDFILT,13)
.D SETREC^SDECXML(.SDLCNT,SDDATA,15)
;
; Get the total for the provider at the Group level, is the sum of All clinics
; Provider's cross-division resourcegroup totals
N SDCLIN
I $G(SDIV) D
.S SDPRV="" F S SDPRV=$O(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,SDIV,"GRP",SDGRP,SDPRV)) Q:SDPRV="" D
..Q:(SDPRV'["^") S APPDEM="",APPTOT="",ADJDIFF="",ADJDEM=""
..S APPLEN=0 F S APPLEN=$O(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,SDIV,"GRP",SDGRP,SDPRV,"APP","LEN",APPLEN)) Q:'APPLEN D
...S SDSTP="" F S SDSTP=$O(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,SDIV,"GRP",SDGRP,SDPRV,"APP","LEN",APPLEN,SDSTP)) Q:SDSTP="" D
....Q:SDSTP="" S ACTOT=""
....S APPTOT=$G(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,SDIV,"GRP",SDGRP,SDPRV,"APP","LEN",APPLEN,SDSTP))
....Q:(APPTOT="")
....;I '$G(GRPFLG) S SDFILT=$$GRP^SDECXML(SDGRP) D SETTMPF^SDECXML(.SDLCNT,SDFILT,13)
....S APPDEM=APPDEM+$P(APPTOT,"^")
...S SDRESCH="" F S SDRESCH=$O(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,SDIV,"GRP",SDGRP,SDPRV,"APP","LEN",APPLEN,"STAT",SDRESCH)) Q:SDRESCH="" D
....Q:'($P(SDRESCH,";")="NSR"!($P(SDRESCH,";")="CPR")!($P(SDRESCH,";")="CCR"))
....S ADJDIFF=ADJDIFF+(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,SDIV,"GRP",SDGRP,SDPRV,"APP","LEN",APPLEN,"STAT",SDRESCH)*APPLEN)
..I ADJDIFF&APPDEM S ADJDEM=APPDEM-ADJDIFF
..S ADJDEM=$S($G(ADJDEM):ADJDEM,1:APPDEM)
..I '(APPDEM="") D PARSE^SDECXML2(APPDEM,"All",SDPRV,"DEM",APPLEN,SDSTP,ADJDEM)
..S APPOVR="",APPNEW="",APPEST="",APPTOT=""
..S APPLEN="" F S APPLEN=$O(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,SDIV,"GRP",SDGRP,SDPRV,"APP","LEN",APPLEN)) Q:'APPLEN D
...S SDSTP="" F S SDSTP=$O(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,SDIV,"GRP",SDGRP,SDPRV,"APP","LEN",APPLEN,SDSTP)) Q:SDSTP="" D
....S ACTOT=""
....S APPTOT=$G(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,SDIV,"GRP",SDGRP,SDPRV,"APP","LEN",APPLEN,SDSTP))
....Q:(APPTOT="")
....I '$G(GRPFLG) S SDFILT=$$GRP^SDECXML(SDGRP) D SETTMPF^SDECXML(.SDLCNT,SDFILT,13)
....S APPOVR=$P(APPTOT,"^",2),APPNEW=$P(APPTOT,"^",3),APPEST=$P(APPTOT,"^",4),ACTOT=APPNEW+APPEST
....D PARSE^SDECXML2(ACTOT,"All",SDPRV,"APPACT",APPLEN,SDSTP)
....I APPOVR S SDDATA=$$PROV^SDECXML(SDPRV)_" "_$$OVRAP^SDECXML2(APPOVR,APPLEN,SDSTP) D SETREC^SDECXML(.SDLCNT,SDDATA,15)
....I APPNEW S SDDATA=$$PROV^SDECXML(SDPRV)_" "_$$NEWAP^SDECXML2(APPNEW,APPLEN,SDSTP) D SETREC^SDECXML(.SDLCNT,SDDATA,15)
....I APPEST S SDDATA=$$PROV^SDECXML(SDPRV)_" "_$$ESTAP^SDECXML2(APPEST,APPLEN,SDSTP) D SETREC^SDECXML(.SDLCNT,SDDATA,15)
..;
..; Encounters
..I SDIV="All" S PRGDTOT=$G(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,"GRP",SDGRP,"PROV",SDPRV))
..I $G(SDIV) S PRGDTOT=$G(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,SDIV,"GRP",SDGRP,SDPRV))
..I '(PRGDTOT="") D
...N SDI F SDI=1:1:4 D
....S SDDATA=$$PROV^SDECXML(SDPRV)_" "_$S(SDI=1:$$ENC^SDECXML($P(PRGDTOT,"^",SDI)),SDI=2:$$NEW^SDECXML($P(PRGDTOT,"^",SDI)),SDI=3:$$EST^SDECXML($P(PRGDTOT,"^",SDI)),SDI=4:$$TEL^SDECXML($P(PRGDTOT,"^",SDI)),1:"")
....Q:($TR(SDDATA,"^","")="")
....D SETREC^SDECXML(.SDLCNT,SDDATA,15)
;
N SDCLIN
I '$G(SDIV) D
.S SDPRV="" F S SDPRV=$O(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,"GRP",SDGRP,"PROV",SDPRV)) Q:SDPRV="" D
..Q:(SDPRV'["^") S APPDEM="",APPTOT="",ADJDIFF="",ADJDEM=""
..S APPLEN=0 F S APPLEN=$O(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,"GRP",SDGRP,"PROV",SDPRV,"APP","LEN",APPLEN)) Q:'APPLEN D
...S SDSTP="" F S SDSTP=$O(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,"GRP",SDGRP,"PROV",SDPRV,"APP","LEN",APPLEN,SDSTP)) Q:SDSTP="" D
....Q:SDSTP="" S ACTOT=""
....S APPTOT=$G(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,"GRP",SDGRP,"PROV",SDPRV,"APP","LEN",APPLEN,SDSTP))
....Q:(APPTOT="")
....;I '$G(GRPFLG) S SDFILT=$$GRP^SDECXML(SDGRP) D SETTMPF^SDECXML(.SDLCNT,SDFILT,13)
....S APPDEM=APPDEM+$P(APPTOT,"^")
...S SDRESCH="" F S SDRESCH=$O(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,"GRP",SDGRP,"PROV",SDPRV,"APP","LEN",APPLEN,"STAT",SDRESCH)) Q:SDRESCH="" D
....Q:'($P(SDRESCH,";")="NSR"!($P(SDRESCH,";")="CPR")!($P(SDRESCH,";")="CCR"))
....S ADJDIFF=ADJDIFF+(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,"GRP",SDGRP,"PROV",SDPRV,"APP","LEN",APPLEN,"STAT",SDRESCH)*APPLEN)
..I ADJDIFF&APPDEM S ADJDEM=APPDEM-ADJDIFF
..S ADJDEM=$S($G(ADJDEM):ADJDEM,1:APPDEM)
..I '(APPDEM="") D PARSE^SDECXML2(APPDEM,"All",SDPRV,"DEM",APPLEN,SDSTP,ADJDEM)
..S APPOVR="",APPNEW="",APPEST="",APPTOT=""
..S APPLEN="" F S APPLEN=$O(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,"GRP",SDGRP,"PROV",SDPRV,"APP","LEN",APPLEN)) Q:'APPLEN D
...S SDSTP="" F S SDSTP=$O(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,"GRP",SDGRP,"PROV",SDPRV,"APP","LEN",APPLEN,SDSTP)) Q:SDSTP="" D
....S ACTOT=""
....S APPTOT=$G(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,"GRP",SDGRP,"PROV",SDPRV,"APP","LEN",APPLEN,SDSTP))
....Q:(APPTOT="")
....I '$G(GRPFLG) S SDFILT=$$GRP^SDECXML(SDGRP) D SETTMPF^SDECXML(.SDLCNT,SDFILT,13)
....S APPOVR=$P(APPTOT,"^",2),APPNEW=$P(APPTOT,"^",3),APPEST=$P(APPTOT,"^",4),ACTOT=APPNEW+APPEST
....D PARSE^SDECXML2(ACTOT,"All",SDPRV,"APPACT",APPLEN,SDSTP)
....I APPOVR S SDDATA=$$PROV^SDECXML(SDPRV)_" "_$$OVRAP^SDECXML2(APPOVR,APPLEN,SDSTP) D SETREC^SDECXML(.SDLCNT,SDDATA,15)
....I APPNEW S SDDATA=$$PROV^SDECXML(SDPRV)_" "_$$NEWAP^SDECXML2(APPNEW,APPLEN,SDSTP) D SETREC^SDECXML(.SDLCNT,SDDATA,15)
....I APPEST S SDDATA=$$PROV^SDECXML(SDPRV)_" "_$$ESTAP^SDECXML2(APPEST,APPLEN,SDSTP) D SETREC^SDECXML(.SDLCNT,SDDATA,15)
..;
..; Encounters
..I '$G(SDIV) S PRGDTOT=$G(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,"GRP",SDGRP,"PROV",SDPRV))
..I $G(SDIV) S PRGDTOT=$G(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,"GRP",SDGRP,"PROV",SDPRV))
..I '(PRGDTOT="") D
...N SDI F SDI=1:1:4 D
....S SDDATA=$$PROV^SDECXML(SDPRV)_" "_$S(SDI=1:$$ENC^SDECXML($P(PRGDTOT,"^",SDI)),SDI=2:$$NEW^SDECXML($P(PRGDTOT,"^",SDI)),SDI=3:$$EST^SDECXML($P(PRGDTOT,"^",SDI)),SDI=4:$$TEL^SDECXML($P(PRGDTOT,"^",SDI)),1:"")
....Q:($TR(SDDATA,"^","")="")
....D SETREC^SDECXML(.SDLCNT,SDDATA,15)
;
I $G(CLNTAG) D OUTPUT^SDECXUTL("</Rs>",15,.SDLCNT,SDEBUG,.CLNTAG,.GRPFLG,.DIVTAG,XMLNODE)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDECXML5 11999 printed Oct 16, 2024@18:53:42 Page 2
SDECXML5 ;ALB/JCH - SCHEDULING ENHANCEMENTS 3 (cont) ;11/03/14 10:59am
+1 ;;5.3;Scheduling;**628**;Aug 13, 1993;Build 371
+2 ;
+3 ; ALL CLINICS
+4 QUIT
ALLCLIN(SDLCNT,SDRPTYP,SDAT,SDFAC,SDIV,SDGRP,DTINC,CLNTAG,ALLCLDIV,SDCALL,SDNODE,GRPFLG,SDEBUG,XMLNODE) ; All Clinic
+1 NEW SDCLDIV,APPDEM,ADJDIFF,ADJDEM,APPTOT,SDDATA,APPDEM,ADJDEM,APPLEN,ADJDIFF,SDSTP
+2 NEW APPOVR,APPNEW,APPEST,ACTOT,DTNAM,GRPTOT,PRGDTOT,SDACTAP,SDFILT,SDCLIN,SDPRV,SDRESCH
+3 DO DTNAM^SDECXUTL(DTINC,.DTNAM)
+4 ;
+5 ; If the first clinic in this group, and more than one clinic, create an "All" clinic grouping
+6 IF $GET(SDGRP)
IF ($GET(SDCALL)<1)
IF '($GET(ALLCLDIV)=1)
Begin DoDot:1
+7 IF '$GET(GRPFLG)
SET SDFILT=$$GRP^SDECXML(SDGRP)
DO SETTMPF^SDECXML(.SDLCNT,SDFILT,13)
+8 IF $GET(CLNTAG)
DO OUTPUT^SDECXUTL("</Rs>",15,.SDLCNT,SDEBUG,.CLNTAG,.GRPFLG,.DIVTAG,XMLNODE)
+9 SET SDFILT=$$CLIN^SDECXML("All",1)
DO SETTMPF^SDECXML(.SDLCNT,SDFILT,15)
End DoDot:1
+10 ;
+11 ; Supply
+12 NEW APPTOT
+13 IF ($GET(ALLCLDIV)=1)
SET APPTOT=$GET(^XTMP(SDNODE,DTNAM,SDRPTYP,SDAT,SDFAC,"APP","SUP"))
+14 IF ($GET(ALLCLDIV)=2)
SET APPTOT=$GET(^XTMP(SDNODE,"GROUP",DTNAM,SDRPTYP,SDAT,SDFAC,SDGRP,"APP","SUP"))
+15 IF '$GET(ALLCLDIV)
SET APPTOT=$GET(^XTMP(SDNODE,DTNAM,SDRPTYP,SDAT,SDFAC,SDIV,SDGRP,"APP","SUP"))
+16 SET SDDATA=$$PROV^SDECXML("All")_" "_$$RCASUP^SDECXML($PIECE(APPTOT,"^"))
+17 DO SETREC^SDECXML(.SDLCNT,SDDATA,16)
+18 ;
+19 ; Totals at the group level - sum of all clinics in the group
+20 ; Appointments - Group at Facility level, Demand, Lengths
+21 SET APPTOT=""
SET APPLEN=""
SET SDACTAP=""
SET APPDEM=""
SET ACTOT=""
SET ADJDEM=""
SET ADJDIFF=""
SET SDSTP=""
+22 ; Appointments - Group Level totals Demand, Length
+23 IF $GET(SDIV)
Begin DoDot:1
+24 SET APPLEN=""
FOR
SET APPLEN=$ORDER(^XTMP(SDNODE,DTNAM,SDRPTYP,SDAT,SDFAC,SDIV,SDGRP,"APP","LEN",APPLEN))
if 'APPLEN
QUIT
Begin DoDot:2
+25 SET SDSTP=""
FOR
SET SDSTP=$ORDER(^XTMP(SDNODE,DTNAM,SDRPTYP,SDAT,SDFAC,SDIV,SDGRP,"APP","LEN",APPLEN,SDSTP))
if SDSTP=""
QUIT
Begin DoDot:3
+26 if SDSTP="STAT"
QUIT
+27 SET APPTOT=$GET(^XTMP(SDNODE,DTNAM,SDRPTYP,SDAT,SDFAC,SDIV,SDGRP,"APP","LEN",APPLEN,SDSTP))
+28 if (APPTOT="")
QUIT
+29 SET APPDEM=APPDEM+$PIECE(APPTOT,"^")
End DoDot:3
+30 SET SDRESCH=""
FOR
SET SDRESCH=$ORDER(^XTMP(SDNODE,DTNAM,SDRPTYP,SDAT,SDFAC,SDIV,SDGRP,"APP","LEN",APPLEN,"STAT",SDRESCH))
if SDRESCH=""
QUIT
Begin DoDot:3
+31 if '($PIECE(SDRESCH,";")="NSR"!($PIECE(SDRESCH,";")="CPR")!($PIECE(SDRESCH,";")="CCR"))
QUIT
+32 SET ADJDIFF=ADJDIFF+(^XTMP(SDNODE,DTNAM,SDRPTYP,SDAT,SDFAC,SDIV,SDGRP,"APP","LEN",APPLEN,"STAT",SDRESCH)*APPLEN)
End DoDot:3
End DoDot:2
+33 IF ADJDIFF&APPDEM
SET ADJDEM=APPDEM-ADJDIFF
+34 SET ADJDEM=$SELECT($GET(ADJDEM):ADJDEM,1:APPDEM)
if ADJDEM<0
SET ADJDEM=0
+35 DO PARSE^SDECXML2(APPDEM,"All","All","DEM",+$GET(APPLEN),+$GET(SDSTP),$GET(ADJDEM))
+36 SET APPLEN=""
FOR
SET APPLEN=$ORDER(^XTMP(SDNODE,DTNAM,SDRPTYP,SDAT,SDFAC,SDIV,SDGRP,"APP","LEN",APPLEN))
if APPLEN=""
QUIT
Begin DoDot:2
+37 SET SDSTP=""
FOR
SET SDSTP=$ORDER(^XTMP(SDNODE,DTNAM,SDRPTYP,SDAT,SDFAC,SDIV,SDGRP,"APP","LEN",APPLEN,SDSTP))
if SDSTP=""
QUIT
Begin DoDot:3
+38 SET ACTOT=""
+39 SET APPTOT=$GET(^XTMP(SDNODE,DTNAM,SDRPTYP,SDAT,SDFAC,SDIV,SDGRP,"APP","LEN",APPLEN,SDSTP))
+40 SET APPOVR=$PIECE(APPTOT,"^",2)
SET APPNEW=$PIECE(APPTOT,"^",3)
SET APPEST=$PIECE(APPTOT,"^",4)
SET ACTOT=APPNEW+APPEST
+41 IF ACTOT
DO PARSE^SDECXML2(ACTOT,"All","All","APPACT",APPLEN,SDSTP)
+42 IF APPOVR
SET SDDATA=$$PROV^SDECXML("All")_" "_$$OVRAP^SDECXML2(APPOVR,APPLEN,SDSTP)
DO SETREC^SDECXML(.SDLCNT,SDDATA,15)
+43 IF APPNEW
SET SDDATA=$$PROV^SDECXML("All")_" "_$$NEWAP^SDECXML2(APPNEW,APPLEN,SDSTP)
DO SETREC^SDECXML(.SDLCNT,SDDATA,15)
+44 IF APPEST
SET SDDATA=$$PROV^SDECXML("All")_" "_$$ESTAP^SDECXML2(APPEST,APPLEN,SDSTP)
DO SETREC^SDECXML(.SDLCNT,SDDATA,15)
End DoDot:3
End DoDot:2
+45 ;
+46 ; Appointments - Group Level totals Demand, Length
End DoDot:1
+47 SET APPTOT=""
SET APPDEM=""
SET ADJDIFF=""
SET ADJDEM=""
+48 IF '$GET(SDIV)
Begin DoDot:1
+49 SET APPLEN=""
FOR
SET APPLEN=$ORDER(^XTMP(SDNODE,"GROUP",DTNAM,SDRPTYP,SDAT,SDFAC,SDGRP,"APP","LEN",APPLEN))
if 'APPLEN
QUIT
Begin DoDot:2
+50 SET SDSTP=""
FOR
SET SDSTP=$ORDER(^XTMP(SDNODE,"GROUP",DTNAM,SDRPTYP,SDAT,SDFAC,SDGRP,"APP","LEN",APPLEN,SDSTP))
if SDSTP=""
QUIT
Begin DoDot:3
+51 if SDSTP="STAT"
QUIT
+52 SET APPTOT=$GET(^XTMP(SDNODE,"GROUP",DTNAM,SDRPTYP,SDAT,SDFAC,SDGRP,"APP","LEN",APPLEN,SDSTP))
+53 if (APPTOT="")
QUIT
+54 SET APPDEM=APPDEM+$PIECE(APPTOT,"^")
End DoDot:3
+55 SET SDRESCH=""
FOR
SET SDRESCH=$ORDER(^XTMP(SDNODE,"GROUP",DTNAM,SDRPTYP,SDAT,SDFAC,SDGRP,"APP","LEN",APPLEN,"STAT",SDRESCH))
if SDRESCH=""
QUIT
Begin DoDot:3
+56 if '($PIECE(SDRESCH,";")="NSR"!($PIECE(SDRESCH,";")="CPR")!($PIECE(SDRESCH,";")="CCR"))
QUIT
+57 SET ADJDIFF=ADJDIFF+(^XTMP(SDNODE,"GROUP",DTNAM,SDRPTYP,SDAT,SDFAC,SDGRP,"APP","LEN",APPLEN,"STAT",SDRESCH)*APPLEN)
+58 IF ADJDIFF>APPDEM
End DoDot:3
End DoDot:2
+59 IF ADJDIFF&APPDEM
SET ADJDEM=APPDEM-ADJDIFF
+60 SET ADJDEM=$SELECT($GET(ADJDEM):ADJDEM,1:APPDEM)
if ADJDEM<0
SET ADJDEM=0
+61 DO PARSE^SDECXML2(APPDEM,"All","All","DEM",APPLEN,SDSTP,ADJDEM)
+62 SET APPLEN=""
FOR
SET APPLEN=$ORDER(^XTMP(SDNODE,"GROUP",DTNAM,SDRPTYP,SDAT,SDFAC,SDGRP,"APP","LEN",APPLEN))
if APPLEN=""
QUIT
Begin DoDot:2
+63 SET SDSTP=""
FOR
SET SDSTP=$ORDER(^XTMP(SDNODE,"GROUP",DTNAM,SDRPTYP,SDAT,SDFAC,SDGRP,"APP","LEN",APPLEN,SDSTP))
if SDSTP=""
QUIT
Begin DoDot:3
+64 SET ACTOT=""
+65 SET APPTOT=$GET(^XTMP(SDNODE,"GROUP",DTNAM,SDRPTYP,SDAT,SDFAC,SDGRP,"APP","LEN",APPLEN,SDSTP))
+66 SET APPOVR=$PIECE(APPTOT,"^",2)
SET APPNEW=$PIECE(APPTOT,"^",3)
SET APPEST=$PIECE(APPTOT,"^",4)
SET ACTOT=APPNEW+APPEST
+67 IF ACTOT
DO PARSE^SDECXML2(ACTOT,"All","All","APPACT",APPLEN,SDSTP)
+68 IF APPOVR
SET SDDATA=$$PROV^SDECXML("All")_" "_$$OVRAP^SDECXML2(APPOVR,APPLEN,SDSTP)
DO SETREC^SDECXML(.SDLCNT,SDDATA,15)
+69 IF APPNEW
SET SDDATA=$$PROV^SDECXML("All")_" "_$$NEWAP^SDECXML2(APPNEW,APPLEN,SDSTP)
DO SETREC^SDECXML(.SDLCNT,SDDATA,15)
+70 IF APPEST
SET SDDATA=$$PROV^SDECXML("All")_" "_$$ESTAP^SDECXML2(APPEST,APPLEN,SDSTP)
DO SETREC^SDECXML(.SDLCNT,SDDATA,15)
End DoDot:3
End DoDot:2
End DoDot:1
+71 ;
+72 ; Encounters
+73 IF $GET(SDIV)
SET GRPTOT=$GET(^XTMP(SDNODE,DTNAM,SDRPTYP,SDAT,SDFAC,SDIV,SDGRP))
+74 IF '$GET(SDIV)
SET GRPTOT=$GET(^XTMP(SDNODE,"GROUP",DTNAM,SDRPTYP,SDAT,SDFAC,SDGRP))
+75 IF '(GRPTOT="")
NEW SDI
FOR SDI=1:1:4
Begin DoDot:1
+76 SET SDDATA=$$PROV^SDECXML("All")_" "_$SELECT(SDI=1:$$ENC^SDECXML($PIECE(GRPTOT,"^",SDI)),SDI=2:$$NEW^SDECXML($PIECE(GRPTOT,"^",SDI)),SDI=3:$$EST^SDECXML($PIECE(GRPTOT,"^",SDI)),SDI=4:$$TEL^SDECXML($PIECE(GRPTOT,"^",SDI)),1:"")
+77 if ($TRANSLATE(SDDATA,"^","")="")
QUIT
+78 IF '$GET(GRPFLG)
SET SDFILT=$$GRP^SDECXML(SDGRP)
DO SETTMPF^SDECXML(.SDLCNT,SDFILT,13)
+79 DO SETREC^SDECXML(.SDLCNT,SDDATA,15)
End DoDot:1
+80 ;
+81 ; Get the total for the provider at the Group level, is the sum of All clinics
+82 ; Provider's cross-division resourcegroup totals
+83 NEW SDCLIN
+84 IF $GET(SDIV)
Begin DoDot:1
+85 SET SDPRV=""
FOR
SET SDPRV=$ORDER(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,SDIV,"GRP",SDGRP,SDPRV))
if SDPRV=""
QUIT
Begin DoDot:2
+86 if (SDPRV'["^")
QUIT
SET APPDEM=""
SET APPTOT=""
SET ADJDIFF=""
SET ADJDEM=""
+87 SET APPLEN=0
FOR
SET APPLEN=$ORDER(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,SDIV,"GRP",SDGRP,SDPRV,"APP","LEN",APPLEN))
if 'APPLEN
QUIT
Begin DoDot:3
+88 SET SDSTP=""
FOR
SET SDSTP=$ORDER(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,SDIV,"GRP",SDGRP,SDPRV,"APP","LEN",APPLEN,SDSTP))
if SDSTP=""
QUIT
Begin DoDot:4
+89 if SDSTP=""
QUIT
SET ACTOT=""
+90 SET APPTOT=$GET(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,SDIV,"GRP",SDGRP,SDPRV,"APP","LEN",APPLEN,SDSTP))
+91 if (APPTOT="")
QUIT
+92 ;I '$G(GRPFLG) S SDFILT=$$GRP^SDECXML(SDGRP) D SETTMPF^SDECXML(.SDLCNT,SDFILT,13)
+93 SET APPDEM=APPDEM+$PIECE(APPTOT,"^")
End DoDot:4
+94 SET SDRESCH=""
FOR
SET SDRESCH=$ORDER(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,SDIV,"GRP",SDGRP,SDPRV,"APP","LEN",APPLEN,"STAT",SDRESCH))
if SDRESCH=""
QUIT
Begin DoDot:4
+95 if '($PIECE(SDRESCH,";")="NSR"!($PIECE(SDRESCH,";")="CPR")!($PIECE(SDRESCH,";")="CCR"))
QUIT
+96 SET ADJDIFF=ADJDIFF+(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,SDIV,"GRP",SDGRP,SDPRV,"APP","LEN",APPLEN,"STAT",SDRESCH)*APPLEN)
End DoDot:4
End DoDot:3
+97 IF ADJDIFF&APPDEM
SET ADJDEM=APPDEM-ADJDIFF
+98 SET ADJDEM=$SELECT($GET(ADJDEM):ADJDEM,1:APPDEM)
+99 IF '(APPDEM="")
DO PARSE^SDECXML2(APPDEM,"All",SDPRV,"DEM",APPLEN,SDSTP,ADJDEM)
+100 SET APPOVR=""
SET APPNEW=""
SET APPEST=""
SET APPTOT=""
+101 SET APPLEN=""
FOR
SET APPLEN=$ORDER(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,SDIV,"GRP",SDGRP,SDPRV,"APP","LEN",APPLEN))
if 'APPLEN
QUIT
Begin DoDot:3
+102 SET SDSTP=""
FOR
SET SDSTP=$ORDER(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,SDIV,"GRP",SDGRP,SDPRV,"APP","LEN",APPLEN,SDSTP))
if SDSTP=""
QUIT
Begin DoDot:4
+103 SET ACTOT=""
+104 SET APPTOT=$GET(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,SDIV,"GRP",SDGRP,SDPRV,"APP","LEN",APPLEN,SDSTP))
+105 if (APPTOT="")
QUIT
+106 IF '$GET(GRPFLG)
SET SDFILT=$$GRP^SDECXML(SDGRP)
DO SETTMPF^SDECXML(.SDLCNT,SDFILT,13)
+107 SET APPOVR=$PIECE(APPTOT,"^",2)
SET APPNEW=$PIECE(APPTOT,"^",3)
SET APPEST=$PIECE(APPTOT,"^",4)
SET ACTOT=APPNEW+APPEST
+108 DO PARSE^SDECXML2(ACTOT,"All",SDPRV,"APPACT",APPLEN,SDSTP)
+109 IF APPOVR
SET SDDATA=$$PROV^SDECXML(SDPRV)_" "_$$OVRAP^SDECXML2(APPOVR,APPLEN,SDSTP)
DO SETREC^SDECXML(.SDLCNT,SDDATA,15)
+110 IF APPNEW
SET SDDATA=$$PROV^SDECXML(SDPRV)_" "_$$NEWAP^SDECXML2(APPNEW,APPLEN,SDSTP)
DO SETREC^SDECXML(.SDLCNT,SDDATA,15)
+111 IF APPEST
SET SDDATA=$$PROV^SDECXML(SDPRV)_" "_$$ESTAP^SDECXML2(APPEST,APPLEN,SDSTP)
DO SETREC^SDECXML(.SDLCNT,SDDATA,15)
End DoDot:4
End DoDot:3
+112 ;
+113 ; Encounters
+114 IF SDIV="All"
SET PRGDTOT=$GET(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,"GRP",SDGRP,"PROV",SDPRV))
+115 IF $GET(SDIV)
SET PRGDTOT=$GET(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,SDIV,"GRP",SDGRP,SDPRV))
+116 IF '(PRGDTOT="")
Begin DoDot:3
+117 NEW SDI
FOR SDI=1:1:4
Begin DoDot:4
+118 SET SDDATA=$$PROV^SDECXML(SDPRV)_" "_$SELECT(SDI=1:$$ENC^SDECXML($PIECE(PRGDTOT,"^",SDI)),SDI=2:$$NEW^SDECXML($PIECE(PRGDTOT,"^",SDI)),SDI=3:$$EST^SDECXML($PIECE(PRGDTOT,"^",SDI)),SDI=4:$$TEL^SDECXML($PIECE(PRGDT
OT,"^",SDI)),1:"")
+119 if ($TRANSLATE(SDDATA,"^","")="")
QUIT
+120 DO SETREC^SDECXML(.SDLCNT,SDDATA,15)
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+121 ;
+122 NEW SDCLIN
+123 IF '$GET(SDIV)
Begin DoDot:1
+124 SET SDPRV=""
FOR
SET SDPRV=$ORDER(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,"GRP",SDGRP,"PROV",SDPRV))
if SDPRV=""
QUIT
Begin DoDot:2
+125 if (SDPRV'["^")
QUIT
SET APPDEM=""
SET APPTOT=""
SET ADJDIFF=""
SET ADJDEM=""
+126 SET APPLEN=0
FOR
SET APPLEN=$ORDER(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,"GRP",SDGRP,"PROV",SDPRV,"APP","LEN",APPLEN))
if 'APPLEN
QUIT
Begin DoDot:3
+127 SET SDSTP=""
FOR
SET SDSTP=$ORDER(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,"GRP",SDGRP,"PROV",SDPRV,"APP","LEN",APPLEN,SDSTP))
if SDSTP=""
QUIT
Begin DoDot:4
+128 if SDSTP=""
QUIT
SET ACTOT=""
+129 SET APPTOT=$GET(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,"GRP",SDGRP,"PROV",SDPRV,"APP","LEN",APPLEN,SDSTP))
+130 if (APPTOT="")
QUIT
+131 ;I '$G(GRPFLG) S SDFILT=$$GRP^SDECXML(SDGRP) D SETTMPF^SDECXML(.SDLCNT,SDFILT,13)
+132 SET APPDEM=APPDEM+$PIECE(APPTOT,"^")
End DoDot:4
+133 SET SDRESCH=""
FOR
SET SDRESCH=$ORDER(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,"GRP",SDGRP,"PROV",SDPRV,"APP","LEN",APPLEN,"STAT",SDRESCH))
if SDRESCH=""
QUIT
Begin DoDot:4
+134 if '($PIECE(SDRESCH,";")="NSR"!($PIECE(SDRESCH,";")="CPR")!($PIECE(SDRESCH,";")="CCR"))
QUIT
+135 SET ADJDIFF=ADJDIFF+(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,"GRP",SDGRP,"PROV",SDPRV,"APP","LEN",APPLEN,"STAT",SDRESCH)*APPLEN)
End DoDot:4
End DoDot:3
+136 IF ADJDIFF&APPDEM
SET ADJDEM=APPDEM-ADJDIFF
+137 SET ADJDEM=$SELECT($GET(ADJDEM):ADJDEM,1:APPDEM)
+138 IF '(APPDEM="")
DO PARSE^SDECXML2(APPDEM,"All",SDPRV,"DEM",APPLEN,SDSTP,ADJDEM)
+139 SET APPOVR=""
SET APPNEW=""
SET APPEST=""
SET APPTOT=""
+140 SET APPLEN=""
FOR
SET APPLEN=$ORDER(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,"GRP",SDGRP,"PROV",SDPRV,"APP","LEN",APPLEN))
if 'APPLEN
QUIT
Begin DoDot:3
+141 SET SDSTP=""
FOR
SET SDSTP=$ORDER(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,"GRP",SDGRP,"PROV",SDPRV,"APP","LEN",APPLEN,SDSTP))
if SDSTP=""
QUIT
Begin DoDot:4
+142 SET ACTOT=""
+143 SET APPTOT=$GET(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,"GRP",SDGRP,"PROV",SDPRV,"APP","LEN",APPLEN,SDSTP))
+144 if (APPTOT="")
QUIT
+145 IF '$GET(GRPFLG)
SET SDFILT=$$GRP^SDECXML(SDGRP)
DO SETTMPF^SDECXML(.SDLCNT,SDFILT,13)
+146 SET APPOVR=$PIECE(APPTOT,"^",2)
SET APPNEW=$PIECE(APPTOT,"^",3)
SET APPEST=$PIECE(APPTOT,"^",4)
SET ACTOT=APPNEW+APPEST
+147 DO PARSE^SDECXML2(ACTOT,"All",SDPRV,"APPACT",APPLEN,SDSTP)
+148 IF APPOVR
SET SDDATA=$$PROV^SDECXML(SDPRV)_" "_$$OVRAP^SDECXML2(APPOVR,APPLEN,SDSTP)
DO SETREC^SDECXML(.SDLCNT,SDDATA,15)
+149 IF APPNEW
SET SDDATA=$$PROV^SDECXML(SDPRV)_" "_$$NEWAP^SDECXML2(APPNEW,APPLEN,SDSTP)
DO SETREC^SDECXML(.SDLCNT,SDDATA,15)
+150 IF APPEST
SET SDDATA=$$PROV^SDECXML(SDPRV)_" "_$$ESTAP^SDECXML2(APPEST,APPLEN,SDSTP)
DO SETREC^SDECXML(.SDLCNT,SDDATA,15)
End DoDot:4
End DoDot:3
+151 ;
+152 ; Encounters
+153 IF '$GET(SDIV)
SET PRGDTOT=$GET(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,"GRP",SDGRP,"PROV",SDPRV))
+154 IF $GET(SDIV)
SET PRGDTOT=$GET(^XTMP(SDNODE,"PROVIDER",DTNAM,SDRPTYP,SDAT,"GRP",SDGRP,"PROV",SDPRV))
+155 IF '(PRGDTOT="")
Begin DoDot:3
+156 NEW SDI
FOR SDI=1:1:4
Begin DoDot:4
+157 SET SDDATA=$$PROV^SDECXML(SDPRV)_" "_$SELECT(SDI=1:$$ENC^SDECXML($PIECE(PRGDTOT,"^",SDI)),SDI=2:$$NEW^SDECXML($PIECE(PRGDTOT,"^",SDI)),SDI=3:$$EST^SDECXML($PIECE(PRGDTOT,"^",SDI)),SDI=4:$$TEL^SDECXML($PIECE(PRGDT
OT,"^",SDI)),1:"")
+158 if ($TRANSLATE(SDDATA,"^","")="")
QUIT
+159 DO SETREC^SDECXML(.SDLCNT,SDDATA,15)
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+160 ;
+161 IF $GET(CLNTAG)
DO OUTPUT^SDECXUTL("</Rs>",15,.SDLCNT,SDEBUG,.CLNTAG,.GRPFLG,.DIVTAG,XMLNODE)
+162 QUIT