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

APCLNJ11.m

Go to the documentation of this file.
  1. APCLNJ11 ; IHS/CMI/LAB - PRINT CLINIC VISITS (CALC) ;
  1. ;;2.0;IHS PCC SUITE;**11**;MAY 14, 2009;Build 58
  1. ;
  1. CALC ;find visits by date then store by patient name
  1. D XTMP^APCLOSUT("APCLNJ1","PCC INJURY REPORT 1")
  1. ;
  1. S APCLJOB=$J,APCLBT=$H
  1. S APCLVDT=APCLBD-.0001
  1. VST S APCLVDT=$O(^AUPNVSIT("B",APCLVDT))
  1. G NEXT:APCLVDT="",NEXT:APCLVDT>(APCLED+.2359) S APCLVDFN=0
  1. VST1 S APCLVDFN=$O(^AUPNVSIT("B",APCLVDT,APCLVDFN)) G VST:APCLVDFN=""
  1. ;
  1. G VST1:'$D(^AUPNVSIT(APCLVDFN,0)) S APCLSTR=^(0)
  1. G VST1:$P(APCLSTR,"^",11) ;screen out deleted visits
  1. G VST1:$P(APCLSTR,"^",6)="" ;no location
  1. G VST1:$P(APCLSTR,"^",7)=""
  1. G VST1:$$DEMO^APCLUTL($P(APCLSTR,U,5),$G(APCLDEMO))
  1. I $D(APCLLOCT),'$D(APCLLOCT($P(APCLSTR,U,6))) G VST1
  1. I $D(APCLSCT),'$D(APCLSCT($P(APCLSTR,U,7))) G VST1
  1. I $D(APCLTYPT),'$D(APCLTYPT($P(APCLSTR,U,3))) G VST1
  1. I $D(APCLCLNT),$P(APCLSTR,U,8)="" G VST1
  1. I $D(APCLCLNT),'$D(APCLCLNT($P(APCLSTR,U,8))) G VST1
  1. I $D(APCLAGET),$$AGE^AUPNPAT($P(APCLSTR,U,5))>$P(APCLAGET,"-",2) G VST1
  1. I $D(APCLAGET),$$AGE^AUPNPAT($P(APCLSTR,U,5))<$P(APCLAGET,"-",1) G VST1
  1. ;
  1. S APCLDFN=$P(APCLSTR,"^",5) G:APCLDFN="" VST1 ;IHS/CMI/LAB
  1. G VST1:'$D(^DPT(APCLDFN,0))
  1. S APCLNAME=$P(^DPT(APCLDFN,0),"^")
  1. D POV
  1. G VST1
  1. ;
  1. NEXT ;
  1. S APCLET=$H
  1. Q
  1. ;
  1. POV ;check to see if pov is injury
  1. ;IHS/CMI/LAB - patched line below
  1. ;NEW X S X=0 F S X=$O(^AUPNVPOV("AD",APCLVDFN,X)) Q:X'=+X I $P(^ICD9(+^AUPNVPOV(X,0),0),U)>799.999 D ;cmi/anch/maw 9/10/2007 orig line
  1. ;NEW X S X=0 F S X=$O(^AUPNVPOV("AD",APCLVDFN,X)) Q:X'=+X I $P($$ICDDX^ICDEX(+^AUPNVPOV(X,0)),U,2)>799.999 D ;cmi/anch/maw 9/10/2007 csv
  1. NEW X S X=0 F S X=$O(^AUPNVPOV("AD",APCLVDFN,X)) Q:X'=+X I $$INJ^APCDAPOV($$CODEC^ICDEX(80,+^AUPNVPOV(X,0)),$$CSI^ICDEX(80,+^AUPNVPOV(X,0))) D
  1. .I $D(APCLALCH),APCLALCH="L",$P(^AUPNVPOV(X,0),U,7)'=2 Q
  1. .S ^XTMP("APCLNJ1",APCLJOB,APCLBT,APCLNAME,APCLDFN,APCLVDT,APCLVDFN,X)=""
  1. .Q
  1. Q