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

GMTSHCPR.m

Go to the documentation of this file.
  1. GMTSHCPR ;BP/WAT - Sensitive Data in HS Type Hard Copies ; 3/29/07
  1. ;;2.7; Health Summary; **85**; Oct 20, 1995;Build 24
  1. ;
  1. ;EXTERNAL REFERENCES
  1. ; ICR 2198 $$BROKER^XWBLIB
  1. ; ICR 10078 OP^XQCHK
  1. ; $$HF^GMTSU
  1. ; DEM^GMTSU
  1. ;
  1. ; DFN, GMTSSN, GMTSPNM, GMTSPHDR, GMTSTYP, OBJ and VADM variables are set elsewhere in GMTS* code and therefore are not Newed here
  1. ; DFN - of the current pt - will only be used here if VADM and GMTSSN/GMTSPNM are all null
  1. ; GMTSSN - SSN of current pt
  1. ; GMTSPNM - name of patient: LAST,FIRST
  1. ;GMTSPHDR - array that is expected to hold pt name, ssn, dob, etc for the report header. Values are set in DEM^GMTSU and should exist
  1. ;at the time this routine is called.
  1. ;GMTSTYP - IEN of health summary type and is set prior to this routine
  1. ;;OBJ - set when dealing with a HS object and should exist at the time this routine is called
  1. ;VADM - pt data array set in DEM^GMTSU - should exist at the time of execution.
  1. ;GMTSSN85 = SSN value from pt data array VADM(2)
  1. ;GMTSNM85 = pt name from pt data array VADM(1)
  1. ;GMTSUPRT - internal value of SUPPRESS SENSITIVE DATA PRINT field in file 142
  1. ;set of codes
  1. ;0 or null = do nothing
  1. ;1 = 4 digit ssn/no dob
  1. ;2 = no ssn/no dob
  1. ;GMTSGUI - result of $$BROKER^XWBLIB - 1 = Broker or VistALink GUI; 0 = not
  1. ;GMTSUHF - result of $$HF^GMTSU - 0=gui printing; 1=not
  1. ;GMTS4DIG - local variable for 4-digit ssn
  1. EN ;;
  1. N GMTSUPRT,GMTSGUI,GMTSUHF,GMTS4DIG,GMTSSN85,GMTSNM85
  1. ;abort if current option is Network Health Exchange-related
  1. N XQOPT D OP^XQCHK Q:$P($G(XQOPT),U)["AFJX"
  1. Q:$G(GMTSTYP)="" S GMTSUPRT=$G(^GMT(142,GMTSTYP,2))
  1. S GMTSGUI=$$BROKER^XWBLIB
  1. S GMTSUHF=$$HF^GMTSU
  1. ; store SSN and Name into local variables
  1. S GMTSSN85=$S($L($G(VADM(2)))>0:$P($G(VADM(2)),U,2),1:$G(GMTSSN))
  1. S GMTSNM85=$S($L($G(VADM(1)))>0:$G(VADM(1)),1:$G(GMTSPNM))
  1. ;VADM can be killed by processing some clinical reminder components so make sure we have SSN and Name values
  1. ;If GMTSSN or GMTSPNM are still undefined, refresh VADM
  1. I $G(GMTSSN85)=""!($G(GMTSNM85)="") D
  1. .Q:$G(DFN)="" D DEM^GMTSU ;if you get here and DFN is somehow null, there won't be any pt name or ssn in the report header
  1. .I $L($G(VADM(2)))>0 S GMTSSN85=$P($G(VADM(2)),U,2)
  1. .I $L($G(VADM(1)))>0 S GMTSNM85=$G(VADM(1))
  1. ;if either is null by here, artifically suppress DOB, put info message in Name/SSN variable, and QUIT
  1. I $G(GMTSSN85)=""!($G(GMTSNM85)="") S GMTSPHDR("NMSSN")="SENSITIVE DATA SUPPRESSION FAILED, CONTACT IRM IF PERSISTENT",GMTSPHDR("DOB")=$JUSTIFY(" ",$L($G(GMTSPHDR("DOB")))) Q
  1. D:$G(GMTSGUI)=1 GUISTRP
  1. I $G(GMTSGUI)=0&($E(IOST,1,2)'="C-")&$G(GMTSUPRT)>0 D
  1. .D:+$G(GMTSUPRT)=1 FOURDIG
  1. .D:+$G(GMTSUPRT)=2 NOSSN
  1. E D:$G(OBJ)'=""
  1. .D:+$G(GMTSUPRT)=1 FOURDIG
  1. .D:+$G(GMTSUPRT)=2 NOSSN
  1. Q
  1. GUISTRP ;if GUI is printing remove dob and adjust ssn as needed
  1. I '$D(GMTSUHF)!(+$G(GMTSUHF)'=0) Q
  1. D:+$G(GMTSUPRT)=1 FOURDIG
  1. D:+$G(GMTSUPRT)=2 NOSSN
  1. Q
  1. FOURDIG ;create 4 digit ssn
  1. S GMTSPHDR("DOB")=$JUSTIFY(" ",$L($G(GMTSPHDR("DOB")))) ;replace data w/15 spaces to maintain formatting
  1. D GT4SSN
  1. S GMTSPHDR("NMSSN")=$G(GMTSNM85)_$JUSTIFY(" ",$L($G(GMTSSN85))-5)_$G(GMTS4DIG) ;concat name, 4 dig ssn, and spaces for formatting
  1. Q
  1. NOSSN ;remove ssn
  1. S GMTSPHDR("DOB")=$JUSTIFY(" ",$L($G(GMTSPHDR("DOB")))) ;replace data w/15 spaces to maintain formatting
  1. S GMTSPHDR("NMSSN")=$G(GMTSNM85)
  1. Q
  1. GT4SSN ;; get 4 digit ssn
  1. I $G(GMTSSN85)'["P" D
  1. .S GMTS4DIG=$E($G(GMTSSN85),($L($G(GMTSSN85))-3),$L($G(GMTSSN85))) ;create 4 dig ssn
  1. E S GMTS4DIG=$E($G(GMTSSN85),($L($G(GMTSSN85))-4),$L($G(GMTSSN85))) ;create 4 dig pseudo ssn
  1. Q