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

DGV53PT5.m

Go to the documentation of this file.
  1. DGV53PT5 ;MTC/ALB - Provider Conversion Continued ; 21 JAN 93
  1. ;;5.3;Registration;**1015**;Aug 13, 1993;Build 21
  1. ;
  1. CON411 ;-- This routine will perform the conversion to file #200 for the
  1. ; Scheduled Admission File (#41.1)
  1. ;
  1. N RECNUM,SEQ,NODE,MULT,PROV,PREC,TREC,PSAV,STIME,OK
  1. ;-- get entry in File 43 for conversion of file 41.1
  1. D ADDPC^DGV53PT1(41.1)
  1. ;-- determine if conversion needs to be re-started.
  1. S PSAV=$O(^DG(43,1,"PCON","B",41.1,0)),PREC=$G(^DG(43,1,"PCON",+PSAV,0))
  1. ;-- quit if file is already converted
  1. G:$P(PREC,U,6)="Y" CON411Q
  1. ;-- create entry in log file
  1. D NEWFILE^DGV53PT1(41.1)
  1. ;-- if record already present then re-start
  1. S OK=1 D REST411(PREC,PSAV)
  1. ;-- start of main loop
  1. F S RECNUM=$O(^DGS(41.1,RECNUM)) Q:'RECNUM S TREC=TREC+1 W:'(TREC#100) "." D
  1. . ;-- get provider
  1. . S PROV=$P($G(^DGS(41.1,RECNUM,0)),U,5)
  1. . ;-- save provider information from piece 5 of 0 node
  1. . S ^DG(43,1,"PCON",PSAV,0)=41.1_U_STIME_U_U_RECNUM_U_5_U_U_TREC_U_U_U_PROV
  1. . ;-- update 5 field of node 0
  1. . I PROV D DGS411(RECNUM,PROV)
  1. ;-- enter completion time, mark conversion as completed
  1. D DONE^DGV53PT1(PSAV,TREC),COMFILE^DGV53PT1(41.1,OK)
  1. CON411Q ;-- exit
  1. Q
  1. ;
  1. DGS411(RECNUM,PROV) ;-- process DGS '5' field of the 0 node
  1. ; INPUT : RECNUM - Record Number to process
  1. ; PROV - Current Provider Pointer
  1. ;
  1. N X,Y
  1. S X=$G(^DIC(16,+PROV,"A3"))
  1. I 'X S Y=">>> Provider fld. (5) for entry #"_RECNUM_" :'"_$P($G(^DIC(16,+PROV,0)),U)_"' could not be converted." S OK=0 D WRERROR^DGV53PT1(Y)
  1. S DR="5////"_$S(X:X,1:"@"),DIE="^DGS(41.1,",DA=RECNUM D ^DIE K DA,DIE,DR
  1. Q
  1. ;
  1. REST411(PREC,PSAV) ;-- This tag will re-process the entry incase the conversion
  1. ; needs to be re-started.
  1. ; INPUT : PREC - 0 Node of entry in MAS Parameter File for file 41.1
  1. ;
  1. ;-- get starting point
  1. I '$P(PREC,U,2) D NOW^%DTC S $P(^DG(43,1,"PCON",PSAV,0),U,2)=%
  1. 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)
  1. I 'RECNUM Q
  1. ;-- check if provider field has been processed
  1. S X=$P($G(^DGS(41.1,RECNUM,0)),U,5)
  1. I X,$P(PREC,U,10)=X,NODE=5 D DGS411(RECNUM,X)
  1. Q
  1. ;
  1. CON44 ;-- This routine will perform the conversion to file #200 for the
  1. ; Hospital Location File (#44)
  1. ;
  1. N RECNUM,SEQ,NODE,MULT,PROV,PREC,TREC,PSAV,STIME
  1. ;-- get entry in File 43 for conversion of file 44
  1. D ADDPC^DGV53PT1(44)
  1. ;-- determine if conversion needs to be re-started.
  1. S PSAV=$O(^DG(43,1,"PCON","B",44,0)),PREC=$G(^DG(43,1,"PCON",+PSAV,0))
  1. ;-- quit if file is already converted
  1. G:$P(PREC,U,6)="Y" CON44Q
  1. ;-- if record already present then re-start
  1. D REST44(PREC,PSAV)
  1. ;-- start of main loop
  1. F S RECNUM=$O(^SC(RECNUM)) Q:'RECNUM S TREC=TREC+1 W:'(TREC#100) "." D
  1. . ;-- get provider
  1. . S PROV=$P($G(^SC(RECNUM,0)),U,13)
  1. . ;-- save provider information from piece 13 of 0 node
  1. . S ^DG(43,1,"PCON",PSAV,0)=44_U_STIME_U_U_RECNUM_U_16_U_U_TREC_U_U_U_PROV
  1. . ;-- update field 16 of node 0
  1. . I PROV D SC16(RECNUM,PROV)
  1. ;-- enter completion time, mark conversion as completed
  1. D DONE^DGV53PT1(PSAV,TREC)
  1. CON44Q ;-- exit
  1. Q
  1. ;
  1. SC16(RECNUM,PROV) ;-- process SC '16' field of the 0 node
  1. ; INPUT : RECNUM - Record Number to process
  1. ; PROV - Current Provider Pointer
  1. ;
  1. N X,Y
  1. S X=$G(^DIC(16,+PROV,"A3"))
  1. I 'X S Y=">>> Default Provider fld. (16) for entry #"_RECNUM_" :'"_$P($G(^DIC(16,+PROV,0)),U)_"' could not be converted." S OK=0 D WRERROR^DGV53PT1(Y)
  1. S DR="16////"_$S(X:X,1:"@"),DIE="^SC(",DA=RECNUM D ^DIE K DA,DIE,DR
  1. Q
  1. ;
  1. REST44(PREC,PSAV) ;-- This tag will re-process the entry incase the conversion
  1. ; needs to be re-started.
  1. ; INPUT : PREC - 0 Node of entry in MAS Parameter File for file 44
  1. ;
  1. ;-- get starting point
  1. I '$P(PREC,U,2) D NOW^%DTC S $P(^DG(43,1,"PCON",PSAV,0),U,2)=%
  1. 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)
  1. I 'RECNUM Q
  1. ;-- check if provider field has been processed
  1. S X=$P($G(^SC(RECNUM,0)),U,13)
  1. I X,$P(PREC,U,10)=X,NODE=16 D SC16(RECNUM,X)
  1. Q
  1. ;