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

APCHMT.m

Go to the documentation of this file.
  1. APCHMT ; IHS/CMI/LAB -- create/modify health summary type ;
  1. ;;2.0;IHS PCC SUITE;**7**;MAY 14, 2009
  1. ;; ;
  1. ;routine to create/modify a health summary type
  1. EP ;EP - called from option
  1. W !!!,"This option will allow you to create a new or modify an existing"
  1. W !,"health summary type.",!!
  1. D ^XBFMK S DIC="^APCHSCTL(",DIC(0)="AEMQL" D ^DIC K DIC,DA,DR,DD,DO
  1. I Y=-1 W !!,"Goodbye",! D EOJ Q
  1. S %=$P(^APCHSCTL(+Y,0),U,2) I %]"",$D(^XUSEC(%,DUZ))[0 W !,"This summary type is currently locked to prevent alteration.",! G EP
  1. S APCHDA=+Y
  1. S DIE="^APCHSCTL(",DA=APCHDA,DR=".01;.05" D ^DIE D ^XBFMK
  1. D EN
  1. EOJ ;
  1. D EN^XBVK("APCH")
  1. D ^XBFMK
  1. Q
  1. EN ; -- main entry point for APCH CREATE/MODIFY TYPE
  1. D EN^VALM("APCH CREATE/MODIFY TYPE")
  1. D CLEAR^VALM1
  1. D FULL^VALM1
  1. W:$D(IOF) @IOF
  1. D EOJ
  1. Q
  1. ;
  1. HDR ;EP -- header code
  1. S VALMHDR(1)="Health Summary: " I $G(APCHDA),$D(^APCHSCTL(APCHDA)) S VALMHDR(1)=VALMHDR(1)_$P(^APCHSCTL(APCHDA,0),U)
  1. Q
  1. ;
  1. INIT ;EP -- init variables and list array
  1. K ^TMP($J,"APCHTYPE")
  1. S APCHC=0
  1. NEW X,Y,O,C,M,T,A
  1. S X="STRUCTURE: " D S(X)
  1. S X="Order",$E(X,7)="Component",$E(X,49)="Max occ",$E(X,57)="Time",$E(X,62)="Alternate Title" D S(X)
  1. S Y=0 F S Y=$O(^APCHSCTL(APCHDA,1,Y)) Q:Y'=+Y D
  1. .S O=$P(^APCHSCTL(APCHDA,1,Y,0),U),C=$P(^APCHSCTL(APCHDA,1,Y,0),U,2),C=$P($G(^APCHSCMP(+C,0)),U,1)
  1. .S M=$P(^APCHSCTL(APCHDA,1,Y,0),U,3),T=$P(^APCHSCTL(APCHDA,1,Y,0),U,4),A=$P(^APCHSCTL(APCHDA,1,Y,0),U,5)
  1. .S X=O,$E(X,7)=C,$E(X,49)=M,$E(X,57)=T,$E(X,62)=A D S(X)
  1. S X="GENERAL:" D S(X,1)
  1. S X="Clinic Displayed on outpatient components: "_$$VAL^XBDIQ1(9001015,APCHDA,1.5) D S(X)
  1. S X="ICD Text Display: "_$$VAL^XBDIQ1(9001015,APCHDA,2) D S(X)
  1. S X="Provider Narrative Displayed: "_$$VAL^XBDIQ1(9001015,APCHDA,3) D S(X)
  1. S X="Display Provider Initials in Outpatient components: "_$$VAL^XBDIQ1(9001015,APCHDA,3.6) D S(X)
  1. S X="Provider Initials displayed on Medication components: "_$$VAL^XBDIQ1(9001015,APCHDA,3.7) D S(X)
  1. S X="Lab Comments displayed in LAB component: "_$$VAL^XBDIQ1(9001015,APCHDA,3.8)
  1. S X="Comments displayed with Reasons Service not done: "_$$VAL^XBDIQ1(9001015,APCHDA,3.9)
  1. S X="MEASUREMENT PANELS: " D S(X,1) I '$O(^APCHSCTL(APCHDA,3,0)) D S("<none>") G LP
  1. S X="Order",$E(X,7)="Panel" D S(X)
  1. S Y=0 F S Y=$O(^APCHSCTL(APCHDA,3,Y)) Q:Y'=+Y D
  1. .S O=$P(^APCHSCTL(APCHDA,3,Y,0),U),C=$P(^APCHSCTL(APCHDA,3,Y,0),U,2),C=$P($G(^APCHSMPN(+C,0)),U,1)
  1. .S X=O,$E(X,7)=C D S(X)
  1. LP ;
  1. S X="LAB TEST PANELS: " D S(X,1) I '$O(^APCHSCTL(APCHDA,4,0)) D S("<none>") G HMR
  1. S X="Order",$E(X,7)="Panel" D S(X)
  1. S Y=0 F S Y=$O(^APCHSCTL(APCHDA,4,Y)) Q:Y'=+Y D
  1. .S O=$P(^APCHSCTL(APCHDA,4,Y,0),U),C=$P(^APCHSCTL(APCHDA,4,Y,0),U,2),C=$P($G(^LAB(60,+C,0)),U,1)
  1. .S X=O,$E(X,7)=C D S(X)
  1. HMR ;
  1. S X="HEALTH MAINTENANCE REMINDERS: " D S(X,1) I '$O(^APCHSCTL(APCHDA,5,0)) D S("<none>") G TP
  1. S X="Order",$E(X,7)="Health Maintenance Reminder" D S(X)
  1. S Y=0 F S Y=$O(^APCHSCTL(APCHDA,5,Y)) Q:Y'=+Y D
  1. .S O=$P(^APCHSCTL(APCHDA,5,Y,0),U),C=$P(^APCHSCTL(APCHDA,5,Y,0),U,2),C=$P($G(^APCHSURV(+C,0)),U,1)
  1. .S X=O,$E(X,7)=C D S(X)
  1. TP ;
  1. S X="BEST PRACTICE PROMPTS: " D S(X,1) I '$O(^APCHSCTL(APCHDA,13,0)) D S("<none>") G FS
  1. S X="Order",$E(X,7)="Best Practice Prompt" D S(X)
  1. S Y=0 F S Y=$O(^APCHSCTL(APCHDA,13,Y)) Q:Y'=+Y D
  1. .S O=$P(^APCHSCTL(APCHDA,13,Y,0),U),C=$P(^APCHSCTL(APCHDA,13,Y,0),U,2),C=$P($G(^APCHSURV(+C,0)),U,1)
  1. .S X=O,$E(X,7)=C D S(X)
  1. FS ;
  1. S X="FLOWSHEET: " D S(X,1) I '$O(^APCHSCTL(APCHDA,6,0)) D S("<none>") G HF
  1. S X="Order",$E(X,7)="Flowsheet" D S(X)
  1. S Y=0 F S Y=$O(^APCHSCTL(APCHDA,6,Y)) Q:Y'=+Y D
  1. .S O=$P(^APCHSCTL(APCHDA,6,Y,0),U),C=$P(^APCHSCTL(APCHDA,6,Y,0),U,2),C=$P($G(^APCHSFLC(+C,0)),U,1)
  1. .S X=O,$E(X,7)=C D S(X)
  1. HF ;
  1. S X="HEALTH FACTORS: " D S(X,1) I '$O(^APCHSCTL(APCHDA,7,0)) D S("<none>") G SP
  1. S X="Order",$E(X,7)="Health Factor",$E(X,49)="Title",$E(X,70)="Most Recent" D S(X)
  1. S Y=0 F S Y=$O(^APCHSCTL(APCHDA,7,Y)) Q:Y'=+Y D
  1. .S O=$P(^APCHSCTL(APCHDA,7,Y,0),U),C=$P(^APCHSCTL(APCHDA,7,Y,0),U,2),C=$P($G(^AUTTHF(+C,0)),U,1),T=$P(^APCHSCTL(APCHDA,7,Y,0),U,3),M=$P(^APCHSCTL(APCHDA,7,Y,0),U,4),M=$$EXTSET^XBFUNC(9001015.08,3,M)
  1. .S X=O,$E(X,7)=C,$E(X,49)=$E(T,1,20),$E(X,70)=M D S(X)
  1. SP ;
  1. S X="SUPPLEMENTS: " D S(X,1) I '$O(^APCHSCTL(APCHDA,12,0)) D S("<none>") G PCS
  1. S X="Order",$E(X,7)="Supplement" D S(X)
  1. S Y=0 F S Y=$O(^APCHSCTL(APCHDA,12,Y)) Q:Y'=+Y D
  1. .S O=$P(^APCHSCTL(APCHDA,12,Y,0),U),C=$P(^APCHSCTL(APCHDA,12,Y,0),U,2),C=$P($G(^APCHSUP(+C,0)),U,1)
  1. .S X=O,$E(X,7)=C_" "_$P(^APCHSCTL(APCHDA,12,Y,0),U,3) D S(X)
  1. PCS ;
  1. S X="Provider Class Screen for OUTPATIENT VISITS (SCREENED) component (IF USED): " D S(X,1)
  1. I $O(^APCHSCTL(APCHDA,9,0)) S X="Provider Classes to be EXCLUDED" D S(X)
  1. S Y=0 F S Y=$O(^APCHSCTL(APCHDA,9,Y)) Q:Y'=+Y D
  1. .S C=$P(^APCHSCTL(APCHDA,9,Y,0),U),C=$P($G(^DIC(7,+C,0)),U,1)
  1. .S X=C D S(X)
  1. S X="CLINIC Screen for OUTPATIENT VISITS (SCREENED) component (IF USED): " D S(X,1)
  1. I $O(^APCHSCTL(APCHDA,11,0)) S X="Clinics to be EXCLUDED" D S(X)
  1. S Y=0 F S Y=$O(^APCHSCTL(APCHDA,11,Y)) Q:Y'=+Y D
  1. .S C=$P(^APCHSCTL(APCHDA,11,Y,0),U),C=$P($G(^DIC(40.7,+C,0)),U,1)
  1. .S X=C D S(X)
  1. S VALMCNT=$O(^TMP($J,"APCHTYPE",""),-1)
  1. Q
  1. S(Y,F,C,T) ;EP - set up array
  1. I '$G(F) S F=0
  1. I '$G(T) S T=0
  1. ;blank lines
  1. F F=1:1:F S X="" D S1
  1. S X=Y
  1. I $G(C) S L=$L(Y),T=(80-L)/2 D D S1 Q
  1. .F %=1:1:(T-1) S X=" "_X
  1. F %=1:1:T S X=" "_Y
  1. D S1
  1. Q
  1. S1 ;
  1. S APCHC=APCHC+1
  1. S ^TMP($J,"APCHTYPE",APCHC,0)=X
  1. Q
  1. ;
  1. HELP ; -- help code
  1. S X="?" D DISP^XQORM1 W !!
  1. Q
  1. ;
  1. EXIT ; -- EXIT code
  1. Q
  1. ;
  1. EXPND ; -- expand code
  1. Q
  1. ;