BTIUCPL1 ; IHS/MSC/JS - TIU V Care Plan Object cont. ;02-Jan-2014 15:53;DU
;;1.0;TEXT INTEGRATION UTILITIES;**1012,1013**;MAR 20, 2013;Build 33
;5/22/13 - EHR TEST WITH HARDSET 'PARAM' = 265 (PROBLEM IEN)
;
OUT ; set report data @TARGET for object report
N NODE,PROBDX,STRING
I FNUM=9000092 D
.S CNT=CNT+1
.S @TARGET@(CNT,0)="-------------- Care Plan ------------"
.N PRIEN S PRIEN=+$G(CPLARR(FNUM,IEN_",",.01,"E")) D
..I PRIEN N ICD9IEN S ICD9IEN=+$G(^AUPNPROB(PRIEN,0))
..;I ICD9IEN S PROBDX=$P($G(^ICD9(ICD9IEN,0)),U,3)
..I ICD9IEN S PROBDX=$$GET1^DIQ(9000011,PRIEN,.05)
..N PROBSTAT S PROBSTAT=$G(CPLARR(FNUM_".11",IEN_",",1,"E"))
..S CNT=CNT+1
..S @TARGET@(CNT,0)=$G(PROBDX)_STRPAD_$G(PROBSTAT)
.S CNT=CNT+1
.S @TARGET@(CNT,0)=SPACE
.S CNT=CNT+1
.N SIGNBY S SIGNBY=$G(CPLARR(FNUM,IEN_",",.07,"E"))
.N SIGNDT S SIGNDT=$G(CPLARR(FNUM,IEN_",",.08,"E")) S SIGNDT=$P(SIGNDT,"@",1)
.S @TARGET@(CNT,0)="GOALS - "_$G(SIGNDT)_" by "_$G(SIGNBY)
.S CNT=CNT+1
.S @TARGET@(CNT,0)="CARE PLAN INSTRUCTION -"
.S STRING="",NODE=0
.F S NODE=$O(CPLARR(FNUM,IEN_",","1200",NODE)) Q:NODE'?1N D
..S STRING=$G(CPLARR(FNUM,IEN_",","1200",NODE))
..S CNT=CNT+1
..S @TARGET@(CNT,0)=STRPAD_STRING
..Q
.S CNT=CNT+1
.S @TARGET@(CNT,0)=SPACE
I FNUM=9000010.58 D
.S CNT=CNT+1
.S @TARGET@(CNT,0)="-------------- Visit Instructions --------------"
.S CNT=CNT+1
.N INSTDT S INSTDT=$G(CPLARR(FNUM,IEN_",",.05,"E"))
.N INSTBY S INSTBY=$G(CPLARR(FNUM,IEN_",",.04,"E"))
.S @TARGET@(CNT,0)="VISIT INSTRUCTIONS - "_INSTDT_" by "_INSTBY
.S STRING="",NODE=0
.F S NODE=$O(CPLARR(FNUM,IEN_",","1100",NODE)) Q:NODE'?1N D
..S STRING=$G(CPLARR(FNUM,IEN_",","1100",NODE))
..S CNT=CNT+1
..S @TARGET@(CNT,0)=STRPAD_STRING
..Q
.S CNT=CNT+1
.S @TARGET@(CNT,0)=SPACE
I FNUM=9000010.61 D
.S CNT=CNT+1
.S @TARGET@(CNT,0)="--------------------- Treatment/Regimen --------------------"
.S CNT=CNT+1
.S @TARGET@(CNT,0)="TX/REGIMEN/FU"
.S CNT=CNT+1
.S @TARGET@(CNT,0)=STRPAD_$G(CPLARR(FNUM,IEN_",",.01,"E"))
.S CNT=CNT+1
.S @TARGET@(CNT,0)=SPACE
I FNUM=9000010.16 D
.S CNT=CNT+1
.S @TARGET@(CNT,0)="--------------------- Patient Education --------------------"
.S CNT=CNT+1
.S @TARGET@(CNT,0)="EDUCATION"
.S CNT=CNT+1
.S @TARGET@(CNT,0)=STRPAD_$G(CPLARR(FNUM,IEN_",",.01,"E"))
.S CNT=CNT+1
.S @TARGET@(CNT,0)=STRPAD_$G(CPLARR(FNUM,IEN_",",81101,"E"))
.S CNT=CNT+1
.S @TARGET@(CNT,0)=SPACE
I FNUM=123 D
.S CNT=CNT+1
.S @TARGET@(CNT,0)="-------------------- Consults -----------------------------"
.S CNT=CNT+1
.S @TARGET@(CNT,0)=STRPAD_"Date of Request - "_CPLARR(FNUM,IEN_",","3","E")
.S CNT=CNT+1
.S @TARGET@(CNT,0)=STRPAD_"Provider - "_CPLARR(FNUM,IEN_",","10","E")
.S CNT=CNT+1
.S @TARGET@(CNT,0)=STRPAD_"Procedure - "_CPLARR(FNUM,IEN_",","4","E")
.S CNT=CNT+1
.S @TARGET@(CNT,0)=STRPAD_"To Service - "_CPLARR(FNUM,IEN_",","1","E")_" Attention: "_CPLARR(FNUM,IEN_",","7","E")
.S CNT=CNT+1
.S @TARGET@(CNT,0)=SPACE
BTIUCPL1 ; IHS/MSC/JS - TIU V Care Plan Object cont. ;02-Jan-2014 15:53;DU
+1 ;;1.0;TEXT INTEGRATION UTILITIES;**1012,1013**;MAR 20, 2013;Build 33
+2 ;5/22/13 - EHR TEST WITH HARDSET 'PARAM' = 265 (PROBLEM IEN)
+3 ;
OUT ; set report data @TARGET for object report
+1 NEW NODE,PROBDX,STRING
+2 IF FNUM=9000092
Begin DoDot:1
+3 SET CNT=CNT+1
+4 SET @TARGET@(CNT,0)="-------------- Care Plan ------------"
+5 NEW PRIEN
SET PRIEN=+$GET(CPLARR(FNUM,IEN_",",.01,"E"))
Begin DoDot:2
+6 IF PRIEN
NEW ICD9IEN
SET ICD9IEN=+$GET(^AUPNPROB(PRIEN,0))
+7 ;I ICD9IEN S PROBDX=$P($G(^ICD9(ICD9IEN,0)),U,3)
+8 IF ICD9IEN
SET PROBDX=$$GET1^DIQ(9000011,PRIEN,.05)
+9 NEW PROBSTAT
SET PROBSTAT=$GET(CPLARR(FNUM_".11",IEN_",",1,"E"))
+10 SET CNT=CNT+1
+11 SET @TARGET@(CNT,0)=$GET(PROBDX)_STRPAD_$GET(PROBSTAT)
End DoDot:2
+12 SET CNT=CNT+1
+13 SET @TARGET@(CNT,0)=SPACE
+14 SET CNT=CNT+1
+15 NEW SIGNBY
SET SIGNBY=$GET(CPLARR(FNUM,IEN_",",.07,"E"))
+16 NEW SIGNDT
SET SIGNDT=$GET(CPLARR(FNUM,IEN_",",.08,"E"))
SET SIGNDT=$PIECE(SIGNDT,"@",1)
+17 SET @TARGET@(CNT,0)="GOALS - "_$GET(SIGNDT)_" by "_$GET(SIGNBY)
+18 SET CNT=CNT+1
+19 SET @TARGET@(CNT,0)="CARE PLAN INSTRUCTION -"
+20 SET STRING=""
SET NODE=0
+21 FOR
SET NODE=$ORDER(CPLARR(FNUM,IEN_",","1200",NODE))
IF NODE'?1N
QUIT
Begin DoDot:2
+22 SET STRING=$GET(CPLARR(FNUM,IEN_",","1200",NODE))
+23 SET CNT=CNT+1
+24 SET @TARGET@(CNT,0)=STRPAD_STRING
+25 QUIT
End DoDot:2
+26 SET CNT=CNT+1
+27 SET @TARGET@(CNT,0)=SPACE
End DoDot:1
+28 IF FNUM=9000010.58
Begin DoDot:1
+29 SET CNT=CNT+1
+30 SET @TARGET@(CNT,0)="-------------- Visit Instructions --------------"
+31 SET CNT=CNT+1
+32 NEW INSTDT
SET INSTDT=$GET(CPLARR(FNUM,IEN_",",.05,"E"))
+33 NEW INSTBY
SET INSTBY=$GET(CPLARR(FNUM,IEN_",",.04,"E"))
+34 SET @TARGET@(CNT,0)="VISIT INSTRUCTIONS - "_INSTDT_" by "_INSTBY
+35 SET STRING=""
SET NODE=0
+36 FOR
SET NODE=$ORDER(CPLARR(FNUM,IEN_",","1100",NODE))
IF NODE'?1N
QUIT
Begin DoDot:2
+37 SET STRING=$GET(CPLARR(FNUM,IEN_",","1100",NODE))
+38 SET CNT=CNT+1
+39 SET @TARGET@(CNT,0)=STRPAD_STRING
+40 QUIT
End DoDot:2
+41 SET CNT=CNT+1
+42 SET @TARGET@(CNT,0)=SPACE
End DoDot:1
+43 IF FNUM=9000010.61
Begin DoDot:1
+44 SET CNT=CNT+1
+45 SET @TARGET@(CNT,0)="--------------------- Treatment/Regimen --------------------"
+46 SET CNT=CNT+1
+47 SET @TARGET@(CNT,0)="TX/REGIMEN/FU"
+48 SET CNT=CNT+1
+49 SET @TARGET@(CNT,0)=STRPAD_$GET(CPLARR(FNUM,IEN_",",.01,"E"))
+50 SET CNT=CNT+1
+51 SET @TARGET@(CNT,0)=SPACE
End DoDot:1
+52 IF FNUM=9000010.16
Begin DoDot:1
+53 SET CNT=CNT+1
+54 SET @TARGET@(CNT,0)="--------------------- Patient Education --------------------"
+55 SET CNT=CNT+1
+56 SET @TARGET@(CNT,0)="EDUCATION"
+57 SET CNT=CNT+1
+58 SET @TARGET@(CNT,0)=STRPAD_$GET(CPLARR(FNUM,IEN_",",.01,"E"))
+59 SET CNT=CNT+1
+60 SET @TARGET@(CNT,0)=STRPAD_$GET(CPLARR(FNUM,IEN_",",81101,"E"))
+61 SET CNT=CNT+1
+62 SET @TARGET@(CNT,0)=SPACE
End DoDot:1
+63 IF FNUM=123
Begin DoDot:1
+64 SET CNT=CNT+1
+65 SET @TARGET@(CNT,0)="-------------------- Consults -----------------------------"
+66 SET CNT=CNT+1
+67 SET @TARGET@(CNT,0)=STRPAD_"Date of Request - "_CPLARR(FNUM,IEN_",","3","E")
+68 SET CNT=CNT+1
+69 SET @TARGET@(CNT,0)=STRPAD_"Provider - "_CPLARR(FNUM,IEN_",","10","E")
+70 SET CNT=CNT+1
+71 SET @TARGET@(CNT,0)=STRPAD_"Procedure - "_CPLARR(FNUM,IEN_",","4","E")
+72 SET CNT=CNT+1
+73 SET @TARGET@(CNT,0)=STRPAD_"To Service - "_CPLARR(FNUM,IEN_",","1","E")_" Attention: "_CPLARR(FNUM,IEN_",","7","E")
+74 SET CNT=CNT+1
+75 SET @TARGET@(CNT,0)=SPACE
End DoDot:1