SDESINACTCLINIC ;ALB/ANU,MGD - Inactivate Clinic in HOSPITAL LOCATION FILE 44 ;July 19, 2022
;;5.3;Scheduling;**799,805,820**;Aug 13, 1993;Build 10
;;Per VHA Directive 6402, this routine should not be modified
;
; Documented API's and Integration Agreements
; -------------------------------------------
;Reference to $$GETS^DIQ is supported by IA #2056
;Reference to $$GETS1^DIQ is supported by IA #2056
Q
;
JSONINACTCLN(SDCINJSON,SDCLINICIEN,SDEAS) ;Inactivate Clinic
;INPUT - SDCLINICIEN (Clinic IEN)
; SDEAS - [optional] Enterprise Appointment Scheduling (EAS) Tracking Number associated to an appointment.
;RETURN PARMETER:
; Status
;
N ERRPOP,ERR,ERRMSG
D INIT
D VALIDATE
I ERRPOP D BLDJSON Q
D BLDCINREC
D BLDJSON
Q
;
INIT ; initialize values needed
S ERR=""
S ERRPOP=0,ERRMSG=""
Q
;
VALIDATE ; validate incoming parameters
I $$GET1^DIQ(44,SDCLINICIEN,.01)="" D
. ;create error message - Clinic Name/Clinic IEN not found
. D ERRLOG^SDESJSON(.SDCINREC,80)
. S ERRPOP=1
S SDEAS=$G(SDEAS,"")
I $L(SDEAS) S SDEAS=$$EASVALIDATE^SDESUTIL(SDEAS)
I SDEAS=-1 D ERRLOG^SDESJSON(.SDCINREC,142) S ERRPOP=1
Q
;
BLDJSON ;
D ENCODE^SDESJSON(.SDCINREC,.SDCINJSON,.ERR)
K SDCINREC
Q
;
BLDCINREC ;Inactivate Clinic
;
N SDERR,SDFDA,SDCLNNAME
S SDCLNNAME=""
S SDCLNNAME=$$GET1^DIQ(44,SDCLINICIEN,.01)
I $E(SDCLNNAME,1,2)'="ZZ" S SDFDA(44,SDCLINICIEN_",",.01)="ZZ"_$E($$GET1^DIQ(44,SDCLINICIEN,.01),1,28)
S SDFDA(44,SDCLINICIEN_",",2505)=DT
D UPDATE^DIE("","SDFDA","","SDERR")
I $G(SDERR) D ERRLOG^SDESJSON(.SDCINREC,81) Q
S SDCINREC("Success")="Clinic is successfully inactivated."
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDESINACTCLINIC 1679 printed Dec 13, 2024@02:57:17 Page 2
SDESINACTCLINIC ;ALB/ANU,MGD - Inactivate Clinic in HOSPITAL LOCATION FILE 44 ;July 19, 2022
+1 ;;5.3;Scheduling;**799,805,820**;Aug 13, 1993;Build 10
+2 ;;Per VHA Directive 6402, this routine should not be modified
+3 ;
+4 ; Documented API's and Integration Agreements
+5 ; -------------------------------------------
+6 ;Reference to $$GETS^DIQ is supported by IA #2056
+7 ;Reference to $$GETS1^DIQ is supported by IA #2056
+8 QUIT
+9 ;
JSONINACTCLN(SDCINJSON,SDCLINICIEN,SDEAS) ;Inactivate Clinic
+1 ;INPUT - SDCLINICIEN (Clinic IEN)
+2 ; SDEAS - [optional] Enterprise Appointment Scheduling (EAS) Tracking Number associated to an appointment.
+3 ;RETURN PARMETER:
+4 ; Status
+5 ;
+6 NEW ERRPOP,ERR,ERRMSG
+7 DO INIT
+8 DO VALIDATE
+9 IF ERRPOP
DO BLDJSON
QUIT
+10 DO BLDCINREC
+11 DO BLDJSON
+12 QUIT
+13 ;
INIT ; initialize values needed
+1 SET ERR=""
+2 SET ERRPOP=0
SET ERRMSG=""
+3 QUIT
+4 ;
VALIDATE ; validate incoming parameters
+1 IF $$GET1^DIQ(44,SDCLINICIEN,.01)=""
Begin DoDot:1
+2 ;create error message - Clinic Name/Clinic IEN not found
+3 DO ERRLOG^SDESJSON(.SDCINREC,80)
+4 SET ERRPOP=1
End DoDot:1
+5 SET SDEAS=$GET(SDEAS,"")
+6 IF $LENGTH(SDEAS)
SET SDEAS=$$EASVALIDATE^SDESUTIL(SDEAS)
+7 IF SDEAS=-1
DO ERRLOG^SDESJSON(.SDCINREC,142)
SET ERRPOP=1
+8 QUIT
+9 ;
BLDJSON ;
+1 DO ENCODE^SDESJSON(.SDCINREC,.SDCINJSON,.ERR)
+2 KILL SDCINREC
+3 QUIT
+4 ;
BLDCINREC ;Inactivate Clinic
+1 ;
+2 NEW SDERR,SDFDA,SDCLNNAME
+3 SET SDCLNNAME=""
+4 SET SDCLNNAME=$$GET1^DIQ(44,SDCLINICIEN,.01)
+5 IF $EXTRACT(SDCLNNAME,1,2)'="ZZ"
SET SDFDA(44,SDCLINICIEN_",",.01)="ZZ"_$EXTRACT($$GET1^DIQ(44,SDCLINICIEN,.01),1,28)
+6 SET SDFDA(44,SDCLINICIEN_",",2505)=DT
+7 DO UPDATE^DIE("","SDFDA","","SDERR")
+8 IF $GET(SDERR)
DO ERRLOG^SDESJSON(.SDCINREC,81)
QUIT
+9 SET SDCINREC("Success")="Clinic is successfully inactivated."
+10 QUIT
+11 ;