- PXUTLVST ;ISL/dee - Looks up the visit to see if there is already one ;8/6/96
- ;;1.0;PCE PATIENT CARE ENCOUNTER;;Aug 12, 1996
- Q
- ;
- LOOKVSIT(PAT,VDT,LOC,DSS,INS,TYP) ;Calls visit tracking to see if there is already a visit.
- ;Get the visit for the appointment is there is one
- N APPTVST
- S APPTVST=$$APPT2VST^PXUTL1(PAT,VDT,LOC)
- I APPTVST>0 Q APPTVST
- ;
- N VSIT,VSITPKG
- S VSIT("IEN")=""
- S VSIT("VDT")=VDT
- S VSIT("PAT")=PAT
- S VSIT("LOC")=LOC
- S VSIT("INS")=$G(INS)
- S VSIT("TYP")=$G(TYP)
- S VSIT("DSS")=$G(DSS)
- I VSIT("DSS")="",$P($G(^SC(+VSIT("LOC"),0)),"^",7)>0 S VSIT("DSS")=$P(^SC(+VSIT("LOC"),0),"^",7)
- S VSITPKG="PX"
- S VSIT(0)="D0EM"
- ;
- ;CALL FOR VSIT
- D ^VSIT
- I '$D(VSIT("IEN"))#2 Q -1
- Q $P(VSIT("IEN"),"^",1)
- ;
- PXUTLVST ;ISL/dee - Looks up the visit to see if there is already one ;8/6/96
- +1 ;;1.0;PCE PATIENT CARE ENCOUNTER;;Aug 12, 1996
- +2 QUIT
- +3 ;
- LOOKVSIT(PAT,VDT,LOC,DSS,INS,TYP) ;Calls visit tracking to see if there is already a visit.
- +1 ;Get the visit for the appointment is there is one
- +2 NEW APPTVST
- +3 SET APPTVST=$$APPT2VST^PXUTL1(PAT,VDT,LOC)
- +4 IF APPTVST>0
- QUIT APPTVST
- +5 ;
- +6 NEW VSIT,VSITPKG
- +7 SET VSIT("IEN")=""
- +8 SET VSIT("VDT")=VDT
- +9 SET VSIT("PAT")=PAT
- +10 SET VSIT("LOC")=LOC
- +11 SET VSIT("INS")=$GET(INS)
- +12 SET VSIT("TYP")=$GET(TYP)
- +13 SET VSIT("DSS")=$GET(DSS)
- +14 IF VSIT("DSS")=""
- IF $PIECE($GET(^SC(+VSIT("LOC"),0)),"^",7)>0
- SET VSIT("DSS")=$PIECE(^SC(+VSIT("LOC"),0),"^",7)
- +15 SET VSITPKG="PX"
- +16 SET VSIT(0)="D0EM"
- +17 ;
- +18 ;CALL FOR VSIT
- +19 DO ^VSIT
- +20 IF '$DATA(VSIT("IEN"))#2
- QUIT -1
- +21 QUIT $PIECE(VSIT("IEN"),"^",1)
- +22 ;