source: WorldVistAEHR/trunk/r/HEALTH_SUMMARY-GMTS/GMTSRAI.m@ 1150

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

initial load of WorldVistAEHR

File size: 2.3 KB
Line 
1GMTSRAI ; SLC/JER,KER - Radiology Impression Comp ; 09/21/2001
2 ;;2.7;Health Summary;**28,37,47**;Oct 20, 1995
3 ;
4 ; External References
5 ; DBIA 3125 ^RADPT( file 70
6 ; DBIA 2056 $$GET1^DIQ (file 70)
7 ; DBIA 10011 ^DIWP
8 ;
9ENSRA ; Controls branching
10 Q:+($G(DFN))=0 Q:+($G(DFN))'=+($$RP(+($G(DFN))))
11 K ^TMP("RAE",$J)
12 N GMDATA,GMTSCP D MAIN^GMTSRAE(1) Q:'$D(^TMP("RAE",$J))
13 D LOOP K ^TMP("RAE",$J)
14 Q
15LOOP ; Loops through ^TMP("RAE",$J,
16 N GMTSIDT,GMTSPN,GMTSPC S (GMTSIDT,GMTSPC)=0 F S GMTSIDT=$O(^TMP("RAE",$J,GMTSIDT)) Q:GMTSIDT'>0 D Q:$D(GMTSQIT)
17 . S GMTSPN=0 F S GMTSPN=$O(^TMP("RAE",$J,GMTSIDT,GMTSPN)) Q:GMTSPN'>0 D WRT Q:$D(GMTSQIT)
18 Q
19WRT ; Writes component data
20 Q:$D(GMTSQIT) N X,GMTSEDT S GMDATA=1,X=+^TMP("RAE",$J,GMTSIDT,GMTSPN,0) D REGDT4^GMTSU S GMTSEDT=X
21 D HD S GMTSPC=+($G(GMTSCP))+1 Q:$D(GMTSQIT) D HD Q:$D(GMTSQIT) W GMTSEDT D PRO,IMP Q
22 Q
23PRO ; Procedure
24 N GMTSPRO,GMTSEST,GMTSTA,GMTSCPT,GMTSI,GMTSCN
25 S GMTSPRO=$P(^TMP("RAE",$J,GMTSIDT,GMTSPN,0),"^",2),GMTSEST=$P(^(0),"^",3),GMTSTA=$P(^(0),"^",4),GMTSCPT=$P(^(0),"^",7),GMTSCN=$P(^(0),"^",9)
26 S GMTSTA=$S(GMTSTA="RELEASED/NOT VERIFIED":"REL/NOT VER",GMTSTA="PROBLEM DRAFT":"PROB DRAFT",1:GMTSTA)
27 S GMTSTA=$S(GMTSEST["CANCEL":"CANCELLED",1:GMTSTA)
28 S GMTSTA=$$EN2^GMTSUMX(GMTSTA)
29 I $L(GMTSPRO)>31 S GMTSPRO=$$WRAP^GMTSORC(GMTSPRO,31)
30 D HD Q:$D(GMTSQIT)
31 W ?12,$P(GMTSPRO,"|"),?46,GMTSCPT,?52,$E(GMTSTA,1,11),?64,$G(GMTSCN),!
32 F GMTSI=2:1:$L(GMTSPRO,"|") D Q:$D(GMTSQIT)
33 . D HD Q:$D(GMTSQIT) W:$P(GMTSPRO,"|",GMTSI)]"" ?14,$P(GMTSPRO,"|",GMTSI),!
34 Q
35IMP ; Impression
36 Q:$D(GMTSQIT) N GMTSI,GMTST,DIWF,DIWL,DIWR
37 S GMTST=12 Q:'$D(^TMP("RAE",$J,GMTSIDT,GMTSPN,"I")) K ^UTILITY($J,"W")
38 S DIWF="C"_(78-GMTST),DIWL=0,DIWR=0,GMTSI=0
39 F S GMTSI=$O(^TMP("RAE",$J,GMTSIDT,GMTSPN,"I",GMTSI)) Q:+GMTSI=0 D Q:$D(GMTSQIT)
40 . S X=$G(^TMP("RAE",$J,GMTSIDT,GMTSPN,"I",GMTSI)) D ^DIWP
41 S GMTSI=0 F S GMTSI=$O(^UTILITY($J,"W",0,GMTSI)) Q:+GMTSI=0 D Q:$D(GMTSQIT)
42 . D HD Q:$D(GMTSQIT) W ?GMTST,$G(^UTILITY($J,"W",0,GMTSI,0)),!
43 K ^UTILITY($J,"W")
44 Q
45HD ; Header/Page Check
46 Q:$D(GMTSQIT) D CKP^GMTSUP Q:$D(GMTSQIT) Q:+($G(GMTSNPG))=0&(+($G(GMTSPC))>0)
47 W "Date",?12,"Procedure",?46,"CPT",?52,"Status",?64,"Case #",!
48 Q
49RP(X) ; Radiology Patient
50 N Y S X=+($G(X)) S Y=$$GET1^DIQ(70,X,.01,"I") S X=Y Q X
Note: See TracBrowser for help on using the repository browser.