| 1 | SDQQCN2 ;ALB/MJK - COMMENT to REQUEST/CONSULTATION ; 3/23/06 12:10pm | 
|---|
| 2 | ;;5.3;Scheduling;**478**;Aug 13, 1993 | 
|---|
| 3 | ; | 
|---|
| 4 | ;IA#2980 GMRCGUIB | 
|---|
| 5 | ; Code taken from ORQQCN2 | 
|---|
| 6 | ; OR variables in ORQQCN2 replaced with SD names. | 
|---|
| 7 | CMT(SDERR,SDIEN,SDCOM,SDALRT,SDALTO,SDDATE) ;Add comment to existing consult without changing status | 
|---|
| 8 | ;SDIEN - IEN of consult from File 123 | 
|---|
| 9 | ;SDERR - return array for results/errors | 
|---|
| 10 | ;SDCOM is the comments array to be added | 
|---|
| 11 | ;     passed in as SDCOM(1)="Xxxx Xxxxx...",SDCOM(2)="Xxxx Xx Xxx...", SDCOM(3)="Xxxxx Xxx Xx...", etc. | 
|---|
| 12 | ;SDALRT - should alerts be sent to anyone? | 
|---|
| 13 | ;SDALTO - array of alert recipient IENs | 
|---|
| 14 | N SDAD,SDDUZ,SDNP,X,I | 
|---|
| 15 | S SDERR=0,SDAD=$S($D(SDDATE):SDDATE,1:$$NOW^XLFDT),SDNP="" | 
|---|
| 16 | I '$D(SDCOM) S SDERR="1^Comments required - no action taken" Q | 
|---|
| 17 | I '$D(^GMR(123,SDIEN)) S SDERR="1^No such consult" Q | 
|---|
| 18 | I $G(SDALRT)=1 D | 
|---|
| 19 | .F I=1:1  S X=$P(SDALTO,";",I) Q:X=""  S SDDUZ(X)="" | 
|---|
| 20 | D CMT^GMRCGUIB(SDIEN,.SDCOM,.SDDUZ,SDAD,DUZ) | 
|---|
| 21 | Q | 
|---|
| 22 | ; | 
|---|
| 23 | SCH(SDERR,SDIEN,SDNP,SDDATE,SDALRT,SDALTO,SDCOM) ;Schedule consult and change status | 
|---|
| 24 | ;SDERR - return array for results/errors | 
|---|
| 25 | ;SDIEN - IEN of consult from File 123 | 
|---|
| 26 | ;SDNP - Provider who Scheduled consult | 
|---|
| 27 | ;SDDATE - Date/Time Consult was scheduled. | 
|---|
| 28 | ;SDALRT - should alerts be sent to anyone? | 
|---|
| 29 | ;SDALTO - array of alert recipient IENs | 
|---|
| 30 | ;SDCOM is the comments array to be added | 
|---|
| 31 | ;     passed in as SDCOM(1)="Xxxx Xxxxx...",SDCOM(2)="Xxxx Xx Xxx...", SDCOM(3)="Xxxxx Xxx Xx...", etc. | 
|---|
| 32 | N SDAD,SDDUZ,X | 
|---|
| 33 | S SDERR=0,SDAD=$S($D(SDDATE):SDDATE,1:$$NOW^XLFDT) | 
|---|
| 34 | S:+$G(SDNP)=0 SDNP=DUZ | 
|---|
| 35 | I '$D(^GMR(123,SDIEN)) S SDERR="1^No such consult" Q | 
|---|
| 36 | I $G(SDALRT)=1 D | 
|---|
| 37 | .F I=1:1  S X=$P(SDALTO,";",I) Q:X=""  S SDDUZ(X)="" | 
|---|
| 38 | S SDERR=$$SCH^GMRCGUIB(SDIEN,SDNP,SDAD,.SDDUZ,.SDCOM) | 
|---|
| 39 | Q | 
|---|