SDES2GETCLINSVC ;ALB/BWF - SDES2 GET SERVICES FOR CLINICS; AUG 27,2024
;;5.3;Scheduling;**890**;Aug 13, 1993;Build 5
;;Per VHA Directive 6402, this routine should not be modified
;
Q
GETSERVICETYPES(RETURN,SDCONTEXT) ;
N FLDINFO,FERR,ERRORS,DONE,CNT,I,SERVICEDATA
D VALCONTEXT^SDES2VALCONTEXT(.ERRORS,.SDCONTEXT)
I $D(ERRORS) S ERRORS("ServiceTypes",1)="" D BUILDJSON^SDES2JSON(.RETURN,.ERRORS) Q
D FIELD^DID(44,9,"","SET OF CODES","FLDINFO","FERR")
I $D(FERR) D Q
.D ERRLOG^SDES2JSON(.ERRORS,52,"Unable to get field data.")
.S ERRORS("ServiceTypes",1)=""
.D BUILDJSON^SDES2JSON(.RETURN,.ERRORS)
S (DONE,CNT)=0
F I=1:1 Q:DONE D
.S SERVICEDATA=$P(FLDINFO("SET OF CODES"),";",I)
.I SERVICEDATA="" S DONE=1 Q
.S CNT=CNT+1
.S SERVICEDATA("ServiceTypes",CNT,"Code")=$P(SERVICEDATA,":")
.S SERVICEDATA("ServiceTypes",CNT,"Value")=$P(SERVICEDATA,":",2)
I '$D(SERVICEDATA) S SERVICEDATA("ServiceTypes",1)=""
D BUILDJSON^SDES2JSON(.RETURN,.SERVICEDATA)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDES2GETCLINSVC 994 printed Dec 13, 2024@02:53:55 Page 2
SDES2GETCLINSVC ;ALB/BWF - SDES2 GET SERVICES FOR CLINICS; AUG 27,2024
+1 ;;5.3;Scheduling;**890**;Aug 13, 1993;Build 5
+2 ;;Per VHA Directive 6402, this routine should not be modified
+3 ;
+4 QUIT
GETSERVICETYPES(RETURN,SDCONTEXT) ;
+1 NEW FLDINFO,FERR,ERRORS,DONE,CNT,I,SERVICEDATA
+2 DO VALCONTEXT^SDES2VALCONTEXT(.ERRORS,.SDCONTEXT)
+3 IF $DATA(ERRORS)
SET ERRORS("ServiceTypes",1)=""
DO BUILDJSON^SDES2JSON(.RETURN,.ERRORS)
QUIT
+4 DO FIELD^DID(44,9,"","SET OF CODES","FLDINFO","FERR")
+5 IF $DATA(FERR)
Begin DoDot:1
+6 DO ERRLOG^SDES2JSON(.ERRORS,52,"Unable to get field data.")
+7 SET ERRORS("ServiceTypes",1)=""
+8 DO BUILDJSON^SDES2JSON(.RETURN,.ERRORS)
End DoDot:1
QUIT
+9 SET (DONE,CNT)=0
+10 FOR I=1:1
if DONE
QUIT
Begin DoDot:1
+11 SET SERVICEDATA=$PIECE(FLDINFO("SET OF CODES"),";",I)
+12 IF SERVICEDATA=""
SET DONE=1
QUIT
+13 SET CNT=CNT+1
+14 SET SERVICEDATA("ServiceTypes",CNT,"Code")=$PIECE(SERVICEDATA,":")
+15 SET SERVICEDATA("ServiceTypes",CNT,"Value")=$PIECE(SERVICEDATA,":",2)
End DoDot:1
+16 IF '$DATA(SERVICEDATA)
SET SERVICEDATA("ServiceTypes",1)=""
+17 DO BUILDJSON^SDES2JSON(.RETURN,.SERVICEDATA)
+18 QUIT