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

ADEAPC2.m

Go to the documentation of this file.
ADEAPC2 ; IHS/HQT/MJL  - DENTAL PCC LINK PART 3 ;  [ 03/24/1999   9:04 AM ]
 ;;6.0;ADE;**20**;APRIL 1999
 ;DELETES PCC DENTAL DEPENDENT ENTRIES
 ;ALSO DELETES VISIT ENTRY IF CALLED WITH ADENEWVS=1
 Q:'$D(^ADEPCD(ADEDFN,"PCC"))
 ;------->GET VISIT DFN
 S (ADEV,APCDALVR("APCDVSIT"))=$P(^ADEPCD(ADEDFN,"PCC"),U)
 I '+ADEV S ADEY=0 G END
 ;------->DELETE V DENTAL ENTRIES
 D DSERV
 ;------->DELETE V POV ENTRIES
 D VPOV
 ;------->DELETE V PRV ENTRIES
 D VPRV
 ;------->DELETE VISIT ENTRY IF NOT AN EDIT AND NO OTHER DEP. ENTRIES
 I ADENEWVS,$D(^AUPNVSIT(ADEV,0)),'$P(^AUPNVSIT(ADEV,0),U,9) D
 . S AUPNVSIT=ADEV
 . D DEL^AUPNVSIT
 . D ADDPCC("301///@",ADEDFN)
END Q
 ;
DSERV S ADENOD=$P(^ADEPCD(ADEDFN,"PCC"),U,4)
 D:+ADENOD D1
 D ADDPCC("304///@",ADEDFN)
 ;Previous versions stored data in non-Fileman-compatible nodes
 ;subscripted off ADEPCD(ADEDFN,"PCC").  Beginning with version
 ;5.4, these nodes are deleted when found.
 S ADEG=0
 F  Q:ADEG=""  S ADEG=$O(^ADEPCD(ADEDFN,"PCC",ADEG)) I +ADEG D
 . S ADENOD=^ADEPCD(ADEDFN,"PCC",ADEG)
 . D:+ADENOD D1
 . K ^ADEPCD(ADEDFN,"PCC",ADEG) ;See above note
 I $D(^ADEPCD(ADEDFN,"PCC1")) D
 . S ADENOD=^ADEPCD(ADEDFN,"PCC1")
 . D:+ADENOD D1
 . D ADDPCC("401///@",ADEDFN)
 I $D(^ADEPCD(ADEDFN,"PCC2")) D
 . S ADENOD=^ADEPCD(ADEDFN,"PCC2")
 . D:+ADENOD D1
 . D ADDPCC("501///@",ADEDFN)
 K ADEG,ADENOD
 Q
D1 N ADELIM
 S ADELIM="|"
 I ADENOD[";" S ADELIM=";"
 F ADECXX=1:1:$L(ADENOD,ADELIM) D
 . S APCDALVR("APCDADFN")=$P(ADENOD,ADELIM,ADECXX)
 . I APCDALVR("APCDADFN")]"" S DIK="^AUPNVDEN(",DA=APCDALVR("APCDADFN") D ^DIK
 K ADELIM
 Q
VPOV S APCDALVR("APCDDPOV")=$P(^ADEPCD(ADEDFN,"PCC"),U,2)
 Q:APCDALVR("APCDDPOV")=""
 S DIK="^AUPNVPOV(",DA=APCDALVR("APCDDPOV")
 D ^DIK
 D ADDPCC("302///@",ADEDFN)
 Q
VPRV S APCDALVR("APCDDPRV")=$P(^ADEPCD(ADEDFN,"PCC"),U,3)
 Q:APCDALVR("APCDDPRV")=""
 S DIK="^AUPNVPRV(",DA=APCDALVR("APCDDPRV")
 D ^DIK
 D ADDPCC("303///@",ADEDFN)
 Q
ADDPCC(DR,DA) ;EP
 N DIE,DIDEL
 S DIE="^ADEPCD("
 S DIDEL=9002007
 D ^DIE
 K DIE,DIDEL
 Q