- DGV53PT2 ;MTC/ALB - Provider Conversion Continued ; 21 JAN 93
- ;;5.3;Registration;**1015**;Aug 13, 1993;Build 21
- ;
- CON2 ;-- This routine will perform the conversion to file #200 for the
- ; Patient file (#2)
- ;
- N RECNUM,SEQ,NODE,MULT,PROV,PREC,TREC,PSAV,OK
- ;-- Init section for other changes to the Patient File
- D OTHINIT
- ;-- get entry in File 43 for conversion of file 2
- D ADDPC^DGV53PT1(2)
- ;-- determine if conversion needs to be re-started.
- S PSAV=$O(^DG(43,1,"PCON","B",2,0)),PREC=$G(^DG(43,1,"PCON",+PSAV,0))
- ;-- quit if file is already converted
- G:$P(PREC,U,6)="Y" CON2Q
- ;-- create entry in conversion log
- D NEWFILE^DGV53PT1(2)
- ;-- if record already present then re-start
- S OK=1 D REST2(PREC,PSAV)
- ;-- start of main loop
- F S RECNUM=$O(^DPT(RECNUM)) Q:'RECNUM S TREC=TREC+1 W:'(TREC#100) "." D
- . ;-- get provider from .104 node
- . S PROV=$P($G(^DPT(RECNUM,.104)),U)
- . ;-- save provider information from .104 node
- . S ^DG(43,1,"PCON",PSAV,0)=2_U_STIME_U_U_RECNUM_U_.104_U_U_TREC_U_U_U_PROV
- . ;-- update .104 node
- . I PROV D DPT104(RECNUM,+PROV)
- . ;-- get provider information from .1041 node
- . S PROV=$P($G(^DPT(RECNUM,.1041)),U)
- . ;-- save provider information from .1041 node
- . S ^DG(43,1,"PCON",PSAV,0)=2_U_STIME_U_U_RECNUM_U_.1041_U_U_TREC_U_U_U_PROV
- . ;-- update .1041 node
- . I PROV D DPT1041(RECNUM,PROV)
- . ;-- call to process other Patient File changes
- . D OTHER(RECNUM)
- ;-- enter completion time, mark conversion as completed
- D DONE^DGV53PT1(PSAV,TREC),COMFILE^DGV53PT1(2,OK)
- ;-- Post section for other Patient File changes
- D OTHPST
- CON2Q ;-- exit
- Q
- DPT104(RECNUM,PROV) ;-- process DPT '.104' node
- ; INPUT : RECNUM - Record Number to process
- ; PROV - Current Provider Pointer
- ;
- N X,Y
- S X=$G(^DIC(16,+PROV,"A3"))
- I 'X S Y=">>> Provider fld. (.104) for entry #"_RECNUM_" :'"_$P($G(^DIC(16,+PROV,0)),U)_"' could not be converted." S OK=0 D WRERROR^DGV53PT1(Y)
- S DR=".104////"_$S(X:X,1:"@"),DIE="^DPT(",DA=RECNUM D ^DIE K DA,DIE,DR
- Q
- ;
- DPT1041(RECNUM,PROV) ;-- process DPT '.1041' node
- ; INPUT : RECNUM - Record Number to process
- ; PROV - Current Provider Pointer
- ;
- N X,Y
- S X=$G(^DIC(16,+PROV,"A3"))
- I 'X S Y=">>> Attending Physician fld. (.1041) for entry #"_RECNUM_" :'"_$P($G(^DIC(16,+PROV,0)),U)_"' could not be converted." S OK=0 D WRERROR^DGV53PT1(Y)
- S DR=".1041////"_$S(X:X,1:"@"),DIE="^DPT(",DA=RECNUM D ^DIE K DA,DIE,DR
- Q
- ;
- REST2(PREC,PSAV) ;-- This tag will re-process the PTF entry incase the conversion
- ; needs to be re-started.
- ; INPUT : PREC - 0 Node of entry in MAS Parameter File for file 2
- ;
- ;-- get starting point
- I '$P(PREC,U,2) D NOW^%DTC S $P(^DG(43,1,"PCON",PSAV,0),U,2)=%
- S STIME=$P(^DG(43,1,"PCON",PSAV,0),U,2),RECNUM=+$P(PREC,U,4),MULT=$P(PREC,U,8),NODE=$P(PREC,U,5),SEQ=+$P(PREC,U,9),TREC=+$P(PREC,U,7),CURPT=$P(PREC,U,10)
- I 'RECNUM Q
- ;-- check if .104 node has been processed
- S X=$P($G(^DPT(RECNUM,.104)),U)
- I X,$P(PREC,U,10)=X,NODE=.104 D DPT104(RECNUM,X)
- ;-- check if .1041 node has been processed
- S X=$P($G(^DPT(RECNUM,.1041)),U)
- I X,$P(PREC,U,10)=X,NODE=.1041 D DPT1041(RECNUM,X)
- Q
- ;
- OTHER(DFN) ;-- This routines is used to call other Patient File conversion
- ; routines.
- ; INPUT : DFN - Current Patient being processed
- ;
- ;-- Rob W. changes
- D TOTVAAMT^DGYPREG(DFN,1)
- D CFL^DGYPREG(DFN,1)
- D MAKEZIP4^DGYPREG5(DFN)
- D DISPZIP^DGYPREG5(DFN)
- ;
- Q
- ;
- OTHINIT ;-- This routine will init other changes for the Patient file outside
- ; the Provider conversion.
- ;
- ;-- Rob W. changes
- D INITLOOP^DGYPREG
- ;
- Q
- ;
- OTHPST ;-- This routine will perform any post Patient File loop changes that
- ; other packages require.
- ;
- ;-- Rob W. changes
- D ENDLOOP^DGYPREG3
- ;
- Q
- ;
- DGV53PT2 ;MTC/ALB - Provider Conversion Continued ; 21 JAN 93
- +1 ;;5.3;Registration;**1015**;Aug 13, 1993;Build 21
- +2 ;
- CON2 ;-- This routine will perform the conversion to file #200 for the
- +1 ; Patient file (#2)
- +2 ;
- +3 NEW RECNUM,SEQ,NODE,MULT,PROV,PREC,TREC,PSAV,OK
- +4 ;-- Init section for other changes to the Patient File
- +5 DO OTHINIT
- +6 ;-- get entry in File 43 for conversion of file 2
- +7 DO ADDPC^DGV53PT1(2)
- +8 ;-- determine if conversion needs to be re-started.
- +9 SET PSAV=$ORDER(^DG(43,1,"PCON","B",2,0))
- SET PREC=$GET(^DG(43,1,"PCON",+PSAV,0))
- +10 ;-- quit if file is already converted
- +11 IF $PIECE(PREC,U,6)="Y"
- GOTO CON2Q
- +12 ;-- create entry in conversion log
- +13 DO NEWFILE^DGV53PT1(2)
- +14 ;-- if record already present then re-start
- +15 SET OK=1
- DO REST2(PREC,PSAV)
- +16 ;-- start of main loop
- +17 FOR
- SET RECNUM=$ORDER(^DPT(RECNUM))
- IF 'RECNUM
- QUIT
- SET TREC=TREC+1
- IF '(TREC#100)
- WRITE "."
- Begin DoDot:1
- +18 ;-- get provider from .104 node
- +19 SET PROV=$PIECE($GET(^DPT(RECNUM,.104)),U)
- +20 ;-- save provider information from .104 node
- +21 SET ^DG(43,1,"PCON",PSAV,0)=2_U_STIME_U_U_RECNUM_U_.104_U_U_TREC_U_U_U_PROV
- +22 ;-- update .104 node
- +23 IF PROV
- DO DPT104(RECNUM,+PROV)
- +24 ;-- get provider information from .1041 node
- +25 SET PROV=$PIECE($GET(^DPT(RECNUM,.1041)),U)
- +26 ;-- save provider information from .1041 node
- +27 SET ^DG(43,1,"PCON",PSAV,0)=2_U_STIME_U_U_RECNUM_U_.1041_U_U_TREC_U_U_U_PROV
- +28 ;-- update .1041 node
- +29 IF PROV
- DO DPT1041(RECNUM,PROV)
- +30 ;-- call to process other Patient File changes
- +31 DO OTHER(RECNUM)
- End DoDot:1
- +32 ;-- enter completion time, mark conversion as completed
- +33 DO DONE^DGV53PT1(PSAV,TREC)
- DO COMFILE^DGV53PT1(2,OK)
- +34 ;-- Post section for other Patient File changes
- +35 DO OTHPST
- CON2Q ;-- exit
- +1 QUIT
- DPT104(RECNUM,PROV) ;-- process DPT '.104' node
- +1 ; INPUT : RECNUM - Record Number to process
- +2 ; PROV - Current Provider Pointer
- +3 ;
- +4 NEW X,Y
- +5 SET X=$GET(^DIC(16,+PROV,"A3"))
- +6 IF 'X
- SET Y=">>> Provider fld. (.104) for entry #"_RECNUM_" :'"_$PIECE($GET(^DIC(16,+PROV,0)),U)_"' could not be converted."
- SET OK=0
- DO WRERROR^DGV53PT1(Y)
- +7 SET DR=".104////"_$SELECT(X:X,1:"@")
- SET DIE="^DPT("
- SET DA=RECNUM
- DO ^DIE
- KILL DA,DIE,DR
- +8 QUIT
- +9 ;
- DPT1041(RECNUM,PROV) ;-- process DPT '.1041' node
- +1 ; INPUT : RECNUM - Record Number to process
- +2 ; PROV - Current Provider Pointer
- +3 ;
- +4 NEW X,Y
- +5 SET X=$GET(^DIC(16,+PROV,"A3"))
- +6 IF 'X
- SET Y=">>> Attending Physician fld. (.1041) for entry #"_RECNUM_" :'"_$PIECE($GET(^DIC(16,+PROV,0)),U)_"' could not be converted."
- SET OK=0
- DO WRERROR^DGV53PT1(Y)
- +7 SET DR=".1041////"_$SELECT(X:X,1:"@")
- SET DIE="^DPT("
- SET DA=RECNUM
- DO ^DIE
- KILL DA,DIE,DR
- +8 QUIT
- +9 ;
- REST2(PREC,PSAV) ;-- This tag will re-process the PTF entry incase the conversion
- +1 ; needs to be re-started.
- +2 ; INPUT : PREC - 0 Node of entry in MAS Parameter File for file 2
- +3 ;
- +4 ;-- get starting point
- +5 IF '$PIECE(PREC,U,2)
- DO NOW^%DTC
- SET $PIECE(^DG(43,1,"PCON",PSAV,0),U,2)=%
- +6 SET STIME=$PIECE(^DG(43,1,"PCON",PSAV,0),U,2)
- SET RECNUM=+$PIECE(PREC,U,4)
- SET MULT=$PIECE(PREC,U,8)
- SET NODE=$PIECE(PREC,U,5)
- SET SEQ=+$PIECE(PREC,U,9)
- SET TREC=+$PIECE(PREC,U,7)
- SET CURPT=$PIECE(PREC,U,10)
- +7 IF 'RECNUM
- QUIT
- +8 ;-- check if .104 node has been processed
- +9 SET X=$PIECE($GET(^DPT(RECNUM,.104)),U)
- +10 IF X
- IF $PIECE(PREC,U,10)=X
- IF NODE=.104
- DO DPT104(RECNUM,X)
- +11 ;-- check if .1041 node has been processed
- +12 SET X=$PIECE($GET(^DPT(RECNUM,.1041)),U)
- +13 IF X
- IF $PIECE(PREC,U,10)=X
- IF NODE=.1041
- DO DPT1041(RECNUM,X)
- +14 QUIT
- +15 ;
- OTHER(DFN) ;-- This routines is used to call other Patient File conversion
- +1 ; routines.
- +2 ; INPUT : DFN - Current Patient being processed
- +3 ;
- +4 ;-- Rob W. changes
- +5 DO TOTVAAMT^DGYPREG(DFN,1)
- +6 DO CFL^DGYPREG(DFN,1)
- +7 DO MAKEZIP4^DGYPREG5(DFN)
- +8 DO DISPZIP^DGYPREG5(DFN)
- +9 ;
- +10 QUIT
- +11 ;
- OTHINIT ;-- This routine will init other changes for the Patient file outside
- +1 ; the Provider conversion.
- +2 ;
- +3 ;-- Rob W. changes
- +4 DO INITLOOP^DGYPREG
- +5 ;
- +6 QUIT
- +7 ;
- OTHPST ;-- This routine will perform any post Patient File loop changes that
- +1 ; other packages require.
- +2 ;
- +3 ;-- Rob W. changes
- +4 DO ENDLOOP^DGYPREG3
- +5 ;
- +6 QUIT
- +7 ;