- AQAOPOS2 ; IHS/ORDC/LJF - POST INIT CONTINUED ;
- ;;1.01;QAI MANAGEMENT;;OCT 05, 1995
- ;
- ;This is a continuation of the QAI postinits. This rtn installs your
- ;primary facility into the QI Parameter file and sets up at least one
- ;user as the package administrator.
- ;
- MAIN D 3,4,5,6,7 Q ;do steps 3, 4, 5, 6, 7 and return to AQAOPOST
- ;
- 3 ; step 3 - create primary facility entry in parameter file
- W !!,"STEP 3 - SET UP YOUR FACILITY IN PARAMETER FILE",!!
- I $D(DUZ(2)),DUZ(2)>0,$D(^AQAGP(DUZ(2))) D Q
- .W !,$P(^DIC(4,DUZ(2),0),U)
- .W " is ALREADY set up in the QI Parameter file!!"
- ; ask user for facility name
- W !! K DIC S DIC="^AUTTLOC(",DIC(0)="AEMZQ"
- S DIC("B")=$S('$D(DUZ(2)):"",DUZ(2)<1:"",1:$P($G(^DIC(4,DUZ(2),0)),U))
- S DIC("A")="Select QI FACILITY NAME: " D ^DIC
- Q:$D(DTOUT) Q:$D(DUOUT) Q:X="" G 3:Y=-1 S AQAOFAC=+Y
- 31 I $D(^AQAGP(AQAOFAC)) D Q
- .W !!,"This facility is ALREADY set up in the QI Parameter file!!"
- ;
- SURE ; ask user if he is sure he wants to add this facility
- W !! K DIR,DIC S DIR(0)="YO",DIR("B")="NO"
- S DIR("A")="Okay to ADD this facility to the QI PARAMETER file"
- S DIR("?",1)="Answer YES to create an entry in the QI Parameter file"
- S DIR("?",2)="for the facility you selected. Answer NO to select "
- S DIR("?")="another facility."
- D ^DIR Q:$D(DIRUT) G 3:Y=0
- ;
- ADD ; set variables and call file^dicn
- W !! K DD,DO,DIC,DIR S DLAYGO=9002166,DIC="^AQAGP(",DIC(0)="L"
- S (DINUM,X)=AQAOFAC,DIC("DR")="[AQAO PARAM ADD]"
- L +(^AQAGP(0)):1 I '$T D Q
- .W !!,"CANNOT ADD; ANOTHER USER ADDING TO THIS FILE. TRY AGAIN.",!
- D FILE^DICN L -(^AQAGP(0))
- W !!,"CREATING ENTRY . . ."
- I Y=-1 W !!,"**ERROR** COULD NOT CREATE ENTRY IN FILE!" G 4
- W !!,"ENTRY CREATED!"
- W !!,"To ACTIVATE any of the automatic linkages, please use the option"
- W !,"titled EDIT PARAMETER FILE and select the same facility."
- W !!
- Q
- ;
- ;
- 4 ; step 4 - set up pkg administrator
- W !!,"STEP 4 - DEFINE QAI PACKAGE ADMINISTRATOR",!!
- W !,"Due to the extra security measures implemented in this package,"
- W !,"no one can access the main QAI menu without having the proper"
- W !,"entry in the QI USER file. This step will create an entry for"
- W !,"the QI staff person who will be responsible for all the"
- W !,"administrative duties involved in running this package. This"
- W !,"should be a QI staff member, NOT the site manager. This person"
- W !,"can add more package administrators, if necessary.",!!
- ;
- I $O(^AQAO(9,"AC","QA",0)) D
- .W !!,"You already have a PKG ADMINISTRATOR defined."
- .S X=0 F S X=$O(^AQAO(9,"AC","QA",X)) Q:X="" D
- ..W !,"Name: ",$P(^VA(200,X,0),U)
- .W !!,"To bypass this step, simple enter a ""^"" at the prompt.",!!
- ;
- K DIC S DIC=200,DIC(0)="AEMQZ"
- S DIC("S")="I $P(^VA(200,Y,0),U,3)]"""",$P(^(0),U,11)="""""
- S DIC("A")="Select PERSON to be PKG ADMINISTRATOR: " D ^DIC
- Q:$D(DTOUT) Q:$D(DUOUT) G 4:Y=-1 S AQAOX=+Y
- ;
- I $D(^AQAO(9,"AC","QA",AQAOX)) D Q
- .W !!,"This person is already set up as a package administrator."
- .W !,"Bypassing . . ."
- ;
- I $D(^AQAO(9,"B",AQAOX)) D Q
- .W !!,"This person is already in the QI User file but NOT as a"
- .W !,"package administrator."
- .K DIR S DIR(0)="Y",DIR("B")="NO"
- .S DIR("A")="Do you want to make this user a pkg administrator"
- .D ^DIR I Y=1 D
- ..S DIE="^AQAO(9,",DA=AQAOX,DR=".06////QA" D ^DIE
- ;
- W !! K DIR S DIR(0)="Y"
- S DIR("A")="Ready to add this person as PKG ADMINISTRATOR"
- D ^DIR I Y'=1 G 4
- K DIC,DD,DO S DIC="^AQAO(9,",DIC(0)="L",(DINUM,X)=AQAOX
- S DIC("DR")=".02////"_DT_";.03////"_$G(DUZ)_";.06////QA" D FILE^DICN
- I Y=-1 W !!,"**ERROR** Could not create entry!"
- W !!,"Make sure the Package Administrator is given ALL security"
- W !,"keys in the AQAO namespace BUT only if QAI training has been"
- W !,"given by the developer OR area trainer",!!
- Q
- ;
- ;
- 5 ; step 5 - add AQAOVST to PCC Visit Merge Utility
- W !!,"STEP 5 - UPDATE PCC VISIT MERGE UTILITY",!!
- W !,"I will now add an entry for QAI into the MODULE PCC LINK CONTROL"
- W !,"file. This insures visit merges will be reflected in those"
- W !,"occurrences pointing to the affected visits.",!!
- Q:$D(^APCDLINK("B","QAI MGT SYSTEM")) ;already exists
- K DD,DO S DIC="^APCDLINK(",DIC(0)="LE",DLAYGO=9001002
- S DIC("DR")="1////S AQAOSAV=$G(X),X=""AQAOVST"" X ^%ZOSF(""TEST"") S X=AQAOSAV K AQAOSAV I $T D MRG^AQAOVST"
- S X="QAI MGT SYSTEM" D FILE^DICN
- Q
- ;
- ;
- 6 ;step 6 - kill old xrefs no longer used
- W !!,"STEP 6 - KILL OLD CROSS-REFERENCES NO LONGER USED",!!
- W !,"I will now kill any cross-references used during alpha testing"
- W !,"that are no longer needed by the software",!!
- W !,"Kill ^AQAOCC(7,""AC"")" K ^AQAOCC(7,"AC")
- W !,"Kill ^AQAOC(""AFF"")" K ^AQAOC("AFF")
- Q
- ;
- 7 ; -- convert provider data to variable pointer
- W !!,"CONVERTING provider data to new structure. . ."
- NEW X,Y,DIK K ^AQAOCC(7,"B")
- S X=0 F S X=$O(^AQAOCC(7,X)) Q:X'=+X D
- . S Y=$P(^AQAOCC(7,X,0),U) Q:Y'=+Y ;already converted
- . S $P(^AQAOCC(7,X,0),U)=Y_";VA(200,"
- S DIK="^AQAOCC(7,",DIK(1)=".01^B" D ENALL^DIK
- Q
- AQAOPOS2 ; IHS/ORDC/LJF - POST INIT CONTINUED ;
- +1 ;;1.01;QAI MANAGEMENT;;OCT 05, 1995
- +2 ;
- +3 ;This is a continuation of the QAI postinits. This rtn installs your
- +4 ;primary facility into the QI Parameter file and sets up at least one
- +5 ;user as the package administrator.
- +6 ;
- MAIN ;do steps 3, 4, 5, 6, 7 and return to AQAOPOST
- DO 3
- DO 4
- DO 5
- DO 6
- DO 7
- QUIT
- +1 ;
- 3 ; step 3 - create primary facility entry in parameter file
- +1 WRITE !!,"STEP 3 - SET UP YOUR FACILITY IN PARAMETER FILE",!!
- +2 IF $DATA(DUZ(2))
- IF DUZ(2)>0
- IF $DATA(^AQAGP(DUZ(2)))
- Begin DoDot:1
- +3 WRITE !,$PIECE(^DIC(4,DUZ(2),0),U)
- +4 WRITE " is ALREADY set up in the QI Parameter file!!"
- End DoDot:1
- QUIT
- +5 ; ask user for facility name
- +6 WRITE !!
- KILL DIC
- SET DIC="^AUTTLOC("
- SET DIC(0)="AEMZQ"
- +7 SET DIC("B")=$SELECT('$DATA(DUZ(2)):"",DUZ(2)<1:"",1:$PIECE($GET(^DIC(4,DUZ(2),0)),U))
- +8 SET DIC("A")="Select QI FACILITY NAME: "
- DO ^DIC
- +9 IF $DATA(DTOUT)
- QUIT
- IF $DATA(DUOUT)
- QUIT
- IF X=""
- QUIT
- IF Y=-1
- GOTO 3
- SET AQAOFAC=+Y
- 31 IF $DATA(^AQAGP(AQAOFAC))
- Begin DoDot:1
- +1 WRITE !!,"This facility is ALREADY set up in the QI Parameter file!!"
- End DoDot:1
- QUIT
- +2 ;
- SURE ; ask user if he is sure he wants to add this facility
- +1 WRITE !!
- KILL DIR,DIC
- SET DIR(0)="YO"
- SET DIR("B")="NO"
- +2 SET DIR("A")="Okay to ADD this facility to the QI PARAMETER file"
- +3 SET DIR("?",1)="Answer YES to create an entry in the QI Parameter file"
- +4 SET DIR("?",2)="for the facility you selected. Answer NO to select "
- +5 SET DIR("?")="another facility."
- +6 DO ^DIR
- IF $DATA(DIRUT)
- QUIT
- IF Y=0
- GOTO 3
- +7 ;
- ADD ; set variables and call file^dicn
- +1 WRITE !!
- KILL DD,DO,DIC,DIR
- SET DLAYGO=9002166
- SET DIC="^AQAGP("
- SET DIC(0)="L"
- +2 SET (DINUM,X)=AQAOFAC
- SET DIC("DR")="[AQAO PARAM ADD]"
- +3 LOCK +(^AQAGP(0)):1
- IF '$TEST
- Begin DoDot:1
- +4 WRITE !!,"CANNOT ADD; ANOTHER USER ADDING TO THIS FILE. TRY AGAIN.",!
- End DoDot:1
- QUIT
- +5 DO FILE^DICN
- LOCK -(^AQAGP(0))
- +6 WRITE !!,"CREATING ENTRY . . ."
- +7 IF Y=-1
- WRITE !!,"**ERROR** COULD NOT CREATE ENTRY IN FILE!"
- GOTO 4
- +8 WRITE !!,"ENTRY CREATED!"
- +9 WRITE !!,"To ACTIVATE any of the automatic linkages, please use the option"
- +10 WRITE !,"titled EDIT PARAMETER FILE and select the same facility."
- +11 WRITE !!
- +12 QUIT
- +13 ;
- +14 ;
- 4 ; step 4 - set up pkg administrator
- +1 WRITE !!,"STEP 4 - DEFINE QAI PACKAGE ADMINISTRATOR",!!
- +2 WRITE !,"Due to the extra security measures implemented in this package,"
- +3 WRITE !,"no one can access the main QAI menu without having the proper"
- +4 WRITE !,"entry in the QI USER file. This step will create an entry for"
- +5 WRITE !,"the QI staff person who will be responsible for all the"
- +6 WRITE !,"administrative duties involved in running this package. This"
- +7 WRITE !,"should be a QI staff member, NOT the site manager. This person"
- +8 WRITE !,"can add more package administrators, if necessary.",!!
- +9 ;
- +10 IF $ORDER(^AQAO(9,"AC","QA",0))
- Begin DoDot:1
- +11 WRITE !!,"You already have a PKG ADMINISTRATOR defined."
- +12 SET X=0
- FOR
- SET X=$ORDER(^AQAO(9,"AC","QA",X))
- IF X=""
- QUIT
- Begin DoDot:2
- +13 WRITE !,"Name: ",$PIECE(^VA(200,X,0),U)
- End DoDot:2
- +14 WRITE !!,"To bypass this step, simple enter a ""^"" at the prompt.",!!
- End DoDot:1
- +15 ;
- +16 KILL DIC
- SET DIC=200
- SET DIC(0)="AEMQZ"
- +17 SET DIC("S")="I $P(^VA(200,Y,0),U,3)]"""",$P(^(0),U,11)="""""
- +18 SET DIC("A")="Select PERSON to be PKG ADMINISTRATOR: "
- DO ^DIC
- +19 IF $DATA(DTOUT)
- QUIT
- IF $DATA(DUOUT)
- QUIT
- IF Y=-1
- GOTO 4
- SET AQAOX=+Y
- +20 ;
- +21 IF $DATA(^AQAO(9,"AC","QA",AQAOX))
- Begin DoDot:1
- +22 WRITE !!,"This person is already set up as a package administrator."
- +23 WRITE !,"Bypassing . . ."
- End DoDot:1
- QUIT
- +24 ;
- +25 IF $DATA(^AQAO(9,"B",AQAOX))
- Begin DoDot:1
- +26 WRITE !!,"This person is already in the QI User file but NOT as a"
- +27 WRITE !,"package administrator."
- +28 KILL DIR
- SET DIR(0)="Y"
- SET DIR("B")="NO"
- +29 SET DIR("A")="Do you want to make this user a pkg administrator"
- +30 DO ^DIR
- IF Y=1
- Begin DoDot:2
- +31 SET DIE="^AQAO(9,"
- SET DA=AQAOX
- SET DR=".06////QA"
- DO ^DIE
- End DoDot:2
- End DoDot:1
- QUIT
- +32 ;
- +33 WRITE !!
- KILL DIR
- SET DIR(0)="Y"
- +34 SET DIR("A")="Ready to add this person as PKG ADMINISTRATOR"
- +35 DO ^DIR
- IF Y'=1
- GOTO 4
- +36 KILL DIC,DD,DO
- SET DIC="^AQAO(9,"
- SET DIC(0)="L"
- SET (DINUM,X)=AQAOX
- +37 SET DIC("DR")=".02////"_DT_";.03////"_$GET(DUZ)_";.06////QA"
- DO FILE^DICN
- +38 IF Y=-1
- WRITE !!,"**ERROR** Could not create entry!"
- +39 WRITE !!,"Make sure the Package Administrator is given ALL security"
- +40 WRITE !,"keys in the AQAO namespace BUT only if QAI training has been"
- +41 WRITE !,"given by the developer OR area trainer",!!
- +42 QUIT
- +43 ;
- +44 ;
- 5 ; step 5 - add AQAOVST to PCC Visit Merge Utility
- +1 WRITE !!,"STEP 5 - UPDATE PCC VISIT MERGE UTILITY",!!
- +2 WRITE !,"I will now add an entry for QAI into the MODULE PCC LINK CONTROL"
- +3 WRITE !,"file. This insures visit merges will be reflected in those"
- +4 WRITE !,"occurrences pointing to the affected visits.",!!
- +5 ;already exists
- IF $DATA(^APCDLINK("B","QAI MGT SYSTEM"))
- QUIT
- +6 KILL DD,DO
- SET DIC="^APCDLINK("
- SET DIC(0)="LE"
- SET DLAYGO=9001002
- +7 SET DIC("DR")="1////S AQAOSAV=$G(X),X=""AQAOVST"" X ^%ZOSF(""TEST"") S X=AQAOSAV K AQAOSAV I $T D MRG^AQAOVST"
- +8 SET X="QAI MGT SYSTEM"
- DO FILE^DICN
- +9 QUIT
- +10 ;
- +11 ;
- 6 ;step 6 - kill old xrefs no longer used
- +1 WRITE !!,"STEP 6 - KILL OLD CROSS-REFERENCES NO LONGER USED",!!
- +2 WRITE !,"I will now kill any cross-references used during alpha testing"
- +3 WRITE !,"that are no longer needed by the software",!!
- +4 WRITE !,"Kill ^AQAOCC(7,""AC"")"
- KILL ^AQAOCC(7,"AC")
- +5 WRITE !,"Kill ^AQAOC(""AFF"")"
- KILL ^AQAOC("AFF")
- +6 QUIT
- +7 ;
- 7 ; -- convert provider data to variable pointer
- +1 WRITE !!,"CONVERTING provider data to new structure. . ."
- +2 NEW X,Y,DIK
- KILL ^AQAOCC(7,"B")
- +3 SET X=0
- FOR
- SET X=$ORDER(^AQAOCC(7,X))
- IF X'=+X
- QUIT
- Begin DoDot:1
- +4 ;already converted
- SET Y=$PIECE(^AQAOCC(7,X,0),U)
- IF Y'=+Y
- QUIT
- +5 SET $PIECE(^AQAOCC(7,X,0),U)=Y_";VA(200,"
- End DoDot:1
- +6 SET DIK="^AQAOCC(7,"
- SET DIK(1)=".01^B"
- DO ENALL^DIK
- +7 QUIT