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

BEDDTRPT.m

Go to the documentation of this file.
BEDDTRPT ;VNGT/HS/BEE-BEDD ED Triage Report  ; 08 Nov 2011  12:00 PM
 ;;2.0;BEDD DASHBOARD;;Jun 04, 2014;Build 13
 ;
 ;Adapted from BEDDTRGRPT/CNHS/RPF
 ;
 Q
 ;
EN(BEDDDFN,SITE,BEDDRPT) ;EP - BEDD ED Triage Report
 ;
 ; Input:
 ; BEDDDFN - Patient DFN
 ; SITE - Site
 ;
 ; Output:
 ; BEDDRPT Array
 ;
 S BEDDDFN=$G(BEDDDFN,"")
 ;
 ;Error Trapping
 NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BEDDTRPT D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
 ;
 NEW PNAME,PCHRT,PSEX,PDOB,VIEN,MIEN,DFN,RCNT
 K BEDDRPT
 S DFN=BEDDDFN
 S PNAME=$$GET1^DIQ(2,DFN_",",.01,"E")
 S PSEX=$$GET1^DIQ(2,DFN_",",.02,"E")
 S PDOB=$$FMTE^BEDDUTIL($$GET1^DIQ(2,DFN_",",.03,"I"))
 S PCHRT=$$GET1^DIQ(9000001.41,SITE_","_DFN_",",.02,"E")
 ;
 S VIEN=$$GET1^DIQ(9009081,DFN_",",1.1,"I")
 ;
 ;Display the ED Triage Report
 ;
 S RCNT=1,BEDDRPT(RCNT)="***ALERT***  THIS PAPER CONTAINS HEALTH INFORMATION *** ALERT ***"
 S RCNT=RCNT+1,BEDDRPT(RCNT)=""
 S RCNT=RCNT+1,BEDDRPT(RCNT)=PNAME
 S RCNT=RCNT+1,BEDDRPT(RCNT)="Chart Number: "_PCHRT_" - "_PSEX_" - DOB: "_PDOB
 S RCNT=RCNT+2,BEDDRPT(RCNT)=""
 S RCNT=RCNT+1,BEDDRPT(RCNT)="Patient Allergies: "_$$PTALG^BEDDUTIL(DFN)
 S RCNT=RCNT+1,BEDDRPT(RCNT)=""
 S RCNT=RCNT+1,BEDDRPT(RCNT)="TRIAGE LEVEL: "_$$GET1^DIQ(9009081,DFN_",",20,"I")
 S RCNT=RCNT+1
 S RCNT=RCNT+1,BEDDRPT(RCNT)="Chief Complaint: "_$$GET1^DIQ(9009081,DFN_",",8,"E")
 S RCNT=RCNT+1,BEDDRPT(RCNT)=""
 S RCNT=RCNT+1,BEDDRPT(RCNT)="Measurements: "
 ;
 ;Measurements
 S MIEN="" F  S MIEN=$O(^AUPNVMSR("AD",VIEN,MIEN)) Q:MIEN=""  D
 . ;
 . NEW MEAS,MVAL,MWHO,MDTM
 . S MEAS=$$GET1^DIQ(9000010.01,MIEN_",",.04,"E")
 . S MVAL=$$GET1^DIQ(9000010.01,MIEN_",",.01,"E")
 . S MWHO=$$GET1^DIQ(9000010.01,MIEN_",",1204,"E")
 . S MDTM=$P(^AUPNVMSR(MIEN,12),"^",1)
 . S RCNT=RCNT+1,BEDDRPT(RCNT)=$$FMTE^BEDDUTIL(MDTM)_" by "_MWHO
 . S RCNT=RCNT+1,BEDDRPT(RCNT)=MVAL_" - "_MEAS
 . S RCNT=RCNT+1,BEDDRPT(RCNT)=""
 S RCNT=RCNT+1
 Q
 ;
ERR ;EP - Capture the error
 D ^%ZTER
 Q