LRMITSES ;SLC/STAFF - MICRO TREND ENTRY SELECTIONS ;10/18/92  16:03
 ;;5.2;LAB SERVICE;**96,257**;Sep 27, 1994
 ; from LRMITSE
 ;
 D SELECT K D,DIC,DIR,DFN,LRASK,LRDFN,LRDPF,LRPROMPT,LRPX,PNM,SSN,X,Y
 Q
SELECT W !!!?10,"Types of reports to be generated."
 ; go thru the report types
 F LRASK="O","S","L","D","P","C" D  Q:LREND
 .; if specific organisms are used on all reports, prompt only to print report
 .I $D(LRSORG),LRASK="O" D  Q
 ..W ! K DIR S DIR(0)="Y",DIR("A")="Include report for organisms",DIR("B")="YES"
 ..S DIR("?")="Enter 'Y'es or 'N'o",DIR("??")=LRHELP
 ..S DIR("?",1)="You have already selected organisms for all report types."
 ..S DIR("?",2)="You may select whether or not to include a report grouped by organisms."
 ..D ^DIR I $D(DIRUT) S LREND=1 Q
 ..I 'Y K LRM("O")
 .S LRPROMPT=$S(LRASK="L":"Location",LRASK="O":"Organism",LRASK="D":"Physician",LRASK="P":"Patient",LRASK="C":"Col Samp",1:"Site/Spec") W !!,"Report by:  ",LRPROMPT
 .S LRPX=$S($D(LRM(LRASK,"A")):"All",1:"No") K DIC,DIR,LRM(LRASK)
 .S DIR(0)="SAM^A:All;S:Selected;N:No",DIR("A")="(A)ll "_LRPROMPT_"s, (S)elected "_LRPROMPT_"s, or (N)o "_LRPROMPT_" Report? ",DIR("B")=LRPX
 .S DIR("?")="Enter 'A'll, 'S'elected, or 'N'o.",DIR("??")=LRHELP
 .S DIR("?",1)="Select 'A' to obtain a report grouped by all "_LRPROMPT_"s."
 .S DIR("?",2)="Select 'S' to obtain a report grouped for selected "_LRPROMPT_"s."
 .S DIR("?",3)="Select 'N' if you DO NOT want a report grouped by "_LRPROMPT_"."
 .S DIR("?",4)="Enter '^' to exit."
 .D ^DIR I $D(DIRUT) S LREND=1 Q
 .I Y="A" S LRM(LRASK,"A")=""
 .; if specific values are requested, obtain selections
 .I Y="S" D
 ..I LRASK="L" S DIC=44,DIC(0)="AEMOQ",DIC("A")="Select Location: " F  D ^DIC Q:Y<1  S LRM(LRASK,"S",+Y)=$P(Y,U,2)
 ..I LRASK="O" S DIC=61.2,DIC(0)="AEMOQ",DIC("A")="Select Organism: ",DIC("S")="I $L($P(^(0),U,5)),$D(LROTYPE($P(^(0),U,5)))" F  D ^DIC K DIC Q:Y<1  S LRM(LRASK,"S",+Y)=$P(Y,U,2)
 ..I LRASK="D" F  S DIC=200,DIC(0)="AEQ",DIC("A")="Select Physician: ",D="AK.PROVIDER" D IX^DIC Q:Y<1  S LRM(LRASK,"S",+Y)=$P(Y,U,2)
 ..I LRASK="S" S DIC=61,DIC(0)="AEMOQ",DIC("A")="Select Site/Specimen: " F  D ^DIC Q:Y<1  S LRM(LRASK,"S",+Y)=$P(Y,U,2)
 ..I LRASK="P" F  D ^LRDPA Q:LRDFN=-1!$D(DUOUT)!$D(DTOUT)  S LRM(LRASK,"S",DFN)=PNM_U_LRDFN
 ..I LRASK="C" S DIC=62,DIC(0)="AEMOQ",DIC("A")="Select Collection Sample: " F  D ^DIC Q:Y<1  S LRM(LRASK,"S",+Y)=$P(Y,U,2)
 Q
 
--- Routine Detail   --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLRMITSES   2437     printed  Sep 23, 2025@19:53:11                                                                                                                                                                                                    Page 2
LRMITSES  ;SLC/STAFF - MICRO TREND ENTRY SELECTIONS ;10/18/92  16:03
 +1       ;;5.2;LAB SERVICE;**96,257**;Sep 27, 1994
 +2       ; from LRMITSE
 +3       ;
 +4        DO SELECT
           KILL D,DIC,DIR,DFN,LRASK,LRDFN,LRDPF,LRPROMPT,LRPX,PNM,SSN,X,Y
 +5        QUIT 
