GMTSMHCI ;SLC/WAT - HRMH PATIENT CONTACT INFO ;06/13/11 11:58
;;2.7;Health Summary;**99,110**;Oct 20, 1995;Build 2
;
;EXTERNAL CALLS
;ADD/OAD/KVA ^VADPT 10061
;Field # .134 PHONE NUMBER [CELLULAR] from Patient file 10035
;$$GET1^DIQ 2056
;
;
;Get contact data to display in TIU HS object. The object is used in reminder dialog that MH professionals
;will use to f/u on missed patient apptointments.
;DATA PULLED BY THIS COMPONENT.
;patient phone numbers
; cell
; home
; work
;
;;emergency contact: name, relationship, phone number
;;secondary emergency contact: name, relationship, phone number
;;secondary next of kin contact: name, relationship, phone number
;
PRINT ;MAIN
K ^TMP($J,"GMTS CONTACT INFO")
N CNT,HMPHON,TAB,NODATA S CNT=0
S NODATA="No data available"
S ^TMP($J,"GMTS CONTACT INFO",CNT)=" Patient Phone Numbers:",CNT=CNT+1
S TAB=" " ;8 SPACES
D CELL
D HOME
D WORK
S ^TMP($J,"GMTS CONTACT INFO",CNT)="",CNT=CNT+1
D EMERGNOK
D REPORT
D KVA^VADPT
Q
;
CELL ;GET CELL #
N GMTSCELL S GMTSCELL=""
S GMTSCELL=$$GET1^DIQ(2,DFN,.134)
S ^TMP($J,"GMTS CONTACT INFO",CNT)=TAB_"Cell: "_$S($G(GMTSCELL)>0:GMTSCELL,1:NODATA),CNT=CNT+1
Q
;
WORK ;work ph #
; KDM 1/28/2014 GMTS*2.7*110
; Replaced OAD^VADPT call with OPD^VADPT to return correct patient work phone number
N VAPD,WORK D OPD^VADPT
I $G(VAERR)=1 S ^TMP($J,"GMTS CONTACT INFO",CNT)="PATIENT NOT FOUND",CNT=CNT+1 Q
S ^TMP($J,"GMTS CONTACT INFO",CNT)=TAB_"Work: "_$S($G(VAPD(8))'="":VAPD(8),1:NODATA),CNT=CNT+1
Q
;
HOME ;home phone
N VAPA,VAERR,HOME D ADD^VADPT
I $G(VAERR)=1 S ^TMP($J,"GMTS CONTACT INFO",CNT)="PATIENT NOT FOUND",CNT=CNT+1 Q
S ^TMP($J,"GMTS CONTACT INFO",CNT)=TAB_"Home: "_$S($G(VAPA(8))'="":VAPA(8),1:NODATA),CNT=CNT+1
Q
;
EMERGNOK ; emergency and NOK contacts.
N I,VAOA,VAERR
;S:$G(VAERR)=1 ^TMP($J,"GMTS CONTACT INFO",CNT)="PATIENT NOT FOUND",CNT=CNT+1 Q
F I=1,4,3 D
.S VAOA("A")=I D OAD^VADPT Q:$G(VAERR)=1
.S ^TMP($J,"GMTS CONTACT INFO",CNT)=$S(VAOA("A")=1:" Emergency Contact: ",VAOA("A")=4:" Secondary Emergency Contact: ",VAOA("A")=3:" Secondary Next of Kin Contact"),CNT=CNT+1
.S ^TMP($J,"GMTS CONTACT INFO",CNT)=TAB_"Name: "_$S($G(VAOA(9))'="":VAOA(9),1:NODATA),CNT=CNT+1
.S ^TMP($J,"GMTS CONTACT INFO",CNT)=TAB_"Relationship: "_$S($G(VAOA(10))'="":VAOA(10),1:NODATA),CNT=CNT+1
.S ^TMP($J,"GMTS CONTACT INFO",CNT)=TAB_"Phone: "_$S($G(VAOA(8))'="":VAOA(8),1:NODATA),CNT=CNT+1
.S ^TMP($J,"GMTS CONTACT INFO",CNT)="",CNT=CNT+1
Q
;
REPORT ;write to screen
N LINE S LINE=""
F S LINE=$O(^TMP($J,"GMTS CONTACT INFO",LINE)) D Q:LINE=""
.Q:LINE=""
.D CKP^GMTSUP Q:$D(GMTSQIT)
.W:LINE=0 ^TMP($J,"GMTS CONTACT INFO",LINE)
.W:LINE>0 !,^TMP($J,"GMTS CONTACT INFO",LINE)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMTSMHCI 2831 printed Dec 13, 2024@01:58:11 Page 2
GMTSMHCI ;SLC/WAT - HRMH PATIENT CONTACT INFO ;06/13/11 11:58
+1 ;;2.7;Health Summary;**99,110**;Oct 20, 1995;Build 2
+2 ;
+3 ;EXTERNAL CALLS
+4 ;ADD/OAD/KVA ^VADPT 10061
+5 ;Field # .134 PHONE NUMBER [CELLULAR] from Patient file 10035
+6 ;$$GET1^DIQ 2056
+7 ;
+8 ;
+9 ;Get contact data to display in TIU HS object. The object is used in reminder dialog that MH professionals
+10 ;will use to f/u on missed patient apptointments.
+11 ;DATA PULLED BY THIS COMPONENT.
+12 ;patient phone numbers
+13 ; cell
+14 ; home
+15 ; work
+16 ;
+17 ;;emergency contact: name, relationship, phone number
+18 ;;secondary emergency contact: name, relationship, phone number
+19 ;;secondary next of kin contact: name, relationship, phone number
+20 ;
PRINT ;MAIN
+1 KILL ^TMP($JOB,"GMTS CONTACT INFO")
+2 NEW CNT,HMPHON,TAB,NODATA
SET CNT=0
+3 SET NODATA="No data available"
+4 SET ^TMP($JOB,"GMTS CONTACT INFO",CNT)=" Patient Phone Numbers:"
SET CNT=CNT+1
+5 ;8 SPACES
SET TAB=" "
+6 DO CELL
+7 DO HOME
+8 DO WORK
+9 SET ^TMP($JOB,"GMTS CONTACT INFO",CNT)=""
SET CNT=CNT+1
+10 DO EMERGNOK
+11 DO REPORT
+12 DO KVA^VADPT
+13 QUIT
+14 ;
CELL ;GET CELL #
+1 NEW GMTSCELL
SET GMTSCELL=""
+2 SET GMTSCELL=$$GET1^DIQ(2,DFN,.134)
+3 SET ^TMP($JOB,"GMTS CONTACT INFO",CNT)=TAB_"Cell: "_$SELECT($GET(GMTSCELL)>0:GMTSCELL,1:NODATA)
SET CNT=CNT+1
+4 QUIT
+5 ;
WORK ;work ph #
+1 ; KDM 1/28/2014 GMTS*2.7*110
+2 ; Replaced OAD^VADPT call with OPD^VADPT to return correct patient work phone number
+3 NEW VAPD,WORK
DO OPD^VADPT
+4 IF $GET(VAERR)=1
SET ^TMP($JOB,"GMTS CONTACT INFO",CNT)="PATIENT NOT FOUND"
SET CNT=CNT+1
QUIT
+5 SET ^TMP($JOB,"GMTS CONTACT INFO",CNT)=TAB_"Work: "_$SELECT($GET(VAPD(8))'="":VAPD(8),1:NODATA)
SET CNT=CNT+1
+6 QUIT
+7 ;
HOME ;home phone
+1 NEW VAPA,VAERR,HOME
DO ADD^VADPT
+2 IF $GET(VAERR)=1
SET ^TMP($JOB,"GMTS CONTACT INFO",CNT)="PATIENT NOT FOUND"
SET CNT=CNT+1
QUIT
+3 SET ^TMP($JOB,"GMTS CONTACT INFO",CNT)=TAB_"Home: "_$SELECT($GET(VAPA(8))'="":VAPA(8),1:NODATA)
SET CNT=CNT+1
+4 QUIT
+5 ;
EMERGNOK ; emergency and NOK contacts.
+1 NEW I,VAOA,VAERR
+2 ;S:$G(VAERR)=1 ^TMP($J,"GMTS CONTACT INFO",CNT)="PATIENT NOT FOUND",CNT=CNT+1 Q
+3 FOR I=1,4,3
Begin DoDot:1
+4 SET VAOA("A")=I
DO OAD^VADPT
if $GET(VAERR)=1
QUIT
+5 SET ^TMP($JOB,"GMTS CONTACT INFO",CNT)=$SELECT(VAOA("A")=1:" Emergency Contact: ",VAOA("A")=4:" Secondary Emergency Contact: ",VAOA("A")=3:" Secondary Next of Kin Contact")
SET CNT=CNT+1
+6 SET ^TMP($JOB,"GMTS CONTACT INFO",CNT)=TAB_"Name: "_$SELECT($GET(VAOA(9))'="":VAOA(9),1:NODATA)
SET CNT=CNT+1
+7 SET ^TMP($JOB,"GMTS CONTACT INFO",CNT)=TAB_"Relationship: "_$SELECT($GET(VAOA(10))'="":VAOA(10),1:NODATA)
SET CNT=CNT+1
+8 SET ^TMP($JOB,"GMTS CONTACT INFO",CNT)=TAB_"Phone: "_$SELECT($GET(VAOA(8))'="":VAOA(8),1:NODATA)
SET CNT=CNT+1
+9 SET ^TMP($JOB,"GMTS CONTACT INFO",CNT)=""
SET CNT=CNT+1
End DoDot:1
+10 QUIT
+11 ;
REPORT ;write to screen
+1 NEW LINE
SET LINE=""
+2 FOR
SET LINE=$ORDER(^TMP($JOB,"GMTS CONTACT INFO",LINE))
Begin DoDot:1
+3 if LINE=""
QUIT
+4 DO CKP^GMTSUP
if $DATA(GMTSQIT)
QUIT
+5 if LINE=0
WRITE ^TMP($JOB,"GMTS CONTACT INFO",LINE)
+6 if LINE>0
WRITE !,^TMP($JOB,"GMTS CONTACT INFO",LINE)
End DoDot:1
if LINE=""
QUIT
+7 QUIT