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

ACKQASU3.m

Go to the documentation of this file.
  1. ACKQASU3 ;HCIOFO/BH-New/Edit Visit Utilities ; 04/01/99
  1. ;;3.0;QUASAR;**2**;Feb 11, 2000
  1. ;Per VHA Directive 10-93-142, this routine SHOULD NOT be modified.
  1. ;
  1. PCESEND(ACKVIEN) ; This function is called from within the New Visit
  1. ; and Edit visit processing. It calls the send to PCE function.
  1. ; The SEND to PCE function returns either true or false depending on
  1. ; whether the visit has been sent successfully. It the SEND function
  1. ; returns true this function quits returning a true value. If the
  1. ; SEND function returns false the error is displayed (contained in the
  1. ; error multiple of the A&SP visit file). The user is then offered
  1. ; the option to either quit processing this visit and leave it with an
  1. ; error or to return back into the visit entry function - thus
  1. ; enabling the user to edit the erroreous field.
  1. ;
  1. ; Input : ACKVIEN=IEN of visit to be processed
  1. ; Output : '1' or '0'
  1. ;
  1. N X,Y,DA,D,D0,DA,DI,DIC,DIE,DIFLD,DK,DL,DR
  1. I $$SENDPCE^ACKQPCE(ACKVIEN) Q 1
  1. ; If here transmission was unsucceful - Error text will in field 6.5
  1. ;
  1. ; Display transmission Error
  1. D ERORDISP(ACKVIEN)
  1. ;
  1. ; Prompt user if they wish to re-edit the visit
  1. ;
  1. TEST S DIR("A")=" Do you wish to Re-edit this Visit "
  1. S DIR("B")="Y"
  1. S DIR("?")=" Do you wish to Re-edit this visit or Quit ? Enter (Y) or (N)."
  1. S DIR(0)="Y"
  1. D ^DIR K DIR
  1. I $D(DIRUT) Q 1
  1. I X="Y"!(X="y") Q 0
  1. I X="N"!(X="n") Q 1
  1. ;
  1. Q
  1. ;
  1. ERORDISP(ACKVIEN) ; Display text that defines the reason for the
  1. ; transmission failiure to PCE.
  1. ; Passed in Visit IEN, Displays error multiple (6.5) of the associated
  1. ; visit.
  1. N ACKNUM,ACKK1,ACKTGT,ACKFLD,ACKVAL,ACKERR
  1. ;
  1. W @IOF
  1. I $O(^ACK(509850.6,ACKVIEN,6.5,0))="" D HEADING W !!!," No Error information returned for display.",!! Q
  1. ;
  1. S ACKK1=0 D HEADING
  1. F S ACKK1=$O(^ACK(509850.6,ACKVIEN,6.5,ACKK1)) Q:'+ACKK1 D
  1. . D GETS^DIQ(509850.65,ACKK1_","_ACKVIEN_",",".02;.04;1","I","ACKTGT")
  1. . S ACKFLD=$G(ACKTGT(509850.65,ACKK1_","_ACKVIEN_",",.02,"I"))
  1. . S ACKVAL=$G(ACKTGT(509850.65,ACKK1_","_ACKVIEN_",",.04,"I"))
  1. . S ACKERR=$G(ACKTGT(509850.65,ACKK1_","_ACKVIEN_",",1,"I"))
  1. . S ACKNUM=$E("Error #"_ACKK1,1,10),ACKFLD=$E("Field: "_ACKFLD,1,28)
  1. . S ACKVAL=$E("Value: "_ACKVAL,1,21),ACKERR=$E("Message: "_ACKERR,1,72)
  1. . W !!,?2,ACKNUM,?20,ACKFLD,?50,ACKVAL,!
  1. . W ?2,ACKERR
  1. ;
  1. W !!
  1. Q
  1. ;
  1. HEADING ;
  1. W "There has been an Error during the Transmission of this QUASAR visit.",!
  1. W "The PCE system has return the following Errors for this visit."
  1. Q
  1. ;
  1. DATACHK(ACKVIEN) ; PCE Data integrity check.
  1. ; Only called if Quasar visit has a value within the PCE VISIT IEN
  1. ; field. This routine check the Clinic,Patient,Appointment time and
  1. ; Visit date values on the quasar file and compares them to the same
  1. ; fields on the associated PCE record. If the values are all the same
  1. ; the routine Quits. If the Clinic,Patient or Visit Date are different
  1. ; then a message is displayed to the user detailing which field(s) are
  1. ; different and then deletes the PCE VISIT IEN.If just the Appointment
  1. ; Time is different a message is displayed the user then has the choice
  1. ; to either overwrite the Quasar time with the PCE time or to leave the
  1. ; Quasar time as it is and Quasar will delete the PCE VISIT IEN.
  1. N ACKARR,ACKTEST,ACKSTAT,ACKOUT
  1. S ACKTEST=$$PCECHKV^ACKQUTL3(ACKVIEN)
  1. S ACKSTAT=$P(ACKTEST,"^",1)
  1. ;
  1. I ACKSTAT=2 Q 1 ; Everything is okay
  1. ;
  1. I ACKSTAT=0 D Q ACKOUT ; Clinic, Patient or Visit Date different
  1. . W !!,"The following fields within the PCE Visit entry linked to this Quasar visit no"
  1. . W !,"longer match.",!
  1. . I '$P(ACKTEST,U,2) W !," CLINIC LOCATION"
  1. . I '$P(ACKTEST,U,3) W !," PATIENT"
  1. . I '$P(ACKTEST,U,4) W !," VISIT DATE"
  1. . W !!,"Due to this mismatch the link between this Quasar visit and the PCE visit will"
  1. . W !,"be broken.",!
  1. . S ACKARR(509850.6,ACKVIEN_",",125)="" D FILE^DIE("","ACKARR")
  1. . W !,"Enter <RETURN> to continue processing this visit or '^' to Quit."
  1. . S DIR(0)="E" D ^DIR I $D(DUOUT)!($D(DTOUT)) S ACKOUT=0 Q
  1. . S ACKOUT=1 Q
  1. ;
  1. I ACKSTAT=1 D Q ACKOUT
  1. . W !!,"The Appointment Time of "_$$FMT^ACKQUTL6(ACKTEST)_" within the PCE Visit no longer matches the"
  1. . W !,"Appointment Time of "_$$FMT^ACKQUTL6($$GET1^DIQ(509850.6,ACKVIEN_",",55,"I"))_" within the linked Quasar visit.",!
  1. . K DIR S DIR(0)="Y",DIR("B")="YES"
  1. . S DIR("A")="Update this Quasar Visit with PCE Appointment Time "
  1. . S DIR("?")="Enter YES to Update Quasar with the linked PCE visits Appointment Time, 'NO' to break the link between the Quasar visit and the PCE Visit or '^' to Quit with no action."
  1. . D ^DIR K DIR I $D(DTOUT) S X=U
  1. . I X="^" S ACKOUT=0 Q
  1. . I $E(X)="N" S ACKARR(509850.6,ACKVIEN_",",125)="" D FILE^DIE("","ACKARR") S ACKOUT=1 Q
  1. . I $E(X)="Y" S ACKARR(509850.6,ACKVIEN_",",55)=$P(ACKTEST,U,2) D FILE^DIE("","ACKARR") S ACKOUT=1 Q
  1. Q
  1. ;