APCDAPI4 ; IHS/CMI/LAB - & HMW - PCC API FOR RPMS ;
;;2.0;IHS PCC SUITE;;MAY 14, 2009
; REQUIRES PIMS VERSION 5.3 PATCH 1002
;
GETVISIT(APCDIN,APCDOUT) ;PEP - API for PCC visit Creation by RPMS applications
;
; >> See details in PIMS Technical Manual (released as appendix with patch 1003)
; or in SAC Developers' Handbook
;
; >> All date/time variables must be in FileMan internal format
;
; Special Incoming Variables:
; APCDIN("FORCE ADD") = 1 ; no matter what, create new visit (Optional)
; APCDIN ("NEVER ADD") = 1 ; never add visit, just try to find one or more (Optional)
; APCDIN("ANCILLARY") = 1 ; for ancillary packages to create noon visit if no match found (Optional)
;
; Incoming Variables used in Matching: REQUIRED
; APCDIN("PAT") = patient IEN (file 2 or 9000001)
; APCDIN("VISIT DATE") = visit date & time (same as check-in date & time)
; APCDIN ("SITE") = location of encounter IEN (file 4 or 9999999.06)
; APCDIN("VISIT TYPE") = internal value for field .03 in Visit file
; APCDIN("SRV CAT") = internal value for service category
; APCDIN("TIME RANGE") = # ; range in minutes for matching on visit time; REQUIRED unless FORCE ADD set
; ; zero=exact matches only; -1=don't match on time
;
; These are used to match if sent (Optional)
; APCDIN("PROVIDER") = IEN for provider to match from file 200
; APCDIN("CLINIC CODE") = IEN of clinic stop code (file 40.7)
; APCDIN("HOS LOC") = IEN of hospital location (file 44)
;
; Incoming Variables used in creating appt and visit
; APCDIN("APPT DATE") = appt date & time (Required for scheduled appts and walk-ins; check-in will be performed)
; APCDIN("USR") = user IEN in file 200; REQUIRED
; APCDIN("OPT") = name for Option Used To Create field (Optional)
; APCDIN("OI") = reason for appointment; for walk-ins (Optional)
;
; Incoming PCC variables for adding additional info to visit (Optional)
; APCDIN("APCDTPB") = Third Party Billed (#.04)
; APCDIN("APCDPVL") = Parent Visit Link (#.12)
; APCDIN("APCDAPPT" = WalkIn/Appt (#.16)
; APCDIN("APCDEVM") = Evaluation and Management Code (#.17)
; APCDIN("APCDCODT") = Check Out Date & Time (#.18)
; APCDIN("APCDLS") = Level of Service -PCC Form (#.19).
; APCDIN("APCDVELG") = Eligibility (#.21)
; APCDIN("APCDPROT") = Protocol (#.25).
; APCDIN("APCDOPT") = Option Used To Create (#.24) ;IHS/OIT/LJF 09/15/2005 PATCH 1004
; APCDIN("APCDOLOC") = Outside Location (#2101) ;IHS/OIT/LJF 12/21/2005 PATCH 1005
; Outgoing Array:
; APCDOUT(0) always set; if = 0 none found and may have error message in 2nd piece
; if = 1 and APCDOUT(visit ien)="ADD" new visit just created
; if = 1 and APCDOUT(visit ien)=#; # is time difference in minutes
; if >1, multiple APCDOUT(visit ien) entries exist
;
I '$L($T(VISIT^BSDV)) S APCDOUT(0)="0^PIMS version 5.3 must be installed" Q
I '$L($T(GETVISIT^BSDAPI4)) S APCDOUT(0)="0^PIMS patch 1004 must be installed" Q
D GETVISIT^BSDAPI4(.APCDIN,.APCDOUT)
Q
APCDAPI4 ; IHS/CMI/LAB - & HMW - PCC API FOR RPMS ;
+1 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
+2 ; REQUIRES PIMS VERSION 5.3 PATCH 1002
+3 ;
GETVISIT(APCDIN,APCDOUT) ;PEP - API for PCC visit Creation by RPMS applications
+1 ;
+2 ; >> See details in PIMS Technical Manual (released as appendix with patch 1003)
+3 ; or in SAC Developers' Handbook
+4 ;
+5 ; >> All date/time variables must be in FileMan internal format
+6 ;
+7 ; Special Incoming Variables:
+8 ; APCDIN("FORCE ADD") = 1 ; no matter what, create new visit (Optional)
+9 ; APCDIN ("NEVER ADD") = 1 ; never add visit, just try to find one or more (Optional)
+10 ; APCDIN("ANCILLARY") = 1 ; for ancillary packages to create noon visit if no match found (Optional)
+11 ;
+12 ; Incoming Variables used in Matching: REQUIRED
+13 ; APCDIN("PAT") = patient IEN (file 2 or 9000001)
+14 ; APCDIN("VISIT DATE") = visit date & time (same as check-in date & time)
+15 ; APCDIN ("SITE") = location of encounter IEN (file 4 or 9999999.06)
+16 ; APCDIN("VISIT TYPE") = internal value for field .03 in Visit file
+17 ; APCDIN("SRV CAT") = internal value for service category
+18 ; APCDIN("TIME RANGE") = # ; range in minutes for matching on visit time; REQUIRED unless FORCE ADD set
+19 ; ; zero=exact matches only; -1=don't match on time
+20 ;
+21 ; These are used to match if sent (Optional)
+22 ; APCDIN("PROVIDER") = IEN for provider to match from file 200
+23 ; APCDIN("CLINIC CODE") = IEN of clinic stop code (file 40.7)
+24 ; APCDIN("HOS LOC") = IEN of hospital location (file 44)
+25 ;
+26 ; Incoming Variables used in creating appt and visit
+27 ; APCDIN("APPT DATE") = appt date & time (Required for scheduled appts and walk-ins; check-in will be performed)
+28 ; APCDIN("USR") = user IEN in file 200; REQUIRED
+29 ; APCDIN("OPT") = name for Option Used To Create field (Optional)
+30 ; APCDIN("OI") = reason for appointment; for walk-ins (Optional)
+31 ;
+32 ; Incoming PCC variables for adding additional info to visit (Optional)
+33 ; APCDIN("APCDTPB") = Third Party Billed (#.04)
+34 ; APCDIN("APCDPVL") = Parent Visit Link (#.12)
+35 ; APCDIN("APCDAPPT" = WalkIn/Appt (#.16)
+36 ; APCDIN("APCDEVM") = Evaluation and Management Code (#.17)
+37 ; APCDIN("APCDCODT") = Check Out Date & Time (#.18)
+38 ; APCDIN("APCDLS") = Level of Service -PCC Form (#.19).
+39 ; APCDIN("APCDVELG") = Eligibility (#.21)
+40 ; APCDIN("APCDPROT") = Protocol (#.25).
+41 ; APCDIN("APCDOPT") = Option Used To Create (#.24) ;IHS/OIT/LJF 09/15/2005 PATCH 1004
+42 ; APCDIN("APCDOLOC") = Outside Location (#2101) ;IHS/OIT/LJF 12/21/2005 PATCH 1005
+43 ; Outgoing Array:
+44 ; APCDOUT(0) always set; if = 0 none found and may have error message in 2nd piece
+45 ; if = 1 and APCDOUT(visit ien)="ADD" new visit just created
+46 ; if = 1 and APCDOUT(visit ien)=#; # is time difference in minutes
+47 ; if >1, multiple APCDOUT(visit ien) entries exist
+48 ;
+49 IF '$LENGTH($TEXT(VISIT^BSDV))
SET APCDOUT(0)="0^PIMS version 5.3 must be installed"
QUIT
+50 IF '$LENGTH($TEXT(GETVISIT^BSDAPI4))
SET APCDOUT(0)="0^PIMS patch 1004 must be installed"
QUIT
+51 DO GETVISIT^BSDAPI4(.APCDIN,.APCDOUT)
+52 QUIT