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

BHSCOAG.m

Go to the documentation of this file.
BHSCOAG ;IHS/MSC/MGH  - Health Summary for Anticoag data ;22-Aug-2014 14:54;DU
 ;;1.0;HEALTH SUMMARY COMPONENTS;**8,9**;Mar 17,2006;Build 16
 ;===================================================================
ANTICOAG ;DISPLAY PROBLEMS USED BY VISITS IN HEALTH SUMMARY
 N TARGET,X,LINE,IEN,QUIT,NUM,CNT
 ;For Visit instructions and treatments, the default is the latest visit
 S GMTSNDM=$G(GMTSNDM)
 I (GMTSNDM="")!(GMTSNDM=-1) S GMTSNDM=999
 D CKP^GMTSUP Q:$D(GMTSQIT)
 ;Find the visits
 S CNT=0
 S IEN=$C(0)
 F  S IEN=$O(^AUPNVACG("AC",DFN,IEN),-1) Q:IEN=""!(CNT>GMTSNDM)  D
 .Q:$$GET1^DIQ(9000010.51,IEN,1.01)'=""
 .D CKP^GMTSUP Q:$D(GMTSQIT)  I GMTSNPG W !,"Anticoag Data",!
 .S CNT=CNT+1
 .D DATA(IEN)
 Q
DATA(IEN) ;Get the data for the anticoag entry
 N EVDT,WAR,GOAL,MAX,MIN,DUR,START,STOP,COMM,STRING,STRING,COMMENT,END,STRING2
 S STRING2=""
 S EVDT=$$GET1^DIQ(9000010.51,IEN,1201)
 I EVDT="" S EVDT=$$GET1^DIQ(9000010.51,IEN,.03)
 S WAR=$$GET1^DIQ(9000010.51,IEN,.01)
 S GOAL=$$GET1^DIQ(9000010.51,IEN,.04)
 S MIN=$$GET1^DIQ(9000010.51,IEN,.05)
 S MAX=$$GET1^DIQ(9000010.51,IEN,.06)
 S DUR=$$GET1^DIQ(9000010.51,IEN,.07)
 S START=$$GET1^DIQ(9000010.51,IEN,.08)
 S END=$$GET1^DIQ(9000010.51,IEN,.09)
 S COMMENT=$$GET1^DIQ(9000010.51,IEN,1101)
 D CKP^GMTSUP Q:$D(GMTSQIT)
 W !!,"Date: "_EVDT_" Warfarin: "_WAR
 S STRING="Goal: "_GOAL
 I MIN'="" S STRING=STRING_" Min: "_MIN
 I MAX'="" S STRING=STRING_" Max: "_MAX
 D CKP^GMTSUP Q:$D(GMTSQIT)
 W !,STRING
 D CKP^GMTSUP Q:$D(GMTSQIT)
 W !,"Duration: "_DUR
 I START'="" S STRING2="Start "_START
 I END'="" S STRING2=STRING2_" End: "_END
 I STRING2'="" D
 .D CKP^GMTSUP Q:$D(GMTSQIT)
 .W !,STRING2
 I COMMENT'="" D
 .D CKP^GMTSUP Q:$D(GMTSQIT)
 .W !,"Comment: "_COMMENT
 Q
TMPGBL() ;EP
 K ^TMP("BHSCOAG",$J) Q $NA(^($J))