LRMITSEC ;SLC/STAFF - MICRO TREND ENTRY COMPREHENSIVE ;10/19/92 10:08
;;5.2;LAB SERVICE;;Sep 27, 1994
; from LRMITSE
;
D COMP K DIC,DIR,LRDN,X,Y
Q
COMP W !!?10,"Criteria for all reports."
; organism type
W ! K DIR S DIR(0)="LA^1:5",DIR("A")="Select the numbers: ",DIR("B")="" F LRX="B^1","F^2","M^3","P^4","V^5" I $D(LROTYPE($P(LRX,U))) S DIR("B")=DIR("B")_$P(LRX,U,2)_$S($L($O(LROTYPE(LRX))):",",1:"")
K LROTYPE,LRX
S DIR("A",1)="Enter the types of organisms used for all reports."
S DIR("A",2)="1) Bacteria, 2) Fungus, 3) Mycobacteria, 4) Parasite, 5) Virus"
S DIR("?")="Enter numbers for each type of organism to be included on the reports.",DIR("??")=LRHELP
S DIR("?",1)="Enter a number, numbers separated by commas, and/or a range of numbers"
S DIR("?",2)="ex: 1 or 1,3,5 or 1,3-5 or 1-5"
D ^DIR I $D(DIRUT) S LREND=1 Q
S:Y[1 LROTYPE("B")="" S:Y[2 LROTYPE("F")="" S:Y[3 LROTYPE("M")="" S:Y[4 LROTYPE("P")="" S:Y[5 LROTYPE("V")=""
; specific organisms
W ! K DIR S DIR(0)="Y",DIR("A")="Will all reports be for specific organisms",DIR("B")="NO"
S DIR("?")="Enter 'Y'es or 'N'o.",DIR("??")=LRHELP
S DIR("?",1)="Do you want all antibiotic trend data for just selected organisms?"
S DIR("?",2)="This would apply to all types of reports."
D ^DIR I $D(DIRUT) S LREND=1 Q
I Y=1 D Q:LREND
.K DIC S DIC=61.2,DIC(0)="AEMOQZ",DIC("A")="Select Organism: ",DIC("S")="I $L($P(^(0),U,5)),$D(LROTYPE($P(^(0),U,5)))"
.K LRM("O"),LRSORG F D ^DIC Q:Y<1 S LRM("O","S",+Y)=$P(Y,U,2),LRSORG($P(Y(0),U,5),+Y)=""
.I $D(DTOUT) S LREND=1
; length of stay
W ! K DIR S DIR(0)="NA^0:30",DIR("A")="Enter length of stay (days): ",DIR("B")=LRLOS
S DIR("A",1)="Number of days from patient's admission date to collection date of specimen"
S DIR("A",2)="to be excluded from all reports."
S DIR("?")="Enter the number of days.",DIR("??")=LRHELP
S DIR("?",1)="Collections taken before this many days from admission would be excluded."
S DIR("?",2)="Outpatients would also be excluded."
D ^DIR I $D(DIRUT) S LREND=1 Q
S LRLOS=Y
; antibiotic pattern
I $D(LROTYPE("B")) D Q:LREND
.W ! K DIR,LRAP S DIR(0)="Y",DIR("A")="Will all reports require a specific antibiotic pattern",DIR("B")="NO"
.S DIR("?")="Enter 'Y'es or 'N'o.",DIR("??")=LRHELP
.S DIR("?",1)="You may restrict all reports to only those that have specific antibiotic"
.S DIR("?",2)="interpretations."
.D ^DIR I $D(DIRUT) S LREND=1 Q
.I Y=1 D Q:LREND
..K DIC S DIC=62.06,DIC(0)="AEMOQZ",DIC("A")="Select Antibiotic: ",DIC("S")="I +$P(^(0),U,2),$L($P(^(0),U,5))"
..F D ^DIC Q:Y<1 S LRDN=$P(Y(0),U,2) D Q:LREND
...K DIR S DIR(0)="SAM^S:Susceptible;R:Resistant",DIR("A")="Select Interpretation: "
...S DIR("?")="Enter 'S' or 'R'.",DIR("??")=LRHELP
...S DIR("?",1)="Interpretations are evaluated as only S or R."
...S DIR("?",2)="Interpretations of 'I' are counted as 'R'."
...S DIR("?",3)="Interpretations of 'MS' are counted as 'S'."
...D ^DIR I $D(DIRUT) S LREND=1 Q
...S LRAP(LRDN)=Y
..I $D(DTOUT) S LREND=1
; merge criteria
S:'$D(LROTYPE("B")) LRMERGE="N" I $D(LROTYPE("B")) D Q:LREND
.W !!,"Merge criteria for all reports."
.K DIR S DIR(0)="SAM^N:No Merge;S:Specimen;C:Collection sample;A:Any sample",DIR("A")="(N)o merge, (S)pecimen, (C)ollection sample, or (A)ny sample: ",DIR("B")=LRMERGE
.S DIR("?")="Enter 'N'o merge, 'S'pecimen, 'C'olection sample, or 'A'ny sample.",DIR("??")=LRHELP
.S DIR("?",1)="Isolates from the same patient of the same organism can be merged."
.S DIR("?",2)="Merged isolates are only counted once."
.D ^DIR I $D(DIRUT) S LREND=1 Q
.S LRMERGE=Y
; detailed report
W ! K DIR S DIR(0)="Y",DIR("A")="Include detailed patient results on all reports",DIR("B")=$S(LRDETAIL:"YES",1:"NO")
S DIR("?")="Enter 'Y'es or 'N'o.",DIR("??")=LRHELP
S DIR("?",1)="A detailed report includes specific information on all isolates."
S DIR("?",2)="It can be useful in confirming the counts on the trend report."
S DIR("?",3)="This printout is much longer than the usual report."
D ^DIR I $D(DIRUT) S LREND=1 Q
S LRDETAIL=$S(Y:1,1:0)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLRMITSEC 4118 printed Dec 13, 2024@02:17:30 Page 2
LRMITSEC ;SLC/STAFF - MICRO TREND ENTRY COMPREHENSIVE ;10/19/92 10:08
+1 ;;5.2;LAB SERVICE;;Sep 27, 1994
+2 ; from LRMITSE
+3 ;
+4 DO COMP
KILL DIC,DIR,LRDN,X,Y
+5 QUIT
COMP WRITE !!?10,"Criteria for all reports."
+1 ; organism type
+2 WRITE !
KILL DIR
SET DIR(0)="LA^1:5"
SET DIR("A")="Select the numbers: "
SET DIR("B")=""
FOR LRX="B^1","F^2","M^3","P^4","V^5"
IF $DATA(LROTYPE($PIECE(LRX,U)))
SET DIR("B")=DIR("B")_$PIECE(LRX,U,2)_$SELECT($LENGTH($ORDER(LROTYPE(LRX))):",",1:"")
+3 KILL LROTYPE,LRX
+4 SET DIR("A",1)="Enter the types of organisms used for all reports."
+5 SET DIR("A",2)="1) Bacteria, 2) Fungus, 3) Mycobacteria, 4) Parasite, 5) Virus"
+6 SET DIR("?")="Enter numbers for each type of organism to be included on the reports."
SET DIR("??")=LRHELP
+7 SET DIR("?",1)="Enter a number, numbers separated by commas, and/or a range of numbers"
+8 SET DIR("?",2)="ex: 1 or 1,3,5 or 1,3-5 or 1-5"
+9 DO ^DIR
IF $DATA(DIRUT)
SET LREND=1
QUIT
+10 if Y[1
SET LROTYPE("B")=""
if Y[2
SET LROTYPE("F")=""
if Y[3
SET LROTYPE("M")=""
if Y[4
SET LROTYPE("P")=""
if Y[5
SET LROTYPE("V")=""
+11 ; specific organisms
+12 WRITE !
KILL DIR
SET DIR(0)="Y"
SET DIR("A")="Will all reports be for specific organisms"
SET DIR("B")="NO"
+13 SET DIR("?")="Enter 'Y'es or 'N'o."
SET DIR("??")=LRHELP
+14 SET DIR("?",1)="Do you want all antibiotic trend data for just selected organisms?"
+15 SET DIR("?",2)="This would apply to all types of reports."
+16 DO ^DIR
IF $DATA(DIRUT)
SET LREND=1
QUIT
+17 IF Y=1
Begin DoDot:1
+18 KILL DIC
SET DIC=61.2
SET DIC(0)="AEMOQZ"
SET DIC("A")="Select Organism: "
SET DIC("S")="I $L($P(^(0),U,5)),$D(LROTYPE($P(^(0),U,5)))"
+19 KILL LRM("O"),LRSORG
FOR
DO ^DIC
if Y<1
QUIT
SET LRM("O","S",+Y)=$PIECE(Y,U,2)
SET LRSORG($PIECE(Y(0),U,5),+Y)=""
+20 IF $DATA(DTOUT)
SET LREND=1
End DoDot:1
if LREND
QUIT
+21 ; length of stay
+22 WRITE !
KILL DIR
SET DIR(0)="NA^0:30"
SET DIR("A")="Enter length of stay (days): "
SET DIR("B")=LRLOS
+23 SET DIR("A",1)="Number of days from patient's admission date to collection date of specimen"
+24 SET DIR("A",2)="to be excluded from all reports."
+25 SET DIR("?")="Enter the number of days."
SET DIR("??")=LRHELP
+26 SET DIR("?",1)="Collections taken before this many days from admission would be excluded."
+27 SET DIR("?",2)="Outpatients would also be excluded."
+28 DO ^DIR
IF $DATA(DIRUT)
SET LREND=1
QUIT
+29 SET LRLOS=Y
+30 ; antibiotic pattern
+31 IF $DATA(LROTYPE("B"))
Begin DoDot:1
+32 WRITE !
KILL DIR,LRAP
SET DIR(0)="Y"
SET DIR("A")="Will all reports require a specific antibiotic pattern"
SET DIR("B")="NO"
+33 SET DIR("?")="Enter 'Y'es or 'N'o."
SET DIR("??")=LRHELP
+34 SET DIR("?",1)="You may restrict all reports to only those that have specific antibiotic"
+35 SET DIR("?",2)="interpretations."
+36 DO ^DIR
IF $DATA(DIRUT)
SET LREND=1
QUIT
+37 IF Y=1
Begin DoDot:2
+38 KILL DIC
SET DIC=62.06
SET DIC(0)="AEMOQZ"
SET DIC("A")="Select Antibiotic: "
SET DIC("S")="I +$P(^(0),U,2),$L($P(^(0),U,5))"
+39 FOR
DO ^DIC
if Y<1
QUIT
SET LRDN=$PIECE(Y(0),U,2)
Begin DoDot:3
+40 KILL DIR
SET DIR(0)="SAM^S:Susceptible;R:Resistant"
SET DIR("A")="Select Interpretation: "
+41 SET DIR("?")="Enter 'S' or 'R'."
SET DIR("??")=LRHELP
+42 SET DIR("?",1)="Interpretations are evaluated as only S or R."
+43 SET DIR("?",2)="Interpretations of 'I' are counted as 'R'."
+44 SET DIR("?",3)="Interpretations of 'MS' are counted as 'S'."
+45 DO ^DIR
IF $DATA(DIRUT)
SET LREND=1
QUIT
+46 SET LRAP(LRDN)=Y
End DoDot:3
if LREND
QUIT
+47 IF $DATA(DTOUT)
SET LREND=1
End DoDot:2
if LREND
QUIT
End DoDot:1
if LREND
QUIT
+48 ; merge criteria
+49 if '$DATA(LROTYPE("B"))
SET LRMERGE="N"
IF $DATA(LROTYPE("B"))
Begin DoDot:1
+50 WRITE !!,"Merge criteria for all reports."
+51 KILL DIR
SET DIR(0)="SAM^N:No Merge;S:Specimen;C:Collection sample;A:Any sample"
SET DIR("A")="(N)o merge, (S)pecimen, (C)ollection sample, or (A)ny sample: "
SET DIR("B")=LRMERGE
+52 SET DIR("?")="Enter 'N'o merge, 'S'pecimen, 'C'olection sample, or 'A'ny sample."
SET DIR("??")=LRHELP
+53 SET DIR("?",1)="Isolates from the same patient of the same organism can be merged."
+54 SET DIR("?",2)="Merged isolates are only counted once."
+55 DO ^DIR
IF $DATA(DIRUT)
SET LREND=1
QUIT
+56 SET LRMERGE=Y
End DoDot:1
if LREND
QUIT
+57 ; detailed report
+58 WRITE !
KILL DIR
SET DIR(0)="Y"
SET DIR("A")="Include detailed patient results on all reports"
SET DIR("B")=$SELECT(LRDETAIL:"YES",1:"NO")
+59 SET DIR("?")="Enter 'Y'es or 'N'o."
SET DIR("??")=LRHELP
+60 SET DIR("?",1)="A detailed report includes specific information on all isolates."
+61 SET DIR("?",2)="It can be useful in confirming the counts on the trend report."
+62 SET DIR("?",3)="This printout is much longer than the usual report."
+63 DO ^DIR
IF $DATA(DIRUT)
SET LREND=1
QUIT
+64 SET LRDETAIL=$SELECT(Y:1,1:0)
+65 QUIT