AMQQGTX ; IHS/CMI/THL - GENERIC TAXONOMY GENERATOR AND RESTORER ;
;;2.0;IHS PCC SUITE;;MAY 14, 2009
;-----
EN ; - ENTRY POINT - Generate Taxonomy
I '$D(AMQQGTX) W !,"Array variable, AMQQGTX, to store members of taxonomy not set" Q
I '$D(DTIME) S DTIME=999
K AMQQQUIT,^UTILITY("AMQQ TAX",$J)
S AMQQCNAM="PATIENTS"
S AMQQCCLS="P"
S AMQQURGN=0
S AMQQDF=""
D ^AMQQAT
S AMQQCNAM="PROVIDER"
S AMQQCCLS="H"
S AMQQURGN=0
S AMQQDF=""
D ^AMQQAT
I $D(^UTILITY("AMQQ TAX",$J)) S %=0 F S %=$O(^UTILITY("AMQQ TAX",$J,1,%)) Q:%="" S @(AMQQGTX_""""_%_""")")=""
K AMQQCCLS,AMQQMULT,AMQQQUIT,AMQQCNAM,AMQQQ,AMQQURGN,DR,DIE,AMQQDF,^UTILITY("AMQQ TAX",$J),AMQQGTX,AMQQTAX
Q
;
EN1 ; - ENTRY POINT - Restore Taxonomy
I '$D(AMQQGTX) Q
K ^UTILITY("AMQQ TAX",$J),^UTILITY("AMQQ",$J)
S AMQQHILO="^UTILITY(""AMQQ"",$J,""HILO"")"
S AMQQURGN=1
S AMQQDF=""
D RESTORE^AMQQTX0
I $D(^UTILITY("AMQQ TAX",$J)) S %=0 F S %=$O(^UTILITY("AMQQ TAX",$J,1,%)) Q:%="" S @(AMQQGTX_%_")")=""
K AMQQB,AMQQDF,AMQQHILO,AMQQTAXT,AMQQTGBL,AMQQGTX,AMQQURGN,AMQQECHO,AMQQLINK,AMQQTGFG,^UTILITY("AMQQ TAX",$J),^UTILITY("AMQQ",$J),AMQQTAX
Q
;
EN2 ; - ENTRY POINT - Generation of taxonomy by end user
S DIR("?")="Select the number or name of an attribute from the list for which a taxonomy is to be created"
S DIR(0)="S^1:DIAGNOSIS;2:ADA CODE;3:RX;4:PROCEDURE (MEDICAL);5:PATIENT ED TOPIC;6:HEALTH FACTORS"
D ^DIR
K DIR
I '$D(Y(0)) G X1
S X=$O(^AMQQ(5,"B",Y(0),""))
I X="" W !,"A taxonomy can not be created for this attribute" G X1
S AMQQATNM=Y(0)
D EN1^AMQQTX
K ^UTILITY("AMQQ TAX",$J),AMQQTDFN,AMQQTAX,AMQQURGN,AMQQTAX,AMQQATNM
X1 Q
;
AMQQGTX ; IHS/CMI/THL - GENERIC TAXONOMY GENERATOR AND RESTORER ;
+1 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
+2 ;-----
EN ; - ENTRY POINT - Generate Taxonomy
+1 IF '$DATA(AMQQGTX)
WRITE !,"Array variable, AMQQGTX, to store members of taxonomy not set"
QUIT
+2 IF '$DATA(DTIME)
SET DTIME=999
+3 KILL AMQQQUIT,^UTILITY("AMQQ TAX",$JOB)
+4 SET AMQQCNAM="PATIENTS"
+5 SET AMQQCCLS="P"
+6 SET AMQQURGN=0
+7 SET AMQQDF=""
+8 DO ^AMQQAT
+9 SET AMQQCNAM="PROVIDER"
+10 SET AMQQCCLS="H"
+11 SET AMQQURGN=0
+12 SET AMQQDF=""
+13 DO ^AMQQAT
+14 IF $DATA(^UTILITY("AMQQ TAX",$JOB))
SET %=0
FOR
SET %=$ORDER(^UTILITY("AMQQ TAX",$JOB,1,%))
IF %=""
QUIT
SET @(AMQQGTX_""""_%_""")")=""
+15 KILL AMQQCCLS,AMQQMULT,AMQQQUIT,AMQQCNAM,AMQQQ,AMQQURGN,DR,DIE,AMQQDF,^UTILITY("AMQQ TAX",$JOB),AMQQGTX,AMQQTAX
+16 QUIT
+17 ;
EN1 ; - ENTRY POINT - Restore Taxonomy
+1 IF '$DATA(AMQQGTX)
QUIT
+2 KILL ^UTILITY("AMQQ TAX",$JOB),^UTILITY("AMQQ",$JOB)
+3 SET AMQQHILO="^UTILITY(""AMQQ"",$J,""HILO"")"
+4 SET AMQQURGN=1
+5 SET AMQQDF=""
+6 DO RESTORE^AMQQTX0
+7 IF $DATA(^UTILITY("AMQQ TAX",$JOB))
SET %=0
FOR
SET %=$ORDER(^UTILITY("AMQQ TAX",$JOB,1,%))
IF %=""
QUIT
SET @(AMQQGTX_%_")")=""
+8 KILL AMQQB,AMQQDF,AMQQHILO,AMQQTAXT,AMQQTGBL,AMQQGTX,AMQQURGN,AMQQECHO,AMQQLINK,AMQQTGFG,^UTILITY("AMQQ TAX",$JOB),^UTILITY("AMQQ",$JOB),AMQQTAX
+9 QUIT
+10 ;
EN2 ; - ENTRY POINT - Generation of taxonomy by end user
+1 SET DIR("?")="Select the number or name of an attribute from the list for which a taxonomy is to be created"
+2 SET DIR(0)="S^1:DIAGNOSIS;2:ADA CODE;3:RX;4:PROCEDURE (MEDICAL);5:PATIENT ED TOPIC;6:HEALTH FACTORS"
+3 DO ^DIR
+4 KILL DIR
+5 IF '$DATA(Y(0))
GOTO X1
+6 SET X=$ORDER(^AMQQ(5,"B",Y(0),""))
+7 IF X=""
WRITE !,"A taxonomy can not be created for this attribute"
GOTO X1
+8 SET AMQQATNM=Y(0)
+9 DO EN1^AMQQTX
+10 KILL ^UTILITY("AMQQ TAX",$JOB),AMQQTDFN,AMQQTAX,AMQQURGN,AMQQTAX,AMQQATNM
X1 QUIT
+1 ;