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

APCDDMU1.m

Go to the documentation of this file.
APCDDMU1 ; IHS/CMI/LAB - EDITS FOR AUPNVSIT (VISIT:9000010) 24-MAY-1993 ;
 ;;2.0;IHS PCC SUITE;**7**;MAY 14, 2009
 ;
 K APCDVSIT
 I $P(APCDREC,U,11)="" Q
 S APCDDMDT=$P(APCDREC,U,11)
 S APCDMTYP=$O(^AUTTEXAM("B","DIABETIC FOOT EXAM, COMPLETE",0))
 D EVSIT^APCDDMUP ;get event visit
 I '$G(APCDVSIT) S T="Could not Create PCC Visit when attempting to update foot exam." D ERR^APCDDMUP(T) Q
 S (X,G)=0 F  S X=$O(^AUPNVXAM("AD",APCDVSIT,X)) Q:X'=+X!(G)  I $P(^AUPNVXAM(X,0),U)=APCDMTYP S G=1
 I G S T="Already have a foot exam on Visit Date "_$$FMTE^XLFDT($P(^AUPNVSIT(APCDVSIT,0),U)) D ERR^APCDDMUP(T) Q
 K APCDALVR
 S APCDALVR("APCDPAT")=APCDDMPT
 S APCDALVR("APCDVSIT")=APCDVSIT
 S APCDALVR("APCDATMP")="[APCDALVR 9000010.13 (ADD)]"
 S APCDALVR("APCDTEX")="`"_APCDMTYP
 S APCDALVR("APCDTRES")=$P(APCDREC,U,21)
 D ^APCDALVR
 I $D(APCDALVR("APCDAFLG")) S T="Error creating V Exam Entry for Foot Exam.  PCC not updated." D ERR^APCDDMUP(T)
 K APCDALVR
 Q
EYE ;EP
 K APCDVSIT
 I $P(APCDREC,U,12)="" Q
 S APCDDMDT=$P(APCDREC,U,12)
 S APCDMTYP=$O(^AUTTEXAM("B","DIABETIC EYE EXAM",0))
 D EVSIT^APCDDMUP ;get event visit
 I '$G(APCDVSIT) S T="Could not Create PCC Visit when attempting to update eye exam." D ERR^APCDDMUP(T) Q
 S (X,G)=0 F  S X=$O(^AUPNVXAM("AD",APCDVSIT,X)) Q:X'=+X!(G)  I $P(^AUPNVXAM(X,0),U)=APCDMTYP S G=1
 I G S T="Already have a eye exam on Visit Date "_$$FMTE^XLFDT($P(^AUPNVSIT(APCDVSIT,0),U)) D ERR^APCDDMUP(T) Q
 K APCDALVR
 S APCDALVR("APCDPAT")=APCDDMPT
 S APCDALVR("APCDVSIT")=APCDVSIT
 S APCDALVR("APCDATMP")="[APCDALVR 9000010.13 (ADD)]"
 S APCDALVR("APCDTEX")="`"_APCDMTYP
 S APCDALVR("APCDTRES")=$P(APCDREC,U,22)
 D ^APCDALVR
 I $D(APCDALVR("APCDAFLG")) S T="Error creating V Exam Entry for Eye Exam.  PCC not updated." D ERR^APCDDMUP(T)
 K APCDALVR
 Q
DEPR ;EP
 K APCDVSIT
 I $P(APCDREC,U,25)="" Q
 S APCDDMDT=$P(APCDREC,U,25)
 S APCDMTYP=$O(^AUTTEXAM("C",36,0))
 D EVSIT^APCDDMUP ;get event visit
 I '$G(APCDVSIT) S T="Could not Create PCC Visit when attempting to update Depression screening exam." D ERR^APCDDMUP(T) Q
 S (X,G)=0 F  S X=$O(^AUPNVXAM("AD",APCDVSIT,X)) Q:X'=+X!(G)  I $P(^AUPNVXAM(X,0),U)=APCDMTYP S G=1
 I G S T="Already have a depression screening exam on Visit Date "_$$FMTE^XLFDT($P(^AUPNVSIT(APCDVSIT,0),U)) D ERR^APCDDMUP(T) Q
 K APCDALVR
 S APCDALVR("APCDPAT")=APCDDMPT
 S APCDALVR("APCDVSIT")=APCDVSIT
 S APCDALVR("APCDATMP")="[APCDALVR 9000010.13 (ADD)]"
 S APCDALVR("APCDTEX")="`"_APCDMTYP
 S APCDALVR("APCDTRES")=$P(APCDREC,U,22)
 D ^APCDALVR
 I $D(APCDALVR("APCDAFLG")) S T="Error creating V Exam Entry for Depression Screening Exam.  PCC not updated." D ERR^APCDDMUP(T)
 K APCDALVR
 Q
