AGCNVROI ;IHS/SD/TPF - CONVERT AUPNPAT FIELDS .04 TO 3601 ;
;;7.1;PATIENT REGISTRATION;**1,2**;JAN 31, 2007
;
ROI ;FIND OLD ENTRIES IN FIELD .04
;TO POPULATE NEW MULTIPLE FIELD 7101 OF AUPNPAT
N IEN,ROI
S IEN=0
F S IEN=$O(^AUPNPAT(IEN)) Q:'IEN D
. Q:$D(^AUPNPAT(IEN,36,0)) ;QUIT IF ALREADY DONE FOR THIS PATIENT
. S ROI=$P($G(^AUPNPAT(IEN,0)),U,4) ;ROI
.Q:'ROI
.D ROIADD
Q
ROIADD ;ADD ENTRY FROM OLD FIELDS TO NEW FIELDS
K DD,DO,X,DA,DINUM
S DA(1)=IEN
S DIC="^AUPNPAT("_DA(1)_",36,"
S DIC(0)="LZE"
S DLAYGO=9000001
S X=ROI
D FILE^DICN
Q
AGCNVROI ;IHS/SD/TPF - CONVERT AUPNPAT FIELDS .04 TO 3601 ;
+1 ;;7.1;PATIENT REGISTRATION;**1,2**;JAN 31, 2007
+2 ;
ROI ;FIND OLD ENTRIES IN FIELD .04
+1 ;TO POPULATE NEW MULTIPLE FIELD 7101 OF AUPNPAT
+2 NEW IEN,ROI
+3 SET IEN=0
+4 FOR
SET IEN=$ORDER(^AUPNPAT(IEN))
IF 'IEN
QUIT
Begin DoDot:1
+5 ;QUIT IF ALREADY DONE FOR THIS PATIENT
IF $DATA(^AUPNPAT(IEN,36,0))
QUIT
+6 ;ROI
SET ROI=$PIECE($GET(^AUPNPAT(IEN,0)),U,4)
+7 IF 'ROI
QUIT
+8 DO ROIADD
End DoDot:1
+9 QUIT
ROIADD ;ADD ENTRY FROM OLD FIELDS TO NEW FIELDS
+1 KILL DD,DO,X,DA,DINUM
+2 SET DA(1)=IEN
+3 SET DIC="^AUPNPAT("_DA(1)_",36,"
+4 SET DIC(0)="LZE"
+5 SET DLAYGO=9000001
+6 SET X=ROI
+7 DO FILE^DICN
+8 QUIT