QAMC16 ;HISC/DAD-CONDITION: REGISTRATION ;9/3/93 13:19
;;1.0;Clinical Monitoring System;;09/13/1993
EN1 ; *** CONDITION CODE
S STATUS(0)=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P1"))#2:^("P1"),1:"")
S BENEFIT(0)=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P2"))#2:^("P2"),1:"")
S CARE(0)=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P3"))#2:^("P3"),1:"")
S QAMDISP(0)=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P4"))#2:+^("P4"),1:0)
F QAMREGDT=(QAMTODAY-.0000001):0 S QAMREGDT=$O(^DPT("ADIS",QAMREGDT)) Q:(QAMREGDT'>0)!(QAMREGDT\1'?7N)!(QAMREGDT>(QAMTODAY+.9999999)) F QAMDFN=0:0 S QAMDFN=$O(^DPT("ADIS",QAMREGDT,QAMDFN)) Q:QAMDFN'>0 D LOOP1
K STATUS,BENEFIT,CARE,QAMREGDT,QAMDISP
Q
LOOP1 S QAM=$S($D(^DPT(QAMDFN,"DIS",9999999-QAMREGDT,0))#2:^(0),1:""),STATUS=$P(QAM,"^",2),BENEFIT=$P(QAM,"^",3),CARE=$P(QAM,"^",11),QAMDISP=+$P(QAM,"^",7)
I STATUS(0)]"" Q:(STATUS="")!(STATUS(0)'[STATUS)
I BENEFIT(0)]"" Q:(BENEFIT="")!(BENEFIT(0)'[BENEFIT)
I CARE(0)]"" Q:(CARE="")!(CARE(0)'[CARE)
I QAMDISP(0) Q:$O(^QA(743.5,QAMDISP(0),"GRP","AB",QAMDISP,0))'>0
S ^UTILITY($J,"QAM CONDITION",QAMD1,QAMDFN)="",^(QAMDFN,QAMREGDT)=QAMDFN_"^"_(9999999-QAMREGDT)
Q
EN2 ; *** PARAMETER CODE
K DIR S DIR(0)="LO^0:2^K:X[""."" X",DIR("A")="STATUS",DIR("B")=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P1"))#2:^("P1"),1:"") K:DIR("B")="" DIR("B")
S DIR("?",1)=" 0 10/10 VISIT",DIR("?",2)=" 1 UNSCHEDULED",DIR("?",3)=" 2 APPLICATION WITHOUT EXAM",DIR("?",4)="Choose any or all that you wish to monitor, e.g. 0,1 or 0-2, etc.",DIR("?")="Press RETURN for all status types."
S QAMPARAM="P1" D EN3^QAMUTL1 I $D(DIRUT) S Y=-1 G Y
S:Y]"" ^QA(743,QAMD0,"COND",QAMD1,"P1")=$S($E(Y,$L(Y))=",":$E(Y,1,$L(Y)-1),1:Y)
21 K DIR S DIR(0)="LO^1:5^K:X[""."" X",DIR("A")="TYPE OF BENEFIT APPLIED FOR",DIR("B")=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P2"))#2:^("P2"),1:"") K:DIR("B")="" DIR("B")
S DIR("?",1)=" 1 HOSPITAL",DIR("?",2)=" 2 DOMICILIARY",DIR("?",3)=" 3 OUTPATIENT MEDICAL",DIR("?",4)=" 4 OUTPATIENT DENTAL",DIR("?",5)=" 5 NURSING HOME CARE"
S DIR("?",6)="Choose any or all that you wish to monitor, e.g. 1,3,5 or 2-4, etc.",DIR("?")="Press RETURN for all benefit types."
S QAMPARAM="P2" D EN3^QAMUTL1 I $D(DIRUT) S Y=-1 G Y
S:Y]"" ^QA(743,QAMD0,"COND",QAMD1,"P2")=$S($E(Y,$L(Y))=",":$E(Y,1,$L(Y)-1),1:Y)
22 K DIR S DIR(0)="LO^1:5^K:X[""."" X",DIR("A")="TYPE OF CARE APPLIED FOR",DIR("B")=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P3"))#2:^("P3"),1:"") K:DIR("B")="" DIR("B")
S DIR("?",1)=" 1 DENTAL",DIR("?",2)=" 2 PLASTIC SURGERY",DIR("?",3)=" 3 STERILIZATION",DIR("?",4)=" 4 PREGNANCY",DIR("?",5)=" 5 ALL OTHER"
S DIR("?",6)="Choose any or all that you wish to monitor, e.g. 1,3,5 or 2-4, etc.",DIR("?")="Press RETURN for all care types."
S QAMPARAM="P3" D EN3^QAMUTL1 I $D(DIRUT) S Y=-1 G Y
S:Y]"" ^QA(743,QAMD0,"COND",QAMD1,"P3")=$S($E(Y,$L(Y))=",":$E(Y,1,$L(Y)-1),1:Y)
23 K DIC,DIR,DIRUT S DIC=743.5,DIC(0)="EMNQZ",DIC("S")="I $P(^(0),""^"",2)=37",DIC("A")="DISPOSITION GROUP: ",DIC("B")=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P4"))#2:$P(^("P4"),"^",2),1:"") K:DIC("B")="" DIC("B")
S DIR("?",1)="Enter a GROUP name that contains MAS disposition types.",DIR("?")="press 'RETURN' for all disposition types."
S QAMPARAM="P4" D EN2^QAMUTL1 I $D(DIRUT) S Y=-1 G Y
S:Y]"" ^QA(743,QAMD0,"COND",QAMD1,"P4")=+Y_"^"_Y(0,0)
EXIT K Y
K QAMPARAM
Y Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HQAMC16 3343 printed Dec 13, 2024@01:42 Page 2
QAMC16 ;HISC/DAD-CONDITION: REGISTRATION ;9/3/93 13:19
+1 ;;1.0;Clinical Monitoring System;;09/13/1993
EN1 ; *** CONDITION CODE
+1 SET STATUS(0)=$SELECT($DATA(^QA(743,QAMD0,"COND",QAMD1,"P1"))#2:^("P1"),1:"")
+2 SET BENEFIT(0)=$SELECT($DATA(^QA(743,QAMD0,"COND",QAMD1,"P2"))#2:^("P2"),1:"")
+3 SET CARE(0)=$SELECT($DATA(^QA(743,QAMD0,"COND",QAMD1,"P3"))#2:^("P3"),1:"")
+4 SET QAMDISP(0)=$SELECT($DATA(^QA(743,QAMD0,"COND",QAMD1,"P4"))#2:+^("P4"),1:0)
+5 FOR QAMREGDT=(QAMTODAY-.0000001):0
SET QAMREGDT=$ORDER(^DPT("ADIS",QAMREGDT))
if (QAMREGDT'>0)!(QAMREGDT\1'?7N)!(QAMREGDT>(QAMTODAY+.9999999))
QUIT
FOR QAMDFN=0:0
SET QAMDFN=$ORDER(^DPT("ADIS",QAMREGDT,QAMDFN))
if QAMDFN'>0
QUIT
DO LOOP1
+6 KILL STATUS,BENEFIT,CARE,QAMREGDT,QAMDISP
+7 QUIT
LOOP1 SET QAM=$SELECT($DATA(^DPT(QAMDFN,"DIS",9999999-QAMREGDT,0))#2:^(0),1:"")
SET STATUS=$PIECE(QAM,"^",2)
SET BENEFIT=$PIECE(QAM,"^",3)
SET CARE=$PIECE(QAM,"^",11)
SET QAMDISP=+$PIECE(QAM,"^",7)
+1 IF STATUS(0)]""
if (STATUS="")!(STATUS(0)'[STATUS)
QUIT
+2 IF BENEFIT(0)]""
if (BENEFIT="")!(BENEFIT(0)'[BENEFIT)
QUIT
+3 IF CARE(0)]""
if (CARE="")!(CARE(0)'[CARE)
QUIT
+4 IF QAMDISP(0)
if $ORDER(^QA(743.5,QAMDISP(0),"GRP","AB",QAMDISP,0))'>0
QUIT
+5 SET ^UTILITY($JOB,"QAM CONDITION",QAMD1,QAMDFN)=""
SET ^(QAMDFN,QAMREGDT)=QAMDFN_"^"_(9999999-QAMREGDT)
+6 QUIT
EN2 ; *** PARAMETER CODE
+1 KILL DIR
SET DIR(0)="LO^0:2^K:X[""."" X"
SET DIR("A")="STATUS"
SET DIR("B")=$SELECT($DATA(^QA(743,QAMD0,"COND",QAMD1,"P1"))#2:^("P1"),1:"")
if DIR("B")=""
KILL DIR("B")
+2 SET DIR("?",1)=" 0 10/10 VISIT"
SET DIR("?",2)=" 1 UNSCHEDULED"
SET DIR("?",3)=" 2 APPLICATION WITHOUT EXAM"
SET DIR("?",4)="Choose any or all that you wish to monitor, e.g. 0,1 or 0-2, etc."
SET DIR("?")="Press RETURN for all status types."
+3 SET QAMPARAM="P1"
DO EN3^QAMUTL1
IF $DATA(DIRUT)
SET Y=-1
GOTO Y
+4 if Y]""
SET ^QA(743,QAMD0,"COND",QAMD1,"P1")=$SELECT($EXTRACT(Y,$LENGTH(Y))=",":$EXTRACT(Y,1,$LENGTH(Y)-1),1:Y)
21 KILL DIR
SET DIR(0)="LO^1:5^K:X[""."" X"
SET DIR("A")="TYPE OF BENEFIT APPLIED FOR"
SET DIR("B")=$SELECT($DATA(^QA(743,QAMD0,"COND",QAMD1,"P2"))#2:^("P2"),1:"")
if DIR("B")=""
KILL DIR("B")
+1 SET DIR("?",1)=" 1 HOSPITAL"
SET DIR("?",2)=" 2 DOMICILIARY"
SET DIR("?",3)=" 3 OUTPATIENT MEDICAL"
SET DIR("?",4)=" 4 OUTPATIENT DENTAL"
SET DIR("?",5)=" 5 NURSING HOME CARE"
+2 SET DIR("?",6)="Choose any or all that you wish to monitor, e.g. 1,3,5 or 2-4, etc."
SET DIR("?")="Press RETURN for all benefit types."
+3 SET QAMPARAM="P2"
DO EN3^QAMUTL1
IF $DATA(DIRUT)
SET Y=-1
GOTO Y
+4 if Y]""
SET ^QA(743,QAMD0,"COND",QAMD1,"P2")=$SELECT($EXTRACT(Y,$LENGTH(Y))=",":$EXTRACT(Y,1,$LENGTH(Y)-1),1:Y)
22 KILL DIR
SET DIR(0)="LO^1:5^K:X[""."" X"
SET DIR("A")="TYPE OF CARE APPLIED FOR"
SET DIR("B")=$SELECT($DATA(^QA(743,QAMD0,"COND",QAMD1,"P3"))#2:^("P3"),1:"")
if DIR("B")=""
KILL DIR("B")
+1 SET DIR("?",1)=" 1 DENTAL"
SET DIR("?",2)=" 2 PLASTIC SURGERY"
SET DIR("?",3)=" 3 STERILIZATION"
SET DIR("?",4)=" 4 PREGNANCY"
SET DIR("?",5)=" 5 ALL OTHER"
+2 SET DIR("?",6)="Choose any or all that you wish to monitor, e.g. 1,3,5 or 2-4, etc."
SET DIR("?")="Press RETURN for all care types."
+3 SET QAMPARAM="P3"
DO EN3^QAMUTL1
IF $DATA(DIRUT)
SET Y=-1
GOTO Y
+4 if Y]""
SET ^QA(743,QAMD0,"COND",QAMD1,"P3")=$SELECT($EXTRACT(Y,$LENGTH(Y))=",":$EXTRACT(Y,1,$LENGTH(Y)-1),1:Y)
23 KILL DIC,DIR,DIRUT
SET DIC=743.5
SET DIC(0)="EMNQZ"
SET DIC("S")="I $P(^(0),""^"",2)=37"
SET DIC("A")="DISPOSITION GROUP: "
SET DIC("B")=$SELECT($DATA(^QA(743,QAMD0,"COND",QAMD1,"P4"))#2:$PIECE(^("P4"),"^",2),1:"")
if DIC("B")=""
KILL DIC("B")
+1 SET DIR("?",1)="Enter a GROUP name that contains MAS disposition types."
SET DIR("?")="press 'RETURN' for all disposition types."
+2 SET QAMPARAM="P4"
DO EN2^QAMUTL1
IF $DATA(DIRUT)
SET Y=-1
GOTO Y
+3 if Y]""
SET ^QA(743,QAMD0,"COND",QAMD1,"P4")=+Y_"^"_Y(0,0)
EXIT KILL Y
+1 KILL QAMPARAM
Y QUIT