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

SDESJSON.m

Go to the documentation of this file.
SDESJSON ;ALB/MGD/TAW - VISTA SCHEDULING JSON UTILITES ;Jun 3, 2021@14:27
 ;;5.3;Scheduling;**788,794**Aug 13, 1993;Build 6;Build 2
 ;;Per VHA Directive 2004-038, this routine should not be modified
 Q
 ; This routine documents the entry points for the new ??? GUI.
 ;
ENCODE(SDESINP,SDESOUT,SDESERR) ;
 ; Input: SDESINP = Required: Properly formatted input array to convert to JSON
 ;        SDESOUT = Required: Name of string to return to Broker
 ;        SDESERR = Optional: Name of string for error messages.
 ; Output:
 ;        SDESOUT = JSON formatted string
 ;        SDESERR = Still under development by Kernel
 ;
 ; Validate Input Parameters
 I '$D(SDESINP) D ERRLOG(.SDESINP,"Input Data Required.")
 D ENCODE^XLFJSON("SDESINP","SDESOUT","SDESERR")
 Q
 ;
ERRLOG(SDESIN,SDESERRNUM,SDESOPTMSG) ;
 ; Input:     SDESIN = Required: Array name with related data to be logged
 ;        SDESERRNUM = Required: Error # to return
 ;        SDESOPTMSG = Optional message string to append to existing error in table
 N SDESCNT
 S SDESOPTMSG=$G(SDESOPTMSG)
 I '$D(SDESIN) S SDESIN("Error",0)=""
 S SDESERRNUM=$G(SDESERRNUM,0)
 S SDESCNT=$O(SDESIN("Error",""),-1)+1
 S SDESIN("Error",SDESCNT)=$$ERRLKUP(SDESERRNUM,SDESOPTMSG)
 K SDESIN("Error",0)
 Q
 ;
ERRLKUP(SDNUM,SDESOPTMSG) ;
 N SDERRMSG
 S SDERRMSG=$T(ERRTXT+SDNUM+1)
 S SDERRMSG=$P(SDERRMSG,U,2)
 I SDERRMSG="" S SDERRMSG="Invalid Error Number."
 I $G(SDESOPTMSG)'="" D
 . S $E(SDERRMSG,$L(SDERRMSG))=": "_SDESOPTMSG
 Q SDERRMSG
 ;
 ; Standard Error Messages. Add additional errors as needed.
 ; Limit new error messages to 30 characters.
ERRTXT ;
 ;;0^No Error Number Provided.
 ;;1^Missing Patient ID.
 ;;2^Invalid Patient ID.
 ;;3^Missing Appt Request ID.
 ;;4^Invalid Appt Request ID.
 ;;5^Missing Consult Request ID.
 ;;6^Invalid Consult Request ID.
 ;;7^No Recalls for this patient.
 ;;8^No Consults for patient.
 ;;9^Missing begin date.
 ;;10^Missing end date.
 ;;11^Invalid begin date.
 ;;12^Invalid end date.
 ;;13^End date prior to begin date.
 ;;14^Missing Appt ID.
 ;;15^Invalid Appt ID.
 ;;16^Missing Recall ID.
 ;;17^Invalid Recall ID.
 ;;18^Missing Clinic ID.
 ;;19^Invalid Clinic ID.
 ;;20^Clinic not defined.
 ;;21^Missing Check In Date.
 ;;22^Invalid Check In Date.
 ;;23^Missing Check Out Date.
 ;;24^Invalid Check Out Date.
 ;;25^Missing begin date/time.
 ;;26^Missing end date/time.
 ;;27^Invalid begin date/time.
 ;;28^Invalid end date/time.
 ;;29^End date/time prior to begin date/time.
 ;;30^No status match found.
 ;;31^Appointment status is canceled.
 ;;32^Duplicate status entry.
 ;;33^No statuses available.
 ;;34^Status not created.
 ;;35^Status not updated.
 ;;36^Status not set.
 ;;37^Status not found.
 ;;38^No status sent.
 ;;39^Status is less than 3 characters or greater than 30 characters.
 ;;40^Missing check-in step ID.
 ;;41^Status must contain characters
 ;;42^Missing Disposition.
 ;;43^Invalid Disposition.
 ;;44^Invalid user.
 ;;45^Missing date.
 ;;46^Invalid date.
 ;;47^Failed create/update.
 ;;48^Missing Origination date/time.
 ;;49^Invalid Origination date/time.
 ;;50^Missing Clinic name.
 ;;51^Invalid Clinic Name.
 ;;52^Error:
 ;;53^Missing Provider ID.
 ;;54^Invalid Provider ID.
 ;;55^Invalid Disposition Date.
 ;;56^Missing Disposition Date.
 ;;57^Missing Desired Date Of Appt.
 ;;58^Invalid Desired Date Of Appt.
 ;;59^Desired Date of Appt can not be in the past.
 ;;60^Missing Appointment Request Type.
 ;;61^Invalid Appointment Request Type.
 ;;62^Missing Requested By.
 ;;63^Clinic Name or Clinic Stop is required.
 Q