LREPIRP5 ;VA/DALOI/CKA-EMERGING PATHOGENS HL7 REPORT CONVERSION ; 17-Oct-2014 09:22 ; MKK
;;5.2;LAB SERVICE;**281,320,1030,1034**;NOV 01, 1997;Build 88
Q
;
SUMMARY ;BUILD SUMMARY REPORT
; BUILD SUMMARY INFO
F LRPATH=1:1:23 S LRTOT(LRPATH)=0
S LRPATH=0
F S LRPATH=$O(^XTMP("LREPIREP"_LRDATE,"TOTAL",LRPATH)) Q:LRPATH="" D
.S LRTOT(LRPATH)=^XTMP("LREPIREP"_LRDATE,"TOTAL",LRPATH)
S MSG="NTE~1-Vancomycin-resistant Enterococcus"
S MSG=MSG_$E(LRSP,1,17)_$J($P(LRTOT(1),U),5)_" "_$J($P(LRTOT(1),U,2),5)
S ^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
S MSG="NTE~2-Hepatitis C antibody Positive"
S MSG=MSG_$E(LRSP,1,21)_$J($P(LRTOT(2),U),5)_" "_$J($P(LRTOT(2),U,2),5)
S ^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
S MSG="NTE~3-Penicillin-Resistant Streptococcus pneumoniae"
S MSG=MSG_$E(LRSP,1,5)_$J($P(LRTOT(3),U),5)_" "_$J($P(LRTOT(3),U,2),5)
S ^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
S MSG="NTE~4-Clostridium difficile"
S MSG=MSG_$E(LRSP,1,29)_$J($P(LRTOT(4),U),5)_" "_$J($P(LRTOT(4),U,2),5)
S ^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
S MSG="NTE~5-Tuberculosis"
S MSG=MSG_LRSP_$E(LRSP,1,8)_$J($P(LRTOT(5),U),5)_" "_$J($P(LRTOT(5),U,2),5)
S ^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
S MSG="NTE~6-Streptococcus, Group A"
S MSG=MSG_$E(LRSP,1,28)_$J($P(LRTOT(6),U),5)_" "_$J($P(LRTOT(6),U,2),5)
S ^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
S MSG="NTE~7-Legionella/Legionaire's Disease"
S MSG=MSG_$E(LRSP,1,19)_$J($P(LRTOT(7),U),5)_" "_$J($P(LRTOT(7),U,2),5)
S ^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
S MSG="NTE~8-Candida bloodstream infections"
S MSG=MSG_$E(LRSP,1,20)_$J($P(LRTOT(8),U),5)_" "_$J($P(LRTOT(8),U,2),5)
S ^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
S MSG="NTE~9-Crytosporidium"
S MSG=MSG_LRSP_$E(LRSP,1,6)_$J($P(LRTOT(9),U),5)_" "_$J($P(LRTOT(9),U,2),5)
S ^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
S MSG="NTE~10-Escherichia coli O157"
S MSG=MSG_$E(LRSP,1,28)_$J($P(LRTOT(10),U),5)_" "_$J($P(LRTOT(10),U,2),5)
S ^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
S MSG="NTE~11-Malaria"
S MSG=MSG_LRSP_$E(LRSP,1,12)_$J($P(LRTOT(11),U),5)_" "_$J($P(LRTOT(11),U,2),5)
S ^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
S MSG="NTE~12-Dengue"
S MSG=MSG_LRSP_$E(LRSP,1,13)_$J($P(LRTOT(12),U),5)_" "_$J($P(LRTOT(12),U,2),5)
S ^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
S MSG="NTE~13-Creutzfeldt-Jakob Disease"
S MSG=MSG_$E(LRSP,1,24)_$J($P(LRTOT(13),U),5)_" "_$J($P(LRTOT(13),U,2),5)
S ^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
S MSG="NTE~14-Leishmaniasis"
S MSG=MSG_LRSP_$E(LRSP,1,6)_$J($P(LRTOT(14),U),5)_" "_$J($P(LRTOT(14),U,2),5)
S ^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
S MSG="NTE~15-Hepatitis C antibody negative"
S MSG=MSG_$E(LRSP,1,20)_$J($P(LRTOT(15),U),5)_" "_$J($P(LRTOT(15),U,2),5)
S ^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
S MSG="NTE~16-Hepatitis A antibody positive"
S MSG=MSG_$E(LRSP,1,20)_$J($P(LRTOT(16),U),5)_" "_$J($P(LRTOT(16),U,2),5)
S ^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
S MSG="NTE~17-Hepatitis B positive"
S MSG=MSG_$E(LRSP,1,29)_$J($P(LRTOT(17),U),5)_" "_$J($P(LRTOT(17),U,2),5)
S ^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
S MSG="NTE~18-All Staphylococcus Aureus"
S MSG=MSG_$E(LRSP,1,24)_$J($P(LRTOT(18),U),5)_" "_$J($P(LRTOT(18),U,2),5)
S ^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
S MSG="NTE~19-Methicillin-Resistant Staphylococcus Aureus (Mrsa)"
S MSG=MSG_$J($P(LRTOT(19),U),4)_" "_$J($P(LRTOT(19),U,2),5)
S ^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
S MSG="NTE~20-Vancomycin-Resistant Staphylococcus Aureus (Vrsa)"
S MSG=MSG_$J($P(LRTOT(20),U),5)_" "_$J($P(LRTOT(20),U,2),5)
S ^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
S MSG="NTE~21-Vancomycin-Resistant Coagulase Negative"
S ^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
S MSG=" Staphylococci/Staph EPI (Vrse)"
S MSG=MSG_$E(LRSP,1,19)_$J($P(LRTOT(21),U),5)_" "_$J($P(LRTOT(21),U,2),5)
S ^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
S MSG="NTE~22-All Streptococcus Pneumoniae"
S MSG=MSG_$E(LRSP,1,21)_$J($P(LRTOT(22),U),5)_" "_$J($P(LRTOT(22),U,2),5)
S ^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
S MSG="NTE~23-All Enterococci"
S MSG=MSG_LRSP_$E(LRSP,1,4)_$J($P(LRTOT(23),U),5)_" "_$J($P(LRTOT(23),U,2),5)
S ^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
Q
PRTTOT ;Print totals on summary report
S MSG="",^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
S MSG="Processing Month: "_LRHDGL2_" for site # "_$P(SITE,U,3)_" "_$P(SITE,U,2)
S ^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
S MSG="Site totals"
S ^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
S MSG="",^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
S LRNUM=0
F S LRNUM=$O(^XTMP("LREPIREP"_LRDATE,"TOTAL1",LRNUM)) Q:LRNUM="" D
.S MSG=$P($P(^XTMP("LREPIREP"_LRDATE,"TOTAL1",LRNUM),HLFS,3),LRCS,3)
.I 60-$L(MSG)>30 S MSG=MSG_LRSP
.I 60-$L(MSG)>30 S MSG=MSG_LRSP
.S MSG=MSG_$E(LRSP,1,60-$L(MSG))
.S MSG=MSG_$J($P($P(^XTMP("LREPIREP"_LRDATE,"TOTAL1",LRNUM),HLFS,3),LRCS,4),5)
.S ^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
Q
PRTHEP ;PRINT HEP C RISK ASSESSMENT TOTALS
F LRNUM=1:1:7 S LRTOT(LRNUM)=+$G(^XTMP("LREPIREP"_LRDATE,"HEPTOT",LRNUM))
S MSG="Resolved term-1-Declined Assessment for Hepatitis C"
S MSG=MSG_$E(LRSP,1,9)_$J($P(LRTOT(1),U),5)
S ^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
S MSG="Resolved term-2-No Risk Factors for Hepatitis C"
S MSG=MSG_$E(LRSP,1,13)_$J($P(LRTOT(2),U),5)
S ^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
S MSG="Resolved term-3-Previously Assessed for Hepatitis C"
S MSG=MSG_$E(LRSP,1,9)_$J($P(LRTOT(3),U),5)
S ^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
S MSG="Resolved term-4-Risk Factors for Hepatitis C"
S MSG=MSG_$E(LRSP,1,16)_$J($P(LRTOT(4),U),5)
S ^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
S MSG="Resolved term-5-Positive Test for Hepatitis C antibody"
S MSG=MSG_$E(LRSP,1,6)_$J($P(LRTOT(5),U),5)
S ^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
S MSG="Resolved term-6-Negative Test for Hepatitis C antibody"
S MSG=MSG_$E(LRSP,1,6)_$J($P(LRTOT(6),U),5)
S ^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
; S MSG="Resolved term-7-Hepatitis C diagnosis (ICD-9 based)"
S MSG="Resolved term-7-Hepatitis C diagnosis (ICD based)" ; IHS/MSC/MKK - LR*5.2*1034
S MSG=MSG_$E(LRSP,1,9)_$J($P(LRTOT(7),U),5)
S ^TMP($J,"MSG",MSGCNT)=MSG,MSGCNT=MSGCNT+1
S ^TMP($J,"MSG",MSGCNT)=LRSP_LRSP_"-----"
S MSGCNT=MSGCNT+1
S LRTOT=LRTOT(1)+LRTOT(2)+LRTOT(3)+LRTOT(4)+LRTOT(5)+LRTOT(6)+LRTOT(7)
S ^TMP($J,"MSG",MSGCNT)="Total Hepatitis C Risk Assessment Resolution"_$E(LRSP,1,16)_$J(LRTOT,5)
S MSGCNT=MSGCNT+1
;
Q
LREPIRP5 ;VA/DALOI/CKA-EMERGING PATHOGENS HL7 REPORT CONVERSION ; 17-Oct-2014 09:22 ; MKK
+1 ;;5.2;LAB SERVICE;**281,320,1030,1034**;NOV 01, 1997;Build 88
+2 QUIT
+3 ;
SUMMARY ;BUILD SUMMARY REPORT
+1 ; BUILD SUMMARY INFO
+2 FOR LRPATH=1:1:23
SET LRTOT(LRPATH)=0
+3 SET LRPATH=0
+4 FOR
SET LRPATH=$ORDER(^XTMP("LREPIREP"_LRDATE,"TOTAL",LRPATH))
IF LRPATH=""
QUIT
Begin DoDot:1
+5 SET LRTOT(LRPATH)=^XTMP("LREPIREP"_LRDATE,"TOTAL",LRPATH)
End DoDot:1
+6 SET MSG="NTE~1-Vancomycin-resistant Enterococcus"
+7 SET MSG=MSG_$EXTRACT(LRSP,1,17)_$JUSTIFY($PIECE(LRTOT(1),U),5)_" "_$JUSTIFY($PIECE(LRTOT(1),U,2),5)
+8 SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
+9 SET MSG="NTE~2-Hepatitis C antibody Positive"
+10 SET MSG=MSG_$EXTRACT(LRSP,1,21)_$JUSTIFY($PIECE(LRTOT(2),U),5)_" "_$JUSTIFY($PIECE(LRTOT(2),U,2),5)
+11 SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
+12 SET MSG="NTE~3-Penicillin-Resistant Streptococcus pneumoniae"
+13 SET MSG=MSG_$EXTRACT(LRSP,1,5)_$JUSTIFY($PIECE(LRTOT(3),U),5)_" "_$JUSTIFY($PIECE(LRTOT(3),U,2),5)
+14 SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
+15 SET MSG="NTE~4-Clostridium difficile"
+16 SET MSG=MSG_$EXTRACT(LRSP,1,29)_$JUSTIFY($PIECE(LRTOT(4),U),5)_" "_$JUSTIFY($PIECE(LRTOT(4),U,2),5)
+17 SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
+18 SET MSG="NTE~5-Tuberculosis"
+19 SET MSG=MSG_LRSP_$EXTRACT(LRSP,1,8)_$JUSTIFY($PIECE(LRTOT(5),U),5)_" "_$JUSTIFY($PIECE(LRTOT(5),U,2),5)
+20 SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
+21 SET MSG="NTE~6-Streptococcus, Group A"
+22 SET MSG=MSG_$EXTRACT(LRSP,1,28)_$JUSTIFY($PIECE(LRTOT(6),U),5)_" "_$JUSTIFY($PIECE(LRTOT(6),U,2),5)
+23 SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
+24 SET MSG="NTE~7-Legionella/Legionaire's Disease"
+25 SET MSG=MSG_$EXTRACT(LRSP,1,19)_$JUSTIFY($PIECE(LRTOT(7),U),5)_" "_$JUSTIFY($PIECE(LRTOT(7),U,2),5)
+26 SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
+27 SET MSG="NTE~8-Candida bloodstream infections"
+28 SET MSG=MSG_$EXTRACT(LRSP,1,20)_$JUSTIFY($PIECE(LRTOT(8),U),5)_" "_$JUSTIFY($PIECE(LRTOT(8),U,2),5)
+29 SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
+30 SET MSG="NTE~9-Crytosporidium"
+31 SET MSG=MSG_LRSP_$EXTRACT(LRSP,1,6)_$JUSTIFY($PIECE(LRTOT(9),U),5)_" "_$JUSTIFY($PIECE(LRTOT(9),U,2),5)
+32 SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
+33 SET MSG="NTE~10-Escherichia coli O157"
+34 SET MSG=MSG_$EXTRACT(LRSP,1,28)_$JUSTIFY($PIECE(LRTOT(10),U),5)_" "_$JUSTIFY($PIECE(LRTOT(10),U,2),5)
+35 SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
+36 SET MSG="NTE~11-Malaria"
+37 SET MSG=MSG_LRSP_$EXTRACT(LRSP,1,12)_$JUSTIFY($PIECE(LRTOT(11),U),5)_" "_$JUSTIFY($PIECE(LRTOT(11),U,2),5)
+38 SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
+39 SET MSG="NTE~12-Dengue"
+40 SET MSG=MSG_LRSP_$EXTRACT(LRSP,1,13)_$JUSTIFY($PIECE(LRTOT(12),U),5)_" "_$JUSTIFY($PIECE(LRTOT(12),U,2),5)
+41 SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
+42 SET MSG="NTE~13-Creutzfeldt-Jakob Disease"
+43 SET MSG=MSG_$EXTRACT(LRSP,1,24)_$JUSTIFY($PIECE(LRTOT(13),U),5)_" "_$JUSTIFY($PIECE(LRTOT(13),U,2),5)
+44 SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
+45 SET MSG="NTE~14-Leishmaniasis"
+46 SET MSG=MSG_LRSP_$EXTRACT(LRSP,1,6)_$JUSTIFY($PIECE(LRTOT(14),U),5)_" "_$JUSTIFY($PIECE(LRTOT(14),U,2),5)
+47 SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
+48 SET MSG="NTE~15-Hepatitis C antibody negative"
+49 SET MSG=MSG_$EXTRACT(LRSP,1,20)_$JUSTIFY($PIECE(LRTOT(15),U),5)_" "_$JUSTIFY($PIECE(LRTOT(15),U,2),5)
+50 SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
+51 SET MSG="NTE~16-Hepatitis A antibody positive"
+52 SET MSG=MSG_$EXTRACT(LRSP,1,20)_$JUSTIFY($PIECE(LRTOT(16),U),5)_" "_$JUSTIFY($PIECE(LRTOT(16),U,2),5)
+53 SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
+54 SET MSG="NTE~17-Hepatitis B positive"
+55 SET MSG=MSG_$EXTRACT(LRSP,1,29)_$JUSTIFY($PIECE(LRTOT(17),U),5)_" "_$JUSTIFY($PIECE(LRTOT(17),U,2),5)
+56 SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
+57 SET MSG="NTE~18-All Staphylococcus Aureus"
+58 SET MSG=MSG_$EXTRACT(LRSP,1,24)_$JUSTIFY($PIECE(LRTOT(18),U),5)_" "_$JUSTIFY($PIECE(LRTOT(18),U,2),5)
+59 SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
+60 SET MSG="NTE~19-Methicillin-Resistant Staphylococcus Aureus (Mrsa)"
+61 SET MSG=MSG_$JUSTIFY($PIECE(LRTOT(19),U),4)_" "_$JUSTIFY($PIECE(LRTOT(19),U,2),5)
+62 SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
+63 SET MSG="NTE~20-Vancomycin-Resistant Staphylococcus Aureus (Vrsa)"
+64 SET MSG=MSG_$JUSTIFY($PIECE(LRTOT(20),U),5)_" "_$JUSTIFY($PIECE(LRTOT(20),U,2),5)
+65 SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
+66 SET MSG="NTE~21-Vancomycin-Resistant Coagulase Negative"
+67 SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
+68 SET MSG=" Staphylococci/Staph EPI (Vrse)"
+69 SET MSG=MSG_$EXTRACT(LRSP,1,19)_$JUSTIFY($PIECE(LRTOT(21),U),5)_" "_$JUSTIFY($PIECE(LRTOT(21),U,2),5)
+70 SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
+71 SET MSG="NTE~22-All Streptococcus Pneumoniae"
+72 SET MSG=MSG_$EXTRACT(LRSP,1,21)_$JUSTIFY($PIECE(LRTOT(22),U),5)_" "_$JUSTIFY($PIECE(LRTOT(22),U,2),5)
+73 SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
+74 SET MSG="NTE~23-All Enterococci"
+75 SET MSG=MSG_LRSP_$EXTRACT(LRSP,1,4)_$JUSTIFY($PIECE(LRTOT(23),U),5)_" "_$JUSTIFY($PIECE(LRTOT(23),U,2),5)
+76 SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
+77 QUIT
PRTTOT ;Print totals on summary report
+1 SET MSG=""
SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
+2 SET MSG="Processing Month: "_LRHDGL2_" for site # "_$PIECE(SITE,U,3)_" "_$PIECE(SITE,U,2)
+3 SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
+4 SET MSG="Site totals"
+5 SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
+6 SET MSG=""
SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
+7 SET LRNUM=0
+8 FOR
SET LRNUM=$ORDER(^XTMP("LREPIREP"_LRDATE,"TOTAL1",LRNUM))
IF LRNUM=""
QUIT
Begin DoDot:1
+9 SET MSG=$PIECE($PIECE(^XTMP("LREPIREP"_LRDATE,"TOTAL1",LRNUM),HLFS,3),LRCS,3)
+10 IF 60-$LENGTH(MSG)>30
SET MSG=MSG_LRSP
+11 IF 60-$LENGTH(MSG)>30
SET MSG=MSG_LRSP
+12 SET MSG=MSG_$EXTRACT(LRSP,1,60-$LENGTH(MSG))
+13 SET MSG=MSG_$JUSTIFY($PIECE($PIECE(^XTMP("LREPIREP"_LRDATE,"TOTAL1",LRNUM),HLFS,3),LRCS,4),5)
+14 SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
End DoDot:1
+15 QUIT
PRTHEP ;PRINT HEP C RISK ASSESSMENT TOTALS
+1 FOR LRNUM=1:1:7
SET LRTOT(LRNUM)=+$GET(^XTMP("LREPIREP"_LRDATE,"HEPTOT",LRNUM))
+2 SET MSG="Resolved term-1-Declined Assessment for Hepatitis C"
+3 SET MSG=MSG_$EXTRACT(LRSP,1,9)_$JUSTIFY($PIECE(LRTOT(1),U),5)
+4 SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
+5 SET MSG="Resolved term-2-No Risk Factors for Hepatitis C"
+6 SET MSG=MSG_$EXTRACT(LRSP,1,13)_$JUSTIFY($PIECE(LRTOT(2),U),5)
+7 SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
+8 SET MSG="Resolved term-3-Previously Assessed for Hepatitis C"
+9 SET MSG=MSG_$EXTRACT(LRSP,1,9)_$JUSTIFY($PIECE(LRTOT(3),U),5)
+10 SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
+11 SET MSG="Resolved term-4-Risk Factors for Hepatitis C"
+12 SET MSG=MSG_$EXTRACT(LRSP,1,16)_$JUSTIFY($PIECE(LRTOT(4),U),5)
+13 SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
+14 SET MSG="Resolved term-5-Positive Test for Hepatitis C antibody"
+15 SET MSG=MSG_$EXTRACT(LRSP,1,6)_$JUSTIFY($PIECE(LRTOT(5),U),5)
+16 SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
+17 SET MSG="Resolved term-6-Negative Test for Hepatitis C antibody"
+18 SET MSG=MSG_$EXTRACT(LRSP,1,6)_$JUSTIFY($PIECE(LRTOT(6),U),5)
+19 SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
+20 ; S MSG="Resolved term-7-Hepatitis C diagnosis (ICD-9 based)"
+21 ; IHS/MSC/MKK - LR*5.2*1034
SET MSG="Resolved term-7-Hepatitis C diagnosis (ICD based)"
+22 SET MSG=MSG_$EXTRACT(LRSP,1,9)_$JUSTIFY($PIECE(LRTOT(7),U),5)
+23 SET ^TMP($JOB,"MSG",MSGCNT)=MSG
SET MSGCNT=MSGCNT+1
+24 SET ^TMP($JOB,"MSG",MSGCNT)=LRSP_LRSP_"-----"
+25 SET MSGCNT=MSGCNT+1
+26 SET LRTOT=LRTOT(1)+LRTOT(2)+LRTOT(3)+LRTOT(4)+LRTOT(5)+LRTOT(6)+LRTOT(7)
+27 SET ^TMP($JOB,"MSG",MSGCNT)="Total Hepatitis C Risk Assessment Resolution"_$EXTRACT(LRSP,1,16)_$JUSTIFY(LRTOT,5)
+28 SET MSGCNT=MSGCNT+1
+29 ;
+30 QUIT