VENPCCMI ; IHS/OIT/GIS - INSTALLATION UTILITIES FOR ENCOUNTER FORMS AND PRINTER GROUPS ;
;;2.6;PCC+;;NOV 12, 2007
;
;
;
PG ; EP-PRINTER GROUP ENTRY ; EP FROM OPTION FILE
N CFLG
D ^XBCLS,PGL
W !!,"Enter the name of a new Print Group in the format LOCATION_DEPARTMENT",!,"Examples: GIMC_PEDIATRICS, CROW_DENTAL, etc.",!
N DIC,DIE,DA,DR,D,D0,DIG,DIH,X,Y,%,DUOUT,DTOUT
S (DIC,DIE)="^VEN(7.4,",DLAYGO=19707.4,DIC(0)="AEQL",DIC("A")="Print group: "
D ^DIC I Y=-1 Q
S DA=+Y,DR=".02T//NO;1"
L +^VEN(7.4,DA):0 I $T D ^DIE L -^VEN(7.4,DA)
D PG^VENPCCMC(.CFLG) ; CHECK ALL PRINT GROUPS
Q
;
PGL ; EP-PRINTER GROUP LISTER ; EP FROM OPTION FILE
N DIC,X,Y,%,BY,FR,TO,DHD,L,IOP
S DIC="^VEN(7.4,",L=0,BY=.01,FR="",TO="",FLDS="[VEN MASTER PRINTER LIST]",DHD="PCC+ PRINT GROUPS",IOP="HOME"
D EN1^DIP
Q
;
EFL ; EP-ENCOUNTER FORM LIST ; EP FROM OPTION FILE
N DIC,X,Y,%,BY,FR,TO,DHD,L,IOP
S DIC="^VEN(7.41,",L=0,BY=.01,FR="",TO="",FLDS="[VEN EF TEMPLATES LIST]",DHD="PCC+ ENCOUNTER FORMS",IOP="HOME"
D EN1^DIP
Q
;
EF ; EP-ENTER AN ENCOUNTER FORM ; EP FROM OPTION FILE
D ^XBCLS,EFL
N DIC,DIE,DA,DR,D,D0,DIG,DIH,X,Y,%,DUOUT,DTOUT,DIR,%Y,X,Y,%,NAME,HMN,TMN,DIK,C,DI,DQ,DTO,J,TIEN
NAME W !!,"Enter the name of a Print Group in the format: Location Department",!,"Examples: GIMC PEDIATRICS, CROW WALK-IN",!
N1 S (DIC,DIE)="^VEN(7.41,",DLAYGO=19707.41,DIC(0)="AEQL",DIC("A")="Encounter form: "
D ^DIC I Y=-1 Q
I $P(Y,U,3),$P(Y,U,2)'[" " W *7,!,"Name not in the recommended format. ENTRY DELETED. Try again..." W ! S DIK=DIC,DA=+Y D ^DIK K DA,DIK G N1
S NAME=$P(Y,U,2),DA=+Y,DIE=DIC,TIEN=DA
S X=$G(^VEN(7.41,DA,0)),HMN=$P(X,U,2),TMN=$P(X,U,3)
HMN I HMN="ef" G TMN
I HMN="" D G TMN
. S DR=".02////ef"
. L +^VEN(7.41,DA):0 I $T D ^DIE L -^VEN(7.41,DA)
. Q
W !,"The current header mnemonic is '",HMN,"'. Want to change it to 'EF'"
S %=1 D YN^DICN I %=-1 Q
I %=1 S DR=".02////ef" L +^VEN(7.41,DA):0 I $T D ^DIE L -^VEN(7.41,DA)
TMN ; TEMPLATE MNEMONIC
I $L(TMN) S DIR("B")=TMN
S DIR(0)="F^1:10",DIR("A")="Template menmonic",DIR("?")="Must be a unique mnemonic, 1-10 lowercase characters" KILL DA D ^DIR KILL DIR
I $D(DTOUT)!(Y?1."^") K DIRUT,DTOUT,%Y Q
I Y'?1.10L W !,"Must be 1-10 lowercase characters! Try again...",! G TMN
S X=0
F S X=$O(^VEN(7.41,X)) Q:'X I X'=TIEN,$P($G(^VEN(7.41,X,0)),U,3)=Y W !,"This mnemonic has already been used in template: ",$P($G(^VEN(7.41,X,0)),U),!,"Try entering another one...",! G TMN
S TMN=Y,DA=TIEN,DR=".03////^S X=TMN" L +^VEN(7.41,DA):0 I $T D ^DIE L -^VEN(7.41,DA)
BAR ; FIELD .04: BARCODE CHARACTER NO LONGER REQUIRED IN 2.2
S DR=".05:3" L +^VEN(7.41,DA):0 I $T D ^DIE L -^VEN(7.41,DA)
D EF^VENPCCMC ; CHECK ALL ENCOUNTER FORMS
NOTES W !!!,"If any corrections have been suggested, please make them now."
W !!,"You are now ready to place a new encounter form template on the Print Server."
W !?5,"1) The name of the template should be "_TMN_"_template.doc"
W !?5,"3) Make sure that the template is in the proper state. The document should be UNMERGED with the fields names showing."
W !?5,"2) Place the template in c:\program files\ilc\ilc forms print service\templates\"
Q
;
CLL ; EP-LIST CLINICS
N DIC,X,Y,%,BY,FR,TO,DHD,L,IOP
S DIC="^VEN(7.95,",L=0,BY=.01,FR="",TO="",FLDS="[VEN CLINICS]",DHD="PCC+ CLINICS",IOP="HOME"
D EN1^DIP
Q
;
CL ; EP-ENTER A CLINIC
D ^XBCLS,CLL
W !!,"Enter the name of a new Clinic in the format LOCATION - CLINIC",!,"Examples: GIMC - PEDIATRICS, CROW - DENTAL, etc.",!
N DIC,DIE,DA,DR,D,D0,DIG,DIH,X,Y,%,DUOUT,DTOUT,DIR
CL1 S DIC="^VEN(7.95,",DLAYGO=19707.95,DIC(0)="AEQL",DIC("A")="Clinic: " D ^DIC
I Y=-1 Q
I $P(Y,U,3),$P(Y,U,2)'?1.AN1" - "1.AN W !,"Format error. Entry cancelled",!?5,"Should be in the format 'LOCATION - CLINIC' e.g., 'GIMC - DENTAL'" S DA=+Y,DIK=DIC D ^DIK G CL1
S DIE=DIC,DA=+Y,DR=".04Clinic Stop;2.01;2.02;2.05;2.06;2.07STATUS//ACTIVE DESTINATION;2.04//"_$P($G(^DIC(4,+$G(DUZ(2)),0)),U)_";2.03IS THE TRIAGE MODULE USED IN THIS CLINIC//NO"
L +^VEN(7.95,DA):0 I $T D ^DIE L -^VEN(7.95,DA)
D CL^VENPCCMC
Q
;
CFG ; EP-EDIT THE CONFIG FILE
D ^XBCLS
W !?10,"***** EDIT PARAMETERS FOR THE DEFAULT PCC+ CONFIGURATION *****",!!!
N DIC,DIE,DA,DR,D,D0,DIG,DIH,X,Y,%,DUOUT,DTOUT,DIR,CFG
S DA=$$CFG^VENPCCU I 'DA Q
S DIE="^VEN(7.5,",DR=".06UNIQUE CLINIC ('NULL' UNLESS ONLY 1 CLINIC USES PCC+)"
S X=0 F %=0:1 S X=$O(^VEN(7.95,X)) Q:'X Q:%>1
I %=1 S %=$O(^VEN(7.95,0)),X=$P($G(^VEN(7.95,%,0)),U) I $L(X) S DR=DR_"//"_X
S DR=DR_";.08EDIT DEMOGRAPHICS DURING CHECK-IN;.09ASK TO PRINT OUTGUIDE AND PULL CHART;.1ALWAYS PRINT HEALTH SUMMARY IN MED REC DEPT"
I $O(^PSDRUG(0)) S DR=DR_";.16DISPLAY CHRONIC MEDS ONLY"
S DR=DR_";11.1;11.2"
L +^VEN(7.5,DA):0 I $T D ^DIE L -^VEN(7.5,DA)
Q
;
VENPCCMI ; IHS/OIT/GIS - INSTALLATION UTILITIES FOR ENCOUNTER FORMS AND PRINTER GROUPS ;
+1 ;;2.6;PCC+;;NOV 12, 2007
+2 ;
+3 ;
+4 ;
PG ; EP-PRINTER GROUP ENTRY ; EP FROM OPTION FILE
+1 NEW CFLG
+2 DO ^XBCLS
DO PGL
+3 WRITE !!,"Enter the name of a new Print Group in the format LOCATION_DEPARTMENT",!,"Examples: GIMC_PEDIATRICS, CROW_DENTAL, etc.",!
+4 NEW DIC,DIE,DA,DR,D,D0,DIG,DIH,X,Y,%,DUOUT,DTOUT
+5 SET (DIC,DIE)="^VEN(7.4,"
SET DLAYGO=19707.4
SET DIC(0)="AEQL"
SET DIC("A")="Print group: "
+6 DO ^DIC
IF Y=-1
QUIT
+7 SET DA=+Y
SET DR=".02T//NO;1"
+8 LOCK +^VEN(7.4,DA):0
IF $TEST
DO ^DIE
LOCK -^VEN(7.4,DA)
+9 ; CHECK ALL PRINT GROUPS
DO PG^VENPCCMC(.CFLG)
+10 QUIT
+11 ;
PGL ; EP-PRINTER GROUP LISTER ; EP FROM OPTION FILE
+1 NEW DIC,X,Y,%,BY,FR,TO,DHD,L,IOP
+2 SET DIC="^VEN(7.4,"
SET L=0
SET BY=.01
SET FR=""
SET TO=""
SET FLDS="[VEN MASTER PRINTER LIST]"
SET DHD="PCC+ PRINT GROUPS"
SET IOP="HOME"
+3 DO EN1^DIP
+4 QUIT
+5 ;
EFL ; EP-ENCOUNTER FORM LIST ; EP FROM OPTION FILE
+1 NEW DIC,X,Y,%,BY,FR,TO,DHD,L,IOP
+2 SET DIC="^VEN(7.41,"
SET L=0
SET BY=.01
SET FR=""
SET TO=""
SET FLDS="[VEN EF TEMPLATES LIST]"
SET DHD="PCC+ ENCOUNTER FORMS"
SET IOP="HOME"
+3 DO EN1^DIP
+4 QUIT
+5 ;
EF ; EP-ENTER AN ENCOUNTER FORM ; EP FROM OPTION FILE
+1 DO ^XBCLS
DO EFL
+2 NEW DIC,DIE,DA,DR,D,D0,DIG,DIH,X,Y,%,DUOUT,DTOUT,DIR,%Y,X,Y,%,NAME,HMN,TMN,DIK,C,DI,DQ,DTO,J,TIEN
NAME WRITE !!,"Enter the name of a Print Group in the format: Location Department",!,"Examples: GIMC PEDIATRICS, CROW WALK-IN",!
N1 SET (DIC,DIE)="^VEN(7.41,"
SET DLAYGO=19707.41
SET DIC(0)="AEQL"
SET DIC("A")="Encounter form: "
+1 DO ^DIC
IF Y=-1
QUIT
+2 IF $PIECE(Y,U,3)
IF $PIECE(Y,U,2)'[" "
WRITE *7,!,"Name not in the recommended format. ENTRY DELETED. Try again..."
WRITE !
SET DIK=DIC
SET DA=+Y
DO ^DIK
KILL DA,DIK
GOTO N1
+3 SET NAME=$PIECE(Y,U,2)
SET DA=+Y
SET DIE=DIC
SET TIEN=DA
+4 SET X=$GET(^VEN(7.41,DA,0))
SET HMN=$PIECE(X,U,2)
SET TMN=$PIECE(X,U,3)
HMN IF HMN="ef"
GOTO TMN
+1 IF HMN=""
Begin DoDot:1
+2 SET DR=".02////ef"
+3 LOCK +^VEN(7.41,DA):0
IF $TEST
DO ^DIE
LOCK -^VEN(7.41,DA)
+4 QUIT
End DoDot:1
GOTO TMN
+5 WRITE !,"The current header mnemonic is '",HMN,"'. Want to change it to 'EF'"
+6 SET %=1
DO YN^DICN
IF %=-1
QUIT
+7 IF %=1
SET DR=".02////ef"
LOCK +^VEN(7.41,DA):0
IF $TEST
DO ^DIE
LOCK -^VEN(7.41,DA)
TMN ; TEMPLATE MNEMONIC
+1 IF $LENGTH(TMN)
SET DIR("B")=TMN
+2 SET DIR(0)="F^1:10"
SET DIR("A")="Template menmonic"
SET DIR("?")="Must be a unique mnemonic, 1-10 lowercase characters"
KILL DA
DO ^DIR
KILL DIR
+3 IF $DATA(DTOUT)!(Y?1."^")
KILL DIRUT,DTOUT,%Y
QUIT
+4 IF Y'?1.10L
WRITE !,"Must be 1-10 lowercase characters! Try again...",!
GOTO TMN
+5 SET X=0
+6 FOR
SET X=$ORDER(^VEN(7.41,X))
IF 'X
QUIT
IF X'=TIEN
IF $PIECE($GET(^VEN(7.41,X,0)),U,3)=Y
WRITE !,"This mnemonic has already been used in template: ",$PIECE($GET(^VEN(7.41,X,0)),U),!,"Try entering another one...",!
GOTO TMN
+7 SET TMN=Y
SET DA=TIEN
SET DR=".03////^S X=TMN"
LOCK +^VEN(7.41,DA):0
IF $TEST
DO ^DIE
LOCK -^VEN(7.41,DA)
BAR ; FIELD .04: BARCODE CHARACTER NO LONGER REQUIRED IN 2.2
+1 SET DR=".05:3"
LOCK +^VEN(7.41,DA):0
IF $TEST
DO ^DIE
LOCK -^VEN(7.41,DA)
+2 ; CHECK ALL ENCOUNTER FORMS
DO EF^VENPCCMC
NOTES WRITE !!!,"If any corrections have been suggested, please make them now."
+1 WRITE !!,"You are now ready to place a new encounter form template on the Print Server."
+2 WRITE !?5,"1) The name of the template should be "_TMN_"_template.doc"
+3 WRITE !?5,"3) Make sure that the template is in the proper state. The document should be UNMERGED with the fields names showing."
+4 WRITE !?5,"2) Place the template in c:\program files\ilc\ilc forms print service\templates\"
+5 QUIT
+6 ;
CLL ; EP-LIST CLINICS
+1 NEW DIC,X,Y,%,BY,FR,TO,DHD,L,IOP
+2 SET DIC="^VEN(7.95,"
SET L=0
SET BY=.01
SET FR=""
SET TO=""
SET FLDS="[VEN CLINICS]"
SET DHD="PCC+ CLINICS"
SET IOP="HOME"
+3 DO EN1^DIP
+4 QUIT
+5 ;
CL ; EP-ENTER A CLINIC
+1 DO ^XBCLS
DO CLL
+2 WRITE !!,"Enter the name of a new Clinic in the format LOCATION - CLINIC",!,"Examples: GIMC - PEDIATRICS, CROW - DENTAL, etc.",!
+3 NEW DIC,DIE,DA,DR,D,D0,DIG,DIH,X,Y,%,DUOUT,DTOUT,DIR
CL1 SET DIC="^VEN(7.95,"
SET DLAYGO=19707.95
SET DIC(0)="AEQL"
SET DIC("A")="Clinic: "
DO ^DIC
+1 IF Y=-1
QUIT
+2 IF $PIECE(Y,U,3)
IF $PIECE(Y,U,2)'?1.AN1" - "1.AN
WRITE !,"Format error. Entry cancelled",!?5,"Should be in the format 'LOCATION - CLINIC' e.g., 'GIMC - DENTAL'"
SET DA=+Y
SET DIK=DIC
DO ^DIK
GOTO CL1
+3 SET DIE=DIC
SET DA=+Y
SET DR=".04Clinic Stop;2.01;2.02;2.05;2.06;2.07STATUS//ACTIVE DESTINATION;2.04//"_$PIECE($GET(^DIC(4,+$GET(DUZ(2)),0)),U)_";2.03IS THE TRIAGE MODULE USED IN THIS CLINIC//NO"
+4 LOCK +^VEN(7.95,DA):0
IF $TEST
DO ^DIE
LOCK -^VEN(7.95,DA)
+5 DO CL^VENPCCMC
+6 QUIT
+7 ;
CFG ; EP-EDIT THE CONFIG FILE
+1 DO ^XBCLS
+2 WRITE !?10,"***** EDIT PARAMETERS FOR THE DEFAULT PCC+ CONFIGURATION *****",!!!
+3 NEW DIC,DIE,DA,DR,D,D0,DIG,DIH,X,Y,%,DUOUT,DTOUT,DIR,CFG
+4 SET DA=$$CFG^VENPCCU
IF 'DA
QUIT
+5 SET DIE="^VEN(7.5,"
SET DR=".06UNIQUE CLINIC ('NULL' UNLESS ONLY 1 CLINIC USES PCC+)"
+6 SET X=0
FOR %=0:1
SET X=$ORDER(^VEN(7.95,X))
IF 'X
QUIT
IF %>1
QUIT
+7 IF %=1
SET %=$ORDER(^VEN(7.95,0))
SET X=$PIECE($GET(^VEN(7.95,%,0)),U)
IF $LENGTH(X)
SET DR=DR_"//"_X
+8 SET DR=DR_";.08EDIT DEMOGRAPHICS DURING CHECK-IN;.09ASK TO PRINT OUTGUIDE AND PULL CHART;.1ALWAYS PRINT HEALTH SUMMARY IN MED REC DEPT"
+9 IF $ORDER(^PSDRUG(0))
SET DR=DR_";.16DISPLAY CHRONIC MEDS ONLY"
+10 SET DR=DR_";11.1;11.2"
+11 LOCK +^VEN(7.5,DA):0
IF $TEST
DO ^DIE
LOCK -^VEN(7.5,DA)
+12 QUIT
+13 ;