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

LRMITSPS.m

Go to the documentation of this file.
LRMITSPS ;VA/SLC/STAFF - MICRO TREND PROCESS SETUP ;JUL 06, 2010 3:14 PM
 ;;5.2;LAB SERVICE;**257,1027**;NOV 01, 1997
 ; from LRMITSPO
 ;
 S LRMERGEV=$S(LRMERGE="S":LRSPECN,LRMERGE="C":LRCOLN,1:0)
 ; setup data for each report type
 ;MULTIDIVISIONAL PATCH LR*5.2*257 02/01
 F LRTYPE="O;LRORGN;LRORGNM","S;LRSPECN;LRSPECNM","L;LRLOCN;LRLOCNM","D;LRDOCN;LRDOCNM","P;LRPATN;LRPATNM","C;LRCOLN;LRCOLNM","DIV;LRDIV;LRDIVNM" I $D(LRM($P(LRTYPE,";"))) D
 .S LRRTYPE=$P(LRTYPE,";"),LRGPN=@$P(LRTYPE,";",2),LRGPNM=@$P(LRTYPE,";",3)
 .; count patients for report type
 .I $D(LRM(LRRTYPE,"A")) S ^TMP($J,"PAT",LRRTYPE,LRPATN)=""
 .I $D(LRM(LRRTYPE,"S",LRGPN)) S ^TMP($J,"PAT",LRRTYPE,LRPATN)=""
 .; setup isolate data
 .S LRN1=$G(^TMP($J,LRRTYPE,LRGPNM,LRGPN,LRORGNM,LRORGN))
 .I 'LRN1 D
 ..S (LRN1,LRSEQN)=LRSEQN+1
 ..S ^TMP($J,LRRTYPE,LRGPNM,LRGPN,LRORGNM,LRORGN)=LRN1
 .S LRN2=$G(^TMP($J,LRN1,"P",LRPATNM,LRPATN,LRSPECNM,LRSPECN))
 .I 'LRN2 D
 ..S (LRN2,LRSEQN)=LRSEQN+1
 ..S ^TMP($J,LRN1,"P",LRPATNM,LRPATN,LRSPECNM,LRSPECN)=LRN2
 .S (LRN3,LRSEQN)=LRSEQN+1
 .S ^(LRGPN)=$G(^TMP($J,LRRTYPE,LRGPNM,LRGPN))+1
 .S ^TMP($J,LRN2,LRCDATE,LRSUBN)=LRN3_U_LRACC_U_LRPLOS_U_LRCOLN
 .S ^TMP($J,"M",LRN1,LRPATN_";"_LRORGN_";"_LRMERGEV,-LRN3)=LRN2_U_LRCDATE_U_LRSUBN
 .; setup bacteria antibiotic data
 .S LRDN=0 F  S LRDN=$O(LRANTIM(LRDN)) Q:LRDN<2  D
 ..S LRANTINM=$P($G(^TMP($J,"A",LRDN)),U,2) Q:'$L(LRANTINM)
 ..S ^TMP($J,LRN3,"A",LRANTINM)=LRANTIM(LRDN)
 .; setup mycobatcteria antibiotic data
 .S LRDN=0 F  S LRDN=$O(LRTB(LRDN)) Q:LRDN<2  D
 ..S LRANTINM=$P($G(^TMP($J,"T",LRDN)),U) Q:'$L(LRANTINM)
 ..S ^TMP($J,LRN3,"T",LRANTINM)=LRTB(LRDN)
 Q