Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: SDES2GETCLINSVC

SDES2GETCLINSVC.m

Go to the documentation of this file.
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