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

IBDFDEA.m

Go to the documentation of this file.
  1. IBDFDEA ;ALB/AAS - AICS Data Entry API ; 19-JUN-96
  1. ;;3.0;AUTOMATED INFO COLLECTION SYS;;APR 24, 1997
  1. ;
  1. ;
  1. EN1(PXCA,IBDF) ; -- Procedure
  1. ; -- supported reference to process encounter form data.
  1. ; Packages that know patient, visit date/time, and clinic
  1. ; can call this api to use the AICS data entry system to prompt
  1. ; users for encounter data and subsequently store this data
  1. ; using the PCE device interface (this is done automatically using
  1. ; the aics parameters).
  1. ; D EN1^IBDFDEA(.RESULTS,.IBDF)
  1. ;
  1. ; -- Input: PXCA, called by reference, the results of processing
  1. ; are returned in this array. See PCE device inteface
  1. ; manual for description of data nodes
  1. ; IBDF, called by reference
  1. ; IBDF("APPT") := Appointment Date Time (required)
  1. ; IBDF("DFN") := pointer to patient file (required)
  1. ; IBDF("CLINIC") := pointer to hospital location file (44)
  1. ; (optional) if clinic not defined and no
  1. ; form printed, no data entry allowed
  1. ; IBDF("NOAPPT") := (optional) if AICS parameters allow
  1. ; making follow up appointments, setting
  1. ; this to any non-zero value will suppress
  1. ; the ability to add followup appointments
  1. ; IBDF("PROVIDER") := (optional) if defined, will be used as
  1. ; primary provider for data entry, use
  1. ; for provider data entry options
  1. ;
  1. N %,%H,C,I,J,X,Y,ADD,DEL,ASKOTHER,DIR,DIC,DA,CNT,DFN,DIRUT,DUOUT,DTOUT,POP,RTN,FRMDATA,IBY,IBQUIT,IBDOBJ,IBDPTSTI,IBDPTSTE,IBDPTNM,IBDPTDTI,SEL
  1. N IBDPTDTE,IBDFMNME,IBDFMIEN,IBDFMSTI,IBDFMSTE,IBDFMIDI,IBDCLNME,IBFORM,IBDCLNPH,IBDPID,IBDPTPRI,IBDSEL,IBDPI,IBDCO,SDCLST,PXCASTAT,PXKNODA,PXKNODB,IBDREDIT,IBDASK,IBDPRE,IBDOK
  1. N ANS1,AUPNDAYS,AUPNDOB,AUPNDOD,AUPNPAT,AUPNSEX,FORMLST
  1. ;
  1. I '$D(IOF) D HOME^%ZIS
  1. G:'$G(IBDF("DFN")) EN1Q S DFN=IBDF("DFN")
  1. G:'$G(IBDF("APPT")) EN1Q
  1. S IBQUIT=0
  1. ;
  1. ; -- if no form create entry
  1. S FORMLST=$$FINDID^IBDF18C(DFN,IBDF("APPT"),"",1)
  1. I FORMLST="",$G(IBDF("CLINIC")) D ANYWAY^IBDFDE6
  1. ;
  1. G:IBQUIT EN1Q
  1. ;
  1. I FORMLST F IBDX=1:1 S IBDF("FORM")=$P(FORMLST,"^",IBDX) Q:IBDF("FORM")="" I IBDF("FORM")'="" D EN^IBDFDE K IBDSEL,IBDPI Q:IBQUIT
  1. ;
  1. EN1Q Q
  1. ;
  1. SCANFRM(X) ; is entry scannable
  1. Q +$P($G(^IBE(357,+$P($G(^IBD(357.95,+$P($G(^IBD(357.96,X,0)),"^",4),0)),"^",21),0)),"^",12)
  1. ;
  1. DELFT ; -- Delete forms Tracking Entry
  1. N I,J,IBD,DIR,DIRUT,VALMY,IBDF,IBDNODE,DFN,APPT,IBX,CLN,IBQUIT,FORMID
  1. D EN^VALM2($G(XQORNOD(0)))
  1. I $D(VALMY) D FULL^VALM1 S IBD=0 F S IBD=$O(VALMY(IBD)) Q:'IBD!$D(DIRUT) D
  1. .S IBDF=$P($G(^TMP("FRMIDX",$J,+IBD)),"^",2)
  1. .S IBDNODE=$G(^IBD(357.96,+IBDF,0)) I IBDNODE="" W !,"No Form Tracking record associated with entry #",IBD H 2 Q
  1. .I $D(^XUSEC("IBD MANAGER",DUZ)) D
  1. ..S IBX=$P(IBDNODE,"^",11) I IBX>1,IBX<20 W !!,"***** Status indicates action has been taken on this entry #"_IBD_" *****"
  1. ..W !!?25,"*** Entry #"_IBD_" STATUS: "_$S(IBX=1:"PRINTED",IBX=2:"SCANNED",IBX=3:"SCD/PCE",IBX=4:"SCD w/ER",IBX=5:"DENTRY",IBX=6:"DE to PCE",IBX=7:"DE w/ER",IBX=11:"PEND Pgs",IBX=12:"NO TRANS",20:"AVAIL DE",1:"NOT PRNT")_" ***"
  1. .I '$D(^XUSEC("IBD MANAGER",DUZ)) D
  1. ..S DFN=$P(IBDNODE,"^",2),APPT=$P(IBDNODE,"^",3),CLN=$P(IBDNODE,"^",10),FORMID=$P(IBDNODE,"^",4)
  1. ..I $D(^DPT(DFN,"S",APPT,0)),$P(^DPT(DFN,"S",APPT,0),"^",1)=CLN D ; !,"Entry #"_IBD_" - Nothing Deleted...Deleting entries only allowed for entries not associated with an appointment." H 2 S IBQUIT=1 Q
  1. ...I $D(^IBD(357.95,FORMID,0)),'$P(^IBD(357.95,FORMID,0),"^",2) W !,"Entry #"_IBD_" - Nothing Deleted...This entry is associated with an appointment, and is the most current version of the form." H 2 S IBQUIT=1 Q
  1. ..;I $P(IBDNODE,"^",11)>1,$P(IBDNODE,"^",11)<20 W !,"Status indicates action taken on this entry, deletion not allowed." H 2 Q
  1. .I '$D(IBQUIT) W ! S DIR(0)="Y",DIR("B")="NO",DIR("A")="Are You Sure you want to delete entry #"_IBD
  1. .I '$D(IBQUIT) D ^DIR I Y'=1 W !,"Entry #",IBD," not Deleted!" H 2 Q
  1. .I '$D(IBQUIT) D DP1
  1. .K IBQUIT
  1. I '$D(VALMY) G DTQ1
  1. ;
  1. DTQ K ^TMP("CNT",$J),^TMP("FRM",$J),^TMP("FTRK",$J),^TMP("STATS",$J),^TMP("FRMIDX",$J),^TMP("STAIDX",$J)
  1. D EXIT1^IBDFFT,START^IBDFFT1
  1. DTQ1 S VALMBCK="R" Q
  1. ;
  1. DP1 ; -- actual deletion of forms tracking entry
  1. N DA,DIC,DIK
  1. S DA=IBDF,DIK="^IBD(357.96," D ^DIK
  1. W !,"Entry ",IBD," Deleted!"
  1. Q