Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ECXSCXN1

ECXSCXN1.m

Go to the documentation of this file.
ECXSCXN1 ;ALB/JAP  Clinic Extract No Shows; 8/28/02 1:11pm ;1/25/19  10:50
 ;;3.0;DSS EXTRACTS;**71,105,127,132,136,144,166,170,174,184**;Dec 22, 1997;Build 124
NOSHOW(ECXSD,ECXED) ;get noshows from file #44
 ;      ECXSD  = start date, ECXED  = end date
 N ALEN,CLIN,JDATE,JJ,NODE,NOSHOW,PP,STAT,MDIV,ECXEDIS,CNT,ECXARR,ECXSDSC,ECXEDSC,ECXASIH ;136,170
 N ECXECL,ECXESC,ECXCLST ;144 Call to INTPAT^ECXSCX2 sets variables to null.  Call to PAT1^ECXSCX2 will set camp lejeune status when available.  Encounter values remain null as appt is a no-show
 N ECXSCST ;174 Call to PAT1^ECXSCX2 will set the service connected status
 N ECXNOCNT ;174 Clinic non-count flag
 S CLIN=0
 F  S CLIN=$O(^TMP($J,"ECXCL",CLIN)) Q:'CLIN!($G(QFLG))  D  ;136
 .Q:$P($G(^TMP($J,"ECXCL",CLIN)),U,3)'="C"
 .S (P1,P2,P3,P4)="" ;166 add P4
 .D FEEDER^ECXSCX1(CLIN,ECXSD,.P1,.P2,.P3,.TOSEND,.ECXDIV,.P4) ;166 add P4 parameter
 .Q:TOSEND=6
 .;find appts in date range
 .S ECXSDSC=ECXSD+.1,ECXEDSC=$P(ECXED,".") ;136 get dates back into correct fileman format
 .S (ALEN,NOSHOW)="" ;136
 .K ^TMP($J,"SDAMA301") ;136
 .S ECXARR(1)=ECXSDSC_";"_ECXEDSC,ECXARR(2)=CLIN,ECXARR(3)="NS;NSR",ECXARR("FLDS")="5;7;10;12;18" ;136
 .S CNT=$$SDAPI^SDAMA301(.ECXARR) ;136
 .Q:CNT=0  I CNT=-1 D ERR^ECXUTL1 S QFLG=1 Q  ;136 Stop if no data (CNT=0) and send error message if scheduling system down (CNT=-1)
 .S JJ=0 F  S JJ=$O(^TMP($J,"SDAMA301",CLIN,JJ)) Q:'+JJ  S JDATE="" F  S JDATE=$O(^TMP($J,"SDAMA301",CLIN,JJ,JDATE)) Q:'+JDATE  D  ;136
 ..S ECXDATE=JDATE,ECXTI=$$ECXTIME^ECXUTL(JDATE) ;136,166
 ..S ECXDFN=JJ ;136
 ..S ECXPATCAT=$$PATCAT^ECXUTL(ECXDFN) ;added in patch 127
 ..S NODE=$G(^TMP($J,"SDAMA301",CLIN,JJ,JDATE)),MDIV=$P($G(^SC(CLIN,0)),U,15) ;136
 ..Q:NODE=""  ;136
 ..S ECXNOCNT=$P($G(^TMP($J,"ECXCL",CLIN)),U,5) ;174 Get non-count status
 ..S ECXSHAD=$$GETSHAD ;added in patch 127, finds shad status for appt
 ..S ECXOBI=$S($P(NODE,U,7)="Y":"O",1:"") ;136
 ..S NOSHOW="N" ;136 only no-show entries are returned from the SDAMA301 call
 ..D INTPAT^ECXSCX2 S ECXERR=0
 ..D PAT1^ECXSCX2(ECXDFN,ECXDATE,.ECXERR) Q:ECXERR
 ..I ECXLOGIC>2022 S ECXNMPI=ECXMPI ;184
 ..S ALEN=$$RJ^XLFSTR($P(NODE,U,5),3,0) ;136
 ..D PAT2^ECXSCX2(ECXDFN,ECXDATE)
 ..S ECXPVST=+$P(NODE,U,18),ECXATYP=+$P(NODE,U,10)  ;136 Get POV & appt type
 ..S:+ALEN=0 ALEN=$P($G(^TMP($J,"ECXCL",CLIN)),U,2)
 ..S ECXCLIN=CLIN,ECXSTOP=P1
 ..S ECXEDIS=$$EDIS^ECXUTL1(ECXDFN,ECXDATE,"N",,ECXSTOP) ;136
 ..I ECXLOGIC<2019 S:ECXCPT1="" ECXCPT1="9919901"  ;170 tjl - Retain value for prior years
 ..I ECXLOGIC>2018 S:ECXCPT1="" ECXCQM1="9919901"  ;170 tjl - Set new variable value
 ..S ECXCBOC=$S(MDIV'="":$$CBOC^ECXSCX2(.MDIV),1:"")
 ..S (ECXDSSD,ECXENEL,ECXIR,ECXAO,ECXMIL,ECXPROV,ECXPROVP,ECXPROVN,ECXPRX12)="" ;184 - Added ECXPRX12
 ..F I=1:1:7 S (@("ECSP"_I),@("ECSPPC"_I),@("ECSPNPI"_I))="" ;144 2 new prov groups
 ..I TOSEND'=3 D
 ...S ECXKEY=P1_P2_ALEN_P3_NOSHOW_P4,ECXOBS=$$OBSPAT^ECXUTL4(ECXA,ECXTS,ECXKEY) ;166
 ...S ECXENC=$$ENCNUM^ECXUTL4(ECXA,ECXSSN,ECXADMDT,ECXDATE,ECXTS,ECXOBS,ECHEAD,ECXKEY,) D:ECXENC'="" FILE^ECXSCXN
 ..I TOSEND=3 D
 ...S ECXKEY=P1_"000"_ALEN_P3_NOSHOW_P4,ECXOBS=$$OBSPAT^ECXUTL4(ECXA,ECXTS,ECXKEY) ;166
 ...S ECXENC=$$ENCNUM^ECXUTL4(ECXA,ECXSSN,ECXADMDT,ECXDATE,ECXTS,ECXOBS,ECHEAD,ECXKEY,) D:ECXENC'="" FILE^ECXSCXN
 ..I TOSEND=3 D
 ...S ECXKEY=P2_"000"_ALEN_P3_NOSHOW_P4,ECXOBS=$$OBSPAT^ECXUTL4(ECXA,ECXTS,ECXKEY) ;166
 ...S ECXENC=$$ENCNUM^ECXUTL4(ECXA,ECXSSN,ECXADMDT,ECXDATE,ECXTS,ECXOBS,ECHEAD,ECXKEY,) D:ECXENC'="" FILE^ECXSCXN
 ..;create a record for noshow appended ekg. The code was removed for CTX-0604-70970 CLI Extract Problem EXPANDED to NoShows
 Q
 ;GETSHAD section added with patch 127
GETSHAD() ;Function returns shad value
 N DIC,LOCARR,DA,DR,SHAD,ECXERR,ECXVIST
 S SHAD=""
 I '+$P($G(NODE),U,12) Q SHAD  ;136 Quit if no outpatient encounter pointer
 S DIC=409.68,DA=$P(NODE,U,12),DR=.05,DIQ(0)="I",DIQ="LOCARR" ;136
 D EN^DIQ1
 I $G(LOCARR(409.68,DA,.05,"I")) D
 .S ECXERR=0
 .D VISIT^ECXSCX1(ECXDFN,LOCARR(409.68,DA,.05,"I"),.ECXVIST,.ECXERR)
 .I 'ECXERR S SHAD=ECXVIST("SHAD")
 Q SHAD