VIAAPTR ;ALB/WW - Patient RPCs for RTLS ;4/20/16 10:11 pm
;;1.0;RTLS;**4**;April 22, 2013;Build 21
;;
;; RTLS Patient RPC calls
Q
;
; Reference to ^DPT supported by IA #10035
;
;----------------------------------------------------------------------------
RTLSPT(RETSTA,REQDATA,DATAID,DATAID2) ; Retrieve Patient Information.
;
; This RPC allows retrieval of the following fields from
; the Patient File (#2):
; IEN
; SOCIAL SECURITY NUMBER (#.09)
; INTEGRATION CONTROL NUMBER (#991.01)
; NAME ( #.01)
; SEX (#.02)
; DATE OF BIRTH (#.03)
; ROOM-BED (#.101)
; WARD LOCATION(#.1)
;
; Input:
; RETSTA - name of the return array
; REQDATA - identifies the DATAID/DATAID2 parameter value:
; "SSN" defines DATAID as a Social Security Number
; "ICN" defines DATAID as an Internal Control Number
; DATAID - actual value as defined by REQDATA:
; SSN if REQDATA="SSN"
; ICN if REQDATA="ICN"
; Output:
; Global ^TMP("VIAA"_REQDATA,$J)
; Contains data elements when REQDATA and DATAID are passed in as
; input parameters and are defined as follows:
; "IEN^SSN^ICN^NAME^SEX^DOB^ROOM-BED^WARD LOCATION"
; or an error condition:
; "-###^" concatenated with reason for failure is returned,
; where '###' is a 3-digit code
;
N VIAA,VIAATMP,VIAAIEN
;
S VIAA="VIAA"_REQDATA
;
K ^TMP(VIAA,$J)
;
I $G(REQDATA)="" S ^TMP(VIAA,$J,0)="-400^REQDATA must be the keyword 'SSN' or 'ICN'" D OUTPUT Q
;I $G(DATAID)="" S ^TMP(VIAA,$J,0)="-400^DATA ID not specified" D OUTPUT Q
I $G(DATAID)="" D D OUTPUT Q
.I $G(REQDATA)="SSN" S ^TMP(VIAA,$J,0)="-400^SSN cannot be null"
.I $G(REQDATA)="ICN" S ^TMP(VIAA,$J,0)="-400^ICN cannot be null"
;
I "^SSN^ICN^"'[(U_REQDATA_U) D D OUTPUT Q
.S ^TMP(VIAA,$J,0)="-400^REQDATA must be the keyword 'SSN' or 'ICN'"
;
S VIAAIEN=$$FIND1^DIC(2,,,DATAID,$S(REQDATA="ICN":"AICN",1:REQDATA))
;
I 'VIAAIEN D D OUTPUT Q
.S ^TMP(VIAA,$J,0)="-404^("_DATAID_") not a recognized "_REQDATA
;
S VIAATMP=VIAAIEN_U_$$GET1^DIQ(2,VIAAIEN_",","SSN")
S VIAATMP=VIAATMP_U_$$GET1^DIQ(2,VIAAIEN_",","INTEGRATION CONTROL NUMBER")
S VIAATMP=VIAATMP_U_$$GET1^DIQ(2,VIAAIEN_",","NAME")
S VIAATMP=VIAATMP_U_$$GET1^DIQ(2,VIAAIEN_",","SEX","I")
S VIAATMP=VIAATMP_U_$$GET1^DIQ(2,VIAAIEN_",","DOB")
S VIAATMP=VIAATMP_U_$$GET1^DIQ(2,VIAAIEN_",","ROOM-BED")
S VIAATMP=VIAATMP_U_$$GET1^DIQ(2,VIAAIEN_",","WARD LOCATION")
S ^TMP(VIAA,$J,0)=VIAATMP
;
;----------------------------------------------------------------------------
OUTPUT ; Move the ^TMP data to the output array RETSTA
;
S RETSTA=$NA(^TMP(VIAA,$J))
;
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HVIAAPTR 2700 printed Nov 22, 2024@17:43:18 Page 2
VIAAPTR ;ALB/WW - Patient RPCs for RTLS ;4/20/16 10:11 pm
+1 ;;1.0;RTLS;**4**;April 22, 2013;Build 21
+2 ;;
+3 ;; RTLS Patient RPC calls
+4 QUIT
+5 ;
+6 ; Reference to ^DPT supported by IA #10035
+7 ;
+8 ;----------------------------------------------------------------------------
RTLSPT(RETSTA,REQDATA,DATAID,DATAID2) ; Retrieve Patient Information.
+1 ;
+2 ; This RPC allows retrieval of the following fields from
+3 ; the Patient File (#2):
+4 ; IEN
+5 ; SOCIAL SECURITY NUMBER (#.09)
+6 ; INTEGRATION CONTROL NUMBER (#991.01)
+7 ; NAME ( #.01)
+8 ; SEX (#.02)
+9 ; DATE OF BIRTH (#.03)
+10 ; ROOM-BED (#.101)
+11 ; WARD LOCATION(#.1)
+12 ;
+13 ; Input:
+14 ; RETSTA - name of the return array
+15 ; REQDATA - identifies the DATAID/DATAID2 parameter value:
+16 ; "SSN" defines DATAID as a Social Security Number
+17 ; "ICN" defines DATAID as an Internal Control Number
+18 ; DATAID - actual value as defined by REQDATA:
+19 ; SSN if REQDATA="SSN"
+20 ; ICN if REQDATA="ICN"
+21 ; Output:
+22 ; Global ^TMP("VIAA"_REQDATA,$J)
+23 ; Contains data elements when REQDATA and DATAID are passed in as
+24 ; input parameters and are defined as follows:
+25 ; "IEN^SSN^ICN^NAME^SEX^DOB^ROOM-BED^WARD LOCATION"
+26 ; or an error condition:
+27 ; "-###^" concatenated with reason for failure is returned,
+28 ; where '###' is a 3-digit code
+29 ;
+30 NEW VIAA,VIAATMP,VIAAIEN
+31 ;
+32 SET VIAA="VIAA"_REQDATA
+33 ;
+34 KILL ^TMP(VIAA,$JOB)
+35 ;
+36 IF $GET(REQDATA)=""
SET ^TMP(VIAA,$JOB,0)="-400^REQDATA must be the keyword 'SSN' or 'ICN'"
DO OUTPUT
QUIT
+37 ;I $G(DATAID)="" S ^TMP(VIAA,$J,0)="-400^DATA ID not specified" D OUTPUT Q
+38 IF $GET(DATAID)=""
Begin DoDot:1
+39 IF $GET(REQDATA)="SSN"
SET ^TMP(VIAA,$JOB,0)="-400^SSN cannot be null"
+40 IF $GET(REQDATA)="ICN"
SET ^TMP(VIAA,$JOB,0)="-400^ICN cannot be null"
End DoDot:1
DO OUTPUT
QUIT
+41 ;
+42 IF "^SSN^ICN^"'[(U_REQDATA_U)
Begin DoDot:1
+43 SET ^TMP(VIAA,$JOB,0)="-400^REQDATA must be the keyword 'SSN' or 'ICN'"
End DoDot:1
DO OUTPUT
QUIT
+44 ;
+45 SET VIAAIEN=$$FIND1^DIC(2,,,DATAID,$SELECT(REQDATA="ICN":"AICN",1:REQDATA))
+46 ;
+47 IF 'VIAAIEN
Begin DoDot:1
+48 SET ^TMP(VIAA,$JOB,0)="-404^("_DATAID_") not a recognized "_REQDATA
End DoDot:1
DO OUTPUT
QUIT
+49 ;
+50 SET VIAATMP=VIAAIEN_U_$$GET1^DIQ(2,VIAAIEN_",","SSN")
+51 SET VIAATMP=VIAATMP_U_$$GET1^DIQ(2,VIAAIEN_",","INTEGRATION CONTROL NUMBER")
+52 SET VIAATMP=VIAATMP_U_$$GET1^DIQ(2,VIAAIEN_",","NAME")
+53 SET VIAATMP=VIAATMP_U_$$GET1^DIQ(2,VIAAIEN_",","SEX","I")
+54 SET VIAATMP=VIAATMP_U_$$GET1^DIQ(2,VIAAIEN_",","DOB")
+55 SET VIAATMP=VIAATMP_U_$$GET1^DIQ(2,VIAAIEN_",","ROOM-BED")
+56 SET VIAATMP=VIAATMP_U_$$GET1^DIQ(2,VIAAIEN_",","WARD LOCATION")
+57 SET ^TMP(VIAA,$JOB,0)=VIAATMP
+58 ;
+59 ;----------------------------------------------------------------------------
OUTPUT ; Move the ^TMP data to the output array RETSTA
+1 ;
+2 SET RETSTA=$NAME(^TMP(VIAA,$JOB))
+3 ;
+4 QUIT