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

QAPUTIL2.m

Go to the documentation of this file.
  1. QAPUTIL2 ;557/THM-SURVEY GENERATOR UTILITIES, PART 3 [ 07/24/96 2:46 PM ]
  1. ;;2.0;Survey Generator;**2,5**;Jun 20, 1995
  1. ;
  1. HELP2 ;from QAPEDIT
  1. K DTOUT,DIRUT X:$D(CLEOP) CLEOP W !!!,"Select C to create a completely new survey",!
  1. W " B to change only the basic survey information",!
  1. W " D to add or edit demographic survey fields",!
  1. W " E to edit all survey questions in current order",!
  1. W " I to add or edit individual survey questions",!
  1. W " P to print a copy of the survey",!
  1. W " Q, '^' or <RETURN> to EXIT",!
  1. W !!,"Press RETURN " R ANS:30 I '$T X:$D(CLEOP) CLEOP S DIRUT=1 Q
  1. X:$D(CLEOP) CLEOP Q
  1. ;
  1. HELP3 ;demographic help (from input transform)
  1. N QLINE
  1. S QLINE=20 X:$D(CLEOP1) CLEOP1 W !,"Do you want to see extended help" S %=2 D YN^DICN S QLINE=4 X:$D(CLEOP1) CLEOP1 G:%'=1 HELP3Q I $D(DUOUT)!($D(DTOUT)) S QAPOUT=1 Q
  1. W !,"Demographic data items are optional. You may wish to include them in",!
  1. W "order to identify the survey participant or group, or to sort on specific",!
  1. W "demographic items. Note that while including demographic data items in",!
  1. W "your survey is up to you, you may also make them mandatory entry fields",!
  1. W "for your survey participants.",!!
  1. W "First you must enter the text for your demographic data item as it should",!
  1. W "be displayed on the survey. Then you will be asked what TYPE of demographic",!
  1. W "it is. They may be pointers to existing DHCP files, sets of codes, free",!
  1. W "text, or dates.",!!,"Press RETURN " R ANS:DTIME I '$T S DTOUT=1 Q
  1. HELP3Q S QLINE=3 X:$D(CLEOP1) CLEOP1
  1. Q
  1. ;
  1. HELP4 ;password help
  1. W !!,"You may password-protect your survey from unauthorized participants.",!
  1. W "Using the password is optional and if you decide to use one and enter",!
  1. W "it here, you will have to communicate it to all participants.",!
  1. Q
  1. ;
  1. DEMLST ;print demographics on hard copies - from QAPPT0
  1. S QAPOUT=0 Q:$O(^QA(748,SURVEY,1,0))="" ;none to print
  1. S QAPCOL=0 F DEMDA=0:0 S DEMDA=$O(^QA(748,SURVEY,1,DEMDA)) Q:DEMDA=""!(+DEMDA=0)!(QAPOUT=1) DO I QAPOUT=1 S DEMDA="9999"
  1. .S DEMVAL=$P(^QA(748,SURVEY,1,DEMDA,0),U),DEMTYPE=$P(^QA(748,SURVEY,1,DEMDA,0),U,2)
  1. .W ?(QAPCOL),DEMVAL_": " D:'$D(USERPRT)&(DEMTYPE="s") DEMSHOW Q:QAPOUT=1 D:$D(USERPRT) S QAPCOL=QAPCOL+40 I QAPCOL>50 S QAPCOL=0 W !! X:$D(TOF) TOF Q:QAPOUT=1
  1. ..S DEML=$O(^QA(748.3,FILEDA,2,"B",DEMDA,0)) Q:DEML="" ;no type/demog
  1. ..S DEMVAL=$P(^QA(748.3,FILEDA,2,DEML,0),U,2)
  1. ..I DEMTYPE="d" S Y=DEMVAL X ^DD("DD") S DEMVAL=Y
  1. ..W $E(DEMVAL,1,30)
  1. Q:QAPOUT=1 X:$D(TOF) TOF Q:QAPOUT=1 W !!! K QAPCOL,DEMDA X:$D(TOF) TOF
  1. Q
  1. ;
  1. HELPDIS W !,"Enter a number between 1 and 99999. You may use decimals to two",!
  1. W "places if you wish. If there is a previous value in this field you",!
  1. W "may press RETURN to skip it if you do not wish to change it.",!!
  1. Q
  1. ;
  1. TRAP ;suspend and reset during participation for QAPSCRN
  1. LOCK
  1. W !!,*7,"An error has been encountered during your information entry.",!,"Please contact your local IRM for assistance.",!!
  1. W "Your answers entered so far will be saved and your entry given a",!
  1. W """SUSPENDED"" status. You may resume after the error has been",!,"resolved.",!!,"Press RETURN " R ANS:DTIME ;if timeout continue to suspend
  1. S:'$D(QAPCNT) QAPCNT=0 S:'$D(CQUES) CQUES=0 S:'$D(FILEDA) FILEDA=IFN
  1. S (DIC,DIE)="^QA(748.3,",DA=FILEDA,DR="3////s;4////"_QAPCNT_";5////"_CQUES D ^DIE W !!,"Survey suspended, see you later." H 2
  1. D ^%ZISC I '$D(ZTSK),IOST?1"C-VT100"!(IOST?1"C-VT320") S IOTM=1,IOBM=24 W @TOPBOT,@IOF,!
  1. S X="ERR^ZU",@^%ZOSF("TRAP") ;reset to Kernel error trap
  1. G ERR^ZU ;exit via Kernel
  1. ;
  1. KANS ;kill unneeded answers
  1. S NDA=DA,NDA1=DA(1) N DA,ANS,X,Y,DIC,DIE
  1. S DA(2)=NDA1,DA(1)=NDA,ANS=""
  1. F S ANS=$O(^QA(748.25,DA(2),1,DA(1),3,"B",ANS)) Q:ANS="" F DA=0:0 S DA=$O(^QA(748.25,DA(2),1,DA(1),3,"B",ANS,DA)) Q:DA="" S DIK="^QA(748.25,DA(2),1,DA(1),3," D ^DIK
  1. K DA,NDA,NDA1 Q
  1. ;
  1. DEMSHOW F DAX=0:0 S DAX=$O(^QA(748,SURVEY,1,DEMDA,1,DAX)) Q:DAX=""!(+DAX=0) S QDTA=^QA(748,SURVEY,1,DEMDA,1,DAX,0),CODE=$P(QDTA,U,1),MEANING=$P(QDTA,U,2) W ?(QAPCOL),CODE," - ",MEANING,!?(QAPCOL)+$L(DEMVAL)+3 X:$D(TOF) TOF S:QAPOUT=1 DAX=999
  1. Q