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

SDECI2.m

Go to the documentation of this file.
SDECI2 ;ALB/SAT - VISTA SCHEDULING RELEASE 2 PRE/POST INSTALL ;APR 08, 2016
 ;;5.3;Scheduling;**642**;Aug 13, 1993;Build 23
 ;
 Q
 ;
PRE ;
 I $P($G(^DD(409.852,.02,0)),U,1)'="MULT APPTS MADE" D
 .S ^XTMP("SD*5.3*642",0)=$$FMADD^XLFDT(DT,2)_U_$$DT^XLFDT
 .S ^XTMP("SD*5.3*642","MULT")=1
 Q
 ;
POST ;
 D RPC
 D RESAV
 D INDEX
 D BSE
 K ^XTMP("SD*5.3*642")
 N Y
 S Y=$$NOW^XLFDT,Y=$$FMTE^XLFDT(Y)
 W !!,"Post-Installation completed."
 W !,Y
 Q
 ;
RESAV ;add CANCELED to SDEC ACCESS TYPE file
 N Y
 S Y=$$NOW^XLFDT,Y=$$FMTE^XLFDT(Y)
 W !!,"Updating SDEC ACCESS TYPE file 409.823 with entry for ""CANCELED"" ..."
 W !,Y
 I '$O(^SDEC(409.823,"B","CANCELED",0)) D AVAILADD("CANCELED")
 Q
AVAILADD(SDTXT) ;add to SDEC ACCESS TYPE file
 N SDAV,SDFDA
 S SDAV=$O(^SDEC(409.823,"B",SDTXT,0))
 Q:+SDAV
 S SDFDA(409.823,"+1,",.01)=SDTXT
 S SDFDA(409.823,"+1,",.04)=$S(SDTXT="AVAILABLE":"YELLOW",SDTXT="CANCELED":"GRAY",1:"LT. GRAY")
 S SDFDA(409.823,"+1,",.05)=$S(SDTXT="AVAILABLE":247,SDTXT="CANCELED":190,1:230)
 S SDFDA(409.823,"+1,",.06)=$S(SDTXT="AVAILABLE":254,SDTXT="CANCELED":190,1:230)
 S SDFDA(409.823,"+1,",.07)=$S(SDTXT="AVAILABLE":46,SDTXT="CANCELED":190,1:230)
 S SDFDA(409.823,"+1,",.08)=0  ;$S(SDTXT="AVAILABLE":0,1:1)
 D UPDATE^DIE("","SDFDA")
 Q
 ;
INDEX  ;update indexes
 D AF4093     ;AF in SD WAIT LIST
 D AC409831   ;AC in SDEC RESOURCE
 D AC40984    ;AC in SDEC APPOINTMENT
 D AD40984    ;AD in SDEC APPOINTMENT
 D AD40985    ;AD in SDEC APPT REQUEST
 Q
AF4093  ;create and build NEW style AF for SD WAIT LIST file #409.3
 N SDXR,SDRES,SDOUT
 S SDXR("FILE")=409.3
 S SDXR("NAME")="AF"
 S SDXR("SHORT DESCR")="Sort by DATE ENTERED and ENTERED BY USER of PATIENT CONTACTS"
 S SDXR("TYPE")="R"
 S SDXR("EXECUTION")="R"
 S SDXR("ACTIVITY")="IR"
 S SDXR("ROOT TYPE")="W"
 S SDXR("ROOT FILE")=409.344
 S SDXR("USE")="S"
 S SDXR("DESCR",1)="This cross reference sorts the whole SD WAIT LIST file by the"
 S SDXR("DESCR",2)="DATE ENTERED and ENTERED BY USER of the PATIENT CONTACTS multiple"
 S SDXR("DESCR",3)="field #44."
 S SDXR("VAL",1)=.01
 S SDXR("VAL",1,"SUBSCRIPT")=1
 S SDXR("VAL",1,"LENGTH")=""
 S SDXR("VAL",1,"COLLATION")="F"
 S SDXR("VAL",1,"TYPE")="F"
 S SDXR("VAL",2)=2
 S SDXR("VAL",2,"SUBSCRIPT")=2
 S SDXR("VAL",2,"LENGTH")=""
 S SDXR("VAL",2,"COLLATION")="F"
 S SDXR("VAL",2,"TYPE")="F"
 D CREIXN^DDMOD(.SDXR,"S",.SDRES,"SDOUT")
 Q
