SDES2VALCRTCLIN1 ;ALB/MGD/BLB,BWF - CLINIC VALIDATION UTILITIES DRIVER ;SEPT 25,2023
;;5.3;Scheduling;**853,857,860,871,885**;Aug 13, 1993;Build 5
;;Per VHA Directive 6402, this routine should not be modified
;
; Reference to $$CODEC^ICDEX is supported by IA #5747
; Reference to $$CODEN^ICDEX is supported by IA #5747
;
; RPC: SDES CREATE CLINIC2
;
Q
;
VALCLINIC(SDERRORS,SDCLINIC,SDFILEDATA) ; Validate Clinic Input Array
N VRES
; Validate required variables first
D VALALLOWNOSHOW^SDES2VAL44(.SDERRORS,$G(SDCLINIC("ALLOWABLE CONSECUTIVE NO-SHOWS")),.SDFILEDATA)
D VALDIRPATSCHED^SDES2VAL44(.SDERRORS,$G(SDCLINIC("DIRECT PATIENT SCHEDULING")),.SDFILEDATA)
D VALPRIMAMIS^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
D VALNAME^SDES2VAL44(.SDERRORS,$G(SDCLINIC("NAME")),.SDFILEDATA)
D VALDISPAPPT^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
D VALINCPERHOUR^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
D VALDIV^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
D VALCHECKIN^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
D VALAPPTLENGTH^SDES2VAL44(.SDERRORS,$G(SDCLINIC("LENGTH OF APPOINTMENT")),.SDFILEDATA)
D VALMAXFUTBOOK^SDES2VAL44(.SDERRORS,$G(SDCLINIC("MAX DAYS FUTURE BOOKING")),.SDFILEDATA)
D VALMEETATFACIL^SDES2VAL44(.SDERRORS,$G(SDCLINIC("MEETS AT FACILITY")),.SDFILEDATA)
D VALNONCOUNT^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
D VALOVBDAYMAX^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
D VALPRECHECKIN^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
D VALPROFILE^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
D VALSERVICE^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
;
; Quit if any errors in Required input parameters
Q:$D(SDERRORS)
;
; Validate optional variables second - Values that will be altered by the validation will have SDCLINIC passed by reference
; =================================
I $G(SDCLINIC("ABBREVIATION"))'="" D VALABBR^SDES2VAL44(.SDERRORS,SDCLINIC("ABBREVIATION"),.SDFILEDATA)
I $G(SDCLINIC("ADMIN INPATIENT MEDS"))'="" D VALINPATMED^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
I $G(SDCLINIC("APPOINTMENT CANCELLATION LETTER"))'="" D VALAPTCANLET^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
I $G(SDCLINIC("ASK CHECK IN/OUT"))'="" D VALINOUTTIME^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
I $G(SDCLINIC("CLINIC CANCELLATION LETTER"))'="" D VALCANLET^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
I $G(SDCLINIC("CREDIT AMIS"))'="" D VALCREDITAMIS^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
I $G(SDCLINIC("PRIMARY AMIS"))'="",$G(SDCLINIC("CREDIT AMIS"))'="" D CONDAMISCHECK^SDES2VAL44(.SDERRORS,SDCLINIC("PRIMARY AMIS"),SDCLINIC("CREDIT AMIS"))
I $G(SDCLINIC("DEFAULT APPOINTMENT TYPE"))'="" D VALAPPTTYPE^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
I $G(SDCLINIC("DEFAULT TO PC PRACTITIONER"))'="" D VALDEFAULTTOPRAC^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
I $D(SDCLINIC("DIAGNOSIS")) D VALDIAG(.SDERRORS,.SDCLINIC,.SDFILEDATA) ; Call Create only Validator
D VALSTARTHOUR^SDES2VAL44(.SDERRORS,$G(SDCLINIC("HOUR CLINIC DISPLAY BEGINS")),.SDFILEDATA)
I $G(SDCLINIC("NO-SHOW LETTER"))'="" D VALNOSHOWLET^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
I $G(SDCLINIC("PATIENT FRIENDLY NAME"))'="" D VALPATFNAME^SDES2VAL44(.SDERRORS,SDCLINIC("PATIENT FRIENDLY NAME"),.SDFILEDATA)
I $G(SDCLINIC("PBSPID"))'="" D VALPBSPID^SDES2VAL44(.SDERRORS,SDCLINIC("PBSPID"),.SDFILEDATA)
I $G(SDCLINIC("PHYSICAL LOCATION"))'="" D VALLOCATION^SDES2VAL44(.SDERRORS,SDCLINIC("PHYSICAL LOCATION"),.SDFILEDATA)
I $G(SDCLINIC("PRE-APPOINTMENT LETTER"))'="" D VALPREAPTLET^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
I $G(SDCLINIC("PRINCIPAL CLINIC"))'="" D VALPRINCLINIC^SDES2VAL44(.SDERRORS,SDCLINIC("PRINCIPAL CLINIC"),.SDFILEDATA)
I $G(SDCLINIC("PROHIBIT ACCESS TO CLINIC"))'="" D VALNOACCESS^SDES2VAL44(.SDERRORS,SDCLINIC("PROHIBIT ACCESS TO CLINIC"),.SDFILEDATA)
I $D(SDCLINIC("PRIVILEGED USER")),$G(SDCLINIC("PROHIBIT ACCESS TO CLINIC"))="Y" D VALPRIVUSERS(.SDERRORS,.SDCLINIC,.SDFILEDATA) ; Call Create only Validator
I $D(SDCLINIC("PROVIDER")) D VALPROVIDERS(.SDERRORS,.SDCLINIC,.SDFILEDATA) ; Call Create only Validator
I $G(SDCLINIC("REQUIRE X-RAY"))'="" D VALXRAY^SDES2VAL44(.SDERRORS,SDCLINIC("REQUIRE X-RAY"),.SDFILEDATA)
I $G(SDCLINIC("SCHEDULE ON HOLIDAYS"))'="" D VALSCHEDHOLIDAY^SDES2VAL44(.SDERRORS,SDCLINIC("SCHEDULE ON HOLIDAYS"),.SDFILEDATA)
I $D(SDCLINIC("SPECIAL INSTRUCTIONS")) D VALSPECINSTRUCT(.SDERRORS,.SDCLINIC,.SDFILEDATA) ; Call Create only Validator
I $G(SDCLINIC("TELEPHONE"))'="" D VALPHONE^SDES2VAL44(.SDERRORS,SDCLINIC("TELEPHONE"),.SDFILEDATA)
I $G(SDCLINIC("TELEPHONE EXTENSION"))'="" D VALPHONEEXT^SDES2VAL44(.SDERRORS,SDCLINIC("TELEPHONE EXTENSION"),.SDFILEDATA)
I $G(SDCLINIC("VARIABLE APPOINTMENT LENGTH"))'="" D VALVARAPTLENGTH^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
I $G(SDCLINIC("WORKLOAD VALIDATION"))'="" D VALWORKLOAD^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
I $G(SDCLINIC("VETERAN SELF-CANCEL"))'="" D
.D VALBOOLEAN^SDES2VALUTIL(.VRES,.SDERRORS,44,63,$G(SDCLINIC("VETERAN SELF-CANCEL")),,,,571) I VRES S SDFILEDATA("VETERAN SELF-CANCEL")=$G(VRES(44,63,"I"))
Q
;
; Validation for optional variables unique to Create Clinic
; =========================================================
;
VALDIAG(SDERRORS,SDCLINIC,SDFDATA) ;
N SDDIAGCODE,SDDIAGIEN,SDDEFDIAGCNT,SDNEWDIAGIEN
S SDDEFDIAGCNT=0
S SDDIAGCODE="" F S SDDIAGCODE=$O(SDCLINIC("DIAGNOSIS",SDDIAGCODE)) Q:SDDIAGCODE="" D
.I $G(SDCLINIC("DIAGNOSIS",SDDIAGCODE))="@" D ERRLOG^SDES2JSON(.SDERRORS,459,"DIAGNOSIS: "_SDDIAGCODE)
.S SDDIAGIEN=$$CODEN^ICDEX(SDDIAGCODE,80)
.I +SDDIAGIEN=-1 D ERRLOG^SDES2JSON(.SDERRORS,85,SDDIAGCODE)
.I $D(SDCLINIC("DIAGNOSIS",SDDIAGCODE,"DEFAULT")) S SDDEFDIAGCNT=SDDEFDIAGCNT+1
I SDDEFDIAGCNT>1 D ERRLOG^SDES2JSON(.SDERRORS,490) Q
M SDFDATA("DIAGNOSIS")=SDCLINIC("DIAGNOSIS")
Q
;
VALPRIVUSERS(ERRORS,PRIVUSERS,SDFDATA) ;
N SDPUSER
S SDPUSER=0 F S SDPUSER=$O(PRIVUSERS("PRIVILEGED USER",SDPUSER)) Q:'SDPUSER D
.I PRIVUSERS("PRIVILEGED USER",SDPUSER)="@" D ERRLOG^SDES2JSON(.SDERRORS,459,"Privileged User: "_SDPUSER) Q
.D VALUSERDUZ^SDES2VAL200(.ERRORS,SDPUSER)
M SDFDATA("PRIVILEGED USER")=PRIVUSERS("PRIVILEGED USER")
Q
;
VALPROVIDERS(ERRORS,SDCLINIC,SDFDATA) ;
N SDPROVIEN,SDPROVERRORS,SDDEFCNT
S (SDPROVIEN,SDDEFCNT)=0 F S SDPROVIEN=$O(SDCLINIC("PROVIDER",SDPROVIEN)) Q:'SDPROVIEN D
.I $G(SDCLINIC("PROVIDER",SDPROVIEN))="@" D ERRLOG^SDES2JSON(.SDERRORS,459,"Provider: "_SDPROVIEN) Q
.D VALPROVIDER^SDES2VAL200(.ERRORS,SDPROVIEN)
.I $D(SDCLINIC("PROVIDER",SDPROVIEN,"DEFAULT")) S SDDEFCNT=SDDEFCNT+1
I SDDEFCNT>1 D ERRLOG^SDES2JSON(.ERRORS,488)
M SDFDATA("PROVIDER")=SDCLINIC("PROVIDER")
Q
;
VALSPECINSTRUCT(SDERRORS,SDSPECINST,SDFDATA) ;
; SDSPECINST("SPECIAL INSTRUCTIONS",SDINSTRUCT)=IEN|@
; SDSPECINST("SPECIAL INSTRUCTIONS",SDINSTRUCT)=
N SDINSTRUCT,SDINSDATA,SDINSIEN,SDINSTEXT
S SDINSTRUCT=0 F S SDINSTRUCT=$O(SDSPECINST("SPECIAL INSTRUCTIONS",SDINSTRUCT)) Q:'SDINSTRUCT D
.S SDINSDATA=$G(SDSPECINST("SPECIAL INSTRUCTIONS",SDINSTRUCT))
.S SDINSIEN=$P(SDINSDATA,"|")
.S SDINSTEXT=$P(SDINSDATA,"|",2)
.I SDINSTEXT="" Q
.I SDINSTEXT="@" D ERRLOG^SDES2JSON(.SDERRORS,459,"SPECIAL INSTRUCTIONS")
.I $L(SDINSTEXT)<1!($L(SDINSTEXT)>80) D ERRLOG^SDES2JSON(.SDERRORS,52,"Special instructions must be 1-80 characters in length.")
Q:$D(SDERRORS)
M SDFDATA("SPECIAL INSTRUCTIONS")=SDSPECINST("SPECIAL INSTRUCTIONS")
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDES2VALCRTCLIN1 7475 printed Oct 16, 2024@18:55:21 Page 2
SDES2VALCRTCLIN1 ;ALB/MGD/BLB,BWF - CLINIC VALIDATION UTILITIES DRIVER ;SEPT 25,2023
+1 ;;5.3;Scheduling;**853,857,860,871,885**;Aug 13, 1993;Build 5
+2 ;;Per VHA Directive 6402, this routine should not be modified
+3 ;
+4 ; Reference to $$CODEC^ICDEX is supported by IA #5747
+5 ; Reference to $$CODEN^ICDEX is supported by IA #5747
+6 ;
+7 ; RPC: SDES CREATE CLINIC2
+8 ;
+9 QUIT
+10 ;
VALCLINIC(SDERRORS,SDCLINIC,SDFILEDATA) ; Validate Clinic Input Array
+1 NEW VRES
+2 ; Validate required variables first
+3 DO VALALLOWNOSHOW^SDES2VAL44(.SDERRORS,$GET(SDCLINIC("ALLOWABLE CONSECUTIVE NO-SHOWS")),.SDFILEDATA)
+4 DO VALDIRPATSCHED^SDES2VAL44(.SDERRORS,$GET(SDCLINIC("DIRECT PATIENT SCHEDULING")),.SDFILEDATA)
+5 DO VALPRIMAMIS^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
+6 DO VALNAME^SDES2VAL44(.SDERRORS,$GET(SDCLINIC("NAME")),.SDFILEDATA)
+7 DO VALDISPAPPT^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
+8 DO VALINCPERHOUR^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
+9 DO VALDIV^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
+10 DO VALCHECKIN^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
+11 DO VALAPPTLENGTH^SDES2VAL44(.SDERRORS,$GET(SDCLINIC("LENGTH OF APPOINTMENT")),.SDFILEDATA)
+12 DO VALMAXFUTBOOK^SDES2VAL44(.SDERRORS,$GET(SDCLINIC("MAX DAYS FUTURE BOOKING")),.SDFILEDATA)
+13 DO VALMEETATFACIL^SDES2VAL44(.SDERRORS,$GET(SDCLINIC("MEETS AT FACILITY")),.SDFILEDATA)
+14 DO VALNONCOUNT^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
+15 DO VALOVBDAYMAX^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
+16 DO VALPRECHECKIN^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
+17 DO VALPROFILE^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
+18 DO VALSERVICE^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
+19 ;
+20 ; Quit if any errors in Required input parameters
+21 if $DATA(SDERRORS)
QUIT
+22 ;
+23 ; Validate optional variables second - Values that will be altered by the validation will have SDCLINIC passed by reference
+24 ; =================================
+25 IF $GET(SDCLINIC("ABBREVIATION"))'=""
DO VALABBR^SDES2VAL44(.SDERRORS,SDCLINIC("ABBREVIATION"),.SDFILEDATA)
+26 IF $GET(SDCLINIC("ADMIN INPATIENT MEDS"))'=""
DO VALINPATMED^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
+27 IF $GET(SDCLINIC("APPOINTMENT CANCELLATION LETTER"))'=""
DO VALAPTCANLET^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
+28 IF $GET(SDCLINIC("ASK CHECK IN/OUT"))'=""
DO VALINOUTTIME^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
+29 IF $GET(SDCLINIC("CLINIC CANCELLATION LETTER"))'=""
DO VALCANLET^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
+30 IF $GET(SDCLINIC("CREDIT AMIS"))'=""
DO VALCREDITAMIS^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
+31 IF $GET(SDCLINIC("PRIMARY AMIS"))'=""
IF $GET(SDCLINIC("CREDIT AMIS"))'=""
DO CONDAMISCHECK^SDES2VAL44(.SDERRORS,SDCLINIC("PRIMARY AMIS"),SDCLINIC("CREDIT AMIS"))
+32 IF $GET(SDCLINIC("DEFAULT APPOINTMENT TYPE"))'=""
DO VALAPPTTYPE^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
+33 IF $GET(SDCLINIC("DEFAULT TO PC PRACTITIONER"))'=""
DO VALDEFAULTTOPRAC^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
+34 ; Call Create only Validator
IF $DATA(SDCLINIC("DIAGNOSIS"))
DO VALDIAG(.SDERRORS,.SDCLINIC,.SDFILEDATA)
+35 DO VALSTARTHOUR^SDES2VAL44(.SDERRORS,$GET(SDCLINIC("HOUR CLINIC DISPLAY BEGINS")),.SDFILEDATA)
+36 IF $GET(SDCLINIC("NO-SHOW LETTER"))'=""
DO VALNOSHOWLET^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
+37 IF $GET(SDCLINIC("PATIENT FRIENDLY NAME"))'=""
DO VALPATFNAME^SDES2VAL44(.SDERRORS,SDCLINIC("PATIENT FRIENDLY NAME"),.SDFILEDATA)
+38 IF $GET(SDCLINIC("PBSPID"))'=""
DO VALPBSPID^SDES2VAL44(.SDERRORS,SDCLINIC("PBSPID"),.SDFILEDATA)
+39 IF $GET(SDCLINIC("PHYSICAL LOCATION"))'=""
DO VALLOCATION^SDES2VAL44(.SDERRORS,SDCLINIC("PHYSICAL LOCATION"),.SDFILEDATA)
+40 IF $GET(SDCLINIC("PRE-APPOINTMENT LETTER"))'=""
DO VALPREAPTLET^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
+41 IF $GET(SDCLINIC("PRINCIPAL CLINIC"))'=""
DO VALPRINCLINIC^SDES2VAL44(.SDERRORS,SDCLINIC("PRINCIPAL CLINIC"),.SDFILEDATA)
+42 IF $GET(SDCLINIC("PROHIBIT ACCESS TO CLINIC"))'=""
DO VALNOACCESS^SDES2VAL44(.SDERRORS,SDCLINIC("PROHIBIT ACCESS TO CLINIC"),.SDFILEDATA)
+43 ; Call Create only Validator
IF $DATA(SDCLINIC("PRIVILEGED USER"))
IF $GET(SDCLINIC("PROHIBIT ACCESS TO CLINIC"))="Y"
DO VALPRIVUSERS(.SDERRORS,.SDCLINIC,.SDFILEDATA)
+44 ; Call Create only Validator
IF $DATA(SDCLINIC("PROVIDER"))
DO VALPROVIDERS(.SDERRORS,.SDCLINIC,.SDFILEDATA)
+45 IF $GET(SDCLINIC("REQUIRE X-RAY"))'=""
DO VALXRAY^SDES2VAL44(.SDERRORS,SDCLINIC("REQUIRE X-RAY"),.SDFILEDATA)
+46 IF $GET(SDCLINIC("SCHEDULE ON HOLIDAYS"))'=""
DO VALSCHEDHOLIDAY^SDES2VAL44(.SDERRORS,SDCLINIC("SCHEDULE ON HOLIDAYS"),.SDFILEDATA)
+47 ; Call Create only Validator
IF $DATA(SDCLINIC("SPECIAL INSTRUCTIONS"))
DO VALSPECINSTRUCT(.SDERRORS,.SDCLINIC,.SDFILEDATA)
+48 IF $GET(SDCLINIC("TELEPHONE"))'=""
DO VALPHONE^SDES2VAL44(.SDERRORS,SDCLINIC("TELEPHONE"),.SDFILEDATA)
+49 IF $GET(SDCLINIC("TELEPHONE EXTENSION"))'=""
DO VALPHONEEXT^SDES2VAL44(.SDERRORS,SDCLINIC("TELEPHONE EXTENSION"),.SDFILEDATA)
+50 IF $GET(SDCLINIC("VARIABLE APPOINTMENT LENGTH"))'=""
DO VALVARAPTLENGTH^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
+51 IF $GET(SDCLINIC("WORKLOAD VALIDATION"))'=""
DO VALWORKLOAD^SDES2VAL44(.SDERRORS,.SDCLINIC,.SDFILEDATA)
+52 IF $GET(SDCLINIC("VETERAN SELF-CANCEL"))'=""
Begin DoDot:1
+53 DO VALBOOLEAN^SDES2VALUTIL(.VRES,.SDERRORS,44,63,$GET(SDCLINIC("VETERAN SELF-CANCEL")),,,,571)
IF VRES
SET SDFILEDATA("VETERAN SELF-CANCEL")=$GET(VRES(44,63,"I"))
End DoDot:1
+54 QUIT
+55 ;
+56 ; Validation for optional variables unique to Create Clinic
+57 ; =========================================================
+58 ;
VALDIAG(SDERRORS,SDCLINIC,SDFDATA) ;
+1 NEW SDDIAGCODE,SDDIAGIEN,SDDEFDIAGCNT,SDNEWDIAGIEN
+2 SET SDDEFDIAGCNT=0
+3 SET SDDIAGCODE=""
FOR
SET SDDIAGCODE=$ORDER(SDCLINIC("DIAGNOSIS",SDDIAGCODE))
if SDDIAGCODE=""
QUIT
Begin DoDot:1
+4 IF $GET(SDCLINIC("DIAGNOSIS",SDDIAGCODE))="@"
DO ERRLOG^SDES2JSON(.SDERRORS,459,"DIAGNOSIS: "_SDDIAGCODE)
+5 SET SDDIAGIEN=$$CODEN^ICDEX(SDDIAGCODE,80)
+6 IF +SDDIAGIEN=-1
DO ERRLOG^SDES2JSON(.SDERRORS,85,SDDIAGCODE)
+7 IF $DATA(SDCLINIC("DIAGNOSIS",SDDIAGCODE,"DEFAULT"))
SET SDDEFDIAGCNT=SDDEFDIAGCNT+1
End DoDot:1
+8 IF SDDEFDIAGCNT>1
DO ERRLOG^SDES2JSON(.SDERRORS,490)
QUIT
+9 MERGE SDFDATA("DIAGNOSIS")=SDCLINIC("DIAGNOSIS")
+10 QUIT
+11 ;
VALPRIVUSERS(ERRORS,PRIVUSERS,SDFDATA) ;
+1 NEW SDPUSER
+2 SET SDPUSER=0
FOR
SET SDPUSER=$ORDER(PRIVUSERS("PRIVILEGED USER",SDPUSER))
if 'SDPUSER
QUIT
Begin DoDot:1
+3 IF PRIVUSERS("PRIVILEGED USER",SDPUSER)="@"
DO ERRLOG^SDES2JSON(.SDERRORS,459,"Privileged User: "_SDPUSER)
QUIT
+4 DO VALUSERDUZ^SDES2VAL200(.ERRORS,SDPUSER)
End DoDot:1
+5 MERGE SDFDATA("PRIVILEGED USER")=PRIVUSERS("PRIVILEGED USER")
+6 QUIT
+7 ;
VALPROVIDERS(ERRORS,SDCLINIC,SDFDATA) ;
+1 NEW SDPROVIEN,SDPROVERRORS,SDDEFCNT
+2 SET (SDPROVIEN,SDDEFCNT)=0
FOR
SET SDPROVIEN=$ORDER(SDCLINIC("PROVIDER",SDPROVIEN))
if 'SDPROVIEN
QUIT
Begin DoDot:1
+3 IF $GET(SDCLINIC("PROVIDER",SDPROVIEN))="@"
DO ERRLOG^SDES2JSON(.SDERRORS,459,"Provider: "_SDPROVIEN)
QUIT
+4 DO VALPROVIDER^SDES2VAL200(.ERRORS,SDPROVIEN)
+5 IF $DATA(SDCLINIC("PROVIDER",SDPROVIEN,"DEFAULT"))
SET SDDEFCNT=SDDEFCNT+1
End DoDot:1
+6 IF SDDEFCNT>1
DO ERRLOG^SDES2JSON(.ERRORS,488)
+7 MERGE SDFDATA("PROVIDER")=SDCLINIC("PROVIDER")
+8 QUIT
+9 ;
VALSPECINSTRUCT(SDERRORS,SDSPECINST,SDFDATA) ;
+1 ; SDSPECINST("SPECIAL INSTRUCTIONS",SDINSTRUCT)=IEN|@
+2 ; SDSPECINST("SPECIAL INSTRUCTIONS",SDINSTRUCT)=
+3 NEW SDINSTRUCT,SDINSDATA,SDINSIEN,SDINSTEXT
+4 SET SDINSTRUCT=0
FOR
SET SDINSTRUCT=$ORDER(SDSPECINST("SPECIAL INSTRUCTIONS",SDINSTRUCT))
if 'SDINSTRUCT
QUIT
Begin DoDot:1
+5 SET SDINSDATA=$GET(SDSPECINST("SPECIAL INSTRUCTIONS",SDINSTRUCT))
+6 SET SDINSIEN=$PIECE(SDINSDATA,"|")
+7 SET SDINSTEXT=$PIECE(SDINSDATA,"|",2)
+8 IF SDINSTEXT=""
QUIT
+9 IF SDINSTEXT="@"
DO ERRLOG^SDES2JSON(.SDERRORS,459,"SPECIAL INSTRUCTIONS")
+10 IF $LENGTH(SDINSTEXT)<1!($LENGTH(SDINSTEXT)>80)
DO ERRLOG^SDES2JSON(.SDERRORS,52,"Special instructions must be 1-80 characters in length.")
End DoDot:1
+11 if $DATA(SDERRORS)
QUIT
+12 MERGE SDFDATA("SPECIAL INSTRUCTIONS")=SDSPECINST("SPECIAL INSTRUCTIONS")
+13 QUIT