PXAAVSIT ;ISP/LMT - APIs for VISIT (#9000010) ;Aug 29, 2023@08:59
;;1.0;PCE PATIENT CARE ENCOUNTER;**238**;Aug 12, 1996;Build 3
;
; APIs for VISIT (#9000010)
;
;
GETFIELDS(ARRAY,IEN,FIELDS,EXTERNAL) ;
K ARRAY
I $G(IEN)'>0 Q 0
I '$D(^AUPNVSIT(IEN)) Q 0 ; Exit if no such record.
;
N DIQOUT,FLDNUM,IENS,MSG,FLAG
S FLAG="I"
I $G(EXTERNAL) S FLAG="E"
S IENS=IEN_","
D GETS^DIQ(9000010,IENS,FIELDS,FLAG,"DIQOUT","MSG")
I $D(MSG) S ARRAY(1)="Invalid field list." Q -1
S FLDNUM=0
F S FLDNUM=$O(DIQOUT(9000010,IENS,FLDNUM)) Q:FLDNUM="" D
. S ARRAY(FLDNUM)=$G(DIQOUT(9000010,IENS,FLDNUM,FLAG))
Q 1
;
;
GETFIELD(IEN,FIELD,EXTERNAL) ;
N IENS,FLAG
I $G(IEN)'>0 Q ""
I '$D(^AUPNVSIT(IEN)) Q "" ; Exit if no such record.
;
S FLAG="I"
I $G(EXTERNAL) S FLAG="E"
S IENS=IEN_","
Q $$GET1^DIQ(9000010,IENS,$G(FIELD),FLAG)
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPXAAVSIT 872 printed Dec 13, 2024@02:25:43 Page 2
PXAAVSIT ;ISP/LMT - APIs for VISIT (#9000010) ;Aug 29, 2023@08:59
+1 ;;1.0;PCE PATIENT CARE ENCOUNTER;**238**;Aug 12, 1996;Build 3
+2 ;
+3 ; APIs for VISIT (#9000010)
+4 ;
+5 ;
GETFIELDS(ARRAY,IEN,FIELDS,EXTERNAL) ;
+1 KILL ARRAY
+2 IF $GET(IEN)'>0
QUIT 0
+3 ; Exit if no such record.
IF '$DATA(^AUPNVSIT(IEN))
QUIT 0
+4 ;
+5 NEW DIQOUT,FLDNUM,IENS,MSG,FLAG
+6 SET FLAG="I"
+7 IF $GET(EXTERNAL)
SET FLAG="E"
+8 SET IENS=IEN_","
+9 DO GETS^DIQ(9000010,IENS,FIELDS,FLAG,"DIQOUT","MSG")
+10 IF $DATA(MSG)
SET ARRAY(1)="Invalid field list."
QUIT -1
+11 SET FLDNUM=0
+12 FOR
SET FLDNUM=$ORDER(DIQOUT(9000010,IENS,FLDNUM))
if FLDNUM=""
QUIT
Begin DoDot:1
+13 SET ARRAY(FLDNUM)=$GET(DIQOUT(9000010,IENS,FLDNUM,FLAG))
End DoDot:1
+14 QUIT 1
+15 ;
+16 ;
GETFIELD(IEN,FIELD,EXTERNAL) ;
+1 NEW IENS,FLAG
+2 IF $GET(IEN)'>0
QUIT ""
+3 ; Exit if no such record.
IF '$DATA(^AUPNVSIT(IEN))
QUIT ""
+4 ;
+5 SET FLAG="I"
+6 IF $GET(EXTERNAL)
SET FLAG="E"
+7 SET IENS=IEN_","
+8 QUIT $$GET1^DIQ(9000010,IENS,$GET(FIELD),FLAG)
+9 ;