AD40985  ;create and build NEW style AD for SDEC APPT REQUEST file #409.85
 N SDXR,SDRES,SDOUT
 S SDXR("FILE")=409.85
 S SDXR("NAME")="AD"
 S SDXR("SHORT DESCR")="Sort by DATE ENTERED and ENTERED BY USER of PATIENT CONTACTS"
 S SDXR("TYPE")="R"
 S SDXR("EXECUTION")="R"
 S SDXR("ACTIVITY")="IR"
 S SDXR("ROOT TYPE")="W"
 S SDXR("ROOT FILE")=409.8544
 S SDXR("USE")="S"
 S SDXR("DESCR",1)="This cross reference sorts the whole SDEC APPT REQUEST file by the"
 S SDXR("DESCR",2)="DATE ENTERED and ENTERED BY USER of the PATIENT CONTACTS multiple"
 S SDXR("DESCR",3)="field #44."
 S SDXR("VAL",1)=.01
 S SDXR("VAL",1,"SUBSCRIPT")=1
 S SDXR("VAL",1,"LENGTH")=""
 S SDXR("VAL",1,"COLLATION")="F"
 S SDXR("VAL",1,"TYPE")="F"
 S SDXR("VAL",2)=2
 S SDXR("VAL",2,"SUBSCRIPT")=2
 S SDXR("VAL",2,"LENGTH")=""
 S SDXR("VAL",2,"COLLATION")="F"
 S SDXR("VAL",2,"TYPE")="F"
 D CREIXN^DDMOD(.SDXR,"S",.SDRES,"SDOUT")
 Q
AC40984 ;rebuild AC for SDEC APPOINTMENT
 N DA,DIK
 S DIK="^SDEC(409.84,"
 S DIK(1)=.09
 D ENALL^DIK
 Q
AD40984 ;rebuild AD for SDEC APPOINTMENT
 N DA,DIK
 S DIK="^SDEC(409.84,"
 S DIK(1)=.12
 D ENALL^DIK
 Q
AC409831 ;change NEW style AC or all SDEC RESOURCE entries in file 44
 N SDXR,SDRES,SDOUT
 S SDXR("FILE")=409.831
 S SDXR("NAME")="AC"
 S SDXR("TYPE")="R"
 S SDXR("USE")="S"
 S SDXR("EXECUTION")="F"
 S SDXR("ACTIVITY")="IR"
 S SDXR("SHORT DESCR")="Index of RESOURCE TYPE"
 S SDXR("DESCR",1)="This cross-reference is built from both pieces of the"
 S SDXR("DESCR",2)="RESOURCE TYPE variable pointer field to speed up the"
 S SDXR("DESCR",3)="sorting of resources when given a specific source and ID."
 S SDXR("DESCR",4)="The sources could be HOSPITAL LOCATION, NEW PERSON, or SDEC"
 S SDXR("DESCR",5)="ADDITIONAL RESOURCE."
 ;S SDXR("SET")="D RTS^SDEC03(DA,X) Q"   ;only for MUMPS type
 ;S SDXR("KILL")="D RTK^SDEC03(DA,X) Q"  ;only for MUMPS type
 ;S SDXR("WHOLE KILL")="K ^SDEC(409.831,""AC"")"   ;only for MUMPS type
 S SDXR("VAL",1)=.012
 S SDXR("VAL",1,"SUBSCRIPT")=1
 S SDXR("VAL",1,"LENGTH")=""
 S SDXR("VAL",1,"COLLATION")="F"
 S SDXR("VAL",1,"TYPE")="F"
 S SDXR("VAL",1,"XFORM FOR STORAGE")="S X=$E($$OT1^SDEC03(X),1)"
 S SDXR("VAL",2)=.012
 S SDXR("VAL",2,"SUBSCRIPT")=2
 S SDXR("VAL",2,"LENGTH")=""
 S SDXR("VAL",2,"COLLATION")="F"
 S SDXR("VAL",2,"TYPE")="F"
 S SDXR("VAL",2,"XFORM FOR STORAGE")="S X=$P(X,"";"",1)"
 D CREIXN^DDMOD(.SDXR,"S",.SDRES,"SDOUT")
 Q
 ;
RPC ;register SDEC rpcs
 N Y
 S Y=$$NOW^XLFDT,Y=$$FMTE^XLFDT(Y)
 W !!,"Registering new RPCs..."
 W !,Y
 D REGNMSP^SDECRPC("SDEC APPSLOTS","SDECRPC")
 D REGNMSP^SDECRPC("SDEC NOAVAIL","SDECRPC")
 D REGNMSP^SDECRPC("SDECAPP GETYPE","SDECRPC")
 D REGNMSP^SDECRPC("SDECAR ARMULT","SDECRPC")
 D REGNMSP^SDECRPC("SDECAR AUDITGET","SDECRPC")
 D REGNMSP^SDECRPC("SDECCAP CAN","SDECRPC")
 D REGNMSP^SDECRPC("SDECCAP GET","SDECRPC")
 D REGNMSP^SDECRPC("SDECCAP SET","SDECRPC")
 D REGNMSP^SDECRPC("SDECWL AUDITGET","SDECRPC")
 D REGNMSP^SDECRPC("ROR LIST STATES","SDECRPC")
 D REGNMSP^SDECRPC("SDEC NETLOC","SDECRPC")
 D REGNMSP^SDECRPC("SDECXUS ENCRYP","SDECRPC")
 D REGNMSP^SDECRPC("XUS SIGNON SETUP","SDECRPC")
 D REGNMSP^SDECRPC("XUS GET VISITOR","SDECRPC")
 D REGNMSP^SDECRPC("XUS SET VISITOR","SDECRPC")
 D REGNMSP^SDECRPC("XUS AV CODE","SDECRPC")
 Q
 ;