DENTAL ;EP
 K APCDVSIT
 I $P(APCDREC,U,13)="" Q
 S APCDDMDT=$P(APCDREC,U,13)
 S APCDMTYP=$O(^AUTTEXAM("B","DENTAL EXAM",0))
 I 'APCDMTYP S APCDMTYP=$O(^AUTTEXAM("C",30,0))
 D EVSIT^APCDDMUP ;get event visit
 I '$G(APCDVSIT) S T="Could not Create PCC Visit when attempting to update dental exam." D ERR^APCDDMUP(T) Q
 S (X,G)=0 F  S X=$O(^AUPNVXAM("AD",APCDVSIT,X)) Q:X'=+X!(G)  I $P(^AUPNVXAM(X,0),U)=APCDMTYP S G=1
 I G S T="Already have a dental exam on Visit Date "_$$FMTE^XLFDT($P(^AUPNVSIT(APCDVSIT,0),U)) D ERR^APCDDMUP(T) Q
 K APCDALVR
 S APCDALVR("APCDPAT")=APCDDMPT
 S APCDALVR("APCDVSIT")=APCDVSIT
 S APCDALVR("APCDATMP")="[APCDALVR 9000010.13 (ADD)]"
 S APCDALVR("APCDTEX")="`"_APCDMTYP
 D ^APCDALVR
 I $D(APCDALVR("APCDAFLG")) S T="Error creating V Exam Entry for Dental Exam.  PCC not updated." D ERR^APCDDMUP(T)
 K APCDALVR
 Q
PAP ;EP
 K APCDVSIT
 I $P(APCDREC,U,14)="" Q
 S APCDDMDT=$P(APCDREC,U,14)
 S APCDMTYP=$P($$ICDOP^ICDCODE("91.46"),U,1)
 I APCDMTYP=-1 S APCDMTYP=""
 D EVSIT^APCDDMUP ;get event visit
 I '$G(APCDVSIT) S T="Could not Create PCC Visit when attempting to update pap procedure." D ERR^APCDDMUP(T) Q
 S (X,G)=0 F  S X=$O(^AUPNVPRC("AD",APCDVSIT,X)) Q:X'=+X!(G)  I $P(^AUPNVPRC(X,0),U)=APCDMTYP S G=1
 I G S T="Already have a pap procedure on Visit Date "_$$FMTE^XLFDT($P(^AUPNVSIT(APCDVSIT,0),U)) D ERR^APCDDMUP(T) Q
 K APCDALVR
 S APCDALVR("APCDPAT")=APCDDMPT
 S APCDALVR("APCDVSIT")=APCDVSIT
 S APCDALVR("APCDATMP")="[APCDALVR 9000010.08 (ADD)]"
 S APCDALVR("APCDTPRC")="`"_APCDMTYP
 ;S APCDALVR("APCDTNQ")=$P(^ICD0(APCDMTYP,0),U,4)
 S APCDALVR("APCDTNQ")=$P($$ICDOP^ICDCODE(APCDMTYP,$$VD^APCLV(APCDVSIT)),U,3)
 S APCDALVR("APCDTPD")=$$FMTE^XLFDT(APCDDMDT)
 D ^APCDALVR
 I $D(APCDALVR("APCDAFLG")) S T="Error creating V Procedure Entry for PAP Procedure.  PCC not updated." D ERR^APCDDMUP(T)
 K APCDALVR
 Q
MAM ;EP
 K APCDVSIT
 I $P(APCDREC,U,15)="" Q
 I $P(APCDREC,U,24)="" Q
 S APCDDMDT=$P(APCDREC,U,15)
 S APCDMTYP=$P(APCDREC,U,24)
 D EVSIT^APCDDMUP ;get event visit
 I '$G(APCDVSIT) S T="Could not Create PCC Visit when attempting to update mammogram procedure." D ERR^APCDDMUP(T) Q
 S (X,G)=0 F  S X=$O(^AUPNVRAD("AD",APCDVSIT,X)) Q:X'=+X!(G)  I $P(^AUPNVRAD(X,0),U)=APCDMTYP S G=1
 I G S T="Already have a Mammogram on Visit Date "_$$FMTE^XLFDT($P(^AUPNVSIT(APCDVSIT,0),U)) D ERR^APCDDMUP(T) Q
 K APCDALVR
 S APCDALVR("APCDPAT")=APCDDMPT
 S APCDALVR("APCDVSIT")=APCDVSIT
 S APCDALVR("APCDATMP")="[APCDALVR 9000010.22 (ADD)]"
 S APCDALVR("APCDTRAD")="`"_APCDMTYP
 D ^APCDALVR
 I $D(APCDALVR("APCDAFLG")) S T="Error creating V Radiology Entry for MAMMOGRAM.  PCC not updated." D ERR^APCDDMUP(T)
 K APCDALVR
 Q
