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

ACDPCCL6.m

Go to the documentation of this file.
ACDPCCL6 ;IHS/ADC/EDE/KML - PCC LINK;
 ;;4.1;CHEMICAL DEPENDENCY MIS;;MAY 11, 1998
 ;
 ; This routine adds v file entries to the visit just generated
 ;
VFILES ;EP Create v file entries
 I ACDEV("TC")'="CS" D PRIPROV I 1
 E  D CSPROVS,CSCPTS
 D POV
 D AT
 D EOJ
 Q 
 ;
PRIPROV ; v provider (primary provider)
 S ACDPRVDR=ACDEV("PRI PROV")
 S ACDPRVPS="P"
 D PROV
 I $G(ACDQUIT)'="" D VFERROR
 Q
 ;
CSPROVS ; v providers (CS visits)
 ; acdcsdte and acdloc are set prior to getting here
 S ACDPRVPS="S"
 S ACDPRVDR=0
 F  S ACDPRVDR=$O(ACDEV("PROC",ACDCSDTE,ACDLOC,"PROV",ACDPRVDR)) Q:'ACDPRVDR  D PROV I $G(ACDQUIT)'="" D VFERROR
 Q
 ;
PROV ; v provider
 S ACDFILE="V PROVIDER",ACDFILEN=9000010.06
 D KILL
 S APCDALVR("APCDVSIT")=APCDVSIT
 S APCDALVR("APCDATMP")="[APCDALVR 9000010.06 (ADD)]"
 S APCDALVR("APCDPAT")=ACDEV("PAT")
 S APCDALVR("APCDTPS")="P"
 S X=ACDPRVDR
 I '$P($G(^AUTTSITE(1,0)),U,22) D
 . NEW A,P
 . S P=X,A=$P(^DIC(3,P,0),U,16)
 . I A="" S ACDQUIT=42,X="" Q
 . I $P(^VA(200,P,0),U)'=$P(^DIC(16,A,0),U) S ACDQUIT=42,X="" Q
 . S X=A
 . Q
 I X="" S ACDQUIT=41 Q
 S APCDALVR("APCDTPRO")="`"_X
 D APCDALVR
 Q
 ;
CSCPTS ; v cpt
 S ACDFILE="V CPT",ACDFILEN=9000010.18
 S ACDCSPRC=0
 F  S ACDCSPRC=$O(ACDEV("PROC",ACDCSDTE,ACDLOC,ACDCSPRC)) Q:'ACDCSPRC  D
 . D KILL
 .;S APCDALVR("APCDTCPT")="`"_+ACDEV("PROC",ACDCSDTE,ACDLOC,ACDCSPRC,"NARR") I APCDALVR("APCDTCPT")="`" S ACDQUIT=43 D VFERROR Q
 . S APCDALVR("APCDTCPT")=+ACDEV("PROC",ACDCSDTE,ACDLOC,ACDCSPRC,"NARR") I APCDALVR("APCDTCPT")="" S ACDQUIT=43 D VFERROR Q
 . S APCDALVR("APCDVSIT")=APCDVSIT
 . S APCDALVR("APCDATMP")="[APCDALVR 9000010.18 (ADD)]"
 . S APCDALVR("APCDPAT")=ACDEV("PAT")
 . S APCDALVR("APCDTPN")=$P(ACDEV("PROC",ACDCSDTE,ACDLOC,ACDCSPRC,"NARR"),":",3)
 . S APCDALVR("APCDTPP")="Y"
 . S APCDALVR("APCDOVRR")=""
 . D APCDALVR
 . Q
 Q
 ;
CSPROCS ; v procedures ***** NO LONGER USED *****
 S ACDFILE="V PROCEDURES",ACDFILEN=9000010.08
 S ACDCSPRC=0
 F  S ACDCSPRC=$O(ACDEV("PROC",ACDCSDTE,ACDLOC,ACDCSPRC)) Q:'ACDCSPRC  D
 . D KILL
 . S APCDALVR("APCDTPRC")="`"_+ACDEV("PROC",ACDCSDTE,ACDLOC,ACDCSPRC,"NARR") I APCDALVR("APCDTPRC")="`" S ACDQUIT=43 D VFERROR Q
 . S APCDALVR("APCDVSIT")=APCDVSIT
 . S APCDALVR("APCDATMP")="[APCDALVR 9000010.08 (ADD)]"
 . S APCDALVR("APCDPAT")=ACDEV("PAT")
 . S APCDALVR("APCDTNQ")=$P(ACDEV("PROC",ACDCSDTE,ACDLOC,ACDCSPRC,"NARR"),":",3)
 . S APCDALVR("APCDOVRR")=""
 . D APCDALVR
 . Q
 Q
 ;
