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

BTIUCHLP.m

Go to the documentation of this file.
  1. BTIUCHLP ; IHS/ITSC/LJF - Help for Clinician ;
  1. ;;1.0;TEXT INTEGRATION UTILITIES;;NOV 04, 2004
  1. ; IHS subroutines called by ^TIUCHLP and ^BTIUVSIT and Field Trip Note title
  1. ;
  1. CHEKPN(X) ;EP; Display/validate demographic/visit information
  1. ; called by TIUCHLP
  1. W !!,"PCC Visit Identifiers..."
  1. W !?14,"Patient Name: ",$S($G(X("PNM"))]"":$G(X("PNM")),1:"UNKNOWN")
  1. W !?14,"Patient HRCN: ",$S($G(X("HRCN"))]"":$G(X("HRCN")),1:"UNKNOWN")
  1. W !?8,"Date/time of Visit: "
  1. W $S(+$G(X("VISIT")):$$DATE^TIULS($P(X("VISIT"),U,2),"MM/DD/YY HR:MIN"),+$G(X("EDT")):$$DATE^TIULS(X("EDT"),"MM/DD/YY HR:MIN"),1:"UNKNOWN")
  1. W ?50,$P($G(X("CAT")),U,2)
  1. I $P($G(X("CAT")),U)="H" W ! D
  1. . I $G(X("LDT")) W ?12,"Discharge Date: ",$$DATE^TIULS(+X("LDT"),"MM/DD/YY HR:MIN")
  1. . W ?50,$P($G(X("WARD")),U,2),?57,$P($G(X("TS")),U,2),!
  1. . I ($$PNAME^TIULC1(TIUTYPE)="OPERATIVE REPORTS")!($$PNAME^TIULC1(+$$DOCCLASS^TIULC1(TIUTYPE))="OPERATIVE REPORTS") D SURG
  1. E D
  1. . W !?50,$P($G(^DIC(40.7,+$P($G(^AUPNVSIT(+X("VISIT"),0)),U,8),0)),U),!
  1. . I ($$PNAME^TIULC1(TIUTYPE)="OPERATIVE REPORTS")!($$PNAME^TIULC1(+$$DOCCLASS^TIULC1(TIUTYPE))="OPERATIVE REPORTS") D SURG
  1. Q
  1. ;
  1. SURG ;- -- finds surgeries for hospitalization
  1. NEW ORDT,END,IEN,ARR
  1. S ORDT=+$P(X("EDT"),".")-.0001
  1. S END=$S($P($G(X("CAT")),U)'="H":X("EDT")_".2400",+$G(X("LDT")):+X("LDT"),1:DT)
  1. F S ORDT=$O(^SRF("AIHS4",ORDT)) Q:'ORDT!(ORDT>END) D
  1. . Q:'$D(^SRF("AIHS4",ORDT,DFN))
  1. . W ?15,"Surgery on ",$$DATE^TIULS(ORDT,"MM/DD/YY")
  1. . S IEN=0 F S IEN=$O(^SRF("AIHS4",ORDT,DFN,IEN)) Q:'IEN D
  1. .. K ARR D ENP^XBDIQ1(130,IEN,".14;.15;17;26;68","ARR(")
  1. .. I ARR(17)]"" W ?38,"Cancelled" Q
  1. .. W ?38,$E(ARR(.14),1,15)
  1. .. I ARR(.15)]"" W "/",$E(ARR(.15),1,15)
  1. .. W !?20,$E($S(ARR(26)]"":ARR(26),1:ARR(68)),1,58)
  1. . W !
  1. Q
  1. ;
  1. GETEVNT ;EP ; Help get Fields for PN Dictation/Error Resolution
  1. ;called by field trip title which needs universal patient lookup and event visit
  1. N Y,TIU,DFN,TIUY,TITLE
  1. NEW AUPNLK S AUPNLK("ALL")=1
  1. S DFN=+$$PATIENT^TIULA Q:+DFN'>0
  1. S Y=$$READ^TIUU("YO","Okay to create Event visit for this patient")
  1. Q:'Y
  1. ;
  1. S TIUVST=$$ADDEVNT(DFN) Q:'TIUVST ;create event visit
  1. ;
  1. D ENPN^TIUVSIT(.TIU,+DFN,1)
  1. I '$D(TIU) Q
  1. S TIUY=$$CHEKPN^TIUCHLP(.TIU)
  1. I 'TIUY Q
  1. D MAKE^TIUPEFIX(.SUCCESS,DFN,.TITLE,.TIU,$S(+$G(XQADATA):+$G(XQADATA),+$G(BUFDA):+$G(BUFDA),1:""))
  1. I +SUCCESS S TIUDONE=1
  1. Q
  1. ;
  1. ADDEVNT(DFN) ;EP -- returns visit ien for event visit created
  1. ; -- create event visit based on user responses; called by ^BTIUVSIT
  1. NEW TIUFAC,TIUVDT,TIUVST
  1. S TIUFAC=$$READ^TIUU("P^9999999.06:EMZ","Visit Facility")
  1. I TIUFAC S TIUVDT=$$READ^TIUU("D^:NOW:EX","Visit Date")
  1. I $G(TIUVDT) S TIUVST=$$EVENT^BTIUPUTP(DFN,+TIUFAC,TIUVDT)
  1. Q $G(TIUVST)