BTIULD ; IHS/ITSC/LJF - Admission related functions ;
;;1.0;TEXT INTEGRATION UTILITIES;;NOV 04, 2004
;Called by ^TIULD for IHS style display
;
CHEKDS(DATA) ;EP; Display/validate correct patient/treatment episode
NEW Y
I $G(DATA("AD#"))'>0!(DATA("EDT")="") D G CHEKDSX
. W !!,"Movement data doesn't exist for admission, can't create "
. W "Summary",!
I +$$ISA^USRLM(DUZ,"TRANSCRIPTIONIST")>0 S Y=1 G CHEKDSX
W !!?1,"Patient: ",$$NAME^TIULS(DATA("PNM"),"LAST, FIRST MI"),?39,"HRCN: "
W DATA("HRCN"),?62,"Sex: ",$S(DATA("SEX")]"":$P(DATA("SEX"),U,2),1:"UNKNOWN"),!
W "Adm Date: ",$$DATE^TIULS($P(DATA("EDT"),U),"MM/DD/YY"),?39,"Ward: "
W $P(DATA("WARD"),U,2),?62,"Age: ",$S(DATA("AGE")]"":DATA("AGE"),1:"UNKNOWN"),!
W:DATA("LDT")]"" "Dis Date: ",$$DATE^TIULS(DATA("LDT"),"MM/DD/YY"),!
W ?2,"Adm Dx: ",DATA("ADDX"),!,"Att Prov: ",$P(DATA("PMD"),U,2),!
I $D(DATA("DICTDT")) D
. W !,"A DISCHARGE SUMMARY is already on file:",!
. W ?2,"Dict'd: ",DATA("DICTDT"),?41,"By: ",DATA("AUTHOR"),!
. W ?2,"Signed: ",DATA("SIGDT"),?35,"Cosigned: ",DATA("COSDT"),!
. S Y=1
E S Y=$$READ^TIUU("YO","Correct VISIT","YES")
W !
CHEKDSX Q $G(Y)
;
;
CHEKPN(DATA,TIUBY) ;EP; Display/validate demographic/visit information
NEW Y
W !!,"Creating new ",$G(TIUTYPNM,"document"),"..."
W !!?1,"Patient: ",$$NAME^TIULS(DATA("PNM"),"LAST, FIRST MI"),?39,"HRCN: "
W DATA("HRCN"),?62,"Sex: ",$S(DATA("SEX")]"":$P(DATA("SEX"),U,2),1:"UNKNOWN")
W !?4,"Date/time of ",$S($$HOSP:"Admission: ",1:"Visit: ")
W $S(+$P($G(DATA("VSTR")),";",2):$$DATE^TIULS($P(DATA("VSTR"),";",2),"MM/DD/YY HR:MIN"),1:"UNKNOWN")
W " ",$E($$GET1^DIQ(9000010,+DATA("VISIT"),.06),1,12) ;facility
I '$$HOSP W ?55,$E($$GET1^DIQ(9000010,+DATA("VISIT"),.08),1,20) I 1
E W ?61,"Ward: ",$P(DATA("LOC"),U,2)
;
S Y=$$READ^TIUU("YO","Correct VISIT","YES")
I $S($D(DIROUT):1,$D(DUOUT):1,$D(DTOUT):1,1:0) Q 0
I +Y'>0 D
. K X D MAIN^TIUVSIT(.X,DFN,"","","","",1)
. S Y=$S($D(X)>9:$$CHEKPN(.X,.TIUBY),1:0)
Q Y
;
HOSP() ; -- returns 1 if visit is hospitalization
Q $S($P($G(DATA("CAT")),U)="H":1,1:0)
BTIULD ; IHS/ITSC/LJF - Admission related functions ;
+1 ;;1.0;TEXT INTEGRATION UTILITIES;;NOV 04, 2004
+2 ;Called by ^TIULD for IHS style display
+3 ;
CHEKDS(DATA) ;EP; Display/validate correct patient/treatment episode
+1 NEW Y
+2 IF $GET(DATA("AD#"))'>0!(DATA("EDT")="")
Begin DoDot:1
+3 WRITE !!,"Movement data doesn't exist for admission, can't create "
+4 WRITE "Summary",!
End DoDot:1
GOTO CHEKDSX
+5 IF +$$ISA^USRLM(DUZ,"TRANSCRIPTIONIST")>0
SET Y=1
GOTO CHEKDSX
+6 WRITE !!?1,"Patient: ",$$NAME^TIULS(DATA("PNM"),"LAST, FIRST MI"),?39,"HRCN: "
+7 WRITE DATA("HRCN"),?62,"Sex: ",$SELECT(DATA("SEX")]"":$PIECE(DATA("SEX"),U,2),1:"UNKNOWN"),!
+8 WRITE "Adm Date: ",$$DATE^TIULS($PIECE(DATA("EDT"),U),"MM/DD/YY"),?39,"Ward: "
+9 WRITE $PIECE(DATA("WARD"),U,2),?62,"Age: ",$SELECT(DATA("AGE")]"":DATA("AGE"),1:"UNKNOWN"),!
+10 IF DATA("LDT")]""
WRITE "Dis Date: ",$$DATE^TIULS(DATA("LDT"),"MM/DD/YY"),!
+11 WRITE ?2,"Adm Dx: ",DATA("ADDX"),!,"Att Prov: ",$PIECE(DATA("PMD"),U,2),!
+12 IF $DATA(DATA("DICTDT"))
Begin DoDot:1
+13 WRITE !,"A DISCHARGE SUMMARY is already on file:",!
+14 WRITE ?2,"Dict'd: ",DATA("DICTDT"),?41,"By: ",DATA("AUTHOR"),!
+15 WRITE ?2,"Signed: ",DATA("SIGDT"),?35,"Cosigned: ",DATA("COSDT"),!
+16 SET Y=1
End DoDot:1
+17 IF '$TEST
SET Y=$$READ^TIUU("YO","Correct VISIT","YES")
+18 WRITE !
CHEKDSX QUIT $GET(Y)
+1 ;
+2 ;
CHEKPN(DATA,TIUBY) ;EP; Display/validate demographic/visit information
+1 NEW Y
+2 WRITE !!,"Creating new ",$GET(TIUTYPNM,"document"),"..."
+3 WRITE !!?1,"Patient: ",$$NAME^TIULS(DATA("PNM"),"LAST, FIRST MI"),?39,"HRCN: "
+4 WRITE DATA("HRCN"),?62,"Sex: ",$SELECT(DATA("SEX")]"":$PIECE(DATA("SEX"),U,2),1:"UNKNOWN")
+5 WRITE !?4,"Date/time of ",$SELECT($$HOSP:"Admission: ",1:"Visit: ")
+6 WRITE $SELECT(+$PIECE($GET(DATA("VSTR")),";",2):$$DATE^TIULS($PIECE(DATA("VSTR"),";",2),"MM/DD/YY HR:MIN"),1:"UNKNOWN")
+7 ;facility
WRITE " ",$EXTRACT($$GET1^DIQ(9000010,+DATA("VISIT"),.06),1,12)
+8 IF '$$HOSP
WRITE ?55,$EXTRACT($$GET1^DIQ(9000010,+DATA("VISIT"),.08),1,20)
IF 1
+9 IF '$TEST
WRITE ?61,"Ward: ",$PIECE(DATA("LOC"),U,2)
+10 ;
+11 SET Y=$$READ^TIUU("YO","Correct VISIT","YES")
+12 IF $SELECT($DATA(DIROUT):1,$DATA(DUOUT):1,$DATA(DTOUT):1,1:0)
QUIT 0
+13 IF +Y'>0
Begin DoDot:1
+14 KILL X
DO MAIN^TIUVSIT(.X,DFN,"","","","",1)
+15 SET Y=$SELECT($DATA(X)>9:$$CHEKPN(.X,.TIUBY),1:0)
End DoDot:1
+16 QUIT Y
+17 ;
HOSP() ; -- returns 1 if visit is hospitalization
+1 QUIT $SELECT($PIECE($GET(DATA("CAT")),U)="H":1,1:0)