[613] | 1 | QAMC11 ;HISC/GJC-CONDITION: PREVIOUS DISCHARGE FOR A TREATING SPECIALTY ;8/4/92 08:22
|
---|
| 2 | ;;1.0;Clinical Monitoring System;;09/13/1993
|
---|
| 3 | EN1 ;*** CONDITION CODE
|
---|
| 4 | S QAMDIS=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P1"))#2:+^("P1"),1:0)
|
---|
| 5 | S QAMTSP=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P2"))#2:+^("P2"),1:0)
|
---|
| 6 | S QAMDATE=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P3"))#2:+^("P3"),1:0)
|
---|
| 7 | S X1=QAMTODAY,X2=-QAMDIS D C^%DTC S QAMSTRT=X,QAMSTRT=QAMSTRT-.0000001 K ^UTILITY($J,"QAM TEMP")
|
---|
| 8 | F QAMDISH=QAMSTRT:0 S QAMDISH=$O(^DGPM("AMV3",QAMDISH)) Q:(QAMDISH'>0)!(QAMDISH\1'?7N)!(QAMDISH>(QAMTODAY+.9999999)) F QAMDFN=0:0 S QAMDFN=$O(^DGPM("AMV3",QAMDISH,QAMDFN)) Q:QAMDFN'>0 D STR1
|
---|
| 9 | F QAMDFN=0:0 S QAMDFN=$O(^UTILITY($J,"QAM TEMP",QAMDFN)) Q:QAMDFN'>0 F QAMDC=0:0 S QAMDC=$O(^UTILITY($J,"QAM TEMP",QAMDFN,QAMDC)) Q:QAMDC'>0 D STR2
|
---|
| 10 | K DIR,DIRUT,QAMDATE,QAMDC,QAMDFN,QAMDIS,QAMDISH,QAMGJC,QAMIEN,QAMPARAM,QAMTSP,QAMTSP1,QAMSTRT,X,X1,X2,Y
|
---|
| 11 | K ^UTILITY($J,"QAM TEMP")
|
---|
| 12 | Q
|
---|
| 13 | STR1 ;
|
---|
| 14 | F QAMGJC=0:0 S QAMGJC=$O(^DGPM("AMV3",QAMDISH,QAMDFN,QAMGJC)) Q:QAMGJC'>0 D
|
---|
| 15 | . Q:$O(^DGPM("APTT1",QAMDFN,QAMDISH))'>0
|
---|
| 16 | . K ^UTILITY($J,"QAM TEMP",QAMDFN)
|
---|
| 17 | . S ^UTILITY($J,"QAM TEMP",QAMDFN,QAMDISH)=QAMGJC
|
---|
| 18 | . Q
|
---|
| 19 | Q
|
---|
| 20 | STR2 ;
|
---|
| 21 | S QAMDC(1)=QAMDC
|
---|
| 22 | S QAMDC=+$O(^DGPM("ATID6",QAMDFN,9999999.9999999-QAMDC))
|
---|
| 23 | S QAMIEN=+$O(^DGPM("ATID6",QAMDFN,QAMDC,0)) Q:QAMIEN'>0
|
---|
| 24 | I QAMTSP S QAMTSP1=+$S($D(^DGPM(QAMIEN,0))#2:$P(^(0),U,9),1:0) Q:$O(^QA(743.5,QAMTSP,"GRP","AB",QAMTSP1,0))'>0
|
---|
| 25 | S ^UTILITY($J,"QAM CONDITION",QAMD1,QAMDFN)="",^UTILITY($J,"QAM CONDITION",QAMD1,QAMDFN,$S(QAMDATE:QAMDC(1),1:QAMTODAY))=^UTILITY($J,"QAM TEMP",QAMDFN,QAMDC(1))
|
---|
| 26 | Q
|
---|
| 27 | EN2 ;*** LOOK BACK DATE
|
---|
| 28 | K DIR,DIRUT S DIR(0)="NO^1:365:0",DIR("A")="LOOK BACK DAYS",DIR("B")=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P1"))#2:^("P1"),1:"") K:DIR("B")="" DIR("B")
|
---|
| 29 | S DIR("?",1)="Enter the number of days the condition should 'look back'.",DIR("?")="While trying to find a fall out for this monitor."
|
---|
| 30 | S QAMPARAM="P1" D EN3^QAMUTL1 S:$D(DIRUT) Y=-1 Q:Y<0
|
---|
| 31 | S:Y]"" ^QA(743,QAMD0,"COND",QAMD1,"P1")=+Y
|
---|
| 32 | PRT2 K DIC,DIR,DIRUT S DIC="^QA(743.5,",DIC(0)="EMNQZ",DIC("S")="I $P(^(0),U,2)=45.7",DIC("A")="TREATING SPECIALTY GROUP: ",DIC("B")=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P2"))#2:$P(^("P2"),U,2),1:"") K:DIC("B")="" DIC("B")
|
---|
| 33 | S DIR("?",1)="Press 'RETURN' for ALL treating specialties.",DIR("?")="Enter a GROUP name that contains a MAS treating specialty."
|
---|
| 34 | S QAMPARAM="P2" D EN2^QAMUTL1 S:$D(DIRUT) Y=-1 Q:Y<0
|
---|
| 35 | S:Y]"" ^QA(743,QAMD0,"COND",QAMD1,"P2")=+Y_"^"_Y(0,0)
|
---|
| 36 | PRT3 K DIR,DIRUT S DIR("A")="ENTER THE TYPE OF DATE",DIR(0)="SOB^0:AUTO ENROLL DATE;1:DISCHARGE DATE",DIR("?",1)="0 AUTO ENROLL DATE",DIR("?",2)=" 1 DISCHARGE DATE"
|
---|
| 37 | S DIR("?",3)="Enter the date you wish to be",DIR("?",4)="associated with this condition.",DIR("?")="Enter a 'RETURN' for the AUTO ENROLL DATE."
|
---|
| 38 | S DIR("B")=$S($D(^QA(743,QAMD0,"COND",QAMD1,"P3"))#2:$P(^("P3"),U,2),1:"") K:DIR("B")="" DIR("B")
|
---|
| 39 | S QAMPARAM="P3" D EN3^QAMUTL1 S:$D(DIRUT) Y=-1 Q:Y<0
|
---|
| 40 | S:Y]"" ^QA(743,QAMD0,"COND",QAMD1,"P3")=+Y_"^"_Y(0)
|
---|
| 41 | EXIT K Y
|
---|
| 42 | K QAMPARAM
|
---|
| 43 | Y Q
|
---|