VAFHLZSN ;ALB/CM,JLU-PATIENT SENSITIVITY SEGMENT ;12/31/97
;;5.3;Registration;**149**;Aug 13, 1993
EN(DFN) ;Returns ZSN segment
;
;Input: Required Variable
;
; DFN - IEN in the PATIENT file (#2)
;
;Output:
; if DFN is not passed
; First piece - -1
; Second piece - "NO DFN"
; if no patient for DFN
; First piece - -1
; Second piece - "PATIENT NOT IN DATABASE"
; if Patient is known
; First piece - "ZSN"
; Second piece - Field #2 of File #38.1 (Internal value)
; Third piece - Field #3 of File #38.1 (External value)
; Forth piece - Field #4 of File #38.1 (HL7 format)
;
; **Assumes all HL7 variables are defined***
;
N VAFLOCAL,FS,DIC,DR,DA,DIQ,SECURITY,LOCUSER,LOCDATE,RETURN
S FS=HL("FS")
I $G(DFN)="" Q "-1^NO DFN"
I $G(^DPT(DFN,0))="" Q "-1^PATIENT NOT IN DATABASE"
S DIC=38.1,DR="2;3;4",DA=DFN,DIQ="VAFLOCAL",DIQ(0)="IE"
D EN^DIQ1
S SECURITY=$$HLQ^VAFHUTL($G(VAFLOCAL(38.1,DFN,2,"I")))
S LOCUSER=$$HLQ^VAFHUTL($G(VAFLOCAL(38.1,DFN,3,"I")))
S LOCDATE=$G(VAFLOCAL(38.1,DFN,4,"I"))
I LOCDATE]"" S LOCDATE=$$HLDATE^HLFNC(LOCDATE,"TS")
E S LOCDATE=$$HLQ^VAFHUTL(LOCDATE)
S RETURN="ZSN"_FS_SECURITY_FS_LOCUSER_FS_LOCDATE
Q RETURN
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HVAFHLZSN 1215 printed Nov 22, 2024@18:13:38 Page 2
VAFHLZSN ;ALB/CM,JLU-PATIENT SENSITIVITY SEGMENT ;12/31/97
+1 ;;5.3;Registration;**149**;Aug 13, 1993
EN(DFN) ;Returns ZSN segment
+1 ;
+2 ;Input: Required Variable
+3 ;
+4 ; DFN - IEN in the PATIENT file (#2)
+5 ;
+6 ;Output:
+7 ; if DFN is not passed
+8 ; First piece - -1
+9 ; Second piece - "NO DFN"
+10 ; if no patient for DFN
+11 ; First piece - -1
+12 ; Second piece - "PATIENT NOT IN DATABASE"
+13 ; if Patient is known
+14 ; First piece - "ZSN"
+15 ; Second piece - Field #2 of File #38.1 (Internal value)
+16 ; Third piece - Field #3 of File #38.1 (External value)
+17 ; Forth piece - Field #4 of File #38.1 (HL7 format)
+18 ;
+19 ; **Assumes all HL7 variables are defined***
+20 ;
+21 NEW VAFLOCAL,FS,DIC,DR,DA,DIQ,SECURITY,LOCUSER,LOCDATE,RETURN
+22 SET FS=HL("FS")
+23 IF $GET(DFN)=""
QUIT "-1^NO DFN"
+24 IF $GET(^DPT(DFN,0))=""
QUIT "-1^PATIENT NOT IN DATABASE"
+25 SET DIC=38.1
SET DR="2;3;4"
SET DA=DFN
SET DIQ="VAFLOCAL"
SET DIQ(0)="IE"
+26 DO EN^DIQ1
+27 SET SECURITY=$$HLQ^VAFHUTL($GET(VAFLOCAL(38.1,DFN,2,"I")))
+28 SET LOCUSER=$$HLQ^VAFHUTL($GET(VAFLOCAL(38.1,DFN,3,"I")))
+29 SET LOCDATE=$GET(VAFLOCAL(38.1,DFN,4,"I"))
+30 IF LOCDATE]""
SET LOCDATE=$$HLDATE^HLFNC(LOCDATE,"TS")
+31 IF '$TEST
SET LOCDATE=$$HLQ^VAFHUTL(LOCDATE)
+32 SET RETURN="ZSN"_FS_SECURITY_FS_LOCUSER_FS_LOCDATE
+33 QUIT RETURN