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

LA7DEDT.m

Go to the documentation of this file.
  1. LA7DEDT ;DALOI/PWC/RLM-LA7D EDIT FOREIGN COMPUTER INTERFACE FILE ;02/14/2000
  1. ;;5.2;AUTOMATED LAB INSTRUMENTS;**53,58**;Sep 27, 1994
  1. ; Reference to $$FIND1^DIC supported by IA #2051
  1. ; Reference to LIST^DIC supported by IA #2051
  1. ; Reference to UPDATE^DIE supported by IA #2053
  1. ; Reference to ^DIK supported by IA #10013
  1. ; Reference to ^DIR supported by IA #10026
  1. ;
  1. ; This routine will allow the user to enter a foreign computer
  1. ; system name and the supported ward(s) for each name
  1. ; (ie. CareVue, Marquette)
  1. ;
  1. K ^TMP("DIERR",$J)
  1. K CNT,DA,DEL,DIERR,DIK,DIR,DIROUT,DIRUT,DONE,DTOUT,DUOUT,FROM
  1. K I,IEN,IRESULT,J,LA7D,LA7DERR,LA7DERR1,LA7DIEN,LA7DTMP,LAIEN
  1. K LAIENW,OK,WIEN,WWIEN,X,Y
  1. ADDNEW ;
  1. K DIR
  1. S DIR("A")="Do you wish to Add or Edit a Bedside Monitor"
  1. ;S DIR("?")=""
  1. S DIR(0)="S^a:ADD;e:EDIT"
  1. S DIR("B")="E"
  1. D ^DIR Q:X=""!($D(DIRUT))!($D(DIROUT))
  1. G:Y="a" ADD
  1. NAME ; input the name of the bedside monitor interface
  1. D HELPM
  1. K DIR S DIR("A")="Enter BEDSIDE MONITOR INTERFACE NAME"
  1. S DIR("?")="Enter Bedside Monitor Name (ie. CareVue, Marquette)"
  1. S DIR(0)="PO^62.487:LEM"
  1. K DIR("B") S DLAYGO="62.487"
  1. D ^DIR K DLAYGO Q:X=""!($D(DIRUT))!($D(DIROUT))
  1. S IRESULT=$P(Y,"^",2)
  1. S LA7DIEN=$S($D(IEN(1)):IEN(1),1:+Y)
  1. S DONE=0
  1. ;
  1. WARD ; input the ward # associated with the bedside monitor interface
  1. ;
  1. D HELPW
  1. K DIR S DIR("A")="Enter "_IRESULT_" WARD"
  1. S DIR("?")="Enter wards associated with this bedside monitor"
  1. S DIR(0)="P^44:EMZ"
  1. F J=1:1 D Q:DONE
  1. . K DIR("B")
  1. . D ^DIR I X=""!($D(DIRUT))!($D(DIROUT)) S DONE=1 Q
  1. . S WIEN=+Y
  1. . I WIEN=0!(WIEN="") W " Invalid" Q ; does not exist in file 44
  1. . K LA7DERR
  1. . S WWIEN=$$FIND1^DIC(62.4871,","_LA7DIEN_",","AX",$P(Y,"^",2),,,"LA7DERR")
  1. . ;I $D(LA7DERR) K LA7DERR S WWIEN=$$FIND1^DIC(62.4871,","_LA7DIEN_",","AX",$P(Y,"^",2),,,"LA7DERR")
  1. . ;I $D(LA7DERR) W !,"There is an error with this entry." Q
  1. . I WWIEN'=0 W " already on file" D DELETE Q ; exists in file 62.487
  1. . K LA7D,LA7DERR,LAIENW ; does not exist, add to database
  1. . F CNT=1:1 Q:'$D(^LAB(62.487,LA7DIEN,1,CNT))
  1. . I CNT=LA7DIEN S CNT=CNT+1
  1. . S LA7D(62.487,LA7DIEN_",",.01)=IRESULT
  1. . S LA7D(62.4871,"?+"_CNT_","_LA7DIEN_",",.01)=WIEN
  1. . D UPDATE^DIE("S","LA7D","LAIENW","LA7DERR")
  1. . I $D(LA7DERR) W !,$G(LA7DERR("DIERR",1,"TEXT",1))
  1. EXIT ;
  1. K CNT,DA,DEL,DIERR,DIK,DIR,DIROUT,DIRUT,DONE,DTOUT,DUOUT,FROM
  1. K I,IEN,IRESULT,J,LA7D,LA7DERR,LA7DERR1,LA7DIEN,LA7DTMP,LAIEN
  1. K LAIENW,OK,WIEN,WWIEN,X,Y
  1. K ^TMP("DIERR",$J)
  1. Q
  1. ;
  1. HELPW ; A list of available wards will display before the WARD prompt is issued.
  1. ;
  1. W !," Current Wards for ",$P(^LAB(62.487,LA7DIEN,0),"^")
  1. K LA7DTMP,LA7DERR1 S FROM=""
  1. D LIST^DIC(62.4871,","_LA7DIEN_",",.01,,,FROM,,,,,"LA7DTMP","LA7DERR1")
  1. F J=1:1 Q:'$D(LA7DTMP("DILIST",1,J)) W !," ",LA7DTMP("DILIST",1,J) I '(J#5) K DIR S DIR(0)="E" D ^DIR Q:'Y
  1. Q
  1. ;
  1. HELPM ; A list of available Bedside Monitors will display before the BEDSIDE MONITOR prompt is issued.
  1. ;
  1. W !," Current Bedside Monitors"
  1. K LA7DTMP,LA7DERR1 S FROM=""
  1. D LIST^DIC(62.487,,.01,,,FROM,,,,,"LA7DTMP","LA7DERR1")
  1. F J=1:1 Q:'$D(LA7DTMP("DILIST",1,J)) W !," ",LA7DTMP("DILIST",1,J) I '(J#5) K DIR S DIR(0)="E" D ^DIR Q:'Y
  1. Q
  1. ;
  1. ADD ;Add an entry to 62.487
  1. D HELPM
  1. K DIR S DIR("A")="Enter the name of the NEW Bedside Monitor"
  1. S DIR(0)="F^3:30"
  1. D ^DIR Q:X=""!($D(DIRUT))!($D(DIROUT))
  1. S Y=$$FIND1^DIC(62.487,,,X,,,"LA7DERRA")
  1. S IRESULT=X
  1. I Y!(Y="") W !,X_" exists, please select a new name."
  1. I Y=0 S DIR("A")=X_" does not exist. Do you wish to add it?" S DIR(0)="Y",DIR("B")="N" D ^DIR G:'Y ADD D
  1. . K LA7D ;does not exist, add to database
  1. . S LA7D(62.487,"?+1,",.01)=IRESULT
  1. . D UPDATE^DIE("ES","LA7D","LAIEN","LA7DERR")
  1. . ;do the FIND1^DIC again since we don't know the IEN
  1. . S Y=$$FIND1^DIC(62.487,,,X)
  1. . S LA7DIEN=LAIEN(1),DONE=0
  1. G WARD Q
  1. DELETE ; delete entry from ^LAB(62.487
  1. ;
  1. W !,"Ward already on File, DELETE (Y/N) [N] " R DEL:DTIME
  1. S:DEL="" DEL="N" Q:DEL="N"!(DEL="^")
  1. I DEL'="Y" W $C(7)," Must enter Y or N" G DELETE
  1. K DIK,DA S DA(1)=LA7DIEN,DA=WWIEN
  1. S DIK="^LAB(62.487,"_DA(1)_",1,"
  1. D ^DIK K DIK,DA
  1. Q
  1. ZEOR ;LA7DEDT