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

APCDPNAR.m

Go to the documentation of this file.
APCDPNAR ; IHS/CMI/LAB - EDIT PROVIDER NARRATIVE ;
 ;;2.0;IHS PCC SUITE;**10,11**;MAY 14, 2009;Build 58
EP ;
 ; APCDSWD=DICTIONARY NUMBER
 ; APCDSWCR=LINKING CROSS REFERENCE
 ; APCDSWV=VISIT DFN
 S APCDSWD=9000010.07
 S APCDSWCR="AD"
 S APCDSWV=APCDVSIT
 ;
 I $G(APCDVFIE)>0 S APCDLOOK=APCDVFIE Q
 S U="^"
 S APCDLOOK=""
 Q:'$D(APCDSWV)
 Q:APCDSWV=""
 Q:'$D(APCDSWD)
 Q:'APCDSWD
 Q:'$D(^DIC(APCDSWD,0,"GL"))
 S APCDSWG=^DIC(APCDSWD,0,"GL")
 I '$D(APCDSWCR),APCDSWD'=(APCDSWD\1),APCDSWD\1=9000010 S APCDSWCR="AD"
 I '$D(APCDSWCR),APCDSWD\1'=9000010 S APCDSWCR="AC"
 Q:'$D(APCDSWCR)
 Q:APCDSWCR=""
 W !
 S APCDSWDA=0 F APCDSWI=1:1 S APCDSWDA=$O(@(APCDSWG_""""_APCDSWCR_""",APCDSWV,APCDSWDA)")) Q:APCDSWDA=""  S DIC=APCDSWG,Y=APCDSWDA D GETVAL,WRITE
 S APCDSWI=APCDSWI-1
 S APCDSWAN="" ;S:APCDSWI=1 APCDSWAN=APCDSWI
RDR I APCDSWAN="",APCDSWI R !!,"Choose: ",APCDSWAN:$S($D(DTIME):DTIME,1:300)
 I APCDSWAN,$D(APCDSWT(APCDSWAN)) S APCDLOOK=APCDSWT(APCDSWAN)
 ;
 I APCDLOOK]"" I $P($G(^AUPNVPOV(APCDLOOK,11)),U,1) W !!,"This POV has been SNOMED coded, you cannot edit the narrative." G APCDPNAR
EDIT I APCDLOOK]"" S DIE=9000010.07,DR=".04;1218////^S X=$$NOW^XLFDT",DA=APCDLOOK D ^DIE K DIE,DA,DR G APCDPNAR  ;IHS/CMI/GRL
 ;
EXIT K APCDSWV,APCDSWVA,APCDSWL,APCDSWCR,APCDSWD,APCDSWG,APCDSWDA,APCDSWI,APCDSWAN,APCDSWT,APCDSWN,APCDSWEX,APCDSWL,APCDSWP,APCDSWZ,APCDSWD2,APCDSWG2,APCDSWV2,Y
 W !
 Q
 ;
GETVAL ;
 S APCDSWD2=APCDSWD,APCDSWG2=APCDSWG,APCDSWV2=APCDSWDA
 F APCDSWL=0:0 S APCDSWVA=$P(@(APCDSWG2_APCDSWV2_",0)"),U) Q:$P(@("^DD("_APCDSWD2_",.01,0)"),U,2)'["P"  S APCDSWG2=U_$P(^(0),U,3),APCDSWD2=+$P($P(^(0),U,2),"P",2),APCDSWV2=APCDSWVA
 Q
 ;
WRITE ;
 NEW P,Q
 W !,APCDSWI,"  ",APCDSWVA," ",?12,$$VAL^XBDIQ1(APCDSWD,Y,.04)
 W @("$E("_DIC_"Y,0),0)")   ;RESET NAKED REFERENCE
 S APCDSWN=0,APCDSWT(APCDSWI)=APCDSWDA F APCDSWL=0:0 S APCDSWN=$O(@("^DD("_APCDSWD_",0,""ID"",APCDSWN)")) Q:APCDSWN=""  S APCDSWEX=^(APCDSWN) W @("$E("_DIC_"Y,0),0)") X APCDSWEX
 Q