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

QANQIP1.m

Go to the documentation of this file.
QANQIP1 ;HISC/GJC-Interface with QUIC, tracking IR V2.0 data. ;4/13/93  10:00
 ;;2.0;Incident Reporting;**18**;08/07/1992
 S QANINCD(1)=$O(^QA(742.1,"BUPPER","ASSAULT-PATIENT TO PATIENT",0))
 S QANINCD(2)=$O(^QA(742.1,"BUPPER","PATIENT ABUSE",0))
 I QANINCD(1)=""!(QANINCD(2)="") W !?5,"Incident data incomplete, check the QA Incident file." S QANEXIT=1 Q
 F QAN=QANBDT:0 S QAN=$O(^QA(742.4,"BDT",QAN)) Q:QAN'>0!(QAN>QANEDT)  F QAN7424=0:0 S QAN7424=$O(^QA(742.4,"BDT",QAN,QAN7424)) Q:QAN7424'>0  D EXTRCT1
 Q
EXTRCT1 ;Grab the appropriate data.
 S QAN7424(0)=$G(^QA(742.4,QAN7424,0)) Q:QAN7424(0)']""  S QANINCD=$P(QAN7424(0),U,2)
 Q:$P(QAN7424(0),U,8)=2  ;Deleted incident.
 Q:QANINCD'=QANINCD(1)&(QANINCD'=QANINCD(2))
 Q:QANINCD=QANINCD(2)&(+$P(QAN7424(0),U,16)'=1)
 S QANINAM=$P(^QA(742.1,QANINCD,0),U)
 S QANINAM=$S(QANINAM="Assault-Patient to Patient":"PATIENT ASSAULT",1:"PATIENT ABUSE")
 F QAN742=0:0 S QAN742=$O(^QA(742,"BCS",QAN7424,QAN742)) Q:QAN742'>0  S QAN742(0)=$G(^QA(742,QAN742,0)) Q:QAN742(0)']""  D EXTRCT2
 Q
EXTRCT2 ;Total the data.
 S QANPTTY=$S($P(QAN742(0),U,5)=1:"IN",$P(QAN742(0),U,5)=0:"OUT",1:"") Q:QANPTTY']""
 I '$D(ARRAY(QANINAM,QANPTTY)) S ARRAY(QANINAM,QANPTTY)=1
 E  S ARRAY(QANINAM,QANPTTY)=ARRAY(QANINAM,QANPTTY)+1
 S ^TMP($J,"XREF",QAN7424,QAN742)="" ;Setting xref node for data output.
 Q