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

SDPFSS2.m

Go to the documentation of this file.
  1. SDPFSS2 ;ALD/SCK - Patient Financial Services System cont. ; 22-April-2005
  1. ;;5.3;Scheduling;**430**;Aug 13, 1993
  1. ;
  1. Q
  1. ;
  1. GETARN(SDT,DFN,SDCL) ; Get the PFSS Account Number Reference from file #409.55 for the matching Appt. D/T,
  1. ; patient DFN, and clinic location.
  1. ; Input
  1. ; SDT - Appointment Date/Time
  1. ; DFN - Patient IEN to File #2
  1. ; SDCL - Clinic IEN to File #44
  1. ;
  1. ; Output
  1. ; If an error occurred : -1^Error message
  1. ; 0 if no match found
  1. ; SDANR if a match is found
  1. ;
  1. N SDANR,SDIEN
  1. ;
  1. S DFN=$G(DFN) I 'DFN S SDANR="-1^No DFN was provided" G ARNQ
  1. S SDT=$G(SDT) I 'SDT S SDANR="-1^No Appointment Date/Time provided" G ARNQ
  1. S SDCL=$G(SDCL) I 'SDCL S SDANR="-1^No Clinic information was provided" G ARNQ
  1. ;
  1. S SDIEN=0
  1. S SDIEN=$O(^SD(409.55,"D",SDT,DFN,SDCL,0))
  1. I SDIEN>0 D
  1. . S SDANR=$$GET1^DIQ(409.55,SDIEN,.04)
  1. E D
  1. . S SDANR=0
  1. ARNQ Q $G(SDANR)
  1. ;
  1. ENCPRV(DFN,SDVSIT) ; Returns the encounter provider associated with the visit.
  1. ; Input
  1. ; DFN - Patient IEN from the PATIENT File (#2)
  1. ; SDVSIT - Visit IEN from the VISIT File (#9000010)
  1. ; DFN and SDVSIT are references to global variables which are available as part
  1. ; of the SD application.
  1. ;
  1. ; Output
  1. ; Visit Provider from the NEW PERSON File (#200)
  1. ; IEN^Provider Name or Null
  1. ;
  1. N PRVIEN,SDX,PRVNAME,RSLT
  1. ;
  1. I $G(SDVSIT)>0 S SDX=$O(^AUPNVPRV("AD",SDVSIT,0))
  1. I +$G(SDX)>0 D
  1. . S PRVIEN=$P($G(^AUPNVPRV(SDX,0)),U)
  1. . I PRVIEN>0,$P($G(^AUPNVPRV(SDX,0)),U,2)=DFN S PRVNAME=$$GET1^DIQ(200,PRVIEN,.01)
  1. . S RSLT=$G(PRVIEN)_"^"_$G(PRVNAME)
  1. Q $G(RSLT)
  1. ;
  1. DEFPRV(SDCLN) ; Return the default provider for a clinic if one is specified
  1. ; Input
  1. ; SDCLN - Clinic IEN for HOSPITAL LOCATION File (#44)
  1. ; Output
  1. ; Provider from NEW PERSON File (#200):
  1. ; IEN^Provider Name or Null
  1. ;
  1. N SDX,PRVIEN,PRVNAME,RSLT
  1. ;
  1. S SDX=0
  1. F S SDX=$O(^SC(SDCLN,"PR",SDX)) Q:'SDX D
  1. . Q:'$P($G(^SC(SDCLN,"PR",SDX,0)),U,2)
  1. . S PRVIEN=$P($G(^SC(SDCLN,"PR",SDX,0)),U)
  1. . S PRVNAME=$$GET1^DIQ(200,PRVIEN,.01)
  1. . S RSLT=$G(PRVIEN)_"^"_$G(PRVNAME)
  1. Q $G(RSLT)
  1. ;
  1. ERRMSG(ERRCODE) ; Generate bulletin when an error condition is processed
  1. ; Bulletins will be sent only if the receiving mail group SD RSA API ERRORS
  1. ; contains at least 1 member
  1. ;
  1. N XMDUZ,XMSUB,XMTEXT,XMB,X,Y,MSG,SDMG,XMY
  1. ;
  1. S SDMG=$O(^XMB(3.8,"B","SD RSA API ERRORS",0))
  1. Q:'SDMG
  1. ; Check mail group for members. Quit if there are no members assigned to the group
  1. Q:'$D(^XMB(3.8,SDMG,1,"B"))
  1. ;
  1. ; Get the error message, or set a generic message
  1. S MSG=$P($G(ERRCODE),U,2)
  1. I MSG']"" S MSG="A general error condition occurred during the PFSS Event Driver processing"
  1. ;
  1. S XMDUZ="PFSS EVENT DRIVER"
  1. S XMY("G.SD RSA API ERRORS")=""
  1. S XMB="SD API ERROR NOTICE"
  1. S XMB(1)=$$GET1^DIQ(2,DFN,.01)
  1. S XMB(2)=$$FMTE^XLFDT(SDT)
  1. S XMB(3)=$$GET1^DIQ(44,SDCL,.01)
  1. S XMB(4)=IBBEVENT
  1. S XMB(5)=MSG
  1. D ^XMB
  1. Q
  1. ;
  1. GETEVT(EVT) ; Return message type for appointment event
  1. ; The following appoint events will return the indicated message type
  1. ; MAKE A05
  1. ; CHECK-IN A04
  1. ; CHECK-OUT A03
  1. ; NO-SHOW A38
  1. ;
  1. ; CANCEL APPT. A38
  1. ; CANCEL CHECK-IN A11
  1. ; CANCEL CHECK-OUT A13
  1. ; CANCEL NO-SHOW A05
  1. ;
  1. Q $S(EVT="MAKE":"A05",EVT="CHECK-IN":"A04",EVT="CHECK-OUT":"A03",EVT="NO-SHOW":"A38",EVT="CANCEL":"A38",EVT="DELETE CO":"A13",EVT="DELETE CI":"A11",EVT="DELETE NS":"A05",1:"")