VistA-FOIAVistA/r/PATIENT_DATA_EXCHANGE-VAQ/VAQPST24.m

85 lines
2.7 KiB
Mathematica

VAQPST24 ;ALB/JRP - POST INIT (FILE CONVERSION);11-JUN-93
;;1.5;PATIENT DATA EXCHANGE;;NOV 17, 1993
;
CNVRT ;COMPLETE FILE CONVERSION FOR LOCAL AND REMOTE REQUESTS
;CONTINUATION FOR REQUEST^VAQPST21 & PROCESS^VAQPST22
; DECLARATIONS DONE IN CALLING ROUTINE
S (PTR15,TRAN15)=0
S TMP=$$NEWTRAN^VAQFILE
I ($P(TMP,"^",1)="-1") S ERRCNT=ERRCNT+1 Q
S PTR15=$P(TMP,"^",1)
S TRAN15=$P(TMP,"^",2)
;TRANSFER INFO
S TMP=$$FILEINFO^VAQFILE(394.61,PTR15,.02,STATUS)
I (TMP) D ERROR Q
S TMP=$$FILEINFO^VAQFILE(394.61,PTR15,.05,RELEASE)
S TMP=$$FILEINFO^VAQFILE(394.61,PTR15,.07,"1.0")
I (PATPTR'="") S TMP=$$FILEINFO^VAQFILE(394.61,PTR15,.03,("`"_PATPTR))
S TMP=$$FILEINFO^VAQFILE(394.61,PTR15,10,NAME)
I (TMP) D ERROR Q
S TMP=$$FILEINFO^VAQFILE(394.61,PTR15,11,SSN)
I (TMP) D ERROR Q
S TMP=$$FILEINFO^VAQFILE(394.61,PTR15,12,DOB)
S TMP=$$FILEINFO^VAQFILE(394.61,PTR15,13,PID)
I (TMP) D ERROR Q
S TMP=$$FILEINFO^VAQFILE(394.61,PTR15,20,DATE)
I (TMP) D ERROR Q
S TMP=$$FILEINFO^VAQFILE(394.61,PTR15,21,USER)
I (TMP) D ERROR Q
S TMP=$$FILEINFO^VAQFILE(394.61,PTR15,30,SITE)
I (TMP) D ERROR Q
S TMP=$$FILEINFO^VAQFILE(394.61,PTR15,31,DOMAIN)
I (TMP) D ERROR Q
S TMP=$$FILEINFO^VAQFILE(394.61,PTR15,40,"NO")
S TMP=$$FILEINFO^VAQFILE(394.61,PTR15,60,REMOTE)
I (TMP) D ERROR Q
S TMP=$$FILEINFO^VAQFILE(394.61,PTR15,61,RETURN)
I (TMP) D ERROR Q
S TMP=$$FILEINFO^VAQFILE(394.61,PTR15,.06,REMTRAN)
I (TMP) D ERROR Q
S TMP=$$FILEINFO^VAQFILE(394.61,PTR15,70,"NO")
S TMP=$$FILEINFO^VAQFILE(394.61,PTR15,80,"PDX*MIN",.01,"PDX*MIN")
S TMP=$$FILEINFO^VAQFILE(394.61,PTR15,80,"PDX*MAS",.01,"PDX*MAS")
S TMP=$$FILEINFO^VAQFILE(394.61,PTR15,80,"PDX*MPL",.01,"PDX*MPL")
S TMP=$$FILEINFO^VAQFILE(394.61,PTR15,90,"NO")
Q
;
ERROR ;DELETE NEW TRANSACTION
S ERRCNT=ERRCNT+1
S TMP=$$DELTRAN^VAQFILE(PTR15)
Q
;
;
DELETE(DEBUG) ;DELETE ENTRIES IN VERSION 1.0 FILES
;INPUT : DEBUG - Turns on debug mode (info written to screen)
; 1 - Debug on
; 0 - Debug off (default)
;OUTPUT : NONE
;
;CHECK INPUT
S DEBUG=+$G(DEBUG)
;DECLARE VARIABLES
N TMP,FILE
W:(DEBUG) !!!!
W:(DEBUG) !,"**************************"
W:(DEBUG) !,"* *"
W:(DEBUG) !,"* Deletion of Entries *"
W:(DEBUG) !,"* In Version 1.0 Files *"
W:(DEBUG) !,"* *"
W:(DEBUG) !,"**************************"
W:(DEBUG) !!,"Beginning deletions",!," Time: ",$$NOW^VAQUTL99,!
;LOOP THROUGH ALL FILES & DELETE ENTRIES
F FILE=394,394.1,394.2,394.3,394.4 D
.W:(DEBUG) !!,"Deleting entries in file number ",FILE," ... "
.;GET ZERO NODE FOR FILE
.S TMP=$G(^VAT(FILE,0))
.;UPDATE ZERO NODE
.S $P(TMP,"^",3)=0
.S $P(TMP,"^",4)=0
.;DELETE ENTRIES
.K ^VAT(FILE)
.;RESET ZERO NODE
.S ^VAT(FILE,0)=TMP
.W:(DEBUG) "Done"
Q