FLU ;EP
 K APCDVSIT
 I $P(APCDREC,U,16)=""!($P(APCDREC1,U,11)="") Q
 S APCDDMDT=$P(APCDREC,U,16)
 S APCDMTYP=$P(APCDREC1,U,11)
 D EVSIT^APCDDMUP ;get event visit
 I '$G(APCDVSIT) S T="Could not Create PCC Visit when attempting to update Flu Immunization." D ERR^APCDDMUP(T) Q
 S (X,G)=0 F  S X=$O(^AUPNVIMM("AD",APCDVSIT,X)) Q:X'=+X!(G)  I $P(^AUPNVIMM(X,0),U)=APCDMTYP S G=1
 I G S T="Already have a flu immunization on Visit Date "_$$FMTE^XLFDT($P(^AUPNVSIT(APCDVSIT,0),U)) D ERR^APCDDMUP(T) Q
 K APCDALVR
 S APCDALVR("APCDPAT")=APCDDMPT
 S APCDALVR("APCDVSIT")=APCDVSIT
 S APCDALVR("APCDATMP")="[APCDALVR 9000010.11 (ADD)]"
 S APCDALVR("APCDTIMM")="`"_APCDMTYP
 D ^APCDALVR
 I $D(APCDALVR("APCDAFLG")) S T="Error creating V Immunization Entry for Flu Immunization.  PCC not updated." D ERR^APCDDMUP(T)
 K APCDALVR
 Q
PNEU ;EP
 K APCDVSIT
 I $P(APCDREC,U,17)=""!($P(APCDREC1,U,12)="") Q
 S APCDDMDT=$P(APCDREC,U,17)
 S APCDMTYP=$P(APCDREC1,U,12)
 D EVSIT^APCDDMUP ;get event visit
 I '$G(APCDVSIT) S T="Could not Create PCC Visit when attempting to update Pneumovac Immunization." D ERR^APCDDMUP(T) Q
 S (X,G)=0 F  S X=$O(^AUPNVIMM("AD",APCDVSIT,X)) Q:X'=+X!(G)  I $P(^AUPNVIMM(X,0),U)=APCDMTYP S G=1
 I G S T="Already have a pneumovac immunization on Visit Date "_$$FMTE^XLFDT($P(^AUPNVSIT(APCDVSIT,0),U)) D ERR^APCDDMUP(T) Q
 K APCDALVR
 S APCDALVR("APCDPAT")=APCDDMPT
 S APCDALVR("APCDVSIT")=APCDVSIT
 S APCDALVR("APCDATMP")="[APCDALVR 9000010.11 (ADD)]"
 S APCDALVR("APCDTIMM")="`"_APCDMTYP
 D ^APCDALVR
 I $D(APCDALVR("APCDAFLG")) S T="Error creating V Immunization Entry for Pneumovac Immunization.  PCC not updated." D ERR^APCDDMUP(T)
 K APCDALVR
 Q
TD ;EP
 K APCDVSIT
 I $P(APCDREC,U,18)=""!($P(APCDREC1,U,13)="") Q
 S APCDDMDT=$P(APCDREC,U,18)
 S APCDMTYP=$P(APCDREC1,U,13)
 D EVSIT^APCDDMUP ;get event visit
 I '$G(APCDVSIT) S T="Could not Create PCC Visit when attempting to update Pneumovac Immunization." D ERR^APCDDMUP(T) Q
 S (X,G)=0 F  S X=$O(^AUPNVIMM("AD",APCDVSIT,X)) Q:X'=+X!(G)  I $P(^AUPNVIMM(X,0),U)=APCDMTYP S G=1
 I G S T="Already have a TD immunization on Visit Date "_$$FMTE^XLFDT($P(^AUPNVSIT(APCDVSIT,0),U)) D ERR^APCDDMUP(T) Q
 K APCDALVR
 S APCDALVR("APCDPAT")=APCDDMPT
 S APCDALVR("APCDVSIT")=APCDVSIT
 S APCDALVR("APCDATMP")="[APCDALVR 9000010.11 (ADD)]"
 S APCDALVR("APCDTIMM")="`"_APCDMTYP
 D ^APCDALVR
 I $D(APCDALVR("APCDAFLG")) S T="Error creating V Immunization Entry for TD Immunization.  PCC not updated." D ERR^APCDDMUP(T)
 K APCDALVR
 Q
ID ;
 S:$E(APCDDMDT,6,7)="00" APCDDMDT=$E(APCDDMDT,1,5)_"01" S:$E(APCDDMDT,4,5)="00" APCDDMDT=$E(APCDDMDT,1,3)_"01"_$E(APCDDMDT,6,7)
 Q
BI() ;EP- check to see if using new imm package or not 1/5/1999 IHS/CMI/LAB
 Q $S($O(^AUTTIMM(0))<100:0,1:1)
 ;