SELECT     WRITE !!!?10,"Types of reports to be generated."
 +1       ; go thru the report types
 +2        FOR LRASK="O","S","L","D","P","C"
               Begin DoDot:1
 +3       ; if specific organisms are used on all reports, prompt only to print report
 +4                IF $DATA(LRSORG)
                       IF LRASK="O"
                           Begin DoDot:2
 +5                            WRITE !
                               KILL DIR
                               SET DIR(0)="Y"
                               SET DIR("A")="Include report for organisms"
                               SET DIR("B")="YES"
 +6                            SET DIR("?")="Enter 'Y'es or 'N'o"
                               SET DIR("??")=LRHELP
 +7                            SET DIR("?",1)="You have already selected organisms for all report types."
 +8                            SET DIR("?",2)="You may select whether or not to include a report grouped by organisms."
 +9                            DO ^DIR
                               IF $DATA(DIRUT)
                                   SET LREND=1
                                   QUIT 
 +10                           IF 'Y
                                   KILL LRM("O")
                           End DoDot:2
                           QUIT 
 +11               SET LRPROMPT=$SELECT(LRASK="L":"Location",LRASK="O":"Organism",LRASK="D":"Physician",LRASK="P":"Patient",LRASK="C":"Col Samp",1:"Site/Spec")
                   WRITE !!,"Report by:  ",LRPROMPT
 +12               SET LRPX=$SELECT($DATA(LRM(LRASK,"A")):"All",1:"No")
                   KILL DIC,DIR,LRM(LRASK)
 +13               SET DIR(0)="SAM^A:All;S:Selected;N:No"
                   SET DIR("A")="(A)ll "_LRPROMPT_"s, (S)elected "_LRPROMPT_"s, or (N)o "_LRPROMPT_" Report? "
                   SET DIR("B")=LRPX
 +14               SET DIR("?")="Enter 'A'll, 'S'elected, or 'N'o."
                   SET DIR("??")=LRHELP
 +15               SET DIR("?",1)="Select 'A' to obtain a report grouped by all "_LRPROMPT_"s."
 +16               SET DIR("?",2)="Select 'S' to obtain a report grouped for selected "_LRPROMPT_"s."
 +17               SET DIR("?",3)="Select 'N' if you DO NOT want a report grouped by "_LRPROMPT_"."
 +18               SET DIR("?",4)="Enter '^' to exit."
 +19               DO ^DIR
                   IF $DATA(DIRUT)
                       SET LREND=1
                       QUIT 
 +20               IF Y="A"
                       SET LRM(LRASK,"A")=""
 +21      ; if specific values are requested, obtain selections
 +22               IF Y="S"
                       Begin DoDot:2
 +23                       IF LRASK="L"
                               SET DIC=44
                               SET DIC(0)="AEMOQ"
                               SET DIC("A")="Select Location: "
                               FOR 
                                   DO ^DIC
                                   if Y<1
                                       QUIT 
                                   SET LRM(LRASK,"S",+Y)=$PIECE(Y,U,2)
 +24                       IF LRASK="O"
                               SET DIC=61.2
                               SET DIC(0)="AEMOQ"
                               SET DIC("A")="Select Organism: "
                               SET DIC("S")="I $L($P(^(0),U,5)),$D(LROTYPE($P(^(0),U,5)))"
                               FOR 
                                   DO ^DIC
                                   KILL DIC
                                   if Y<1
                                       QUIT 
                                   SET LRM(LRASK,"S",+Y)=$PIECE(Y,U,2)
 +25                       IF LRASK="D"
                               FOR 
                                   SET DIC=200
                                   SET DIC(0)="AEQ"
                                   SET DIC("A")="Select Physician: "
                                   SET D="AK.PROVIDER"
                                   DO IX^DIC
                                   if Y<1
                                       QUIT 
                                   SET LRM(LRASK,"S",+Y)=$PIECE(Y,U,2)
 +26                       IF LRASK="S"
                               SET DIC=61
                               SET DIC(0)="AEMOQ"
                               SET DIC("A")="Select Site/Specimen: "
                               FOR 
                                   DO ^DIC
                                   if Y<1
                                       QUIT 
                                   SET LRM(LRASK,"S",+Y)=$PIECE(Y,U,2)
 +27                       IF LRASK="P"
                               FOR 
                                   DO ^LRDPA
                                   if LRDFN=-1!$DATA(DUOUT)!$DATA(DTOUT)
                                       QUIT 
                                   SET LRM(LRASK,"S",DFN)=PNM_U_LRDFN
 +28                       IF LRASK="C"
                               SET DIC=62
                               SET DIC(0)="AEMOQ"
                               SET DIC("A")="Select Collection Sample: "
                               FOR 
                                   DO ^DIC
                                   if Y<1
                                       QUIT 
                                   SET LRM(LRASK,"S",+Y)=$PIECE(Y,U,2)
                       End DoDot:2
               End DoDot:1
               if LREND
                   QUIT 
 +29       QUIT