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

ORWPT2.m

Go to the documentation of this file.
  1. ORWPT2 ; SLC/JLC - Patient Lookup Functions (cont) ; Aug 29, 2023@11:35
  1. ;;3.0;ORDER ENTRY/RESULTS REPORTING;**485,608**;Dec 17, 1997;Build 15
  1. ;
  1. ; Reference to OUTPTPR^SDUTL3 in ICR #1252
  1. ; Reference to ^AUPNVSIT in ICR #2028
  1. ; - READ ACCESS ONLY TO PCE VISIT FILE
  1. ; covers $Ordering through "AET" index as well
  1. ; as the READing of the zero node.
  1. ; Reference to INP^VADPT in ICR #10061
  1. ; Reference to FMTE^XLFDT in ICR #10103
  1. ; Reference to GUIBS5A^DPTLK6 in ICR #3593
  1. ; Reference to STATUS^PXRMCOVID19 in ICR #7146
  1. ; Reference to GET^XPAR in ICR #2263
  1. ;
  1. Q
  1. ;
  1. COVID(Y,DFN) ; return COVID-19 statuses
  1. N A,RIEN
  1. S RIEN=+$$GET^XPAR("ALL","OR OTHER INFO REMINDER",1,"I")
  1. I RIEN=0 S Y="-1^No Reminder definition is defined"
  1. ;ICR #7146
  1. S Y=$$STATUS^PXRMCOVID19(DFN,RIEN)
  1. Q Y
  1. ;
  1. IDINFO(REC,DFN) ; Return more identifying info for a patient
  1. ; This RPC allows retrieval of the Inpatient Provider,
  1. ; Primary Care Provider, Last Location Name & Last Visit
  1. ; Date for a Patient.
  1. ;
  1. ; Input:
  1. ; DFN is the unique IEN into PATIENT file #2
  1. ; Output:
  1. ; REC which is returned as Inpatient Provider ^
  1. ; Primary Care Provider ^ Last Location Name
  1. ; ^ Last Visit Date
  1. ;
  1. N DELETED,RECPCE,VAIN,VDT,VSTINFO
  1. F RECPCE=1:1:4 S $P(REC,U,RECPCE)=""
  1. D INP^VADPT I $G(VAIN(2)) S $P(REC,U,1)=$P(VAIN(2),U,2)
  1. S $P(REC,U,2)=$P($$OUTPTPR^SDUTL3(DFN),U,2)
  1. S VDT=""
  1. VDTLOOP ; Loop to next previous one if this one Deleted
  1. S VDT=$O(^AUPNVSIT("AET",DFN,VDT),-1)
  1. I VDT]"" D G:DELETED VDTLOOP
  1. . S DELETED=$$DELETED(DFN,VDT) Q:DELETED
  1. . D LIST^ORQQVS(.VSTINFO,DFN,VDT,VDT,"") ; retrieve the one visit record
  1. . I $G(VSTINFO(1))]"" D
  1. .. S $P(REC,U,3)=$P($P(VSTINFO(1),U,3),";",2)
  1. .. S $P(REC,U,4)=$$FMTE^XLFDT($P($P(VSTINFO(1),U,2),".",1))
  1. Q
  1. ;
  1. DELETED(DFN,VDT) ; Check if VISIT is Deleted
  1. N V0,VLOC,VETYP,VIEN
  1. S VLOC=$O(^AUPNVSIT("AET",DFN,VDT,"")) Q:VLOC="" 1
  1. S VETYP=$O(^AUPNVSIT("AET",DFN,VDT,VLOC,"")) Q:VETYP="" 1
  1. S VIEN=$O(^AUPNVSIT("AET",DFN,VDT,VLOC,VETYP,""))
  1. Q:VIEN="" 1 S V0=$G(^AUPNVSIT(VIEN,0)) Q:V0="" 1
  1. I $P(V0,U,11)=1 Q 1
  1. Q 0
  1. LOOKUP(ORRTN,DFN) ; Lookup not only for similar patients but include extra data
  1. N INDX,GUICALL,RT1,RT2,RT3,NDFN
  1. D GUIBS5A^DPTLK6(.GUICALL,DFN)
  1. I GUICALL(1)<1 Q
  1. M ORRTN=GUICALL
  1. S INDX=1
  1. F S INDX=$O(ORRTN(INDX)) Q:INDX="" D
  1. . I $P(ORRTN(INDX),"^")'=1 Q
  1. . S NDFN=$P(ORRTN(INDX),"^",2)
  1. . D IDINFO^ORWPT(.RT1,NDFN)
  1. . D IDINFO^ORWPT2(.RT2,NDFN)
  1. . D PRCARE^ORWPT1(.RT3,NDFN)
  1. . S $P(ORRTN(INDX),"^",6)=$P(RT1,"^",6)
  1. . S $P(ORRTN(INDX),"^",7)=$P(RT2,"^",2)
  1. . S $P(ORRTN(INDX),"^",8)=$P(RT2,"^",3)
  1. . S $P(ORRTN(INDX),"^",9)=$P(RT2,"^",4)
  1. . S $P(ORRTN(INDX),"^",10)=$P(RT3,"^",3)
  1. Q