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

PXCESK.m

Go to the documentation of this file.
  1. PXCESK ;ISL/dee - Used to edit and display V SKIN TEST ;Mar 15, 2021@15:16:32
  1. ;;1.0;PCE PATIENT CARE ENCOUNTER;**27,124,162,210,211,217**;Aug 12, 1996;Build 134
  1. ;; ;
  1. Q
  1. ;
  1. ;Line with the line label "FORMAT"
  1. ;;Long name~File Number~Node Subscripts~Allow Duplicate entries (1=yes, 0=no)~File global name
  1. ; 1 2 3 4 5
  1. ;
  1. ;Followning lines:
  1. ;;Node~Piece~,Field Number~Edit Label~Display Label~Display Routine~Edit Routine~Help Text for DIR("?")~Set of PXCEKEYS that can Edit~D if Detail Display Only~
  1. ; 1 ~ 2 ~ 3 ~ 4 ~ 5 ~ 6 ~ 7 ~ 8 ~ 9 ~ 10
  1. ;The Display & Edit routines are for special caces.
  1. ; (The .01 field cannot have a special edit.)
  1. ;
  1. ;***Reading (.05) must be the line before Results (.04)***
  1. ;Adding/editing diagnosis removed in PX*1.0*211, reference to
  1. ;EPOV^PXCEVIMM replaced by SKIP^PXCESK.
  1. ;
  1. FORMAT ;;Skin Test~9000010.12~0,12,13,80,811,812~1~^AUPNVSK
  1. ;;0~1~.01~Skin Test: ~Skin Test: ~$$DISPLYSK^PXCESK~~~~B
  1. ;;12~1~1201~Placement Date and Time: ~Date/Time of Placement: ~~EVENTDT^PXCESK(.PXCEAFTR)~~~D
  1. ;;12~2~1202~Ordering Provider: ~Ordering Provider: ~~EPROV12^PXCEPRV~~~D
  1. ;;12~4~1204~Administered By: ~Administered By: ~~EPROV12^PXCEPRV~~~D
  1. ;;12~12~1212~Anatomic Location: ~Anatomic Location of Placement: ~~~~~D
  1. ;;811~1~81101~Placement Comments: ~Placement Comments: ~~~~~D
  1. ;;812~2~81202~Package: ~Package: ~~SKIP^PXCESK~~~D
  1. ;;812~3~81203~Data Source: ~Data Source: ~~SKIP^PXCESK~~~D
  1. ;;0~6~.06~Reading Date and Time: ~Reading Date/Time: ~~EREADDT^PXCESK~~~D
  1. ;;12~14~1214~Hours Read Post-Placement: ~Hours Read Post-Placement: ~~~~~D
  1. ;;0~5~.05~Reading in millimeters (mm): ~Reading in millimeters (mm): ~~EREADING^PXCESK~~~D
  1. ;;0~4~.04~Results~Results: ~~ERESULTS^PXCESK~~~D
  1. ;;0~7~.07~Reader: ~Reader: ~~EPROV12^PXCEPRV~~~D
  1. ;;13~1~1301~Reading Comments: ~Reading Comments: ~~~~~D
  1. ;;80~1~801~Diagnosis: ~Diagnosis: ~$$DISPLY01^PXCEPOV~SKIP^PXCESK~~S~
  1. ;;80~2~802~Diagnosis 2: ~Diagnosis 2: ~$$DISPLY01^PXCEPOV~SKIP^PXCESK~~S~
  1. ;;80~3~803~Diagnosis 3: ~Diagnosis 3: ~$$DISPLY01^PXCEPOV~SKIP^PXCESK~~S~
  1. ;;80~4~804~Diagnosis 4: ~Diagnosis 4: ~$$DISPLY01^PXCEPOV~SKIP^PXCESK~~S~
  1. ;;80~5~805~Diagnosis 5: ~Diagnosis 5: ~$$DISPLY01^PXCEPOV~SKIP^PXCESK~~S~
  1. ;;80~6~806~Diagnosis 6: ~Diagnosis 6: ~$$DISPLY01^PXCEPOV~SKIP^PXCESK~~S~
  1. ;;80~7~807~Diagnosis 7: ~Diagnosis 7: ~$$DISPLY01^PXCEPOV~SKIP^PXCESK~~S~
  1. ;;80~8~808~Diagnosis 8: ~Diagnosis 8: ~$$DISPLY01^PXCEPOV~SKIP^PXCESK~~S~
  1. ;;
  1. ;
  1. ;The interface for AICS to get list on form for help.
  1. INTRFACE ;;PX SELECT SKIN TEST
  1. ;
  1. ;********************************
  1. ;Special cases for display.
  1. ;
  1. ;********************************
  1. ;Special cases for edit.
  1. ;
  1. EREADING ;
  1. I $P(PXCEAFTR(0),"^",5)'="" D
  1. . N DIERR,PXCEDILF,PXCEINT,PXCEEXT
  1. . S PXCEINT=$P(PXCEAFTR($P(PXCETEXT,"~",1)),"^",$P(PXCETEXT,"~",2))
  1. . S PXCEEXT=$$EXTERNAL^DILFD(PXCEFILE,$P(PXCETEXT,"~",3),"",PXCEINT,"PXCEDILF")
  1. . S DIR("B")=$S('$D(DIERR):PXCEEXT,1:PXCEINT)
  1. S DIR(0)="NAO^0:40:0"
  1. S DIR("A")=$P(PXCETEXT,"~",4)
  1. S:$P(PXCETEXT,"~",8)]"" DIR("?")=$P(PXCETEXT,"~",8)
  1. D ^DIR
  1. K DIR,DA
  1. I X="@" S Y="@"
  1. E I $D(DTOUT)!$D(DUOUT) S PXCEEND=1 Q
  1. S $P(PXCEAFTR(0),"^",5)=$P(Y,"^")
  1. Q
  1. ;
  1. EREADDT ;
  1. N PXVPLACE
  1. I $P(PXCEAFTR(0),"^",6)'="" D
  1. . N DIERR,PXCEDILF,PXCEINT,PXCEEXT
  1. . S PXCEINT=$P(PXCEAFTR($P(PXCETEXT,"~",1)),"^",$P(PXCETEXT,"~",2))
  1. . S PXCEEXT=$$EXTERNAL^DILFD(PXCEFILE,$P(PXCETEXT,"~",3),"",PXCEINT,"PXCEDILF")
  1. . S DIR("B")=$S('$D(DIERR):PXCEEXT,1:PXCEINT)
  1. S DIR(0)="9000010.12,.06AO"
  1. S DIR("A")=$P(PXCETEXT,"~",4)
  1. S:$P(PXCETEXT,"~",8)]"" DIR("?")=$P(PXCETEXT,"~",8)
  1. D ^DIR
  1. K DIR,DA
  1. I X="@" S Y="@"
  1. E I $D(DTOUT)!$D(DUOUT) S PXCEEND=1 Q
  1. S $P(PXCEAFTR(0),"^",6)=$P(Y,"^")
  1. N PXVX,X1,X2,X3
  1. S X1=$P(PXCEAFTR(0),"^",6) ; DATE READ
  1. S X2=$P(PXCEAFTR(12),"^") ; EVENT DATE AND TIME
  1. I X2="" S X2=$P($G(^AUPNVSIT(+$P(PXCEAFTR(0),U,3),0)),U,1)
  1. S PXVPLACE=$P(PXCEAFTR(12),U,8) ; PLACEMENT SKIN TEST
  1. I PXVPLACE D
  1. . S X2=$P($G(^AUPNVSK(PXVPLACE,12)),U)
  1. . I X2="" S X2=$P($G(^AUPNVSIT(+$P($G(^AUPNVSK(PXVPLACE,0)),U,3),0)),U,1)
  1. S X3=2 ; return difference in seconds
  1. S PXVX=""
  1. I $G(X1),$L(X1)>7,$G(X2),$L(X2)>7,$G(X2)'>$G(X1) S PXVX=$$FMDIFF^XLFDT(X1,X2,X3)\3600
  1. I PXVX D EN^DDIOL("Hours Read Post-Placement: "_PXVX,"","!")
  1. Q
  1. ;
  1. ERESULTS ;
  1. I $P(PXCEAFTR(0),"^",4)'="" D
  1. . N DIERR,PXCEDILF,PXCEINT,PXCEEXT
  1. . S PXCEINT=$P(PXCEAFTR($P(PXCETEXT,"~",1)),"^",$P(PXCETEXT,"~",2))
  1. . S PXCEEXT=$$EXTERNAL^DILFD(PXCEFILE,$P(PXCETEXT,"~",3),"",PXCEINT,"PXCEDILF")
  1. . S DIR("B")=$S('$D(DIERR):PXCEEXT,1:PXCEINT)
  1. S DIR(0)="SOM^P:POSITIVE;N:NEGATIVE;D:DOUBTFUL;O:NO TAKE"
  1. S DIR("A")=$P(PXCETEXT,"~",4)
  1. S:$P(PXCETEXT,"~",8)]"" DIR("?")=$P(PXCETEXT,"~",8)
  1. D ^DIR
  1. K DIR,DA
  1. I X="@" S Y="@"
  1. E I $D(DTOUT)!$D(DUOUT) S PXCEEND=1 Q
  1. S $P(PXCEAFTR(0),"^",4)=$P(Y,"^")
  1. Q
  1. ;
  1. ;********************************
  1. EVENTDT(PXCEAFTR) ;Edit the Event Date and Time.
  1. N DEFAULT,EVENTDT,HELP,IEN,PROMPT
  1. S DEFAULT=$P(^TMP("PXK",$J,"SK",1,12,"BEFORE"),U,1)
  1. S HELP="D EVDTHELP^PXCESK"
  1. S PROMPT="Placement Date and Time"
  1. S EVENTDT=$$GETDT^PXDATE(-1,-1,-1,DEFAULT,PROMPT,HELP)
  1. S $P(PXCEAFTR(12),U,1)=EVENTDT
  1. Q
  1. ;
  1. ;********************************
  1. EVDTHELP ;Event Date and Time help.
  1. N ERR,RESULT,TEXT
  1. S RESULT=$$GET1^DID(9000010.12,1201,"","DESCRIPTION","TEXT","ERR")
  1. D BROWSE^DDBR("TEXT(""DESCRIPTION"")","NR","V Skin Test Placement Date and Time Help")
  1. I $D(DDS) D REFRESH^DDSUTL S DY=IOSL-7,DX=0 X IOXY S $Y=DY,$X=DX
  1. Q
  1. ;
  1. ;********************************
  1. ;Display text for the .01 field which is a pointer to Skin Test.
  1. ;(Must have is called by ASK^PXCEVFI2 and DEL^PXCEVFI2.)
  1. DISPLY01(PXCESK,PXCEDT) ;
  1. N DIERR,PXCEDILF,PXCEINT,PXCEEXT
  1. S PXCEINT=$P(PXCESK,"^",1)
  1. S PXCEEXT=$$EXTERNAL^DILFD(9000010.12,.01,"",PXCEINT,"PXCEDILF")
  1. Q $S('$D(DIERR):PXCEEXT,1:PXCEINT)
  1. ;
  1. ;********************************
  1. ;
  1. SAVE ;Special code for saving a Skin Test.
  1. N PXCERR
  1. S PXCERR=$P(^TMP("PXK",$J,PXCECATS,1,0,"AFTER"),"^",4,5)
  1. Q:PXCERR="^"
  1. I $P(PXCERR,"^",1)'=$P(^TMP("PXK",$J,PXCECATS,1,0,"BEFORE"),"^",4) S $P(^TMP("PXK",$J,PXCECATS,1,0,"AFTER"),"^",4)="@"
  1. I $P(PXCERR,"^",2)'=$P(^TMP("PXK",$J,PXCECATS,1,0,"BEFORE"),"^",5) S $P(^TMP("PXK",$J,PXCECATS,1,0,"AFTER"),"^",5)="@"
  1. D EN1^PXKMAIN
  1. S ^TMP("PXK",$J,PXCECATS,1,0,"AFTER")=PXCEAFTR(0)
  1. S ^TMP("PXK",$J,PXCECATS,1,12,"AFTER")=PXCEAFTR(12)
  1. S ^TMP("PXK",$J,PXCECATS,1,13,"AFTER")=PXCEAFTR(13)
  1. S ^TMP("PXK",$J,PXCECATS,1,80,"AFTER")=PXCEAFTR(80)
  1. S ^TMP("PXK",$J,PXCECATS,1,811,"AFTER")=PXCEAFTR(811)
  1. Q
  1. ;********************************
  1. SKIP ;Used to by-pass roll and scroll editing of a field.
  1. S (X,Y)=""
  1. Q
  1. ;
  1. ;********************************
  1. ; When adding a new skin test entry, prompt if recording placement, reading, or both.
  1. ; if recording reading, prompt to select corresponding placement entry.
  1. NEW(PXCESKTYP,PXCEAFTR,PXCEPAT,PXCEVIEN) ;
  1. ;
  1. N DIR,DIRUT,PXCEEND,PXDATE,PXEND,PXNODE,PXSKIN,PXSKINNM,PXSKINP,PXSKINPDT,PXSKLST,PXSTART,X,Y
  1. ;
  1. S PXCEEND=0
  1. ;
  1. ; For Historical, set both placement and reading fields.
  1. I $P($G(^AUPNVSIT(+PXCEVIEN,0)),U,7)="E" D Q 0
  1. . S PXCESKTYP="B"
  1. ;
  1. W !
  1. S DIR(0)="SA^A:ADMINISTRATION;R:READING;B:BOTH"
  1. S DIR("A")="Are you recording a skin test (A)dministration, (R)eading, or (B)oth? "
  1. D ^DIR
  1. ;
  1. I $D(DIRUT)!(Y'?1(1"A",1"R",1"B")) Q 1
  1. S PXCESKTYP=Y
  1. ;
  1. I Y'="R" Q PXCEEND
  1. ;
  1. S PXDATE=$P($G(^AUPNVSIT(+PXCEVIEN,0)),U,1)
  1. S PXSKIN=$P(PXCEAFTR(0),U,1)
  1. S PXSKINNM=$P($G(^AUTTSK(+PXSKIN,12)),U,1)
  1. I PXSKINNM="" S PXSKINNM=$P($G(^AUTTSK(+PXSKIN,0)),U,1)
  1. D SKLIST^PXVRPC8(.PXSKLST,PXCEPAT,PXSKIN,PXDATE,1)
  1. S PXNODE=$G(PXSKLST(1))
  1. S PXSTART=""
  1. S PXEND=""
  1. I $P(PXNODE,U,1)="DATERANGE" D
  1. . S PXSTART=$P(PXNODE,U,2)
  1. . S PXEND=$P(PXNODE,U,3)
  1. S PXNODE=$G(PXSKLST(2))
  1. S PXSKINPDT=""
  1. I $P(PXNODE,U,1)="PLACEMENT" D
  1. . S PXSKINPDT=$P(PXNODE,U,5)
  1. . S PXSKINP=$P(PXNODE,U,2)
  1. ;
  1. I 'PXSKINPDT D Q 1
  1. . W !!,"We could not find a "_PXSKINNM_" skin test administered between "_$$FMTE^XLFDT(PXSTART,"D")
  1. . W !,"and "_$$FMTE^XLFDT(PXEND,"D")_" that does not already have a reading."
  1. . D WAIT^PXCEHELP
  1. ;
  1. K DIRUT,DIR,Y,X
  1. S DIR(0)="Y"
  1. S DIR("B")="YES"
  1. W !!,"Is this reading for the "_PXSKINNM_" skin test administered on"
  1. S DIR("A")=$$FMTE^XLFDT(PXSKINPDT,"M")
  1. D ^DIR
  1. ;
  1. I $D(DIRUT)!(Y'?1(1"1",1"0")) Q 1
  1. I Y D
  1. . W !!,"We will link this skin test reading to that placement entry.",!
  1. . H 1
  1. . S $P(PXCEAFTR(12),U,8)=PXSKINP
  1. I 'Y D
  1. . S PXCEEND=1
  1. . W !!,"You must first record the skin test placement before recording the reading."
  1. . D WAIT^PXCEHELP
  1. ;
  1. Q PXCEEND
  1. ;
  1. ;********************************
  1. ; Check if this is a placement or reading entry
  1. EDIT(PXCESKTYP,PXCEAFTR,PXCEFIEN) ;
  1. I $P(PXCEAFTR(12),U,8) S PXCESKTYP="R" Q 0
  1. I $O(^AUPNVSK("APT",PXCEFIEN,0)) S PXCESKTYP="A" Q 0
  1. Q 0
  1. ;
  1. ;********************************
  1. ; Check if user should be prompted for this field.
  1. ; Depends on if PXCESKTYP is (A)dministration/(R)eading/(B)oth.
  1. PROMPT(PXCESKTYP,PXFIELD) ;
  1. ;
  1. N PXPLACE,PXREAD
  1. ;
  1. I $G(PXCESKTYP)?1(1"",1"B") Q 1
  1. ;
  1. ; Placement fields
  1. S PXPLACE="^.01^.02^.03^1201^1202^1204^1211^1212^81101^81202^81203^"
  1. ;
  1. ; Reading fields
  1. S PXREAD="^.01^.02^.03^.04^.05^.06^.07^1208^1214^1220^1301^81202^81203^"
  1. ;
  1. I PXCESKTYP="A",PXPLACE[(U_PXFIELD_U) Q 1
  1. I PXCESKTYP="R",PXREAD[(U_PXFIELD_U) Q 1
  1. ;
  1. Q 0
  1. ;
  1. ;********************************
  1. ; Can this skin test entry be deleted?
  1. CANDEL(PXCEFIEN) ;
  1. ;
  1. I '$D(^AUPNVSK("APT",PXCEFIEN)) Q 1
  1. ;
  1. W !!,"There is a skin test reading linked to this entry. "
  1. W !,"You must first delete the skin test reading entry (#"_$O(^AUPNVSK("APT",PXCEFIEN,0))_")"
  1. W !,"before deleting this placement entry."
  1. D WAIT^PXCEHELP
  1. ;
  1. Q 0
  1. ;
  1. ;
  1. DISPLYSK(PXCESK,PXCEDT) ;Display the skin test.
  1. N PXREADTYP,PXTEXT
  1. S PXCESK=+PXCESK
  1. S PXTEXT=$P($G(^AUTTSK(PXCESK,0)),U,1)
  1. ;
  1. S PXREADTYP=""
  1. I $P($G(^AUPNVSK(+$G(IEN),12)),U,8) S PXREADTYP="R"
  1. I $O(^AUPNVSK("APT",+$G(IEN),0)) S PXREADTYP="A"
  1. S PXTEXT=PXTEXT_$S(PXREADTYP="R":" (Reading)",PXREADTYP="A":" (Placement)",1:"")
  1. ;
  1. Q PXTEXT