APCDAAC2 ; IHS/CMI/LAB - CDMIS PCC LINK ;
;;2.0;IHS PCC SUITE;;MAY 14, 2009
;
;
E ;EP - edited a cdmis record
I '$G(ACDEV("VFILES",9000010)) S ACDEV("TYPE")="A" D A^APCDAACD Q ;no pcc visit ever created to edit, act like add
S APCDVSIT=ACDEV("VFILES",9000010)
D DELVFS
I $P(^AUPNVSIT(APCDVSIT,0),U,11) S ACDEV("TYPE")="A" D A^APCDAACD Q ;if pcc visit gone get rid of 15th, v file multiple and then act like add
;if not deleted, do visit mod and then re-add vfiles
S APCDALVR("APCDVSIT")=APCDVSIT
S APCDALVR("APCDATMP")="[APCDALVR 9000010 (MOD)]"
D VISIT^APCDAACD
D ^APCDALVR
I $D(APCDALVR("APCDAFLG")) S APCDQUIT=28 D VSERROR^APCDAACD Q
D VFILES^APCDAAC1
S APCDV("9000010")=APCDVSIT
D COMPLETE^APCDALD
Q
;
D ;EP cdmis visit deleted
I '$G(ACDEV("VFILES",9000010)) Q ;no visit to begin with
S APCDVSIT=ACDEV("VFILES",9000010)
D DELVFS
Q
;
DELVFS ;delete vfiles
S APCDF=0 F S APCDF=$O(ACDEV("VFILES",APCDF)) Q:APCDF'=+APCDF D
.S APCDN=0 F S APCDN=$O(ACDEV("VFILES",APCDF,APCDN)) Q:APCDN'=+APCDN S DA=APCDN,DIK=^DIC(APCDF,0,"GL") D ^DIK
.K DA,DIK
.Q
I '$P(^AUPNVSIT(APCDVSIT,0),U,9),'$P(^(0),U,11) S APCDVDLT=APCDVSIT D ^APCDVDLT ;if no dependent entries delete visit
K APCDF,APCDN,APCDVDLT
Q
APCDAAC2 ; IHS/CMI/LAB - CDMIS PCC LINK ;
+1 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
+2 ;
+3 ;
E ;EP - edited a cdmis record
+1 ;no pcc visit ever created to edit, act like add
IF '$GET(ACDEV("VFILES",9000010))
SET ACDEV("TYPE")="A"
DO A^APCDAACD
QUIT
+2 SET APCDVSIT=ACDEV("VFILES",9000010)
+3 DO DELVFS
+4 ;if pcc visit gone get rid of 15th, v file multiple and then act like add
IF $PIECE(^AUPNVSIT(APCDVSIT,0),U,11)
SET ACDEV("TYPE")="A"
DO A^APCDAACD
QUIT
+5 ;if not deleted, do visit mod and then re-add vfiles
+6 SET APCDALVR("APCDVSIT")=APCDVSIT
+7 SET APCDALVR("APCDATMP")="[APCDALVR 9000010 (MOD)]"
+8 DO VISIT^APCDAACD
+9 DO ^APCDALVR
+10 IF $DATA(APCDALVR("APCDAFLG"))
SET APCDQUIT=28
DO VSERROR^APCDAACD
QUIT
+11 DO VFILES^APCDAAC1
+12 SET APCDV("9000010")=APCDVSIT
+13 DO COMPLETE^APCDALD
+14 QUIT
+15 ;
D ;EP cdmis visit deleted
+1 ;no visit to begin with
IF '$GET(ACDEV("VFILES",9000010))
QUIT
+2 SET APCDVSIT=ACDEV("VFILES",9000010)
+3 DO DELVFS
+4 QUIT
+5 ;
DELVFS ;delete vfiles
+1 SET APCDF=0
FOR
SET APCDF=$ORDER(ACDEV("VFILES",APCDF))
IF APCDF'=+APCDF
QUIT
Begin DoDot:1
+2 SET APCDN=0
FOR
SET APCDN=$ORDER(ACDEV("VFILES",APCDF,APCDN))
IF APCDN'=+APCDN
QUIT
SET DA=APCDN
SET DIK=^DIC(APCDF,0,"GL")
DO ^DIK
+3 KILL DA,DIK
+4 QUIT
End DoDot:1
+5 ;if no dependent entries delete visit
IF '$PIECE(^AUPNVSIT(APCDVSIT,0),U,9)
IF '$PIECE(^(0),U,11)
SET APCDVDLT=APCDVSIT
DO ^APCDVDLT
+6 KILL APCDF,APCDN,APCDVDLT
+7 QUIT