POV ;create V POVS
 S ACDFILE="V POV",ACDFILEN=9000010.07
 S ACDY=0
 F  S ACDY=$O(ACDEV("POV",ACDY)) Q:'ACDY  D
 . D KILL
 . S APCDALVR("APCDTPOV")="`"_+ACDEV("POV",ACDY) I APCDALVR("APCDTPOV")="`" S ACDQUIT=43 D VFERROR Q
 . S APCDALVR("APCDTPS")=$S(ACDY=1:"P",1:"S")
 . S APCDALVR("APCDVSIT")=APCDVSIT
 . S APCDALVR("APCDATMP")="[APCDALVR 9000010.07 (ADD)]"
 . S APCDALVR("APCDPAT")=ACDEV("PAT")
 . S APCDALVR("APCDTNQ")=$P(ACDEV("POV",ACDY),":",3)
 . S APCDALVR("APCDOVRR")=""
 . D APCDALVR
 . Q
 Q
 ;
AT ;create v activity time record
 Q:'$G(ACDEV("TIME"))  ;          quit if no time
 S ACDFILE="V ACTIVITY TIME",ACDFILEN=9000010.19
 D KILL
 S APCDALVR("APCDTACT")=ACDEV("TIME")
 S APCDALVR("APCDVSIT")=APCDVSIT
 S APCDALVR("APCDATMP")="[APCDALVR 9000010.19 (ADD)]"
 S APCDALVR("APCDPAT")=ACDEV("PAT")
 D APCDALVR
 Q
 ;
APCDALVR ; GENERATE V FILE ENTRY
 D ^APCDALVR
 I $D(APCDALVR("APCDAFLG")) S ACDQUIT=APCDALVR("APCDAFLG") D VFERROR Q
 S ACDVFIEN=APCDALVR("APCDADFN")
 S X=ACDFILEN,DA(2)=ACDEV("VISIT"),DA(1)=ACD21IEN,DIC="^ACDVIS("_DA(2)_",21,"_DA(1)_",11,",DIC(0)="L",DIC("DR")=".02////"_ACDVFIEN,DIC("P")=$P(^DD(9002172.121,1100,0),U,2)
 I ACDEV("TC")="CS",ACDFILEN="9000010.18" S DIC("DR")=DIC("DR")_";.03////"_ACDEV("PROC",ACDCSDTE,ACDLOC,ACDCSPRC,"CS IEN")
 D FILE^ACDFMC
 Q
 ;
KILL ;
 K APCDAFLG,APCDALVR,APCDANE,APCDAPPT,APCDATMP,APCDAUTO
 K APCDCAT,APCDCLN
 K APCDLOC
 K APCDOLOC
 K APCDPAT
 K APCDTAT,APCDTLOU,APCDTNQ,APCDTPOV,APCDTPRO,APCDTPRV,APCDTPS,APCDTTOP,APCDTYPE
 K AUPNTALK
 Q
 ;
EOJ ;
 D KILL
 K ACD21IEN,ACDCSPRC,ACDERR,ACDFILE,ACDFILEN,ACDIEN,ACDPRVDR,ACDPRVPS,ACDQUIT,ACDVFIEN,ACDY
 Q
 ;
VFERROR ; WRITE ERROR MESSAGE
 S ACDIEN=$G(ACDEV("VISIT"))
 S ACDERR="VE"_ACDQUIT,ACDERR=$P($T(@ACDERR),";;",2)_$G(APCDALVR("APCDADIE"))
 W !!,$G(IORVON)_"Notify your supervisor that the PCC LINK failed with the following error:",!,ACDFILE,"-",ACDERR_$G(IORVOFF),!!
 D PAUSE^ACDDEU
 K ACDQUIT
 Q
 ;
VE1 ;;incorrect template specification
VE2 ;;invalid values being passed to V file.
VE3 ;;invalid visit parameters (date, location etc.)
VE41 ;;No PROVIDER ENTRY PASSED from CDMIS SYSTEM.
VE42 ;;Could NOT convert 200 Pointer to 6 pointer.
VE43 ;;Could not find ICD9 code in ICD Diagnosis file.