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

RMPRN7PR.m

Go to the documentation of this file.
  1. RMPRN7PR ;HINES/HNC -PRINT REPAIR WORKSHEETS ;2/14/01
  1. ;;3.0;PROSTHETICS;**57,84,103**;Feb 09, 1996
  1. ;
  1. ; AAC Patch 84 2/25/04 additions, deletions and change descriptions for Groups and lines
  1. ; AAC Patch 84 - New Group description changes, R60
  1. ; - Repair Group description changes, R60
  1. ; AAC Patch 103 - 1/17/05 NPPD CATEGORIES/LINES - NEW and REPAIR UPDATES
  1. ;
  1. K ^TMP($J,"RS")
  1. S STN=1
  1. F S STN=$O(^TMP($J,"R",STN)) Q:STN="" D HDR,CDATA,SUM
  1. Q
  1. HDR ;leave this form feed alone
  1. W @IOF
  1. W !,"REPORT OF 2529-3 REPAIR PROSTHETICS ACTIVITIES"
  1. ;header depending on sort selected
  1. W !,$$HDR^RMPRN7S(RMPRDET)
  1. S Y=DATE(1) D DD^%DT W !,Y," - " S Y=DATE(2) D DD^%DT W Y
  1. W !,?10,"STATION: ",STN
  1. ;RMPRSUM if summary header
  1. Q:$G(RMPRSUM)
  1. W !!
  1. W !,"Line",?7,"Item",?21,"VA",?26,"Com",?31,"Total",?37,"Cost",?46
  1. W "Ave Com",?54
  1. W "SC/OP",?61,"NSC/OP",?68,"SC/IP",?74,"NSC/IP"
  1. I IOM>120 D
  1. .W ?83,"SP LEG"
  1. .W ?90,"A&A",?97,"PHC",?104,"ELG REF",?112,"NEW",?120,"$ELG REF"
  1. Q
  1. CDATA ;
  1. Q:FL=1
  1. S LINE="",LINEP=""
  1. S (CA,CB,CC,CD,CE,CF,CG,CH,CI,CJ,CK,CL,CM)=0
  1. F S LINE=$O(^TMP($J,"R",STN,LINE)) Q:LINE="" Q:FL=1 D
  1. .I $E(LINE,0,3)'=$E(LINEP,0,3) D SUM Q:FL=1 D LBLR
  1. .W !,LINE,?7,$E($P(^TMP($J,"R",STN,LINE),U,15),1,14)
  1. .W ?21,$P(^TMP($J,"R",STN,LINE),U,1) S CA=CA+$P(^(LINE),U,1)
  1. .W ?26,$P(^TMP($J,"R",STN,LINE),U,2) S CB=CB+$P(^(LINE),U,2)
  1. .W ?31,$P(^TMP($J,"R",STN,LINE),U,1)+($P(^TMP($J,"R",STN,LINE),U,2))
  1. .W ?37,$FN($J($P(^TMP($J,"R",STN,LINE),U,3),0,0),",") S CC=CC+$P(^(LINE),U,3)
  1. .W:$P(^TMP($J,"R",STN,LINE),U,2)>0 ?46,$FN($J(($P(^(LINE),U,3))/($P(^(LINE),U,2)),0,0),",")
  1. .W ?55,$P(^TMP($J,"R",STN,LINE),U,4) S CD=CD+$P(^(LINE),U,4)
  1. .W ?62,$P(^TMP($J,"R",STN,LINE),U,5) S CE=CE+$P(^(LINE),U,5)
  1. .W ?69,$P(^TMP($J,"R",STN,LINE),U,6) S CF=CF+$P(^(LINE),U,6)
  1. .W ?76,$P(^TMP($J,"R",STN,LINE),U,7) S CG=CG+$P(^(LINE),U,7)
  1. .S CH=CH+$P(^TMP($J,"R",STN,LINE),U,8)
  1. .S CI=CI+$P(^TMP($J,"R",STN,LINE),U,9)
  1. .S CJ=CJ+$P(^TMP($J,"R",STN,LINE),U,10)
  1. .S CK=CK+$P(^TMP($J,"R",STN,LINE),U,11)
  1. .S CL=CL+$P(^TMP($J,"R",STN,LINE),U,12)
  1. .S CM=CM+$P(^TMP($J,"R",STN,LINE),U,16)
  1. .I IOM>120 D
  1. ..W ?83,$P(^TMP($J,"R",STN,LINE),U,8)
  1. ..W ?90,$P(^TMP($J,"R",STN,LINE),U,9)
  1. ..W ?97,$P(^TMP($J,"R",STN,LINE),U,10)
  1. ..W ?104,$P(^TMP($J,"R",STN,LINE),U,11)
  1. ..W ?112,$P(^TMP($J,"R",STN,LINE),U,12)
  1. ..W ?120,$P(^TMP($J,"R",STN,LINE),U,16)
  1. .S LINEP=LINE
  1. Q
  1. SUM ;Print summary for group
  1. Q:FL=1
  1. I LINEP'="" D Q:FL=1
  1. .I $Y+13>IOSL,IOST["C-" D CHK Q:FL=1
  1. .S GROUPT=CA_U_CB_U_(CA+CB)_U_$J(CC,0,0)_U_CD_U_CE_U_CF_U_CG_U_CH_U_CI_U_CJ_U_CK_U_CL_U_CM
  1. .W !,LN,!
  1. .W ?21,CA,?26,CB,?31,(CA+CB),?37,$FN($J(CC,0,0),","),?55,CD,?62,CE,?69,CF,?76,CG
  1. .I IOM>120 W ?83,CH,?90,CI,?97,CJ,?104,CK,?112,CL,?120,CM
  1. .W !
  1. .D LBLG
  1. .S ^TMP($J,"RS",STN,GROUP,STN)=GROUPT
  1. .S (CA,CB,CC,CD,CE,CF,CG,CH,CI,CJ,CK,CL,CM)=0
  1. Q:$G(LINEP)'="R99 ZL"
  1. D FSUM S RMPRSUM=1 D HDR K RMPRSUM
  1. W !!,"STATION SUMMARY (2529-3 REPAIR ACTIVITIES)"
  1. ;W !,$$HDR^RMPRN7S(RMPRDET)
  1. W !,?21,"VA",?31,"Com",?41,"Total",?51,"Cost",?61
  1. W "Ave Com",?71,"Elg Ref $"
  1. W !,LN
  1. W !,?21,CA,?31,CB,?41,(CA+CB),?51,"$"_$FN($J(CC,0,0),",")
  1. W ?61
  1. I CB>0 W "$"_$FN($J((CC/CB),0,0),",")
  1. W ?71
  1. I CM>0 W "$"_$FN($J((CM),0,0),",")
  1. W !,LN,!
  1. W !,?21,"SC/OP",?31,"NSC/OP",?41,"SC/IP",?51,"NSC/IP"
  1. W !,LN,!
  1. W ?21,CD,?31,CE,?41,CF,?51,CG
  1. W !,LN
  1. W !,?21,"SPEC LEG",?31,"A&A",?41,"PHC",?51,"ELG REF",?61,"NEW"
  1. W !,LN,!,?21,CH,?31,CI,?41,CJ,?51,CK,?61,CL,!,LN
  1. W !,?21,"Total Disability: ",(CD+CE+CF+CG),!,LN,!
  1. S (CA,CB,CC,CD,CE,CF,CG,CH,CI,CJ,CK,CL)=0
  1. I IOST["C-" D CHK
  1. Q
  1. LBLG ;group description fo final repair summary
  1. I $E(LINEP,0,3)="R07" S GROUP=$E(LINEP,0,3)_" HEARING AID, LOCAL REPAIRS"
  1. I $E(LINEP,0,3)="R10" S GROUP=$E(LINEP,0,3)_" WHEELCHAIRS AND ACCESSORIES"
  1. I $E(LINEP,0,3)="R20" S GROUP=$E(LINEP,0,3)_" ARTIFICIAL LEGS"
  1. I $E(LINEP,0,3)="R30" S GROUP=$E(LINEP,0,3)_" ARTIFICIAL ARMS AND TERMINAL DEVICES"
  1. I $E(LINEP,0,3)="R40" S GROUP=$E(LINEP,0,3)_" ORTHOSIS"
  1. I $E(LINEP,0,3)="R50" S GROUP=$E(LINEP,0,3)_" SHOES/ORTHOTICS"
  1. I $E(LINEP,0,3)="R60" S GROUP=$E(LINEP,0,3)_" SENSORI-NEURO AIDS"
  1. I $E(LINEP,0,3)="R70" S GROUP=$E(LINEP,0,3)_" HOME DIALYSIS EQUIPMENT"
  1. I $E(LINEP,0,3)="R80" S GROUP=$E(LINEP,0,3)_" MEDICAL EQUIPMENT"
  1. I $E(LINEP,0,3)="R90" S GROUP=$E(LINEP,0,3)_" ALL OTHER"
  1. I $E(LINEP,0,3)="R91" S GROUP=$E(LINEP,0,3)_" OXYGEN & RESPIRATORY"
  1. I $E(LINEP,0,3)="R92" S GROUP=$E(LINEP,0,3)_" AUTO & VAN EQUIP"
  1. I $E(LINEP,0,3)="R99" S GROUP=$E(LINEP,0,3)_" MISC"
  1. Q
  1. LBLR ;label for repair group
  1. I $E(LINE,0,3)="R10" W !,"2529-3 WHEELCHAIRS AND ACCESSORIES"
  1. I $E(LINE,0,3)="R20" W !,"2529-3 ARTIFICIAL LEGS"
  1. I $E(LINE,0,3)="R30" W !,"2529-3 ARTIFICIAL ARMS AND TERMINAL DEVICES"
  1. I $E(LINE,0,3)="R40" W !,"2529-3 ORTHOSIS"
  1. I $E(LINE,0,3)="R50" W !,"2529-3 SHOES/ORTHOTICS"
  1. I $E(LINE,0,3)="R60" W !,"2529-3 SENSORI-NEURO AIDS"
  1. I $E(LINE,0,3)="R70" W !,"2529-3 HOME DIALYSIS EQUIPMENT"
  1. I $E(LINE,0,3)="R80",IOST'["C-" D HDR W !,"2529-3 MEDICAL EQUIPMENT"
  1. I $E(LINE,0,3)="R80",IOST["C-" W !,"2529-3 MEDICAL EQUIPMENT"
  1. I $E(LINE,0,3)="R90" W !,"2529-3 ALL OTHER"
  1. I $E(LINE,0,3)="R91" W !,"2529-3 OXYGEN & RESPIRATORY"
  1. I $E(LINE,0,3)="R92" W !,"2529-3 AUTO & VAN EQUIP"
  1. I $E(LINE,0,3)="R99" W !,"2529-3 MISC"
  1. Q
  1. FSUM ;final summay on Repair Worksheets STATION
  1. S H=0
  1. F S H=$O(^TMP($J,"RS",STN,H)) Q:H="" D
  1. .S H1=0,H2=0
  1. .F S H1=$O(^TMP($J,"RS",STN,H,H1)) Q:H1="" D
  1. ..Q:H1'=STN
  1. ..S H2=^TMP($J,"RS",STN,H,H1)
  1. ..S CA=CA+$P(H2,U,1)
  1. ..S CB=CB+$P(H2,U,2)
  1. ..S CC=CC+$P(H2,U,4)
  1. ..S CD=CD+$P(H2,U,5)
  1. ..S CE=CE+$P(H2,U,6)
  1. ..S CF=CF+$P(H2,U,7)
  1. ..S CG=CG+$P(H2,U,8)
  1. ..S CH=CH+$P(H2,U,9)
  1. ..S CI=CI+$P(H2,U,10)
  1. ..S CJ=CJ+$P(H2,U,11)
  1. ..S CK=CK+$P(H2,U,12)
  1. ..S CL=CL+$P(H2,U,13)
  1. ..S CM=CM+$P(H2,U,14)
  1. Q
  1. CHK ;
  1. K DIR W !! S DIR(0)="E" D ^DIR S:+Y'>0 FL=1
  1. W @IOF
  1. Q
  1. ;END