source: FOIAVistA/trunk/r/LAB_SERVICE-LR-LS/LRMIZAP.m@ 1154

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

initial load of FOIAVistA 6/30/08 version

File size: 2.9 KB
Line 
1LRMIZAP ;SLC/BA - MICRO CONVERSION ; 8/5/87 18:18 ;
2 ;;5.2;LAB SERVICE;;Sep 27, 1994
3 ;Only to be used once for conversion of version 2 or version 3 lab to version 4
4ZAP S U="^",(LREND,LRDFN)=0 I $O(^TMP("LRMIZAP",0)) S J=$O(^TMP("LRMIZAP",0)),LRDFN=$S($D(^TMP("LRMIZAP",J,"ZAP")):^("ZAP"),1:1)-1
5 K ^TMP("LRMIZAP") D X I $D(^TMP("LRMIZAP")) D CONVERT
6END I 'LREND W !!,"ALL DONE",!! I '$D(^TMP("LRMIZAP")) W "NOTHING NEEDED TO BE CHANGED",!
7 K ^TMP("LRMIZAP"),%,B,C,C2,C4,C6,I,J,L,LRBN,LRBUGN,LRCHECK,LRCNT,LRDFN,LREND,LRIDT,LRINTP,LRISR,LRN,LRORIDE,LROVERR,LRRES,LRSUB,LRSUB1,N,T,X,Y
8 Q
9X S LRSUB=0 F I=0:0 S LRSUB=+$O(^LAB(62.06,LRSUB)) Q:LRSUB<1 I $D(^(LRSUB,0)) S LRN=$P(^(0),U,2),LRSUB1=0 F I=0:0 S LRSUB1=+$O(^LAB(62.06,LRSUB,1,LRSUB1)) Q:LRSUB1<1 I $D(^(LRSUB1,0)) S LRRES=$P(^(0),U),LRINTP=$P(^(0),U,2) D AC
10 Q
11AC I $O(^LAB(62.06,LRSUB,1,LRSUB1,0))<1,LRRES=LRINTP Q
12 S ^TMP("LRMIZAP",$J,LRN,LRRES)=LRINTP
13 I +$O(^LAB(62.06,LRSUB,1,LRSUB1,0))>0 S ^TMP("LRMIZAP",$J,LRN,LRRES)=LRINTP_U_"*"_U_LRSUB_U_LRSUB1
14 Q
15CONVERT I LRDFN W !!,"THE CONVERSION WILL PICKUP WHERE IT LEFT OFF",!,"STARTING WITH LRDFN ",LRDFN,! S L=LRDFN D XX^LRMIZAP1 Q
16 W !,"If you are using the microbiology portion of the lab package to report",!,"microbiology results, you will need to run this conversion program",!,"in order to convert previous patient microbiology results to be compatible"
17 W !,"with the current lab software.",!!,"The program will go thru all lab patients and make any needed changes.",!,"The lab patient number (LRDFN) will be displayed on every hundredth patient.",!,"If you must stop this program from running,"
18 W " the next time it is started",!,"it will begin where it left off. It will display 'ALL DONE' when finished."
19 W !!,"THIS PROGRAM SHOULD BE RUN DURING OFF-HOURS.",!
20 F I=0:0 W !!,"Do you wish to run this program" S %=2 D YN^DICN Q:% W !,"Answer 'Y'es or 'N'o"
21 I %'=1 S LREND=1 Q
22 W !,"CONVERTING PATIENT DATA",! S L=LRDFN D XX^LRMIZAP1
23 Q
24UNZAP S U="^",(LREND,LRDFN)=0 I $O(^TMP("LRMIZAP",0)) S J=$O(^TMP("LRMIZAP",0)),LRDFN=$S($D(^TMP("LRMIZAP",J,"UNZAP")):^("UNZAP"),1:1)-1
25 K ^TMP("LRMIZAP") D X I $D(^TMP("LRMIZAP")) W "CONVERTING PATIENT DATA",! W:LRDFN !,"STARTING WITH LRDFN ",LRDFN,! S L=LRDFN D ZZ^LRMIZAP1
26 D END
27 Q
28XREF ;reindex the "AD" x-ref for micro accessions
29 S U="^" W !,"This will reindex the cross reference used by the INFECTION CONTROL SURVEY." F I=0:0 W !,"Do you want to reindex" S %=2 D YN^DICN Q:% W " answer YES or NO"
30 Q:%'=1 W !,"...THIS WILL TAKE AWHILE...",!
31 S LRAA=0 F I=0:0 S LRAA=$O(^LRO(68,LRAA)) Q:LRAA<1 I $P(^(LRAA,0),U,2)="MI" S LRAD=0 F I=0:0 S LRAD=$O(^LRO(68,LRAA,1,LRAD)) Q:LRAD="" K ^(LRAD,1,"AD") D SETAD
32 K %,I,LRAA,LRAD,LRAN,LRTEST,LRTK
33 Q
34SETAD S LRAN=0 F I=0:0 S LRAN=$O(^LRO(68,LRAA,1,LRAD,1,LRAN)) Q:LRAN<1 S LRTEST=0 F I=0:0 S LRTEST=$O(^LRO(68,LRAA,1,LRAD,1,LRAN,4,LRTEST)) Q:LRTEST<1 S LRTK=$P(^(LRTEST,0),U,5) I $L(LRTK) S ^LRO(68,LRAA,1,LRAD,1,"AD",LRTK\1,LRAN)=""
35 Q
Note: See TracBrowser for help on using the repository browser.