AGCNVIMP ;IHS/SD/EFG - CONVERT AUPNPAT FIELD .09 ;
;;7.1;PATIENT REGISTRATION;;AUG 25,2005
;
MCR ;FIND OLD ENTRIES IN FIELD .09 OF AUPNMCR TO USE
;TO POPULATE NEW MULTIPLE FIELD 1201 OF AUPNMCR
K AG("DFN"),AG("MCR")
S AG("DFN")=0
F S AG("DFN")=$O(^AUPNMCR(AG("DFN"))) Q:'AG("DFN") D
. S AG("MCR")=$P($G(^AUPNMCR(AG("DFN"),0)),U,9)
. Q:$D(^AUPNMCR(AG("DFN"),12,0))
. I +AG("MCR") D MCRADD
Q
MCRADD ;ADD ENTRY FROM OLD FIELD TO NEW FIELD
K DD,DO,X,DA
S DA(1)=AG("DFN")
S DIC="^AUPNMCR("_DA(1)_",12,"
S DIC(0)="LZE"
S DLAYGO=9000003
S X=AG("MCR")
K DD,DO
D FILE^DICN
K DIC
Q
AGCNVIMP ;IHS/SD/EFG - CONVERT AUPNPAT FIELD .09 ;
+1 ;;7.1;PATIENT REGISTRATION;;AUG 25,2005
+2 ;
MCR ;FIND OLD ENTRIES IN FIELD .09 OF AUPNMCR TO USE
+1 ;TO POPULATE NEW MULTIPLE FIELD 1201 OF AUPNMCR
+2 KILL AG("DFN"),AG("MCR")
+3 SET AG("DFN")=0
+4 FOR
SET AG("DFN")=$ORDER(^AUPNMCR(AG("DFN")))
IF 'AG("DFN")
QUIT
Begin DoDot:1
+5 SET AG("MCR")=$PIECE($GET(^AUPNMCR(AG("DFN"),0)),U,9)
+6 IF $DATA(^AUPNMCR(AG("DFN"),12,0))
QUIT
+7 IF +AG("MCR")
DO MCRADD
End DoDot:1
+8 QUIT
MCRADD ;ADD ENTRY FROM OLD FIELD TO NEW FIELD
+1 KILL DD,DO,X,DA
+2 SET DA(1)=AG("DFN")
+3 SET DIC="^AUPNMCR("_DA(1)_",12,"
+4 SET DIC(0)="LZE"
+5 SET DLAYGO=9000003
+6 SET X=AG("MCR")
+7 KILL DD,DO
+8 DO FILE^DICN
+9 KILL DIC
+10 QUIT