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

ACKQPCE.m

Go to the documentation of this file.
  1. ACKQPCE ;HCIOFO/AG - Quasar PCE Interface; August 1999.
  1. ;;3.0;QUASAR;;Feb 11, 2000
  1. ;;
  1. ; this routine contains the entry points for sending a Quasar visit
  1. ; to PCE, and deleting a Quasar visit from PCE.
  1. ; the entry points are :-
  1. ; SENDPCE(ACKVIEN,ACKPKG,ACKSRC,ACKDATE) ; send a visit
  1. ; & KILLPCE(ACKVIEN) ; kill a visit from PCE
  1. ;
  1. SENDPCE(ACKVIEN,ACKPKG,ACKSRC) ; send a visit to pce
  1. ; requires :-
  1. ; ACKVIEN - Quasar visit ien (from 509850.6) (reqd)
  1. ; ACKPKG - package number for Quasar from package file (9.4) (opt)
  1. ; ACKSRC - source name (free text) (opt)
  1. ; returns :-
  1. ; 1 - visit processed ok (no errors)
  1. ; 0 - visit not processed (errors found)
  1. ; briefly, this routine does the following :-
  1. ; (code for this function is in ^ACKQPCE1)
  1. ; .lock the visit
  1. ; .retrieve all the visit data
  1. ; .if the visit already exists in PCE...
  1. ; ..remove all workload from the PCE visit
  1. ; ..if workload not removed ok...
  1. ; ...record error on Qsr Visit file
  1. ; ...unlock visit
  1. ; ...end processing - return 0
  1. ; .create temp file containing visit data in format reqd by
  1. ; PCE api DATA2PCE^PXAPI
  1. ; .call the PCE api to update the PCE Visit file
  1. ; .if PCE api returned an error...
  1. ; ..record error on Qsr Visit file
  1. ; ..unlock visit
  1. ; ..end processing - return 0
  1. ; .update visit fields
  1. ; .unlock visit
  1. ; .end processing - return 1
  1. I +$G(ACKVIEN)=0 Q 0
  1. I $G(ACKPKG)="" S ACKPKG=$$PKG
  1. I $G(ACKSRC)="" S ACKSRC=$$SRC
  1. Q $$SENDPCE^ACKQPCE1(ACKVIEN,ACKPKG,ACKSRC)
  1. ;
  1. KILLPCE(ACKVIEN) ; remove a Quasar Visit from PCE
  1. ; requires:-
  1. ; ACKVIEN - Quasar Visit ien (from 509850.6) (reqd)
  1. ; returns:-
  1. ; 0 - unable to process, error returned by PCE
  1. ; 1 - visit deleted successfully
  1. ; this routine does the following :-
  1. ; .get the PCE ien for the visit
  1. ; .if no PCE ien then exit (return 1)
  1. ; .lock the visit
  1. ; .call the PCE API DELVFILE^PXAPI to delete the visit
  1. ; .if error returned by PCE...
  1. ; ..record error on Qsr Visit file
  1. ; ..file Last Edited in Qsr date (to create Exception entry)
  1. ; ..end processing - return 0
  1. ; .update visit fields
  1. ; .unlock visit
  1. ; .end processing - return 1
  1. I +$G(ACKVIEN)=0 Q 0
  1. Q $$KILLPCE^ACKQPCE3(ACKVIEN)
  1. ;
  1. PKG() ; determine Quasar package number
  1. N ACKTGT
  1. D FIND^DIC(9.4,"",.01,"X","QUASAR",1,"B","","","ACKTGT","")
  1. Q +$G(ACKTGT("DILIST",2,1))
  1. ;
  1. SRC() ; return default source string for quasar/pce interface
  1. Q "QUASAR"
  1. ;
  1. CLEAR(ACKVIEN) ; clear the PCE Error multiple for a Quasar visit
  1. N ACKTGT,ACKI,ACKARR
  1. ; get all the current sub file entries
  1. D LIST^DIC(509850.65,","_ACKVIEN_",",.01,"","*","","","","","","ACKTGT","")
  1. ; transfer them to an FDA format array for update
  1. F ACKI=1:1 Q:'$D(ACKTGT("DILIST",2,ACKI)) D
  1. . S ACKSUB=ACKTGT("DILIST",2,ACKI)
  1. . S ACKARR(509850.65,ACKSUB_","_ACKVIEN_",",.01)="@"
  1. ; now update the file
  1. D FILE^DIE("","ACKARR","")
  1. ; done
  1. Q
  1. ;
  1. FILERSN(ACKVIEN,ACKRSN) ; file PCE Errors on Quasar visit file 509850.6
  1. ; requires :- ACKVIEN - quasar visit number
  1. ; ACKRSN - array containing the errors
  1. N ACKI,ACKARR
  1. F ACKI=1:1:ACKRSN D
  1. . S ACKARR(509850.65,"+"_ACKI_","_ACKVIEN_",",.01)=ACKI
  1. . S ACKARR(509850.65,"+"_ACKI_","_ACKVIEN_",",.02)=$P(ACKRSN(ACKI,0),U,2)
  1. . S ACKARR(509850.65,"+"_ACKI_","_ACKVIEN_",",.03)=$P(ACKRSN(ACKI,0),U,3)
  1. . S ACKARR(509850.65,"+"_ACKI_","_ACKVIEN_",",.04)=$P(ACKRSN(ACKI,0),U,4)
  1. . S ACKARR(509850.65,"+"_ACKI_","_ACKVIEN_",",1)=ACKRSN(ACKI,1)
  1. D UPDATE^DIE("","ACKARR","","")
  1. ; done
  1. Q
  1. ;