source: WorldVistAEHR/trunk/r/OCCURRENCE_SCREEN-QAO/QAOSCNVA.m@ 1722

Last change on this file since 1722 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.8 KB
Line 
1QAOSCNVA ;HISC/DDA-CONVERT VALADATED/COMFIRMED SYS/EQIP ISSUES ;1/3/94 15:49
2 ;;3.0;Occurrence Screen;**6**;09/14/1993
3INFO ; INFORMATION ABOUT THIS CONVERSION PROCESS.
4 W !!,"This conversion restores previous versions' SYSTEM and EQUIPMENT"
5 W !,"issues and makes them available for historical reporting via the"
6 W !,"option 'System/Equipment Problems' [QAOS RPT SYS/MGMT/EQUIP PROB]"
7 W !!,"As part of the conversion a non-committee place holder,"
8 W !,"VALIDATED/CONFIRMED, is added to the 'QA OCCURRENCE COMMITTEE'"
9 W !,"file (#741.97)."
10 W !!,"The actual conversion can be performed any number of times with"
11 W !,"no adverse impact on the data. If the conversion is interrupted"
12 W !,"for any reason, simply run this routine again."
13 W !,"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
14 ; HAVE USER PRESS RETURN TO CONTINUE
15 S DIR(0)="E" W ! D ^DIR K DIR
16 I Y'=1 S CNVMSG="User stopped conversion process." G ERROR
17 S STARTIME=$P($H,",",2)
18 W !!,"Starting the conversion..."
19ADDCOM W !!,"Adding place holder committee - VALIDATED/CONFIRMED"
20 W !,"---------------------------------------------------"
21 K DD,DIC,DINUM,DO
22 S X="VALIDATED/CONFIRMED"
23 ; IF IT IS ALREADY IN THE FILE, SKIP TO THE CONVERSION
24 S CNVCOM=$O(^QA(741.97,"B",X,""))
25 G:CNVCOM>0 LP
26 S DIC="^QA(741.97,",DIC(0)="EL",DIC("DR")="1///XX",DLAYGO=741.97 D FILE^DICN I Y=-1 S CNVMSG="UNABLE TO ADD 'VALILATED/CONFIRMED' COMMITTEE TO FILE #741.97" G ERROR
27 S CNVCOM=+Y K DIC,DLAYGO
28LP W !,"Done..."
29 W !!,"Moving VALIDATED/CONFIRMED data to the committee area"
30 W !,"-----------------------------------------------------"
31 S (CNT,CNV)=0
32 D NOW^%DTC S CNVDT=X
33 D WAIT^DICD
34 D LOOP
35 W !,"Done..."
36 S ENDTIME=$P($H,",",2),%=ENDTIME-STARTIME D S^%DTC
37 S HOURS=+$E(%,2,3),MINUTES=+$E(%,4,5),SECONDS=+$E(%,6,7)
38 W !!,"-----------------------------------------------------"
39 W !,"Total records checked: "_CNT_" Total records modified: "_CNV
40 W !,"Conversion completed in ",HOURS,"H ",MINUTES,"M ",SECONDS,"S."
41EXIT K CNT,CNV,CNVCOM,CNVDT,CNVMSG,COMDA,COMIEN,COMMENTS,COMTTL,DA,DD,DIC,DINUM,DLAYGO,DO,ENDTIME,HOURS,IEN,MINUTES,OKAY,QAQADICT,QAQAFLD,SECONDS,STARTIME,VALDT,VC,X,Y,ZER0
42 Q
43LOOP ; LOOP VIA "AVAL" CROSS REFERENCE. ONLY THOSE RECORDS WITH A VALIDATION DATE ARE CHECKED.
44 S VALDT=0
45 F S VALDT=$O(^QA(741,"AVAL",VALDT)) Q:VALDT'>0 S IEN=0 F S IEN=$O(^QA(741,"AVAL",VALDT,IEN)) Q:IEN'>0 S ZER0=$G(^QA(741,IEN,0)) D
46 .S CNT=CNT+1
47 .; CONTINUE IF THERE IS ISSUE CODE DATA (VC)
48 .I +$P(ZER0,"^",20)'=0 D
49 ..S VC=$P(ZER0,"^",20),COMIEN=0,OKAY=1
50 ..; CHECK ALL COMMITTEE ENTRIES. CONTINUE IF NONE HAVE THE SAME ISSUE CODE (VC)
51 ..F S:$D(^QA(741,IEN,"CMTE")) COMIEN=$O(^QA(741,IEN,"CMTE",COMIEN)) Q:COMIEN'>0 I $P($G(^QA(741,IEN,"CMTE",COMIEN,0)),"^",5)=VC S OKAY=0
52 ..; SET HEADER IF NO PREVIOUS COMMITTEE DATA
53 ..I OKAY D
54 ...;SETUP AND STORE COMMITTEE DATA
55 ...I '$D(^QA(741,IEN,"CMTE")) S ^QA(741,IEN,"CMTE",0)="^741.017PA^"
56 ...S COMMENTS=$G(^QA(741,IEN,1))
57 ...S COMDA=$P($G(^QA(741,IEN,"CMTE",0)),"^",3)
58 ...S COMTTL=$P($G(^QA(741,IEN,"CMTE",0)),"^",4)+1
59LDA ...S COMDA=COMDA+1
60 ...L +^QA(741,IEN,"CMTE",COMDA):1 G:('$T)!($D(^QA(741,IEN,"CMTE",COMDA))) LDA
61 ...S ^QA(741,IEN,"CMTE",COMDA,0)=CNVCOM_"^^^^"_VC
62 ...S $P(^QA(741,IEN,"CMTE",0),"^",3,4)=COMDA_"^"_COMTTL
63 ...;FIRE OFF XREFS
64 ...S DA(1)=IEN,DA=COMDA,QAQADICT=741.017,QAQAFLD=.01,X=CNVCOM D ENSET^QAQAXREF
65 ...S DA(1)=IEN,DA=COMDA,QAQADICT=741.017,QAQAFLD=4,X=VC D ENSET^QAQAXREF
66 ...I COMMENTS]"" D
67 ....S ^QA(741,IEN,"CMTE",COMDA,1,0)="^^1^1^"_VALDT_"^^"
68 ....S ^QA(741,IEN,"CMTE",COMDA,1,1,0)=COMMENTS
69 ....Q
70 ...L -^QA(741,IEN,"CMTE",COMDA)
71 ...S CNV=CNV+1
72 ...Q
73 ..Q
74 .Q
75 Q
76ERROR ;
77 W !!,"&%%#^%#))^$$##$^*$&%&*^%#%^$$#%%$#&_(*&&*$^%#)*^^$^%#^$$#@&%#)#%&^$##"
78 W !?5,CNVMSG
79 W !?5,"Conversion has been stopped."
80 W !!,"&%%#^%#))^$$##$^*$&%&*^%#%^$$#%%$#&_(*&&*$^%#)*^^$^%#^$$#@&%#)#%&^$##"
81 D EXIT
82 Q
Note: See TracBrowser for help on using the repository browser.