MULT ;update child requests in SDEC APPT REQUEST file 409.85
 N Y
 S Y=$$NOW^XLFDT,Y=$$FMTE^XLFDT(Y)
 W !!,"updating child requests in SDEC APPT REQUEST..."
 W !,Y
 Q:$D(^XTMP("SD*5.3*642","MULT"))
 N Y
 S Y=$$NOW^XLFDT,Y=$$FMTE^XLFDT(Y)
 W !!,"Updating SDEC APPT REQUEST file 409.85 with child requests..."
 W !,Y
 N SDI,SDJ,SDLIST,SDMULT,SDRET,SD1,SD2
 S (SDLIST,SDRET)=""
 S SDI=0 F  S SDI=$O(^SDEC(409.85,SDI)) Q:SDI'>0  D
 .S SDLIST=""
 .S SDJ=0 F  S SDJ=$O(^SDEC(409.85,SDI,2,SDJ)) Q:SDJ'>0  D
 ..S SDMULT=$G(^SDEC(409.85,SDI,2,SDJ,0))
 ..Q:SDMULT=""
 ..S SD1=$P(SDMULT,U,1)
 ..S SD2=$P($$GET1^DIQ(409.84,+SDMULT_",",.22,"I"),";",1)
 ..S SDLIST=$S(SDLIST'="":SDLIST_"|",1:"")_SD1_"^"_SD2
 .D:SDLIST'="" ARMULT^SDECAR(.SDRET,SDI,SDLIST)
 Q
 ;
BSE ;add/update entry in 8994.5 for VS SCHEDULING CALL CENTER
 N Y
 S Y=$$NOW^XLFDT,Y=$$FMTE^XLFDT(Y)
 W !!,"adding entry to 8994.5 for VS SCHEDULING CALL CENTER..."
 W !,Y
 N RESULT,APCODE,APNAME,APIP,APPORT,APPATH,APCONTEXT
 S APCODE="q2pt~%x|D5dPOhQMAN"        ;APPLICATIONCODE
 S APNAME="VS SCHEDULING CALL CENTER" ;NAME
 S APIP="XXX"                         ;CALLBACKSERVER
 S APPORT="-1"                        ;CALLBACKPORT
 S APPATH=""                          ;URLSTRING
 S APCONTEXT="SDECRPC"                ;CONTEXTOPTION (OPTION file NAME)
 D BSESETUP(APCODE,APNAME,APIP,APPORT,APPATH,APCONTEXT)
 Q
 ;
BSESETUP(APCODE,APNAME,APIP,APPORT,APPATH,APCONTEXT) ;
 N SDIEN
 D DELBSE(APNAME,APCODE)
 D SAVEBSE(APCODE,APNAME,APIP,APPORT,APPATH,APCONTEXT)
 Q
 ;
DELBSE(NAME,APCODE) ;remove existing entries with the same name
 N ERR,LIST
 D FIND^DIC(8994.5,"","@","X",NAME,"*","B","","","LIST","ERR")
 N I,FDA S I=0
 F  S I=$O(LIST("DILIST",2,I)) Q:'I  D
 .K FDA S FDA(8994.5,LIST("DILIST",2,I)_",",.01)="@"
 .D FILE^DIE("","FDA","ERR")
 D FIND^DIC(8994.5,"","@","X",APCODE,"*","ACODE","","","LIST","ERR")
 N I,FDA S I=0
 F  S I=$O(LIST("DILIST",2,I)) Q:'I  D
 .K FDA S FDA(8994.5,LIST("DILIST",2,I)_",",.01)="@"
 .D FILE^DIE("","FDA","ERR")
 Q
 ;
SAVEBSE(APCODE,APNAME,APIP,APPORT,APPATH,APCONTEXT) ;
 N FDA,ERR,INDEX
 S FDA(8994.5,"+1,",.01)=APNAME
 S INDEX=$$CPRSOPT(APCONTEXT)
 I +$G(INDEX)'>0 D  Q 0
 .W "COULD NOT FIND CPRS OPTION:"_INDEX,!
 S FDA(8994.5,"+1,",.02)=INDEX
 S FDA(8994.5,"+1,",.03)=APCODE
 S FDA(8994.51,"+2,+1,",.01)="S"
 S FDA(8994.51,"+2,+1,",.02)=APPORT
 S FDA(8994.51,"+2,+1,",.03)=APIP
 S FDA(8994.51,"+2,+1,",.04)=APPATH
 D UPDATE^DIE("","FDA","","ERR")
 Q
 ;
CPRSOPT(ACONTEXT) ;Finds the IEN of the option for a context
 ;W "LOOKING FOR '"_ACONTEXT_"':"
 N INDEX,ERR S INDEX=$$FIND1^DIC(19,"","X",ACONTEXT,"B","","ERR")
 Q INDEX