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

SDES2RECLDIPREAS.m

Go to the documentation of this file.
  1. SDES2RECLDIPREAS ; ALB/TJB - VISTA SCHEDULING GET DELETE REASON RPC in FILE 403.56 ;OCT 26, 2023
  1. ;;5.3;Scheduling;**864**;Aug 13, 1993;Build 15
  1. ;;Per VHA Directive 6402, this routine should not be modified
  1. ;
  1. ; Documented API's and Integration Agreements
  1. ; -------------------------------------------
  1. ; Reference to HELP^DIE is supported by IA #2053
  1. ;
  1. Q ;No Direct Call
  1. ;
  1. ; SDCONTEXT("ACHERON AUDIT ID") = Up to 40 Character unique ID number. Ex: 11d9dcc6-c6a2-4785-8031-8261576fca37
  1. ; SDCONTEXT("PATIENT DFN") = The DFN/IEN of the target patient from the calling application.
  1. ; SDCONTEXT("PATIENT ICN") = The ICN of the target patient from the calling application.
  1. ; SDCONTEXT("USER DUZ") = The DUZ of the user taking action in the calling application.
  1. ; SDCONTEXT("USER SECID") = The SECID of the user taking action in the calling application.
  1. ;
  1. GETDELREASON(JSONRETURN,SDCONTEXT,SDPARAM) ;
  1. ;
  1. N RETURN,ERRORS
  1. D VALCONTEXT^SDES2VALCONTEXT(.ERRORS,.SDCONTEXT)
  1. I $D(ERRORS) S ERRORS("DeleteReason",1)="" D BUILDJSON^SDES2JSON(.JSONRETURN,.ERRORS) Q
  1. D BUILDDATA(.RETURN)
  1. D BUILDJSON^SDES2JSON(.JSONRETURN,.RETURN)
  1. Q
  1. ;
  1. ; Data returned by D FIELD^DID will look like:
  1. ; Need to parse the data and put it in the returned array
  1. ; K RESULT D FIELD^DID(403.56,203,"","SET OF CODES","RESULT","ERR")
  1. ; ZW RESULT
  1. ; RESULT("SET OF CODES")="1:FAILURE TO RESPOND;2:MOVED;3:DECEASED;4:DOESN'T WANT V
  1. ; A SERVICES;5:RECEIVED CARE AT ANOTHER VA;6:OTHER;7:APPT SCHEDULED;8:VET SELF-CANCEL;"
  1. BUILDDATA(RETURN) ;
  1. N NUMCODES,MYHELP,MYENTRY,I
  1. K MYHELP D FIELD^DID(403.56,203,"","SET OF CODES","MYHELP","ERR")
  1. S NUMCODES=MYHELP("SET OF CODES")
  1. F I=1:1:($L(MYHELP("SET OF CODES"),";")-1) S MYENTRY=$P(MYHELP("SET OF CODES"),";",I) I MYENTRY'="" D
  1. . S RETURN("DeleteReason",I,"Code")=$P(MYENTRY,":",1)
  1. . S RETURN("DeleteReason",I,"Description")=$P(MYENTRY,":",2)
  1. Q