source: WorldVistAEHR/trunk/r/HEALTH_SUMMARY-GMTS/GMTSHCPR.m@ 1651

Last change on this file since 1651 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.5 KB
Line 
1GMTSHCPR ;BP/WAT - Sensitive Data in HS Type Hard Copies ; 3/29/07
2 ;;2.7; Health Summary; **85**; Oct 20, 1995;Build 24
3 ;
4 ;EXTERNAL REFERENCES
5 ; ICR 2198 $$BROKER^XWBLIB
6 ; ICR 10078 OP^XQCHK
7 ; $$HF^GMTSU
8 ; DEM^GMTSU
9 ;
10 ; DFN, GMTSSN, GMTSPNM, GMTSPHDR, GMTSTYP, OBJ and VADM variables are set elsewhere in GMTS* code and therefore are not Newed here
11 ; DFN - of the current pt - will only be used here if VADM and GMTSSN/GMTSPNM are all null
12 ; GMTSSN - SSN of current pt
13 ; GMTSPNM - name of patient: LAST,FIRST
14 ;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
15 ;at the time this routine is called.
16 ;GMTSTYP - IEN of health summary type and is set prior to this routine
17 ;;OBJ - set when dealing with a HS object and should exist at the time this routine is called
18 ;VADM - pt data array set in DEM^GMTSU - should exist at the time of execution.
19 ;GMTSSN85 = SSN value from pt data array VADM(2)
20 ;GMTSNM85 = pt name from pt data array VADM(1)
21 ;GMTSUPRT - internal value of SUPPRESS SENSITIVE DATA PRINT field in file 142
22 ;set of codes
23 ;0 or null = do nothing
24 ;1 = 4 digit ssn/no dob
25 ;2 = no ssn/no dob
26 ;GMTSGUI - result of $$BROKER^XWBLIB - 1 = Broker or VistALink GUI; 0 = not
27 ;GMTSUHF - result of $$HF^GMTSU - 0=gui printing; 1=not
28 ;GMTS4DIG - local variable for 4-digit ssn
29EN ;;
30 N GMTSUPRT,GMTSGUI,GMTSUHF,GMTS4DIG,GMTSSN85,GMTSNM85
31 ;abort if current option is Network Health Exchange-related
32 N XQOPT D OP^XQCHK Q:$P($G(XQOPT),U)["AFJX"
33 Q:$G(GMTSTYP)="" S GMTSUPRT=$G(^GMT(142,GMTSTYP,2))
34 S GMTSGUI=$$BROKER^XWBLIB
35 S GMTSUHF=$$HF^GMTSU
36 ; store SSN and Name into local variables
37 S GMTSSN85=$S($L($G(VADM(2)))>0:$P($G(VADM(2)),U,2),1:$G(GMTSSN))
38 S GMTSNM85=$S($L($G(VADM(1)))>0:$G(VADM(1)),1:$G(GMTSPNM))
39 ;VADM can be killed by processing some clinical reminder components so make sure we have SSN and Name values
40 ;If GMTSSN or GMTSPNM are still undefined, refresh VADM
41 I $G(GMTSSN85)=""!($G(GMTSNM85)="") D
42 .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
43 .I $L($G(VADM(2)))>0 S GMTSSN85=$P($G(VADM(2)),U,2)
44 .I $L($G(VADM(1)))>0 S GMTSNM85=$G(VADM(1))
45 ;if either is null by here, artifically suppress DOB, put info message in Name/SSN variable, and QUIT
46 I $G(GMTSSN85)=""!($G(GMTSNM85)="") S GMTSPHDR("NMSSN")="SENSITIVE DATA SUPPRESSION FAILED, CONTACT IRM IF PERSISTENT",GMTSPHDR("DOB")=$JUSTIFY(" ",$L($G(GMTSPHDR("DOB")))) Q
47 D:$G(GMTSGUI)=1 GUISTRP
48 I $G(GMTSGUI)=0&($E(IOST,1,2)'="C-")&$G(GMTSUPRT)>0 D
49 .D:+$G(GMTSUPRT)=1 FOURDIG
50 .D:+$G(GMTSUPRT)=2 NOSSN
51 E D:$G(OBJ)'=""
52 .D:+$G(GMTSUPRT)=1 FOURDIG
53 .D:+$G(GMTSUPRT)=2 NOSSN
54 Q
55GUISTRP ;if GUI is printing remove dob and adjust ssn as needed
56 I '$D(GMTSUHF)!(+$G(GMTSUHF)'=0) Q
57 D:+$G(GMTSUPRT)=1 FOURDIG
58 D:+$G(GMTSUPRT)=2 NOSSN
59 Q
60FOURDIG ;create 4 digit ssn
61 S GMTSPHDR("DOB")=$JUSTIFY(" ",$L($G(GMTSPHDR("DOB")))) ;replace data w/15 spaces to maintain formatting
62 D GT4SSN
63 S GMTSPHDR("NMSSN")=$G(GMTSNM85)_$JUSTIFY(" ",$L($G(GMTSSN85))-5)_$G(GMTS4DIG) ;concat name, 4 dig ssn, and spaces for formatting
64 Q
65NOSSN ;remove ssn
66 S GMTSPHDR("DOB")=$JUSTIFY(" ",$L($G(GMTSPHDR("DOB")))) ;replace data w/15 spaces to maintain formatting
67 S GMTSPHDR("NMSSN")=$G(GMTSNM85)
68 Q
69GT4SSN ;; get 4 digit ssn
70 I $G(GMTSSN85)'["P" D
71 .S GMTS4DIG=$E($G(GMTSSN85),($L($G(GMTSSN85))-3),$L($G(GMTSSN85))) ;create 4 dig ssn
72 E S GMTS4DIG=$E($G(GMTSSN85),($L($G(GMTSSN85))-4),$L($G(GMTSSN85))) ;create 4 dig pseudo ssn
73 Q
Note: See TracBrowser for help on using the repository browser.