source: WorldVistAEHR/trunk/r/GEN_MED_REC_VITALS-GMRV/GMRVXVM0.m@ 1365

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

initial load of WorldVistAEHR

File size: 2.1 KB
Line 
1GMRVXVM0 ;HIRMFO/YH,RM-GMRV VITAL MEASUREMENT CONVERSION ;8/1/96
2 ;;4.0;Vitals/Measurements;;Apr 25, 1997
3QUEUE ; Entry to queue/requeue GMRV Vital Measurement Conversion
4 D BMES^XPDUTL("Data conversion queued to run in the background")
5 S ZTDTH=$$HADD^XLFDT($H,"","","",60),ZTDESC="V/M V4.0 FILE 120.5 CONVERSION"
6 S ZTRTN="CONV5^GMRVXVM0",(ZTIO,ZTSAVE("DUZ"))=""
7 D ^%ZTLOAD
8 Q
9ALERT ;Set up ALERT variables if conversion bombs out
10 S XQA(DUZ)="",XQAMSG="V/M VERSION 4 data conversion has aborted for file 120.5"
11 D SETUP^XQALERT K XQA,XQAMSQ
12 Q
13 ;
14 ; This job should be queued to run in the background.
15 Q
16CONV5 ;Convert patient data in ^GMR(120.5)
17 N GMRV S XMSUB="V/M V4.0 FILE 120.5 CONVERSION",XMY(DUZ)="",XMTEXT="GMRV("
18 I +$G(^GMRD(120.57,1,"PHASEII"))=1 S GMRV(1)="Data conversion has completed." D ^XMD Q
19 S X="ALERT^GMRVXVM0",@^%ZOSF("TRAP")
20 S ^GMRD(120.57,1,"PHASEII")=$P($G(^GMRD(120.57,1,"PHASEII"))_"^^^","^",1,4)
21 N GMRVDA,GMRVLST,GMRVDATA,GMRV52,GMRV53
22 S GMRVDA=+$P(^GMRD(120.57,1,"PHASEII"),U,2),GMRVDA(1)=+$P(^GMR(120.5,0),"^",3)
23 F S GMRVDA=$O(^GMR(120.5,GMRVDA)) Q:GMRVDA'>0 S GMRVDATA=$G(^GMR(120.5,GMRVDA,0)),GMRV52=+$P(GMRVDATA,"^",7),GMRV53=+$P(GMRVDATA,"^",9) D:GMRV52>0!(GMRV53>0) S $P(^GMRD(120.57,1,"PHASEII"),"^",2)=GMRVDA
24 . S GMRVLST=0 I $D(^GMRD(120.52,GMRV52)) S GMRVLST=GMRVLST+1
25 . I $D(^GMRD(120.52,GMRV52)),'$D(^GMR(120.5,GMRVDA,5,"B",GMRV52)) S ^GMR(120.5,GMRVDA,5,GMRVLST,0)=GMRV52,^GMR(120.5,GMRVDA,5,"B",GMRV52,GMRVLST)=""
26 . I GMRV53>0 S GMRV53(1)=GMRV53_";GMRD(120.53," I $D(^GMRD(120.52,"AOLD",GMRV53(1))) S GMRV53(2)=$O(^GMRD(120.52,"AOLD",GMRV53(1),0)),GMRVLST=GMRVLST+1 D:GMRV53(2)>0
27 . . I '$D(^GMR(120.5,GMRVDA,5,"B",GMRV53(2))) S ^GMR(120.5,GMRVDA,5,GMRVLST,0)=GMRV53(2),^GMR(120.5,GMRVDA,5,"B",GMRV53(2),GMRVLST)=""
28 . S ^GMR(120.5,GMRVDA,5,0)="^120.505P^"_GMRVLST_"^"_GMRVLST
29 . Q
30 I $P(^GMRD(120.57,1,"PHASEII"),"^",2)<GMRVDA(1) S GMRV(1)="Conversion not completed, please check the record after the record # "_$P(^GMRD(120.57,1,"PHASEII"),"^",2)_" in the ^GMR(120.5) file" D ^XMD Q
31 S $P(^GMRD(120.57,1,"PHASEII"),"^")=1
32 S GMRV(1)="FILE 120.5 CONVERSION COMPLETED" D ^XMD
33 Q
Note: See TracBrowser for help on using the repository browser.