- SDES2RECLDIPREAS ; ALB/TJB - VISTA SCHEDULING GET DELETE REASON RPC in FILE 403.56 ;OCT 26, 2023
- ;;5.3;Scheduling;**864**;Aug 13, 1993;Build 15
- ;;Per VHA Directive 6402, this routine should not be modified
- ;
- ; Documented API's and Integration Agreements
- ; -------------------------------------------
- ; Reference to HELP^DIE is supported by IA #2053
- ;
- Q ;No Direct Call
- ;
- ; SDCONTEXT("ACHERON AUDIT ID") = Up to 40 Character unique ID number. Ex: 11d9dcc6-c6a2-4785-8031-8261576fca37
- ; SDCONTEXT("PATIENT DFN") = The DFN/IEN of the target patient from the calling application.
- ; SDCONTEXT("PATIENT ICN") = The ICN of the target patient from the calling application.
- ; SDCONTEXT("USER DUZ") = The DUZ of the user taking action in the calling application.
- ; SDCONTEXT("USER SECID") = The SECID of the user taking action in the calling application.
- ;
- GETDELREASON(JSONRETURN,SDCONTEXT,SDPARAM) ;
- ;
- N RETURN,ERRORS
- D VALCONTEXT^SDES2VALCONTEXT(.ERRORS,.SDCONTEXT)
- I $D(ERRORS) S ERRORS("DeleteReason",1)="" D BUILDJSON^SDES2JSON(.JSONRETURN,.ERRORS) Q
- D BUILDDATA(.RETURN)
- D BUILDJSON^SDES2JSON(.JSONRETURN,.RETURN)
- Q
- ;
- ; Data returned by D FIELD^DID will look like:
- ; Need to parse the data and put it in the returned array
- ; K RESULT D FIELD^DID(403.56,203,"","SET OF CODES","RESULT","ERR")
- ; ZW RESULT
- ; RESULT("SET OF CODES")="1:FAILURE TO RESPOND;2:MOVED;3:DECEASED;4:DOESN'T WANT V
- ; A SERVICES;5:RECEIVED CARE AT ANOTHER VA;6:OTHER;7:APPT SCHEDULED;8:VET SELF-CANCEL;"
- BUILDDATA(RETURN) ;
- N NUMCODES,MYHELP,MYENTRY,I
- K MYHELP D FIELD^DID(403.56,203,"","SET OF CODES","MYHELP","ERR")
- S NUMCODES=MYHELP("SET OF CODES")
- F I=1:1:($L(MYHELP("SET OF CODES"),";")-1) S MYENTRY=$P(MYHELP("SET OF CODES"),";",I) I MYENTRY'="" D
- . S RETURN("DeleteReason",I,"Code")=$P(MYENTRY,":",1)
- . S RETURN("DeleteReason",I,"Description")=$P(MYENTRY,":",2)
- Q
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDES2RECLDIPREAS 1917 printed Mar 13, 2025@21:59:37 Page 2
- 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
- +2 ;;Per VHA Directive 6402, this routine should not be modified
- +3 ;
- +4 ; Documented API's and Integration Agreements
- +5 ; -------------------------------------------
- +6 ; Reference to HELP^DIE is supported by IA #2053
- +7 ;
- +8 ;No Direct Call
- QUIT
- +9 ;
- +10 ; SDCONTEXT("ACHERON AUDIT ID") = Up to 40 Character unique ID number. Ex: 11d9dcc6-c6a2-4785-8031-8261576fca37
- +11 ; SDCONTEXT("PATIENT DFN") = The DFN/IEN of the target patient from the calling application.
- +12 ; SDCONTEXT("PATIENT ICN") = The ICN of the target patient from the calling application.
- +13 ; SDCONTEXT("USER DUZ") = The DUZ of the user taking action in the calling application.
- +14 ; SDCONTEXT("USER SECID") = The SECID of the user taking action in the calling application.
- +15 ;
- GETDELREASON(JSONRETURN,SDCONTEXT,SDPARAM) ;
- +1 ;
- +2 NEW RETURN,ERRORS
- +3 DO VALCONTEXT^SDES2VALCONTEXT(.ERRORS,.SDCONTEXT)
- +4 IF $DATA(ERRORS)
- SET ERRORS("DeleteReason",1)=""
- DO BUILDJSON^SDES2JSON(.JSONRETURN,.ERRORS)
- QUIT
- +5 DO BUILDDATA(.RETURN)
- +6 DO BUILDJSON^SDES2JSON(.JSONRETURN,.RETURN)
- +7 QUIT
- +8 ;
- +9 ; Data returned by D FIELD^DID will look like:
- +10 ; Need to parse the data and put it in the returned array
- +11 ; K RESULT D FIELD^DID(403.56,203,"","SET OF CODES","RESULT","ERR")
- +12 ; ZW RESULT
- +13 ; RESULT("SET OF CODES")="1:FAILURE TO RESPOND;2:MOVED;3:DECEASED;4:DOESN'T WANT V
- +14 ; A SERVICES;5:RECEIVED CARE AT ANOTHER VA;6:OTHER;7:APPT SCHEDULED;8:VET SELF-CANCEL;"
- BUILDDATA(RETURN) ;
- +1 NEW NUMCODES,MYHELP,MYENTRY,I
- +2 KILL MYHELP
- DO FIELD^DID(403.56,203,"","SET OF CODES","MYHELP","ERR")
- +3 SET NUMCODES=MYHELP("SET OF CODES")
- +4 FOR I=1:1:($LENGTH(MYHELP("SET OF CODES"),";")-1)
- SET MYENTRY=$PIECE(MYHELP("SET OF CODES"),";",I)
- IF MYENTRY'=""
- Begin DoDot:1
- +5 SET RETURN("DeleteReason",I,"Code")=$PIECE(MYENTRY,":",1)
- +6 SET RETURN("DeleteReason",I,"Description")=$PIECE(MYENTRY,":",2)
- End DoDot:1
- +7 QUIT