- SDQQCN2 ;ALB/MJK - COMMENT to REQUEST/CONSULTATION ; 3/23/06 12:10pm
- ;;5.3;Scheduling;**478**;Aug 13, 1993
- ;
- ;IA#2980 GMRCGUIB
- ; Code taken from ORQQCN2
- ; OR variables in ORQQCN2 replaced with SD names.
- CMT(SDERR,SDIEN,SDCOM,SDALRT,SDALTO,SDDATE) ;Add comment to existing consult without changing status
- ;SDIEN - IEN of consult from File 123
- ;SDERR - return array for results/errors
- ;SDCOM is the comments array to be added
- ; passed in as SDCOM(1)="Xxxx Xxxxx...",SDCOM(2)="Xxxx Xx Xxx...", SDCOM(3)="Xxxxx Xxx Xx...", etc.
- ;SDALRT - should alerts be sent to anyone?
- ;SDALTO - array of alert recipient IENs
- N SDAD,SDDUZ,SDNP,X,I
- S SDERR=0,SDAD=$S($D(SDDATE):SDDATE,1:$$NOW^XLFDT),SDNP=""
- I '$D(SDCOM) S SDERR="1^Comments required - no action taken" Q
- I '$D(^GMR(123,SDIEN)) S SDERR="1^No such consult" Q
- I $G(SDALRT)=1 D
- .F I=1:1 S X=$P(SDALTO,";",I) Q:X="" S SDDUZ(X)=""
- D CMT^GMRCGUIB(SDIEN,.SDCOM,.SDDUZ,SDAD,DUZ)
- Q
- ;
- SCH(SDERR,SDIEN,SDNP,SDDATE,SDALRT,SDALTO,SDCOM) ;Schedule consult and change status
- ;SDERR - return array for results/errors
- ;SDIEN - IEN of consult from File 123
- ;SDNP - Provider who Scheduled consult
- ;SDDATE - Date/Time Consult was scheduled.
- ;SDALRT - should alerts be sent to anyone?
- ;SDALTO - array of alert recipient IENs
- ;SDCOM is the comments array to be added
- ; passed in as SDCOM(1)="Xxxx Xxxxx...",SDCOM(2)="Xxxx Xx Xxx...", SDCOM(3)="Xxxxx Xxx Xx...", etc.
- N SDAD,SDDUZ,X
- S SDERR=0,SDAD=$S($D(SDDATE):SDDATE,1:$$NOW^XLFDT)
- S:+$G(SDNP)=0 SDNP=DUZ
- I '$D(^GMR(123,SDIEN)) S SDERR="1^No such consult" Q
- I $G(SDALRT)=1 D
- .F I=1:1 S X=$P(SDALTO,";",I) Q:X="" S SDDUZ(X)=""
- S SDERR=$$SCH^GMRCGUIB(SDIEN,SDNP,SDAD,.SDDUZ,.SDCOM)
- Q
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSDQQCN2 1744 printed Feb 19, 2025@00:26:33 Page 2
- SDQQCN2 ;ALB/MJK - COMMENT to REQUEST/CONSULTATION ; 3/23/06 12:10pm
- +1 ;;5.3;Scheduling;**478**;Aug 13, 1993
- +2 ;
- +3 ;IA#2980 GMRCGUIB
- +4 ; Code taken from ORQQCN2
- +5 ; OR variables in ORQQCN2 replaced with SD names.
- CMT(SDERR,SDIEN,SDCOM,SDALRT,SDALTO,SDDATE) ;Add comment to existing consult without changing status
- +1 ;SDIEN - IEN of consult from File 123
- +2 ;SDERR - return array for results/errors
- +3 ;SDCOM is the comments array to be added
- +4 ; passed in as SDCOM(1)="Xxxx Xxxxx...",SDCOM(2)="Xxxx Xx Xxx...", SDCOM(3)="Xxxxx Xxx Xx...", etc.
- +5 ;SDALRT - should alerts be sent to anyone?
- +6 ;SDALTO - array of alert recipient IENs
- +7 NEW SDAD,SDDUZ,SDNP,X,I
- +8 SET SDERR=0
- SET SDAD=$SELECT($DATA(SDDATE):SDDATE,1:$$NOW^XLFDT)
- SET SDNP=""
- +9 IF '$DATA(SDCOM)
- SET SDERR="1^Comments required - no action taken"
- QUIT
- +10 IF '$DATA(^GMR(123,SDIEN))
- SET SDERR="1^No such consult"
- QUIT
- +11 IF $GET(SDALRT)=1
- Begin DoDot:1
- +12 FOR I=1:1
- SET X=$PIECE(SDALTO,";",I)
- if X=""
- QUIT
- SET SDDUZ(X)=""
- End DoDot:1
- +13 DO CMT^GMRCGUIB(SDIEN,.SDCOM,.SDDUZ,SDAD,DUZ)
- +14 QUIT
- +15 ;
- SCH(SDERR,SDIEN,SDNP,SDDATE,SDALRT,SDALTO,SDCOM) ;Schedule consult and change status
- +1 ;SDERR - return array for results/errors
- +2 ;SDIEN - IEN of consult from File 123
- +3 ;SDNP - Provider who Scheduled consult
- +4 ;SDDATE - Date/Time Consult was scheduled.
- +5 ;SDALRT - should alerts be sent to anyone?
- +6 ;SDALTO - array of alert recipient IENs
- +7 ;SDCOM is the comments array to be added
- +8 ; passed in as SDCOM(1)="Xxxx Xxxxx...",SDCOM(2)="Xxxx Xx Xxx...", SDCOM(3)="Xxxxx Xxx Xx...", etc.
- +9 NEW SDAD,SDDUZ,X
- +10 SET SDERR=0
- SET SDAD=$SELECT($DATA(SDDATE):SDDATE,1:$$NOW^XLFDT)
- +11 if +$GET(SDNP)=0
- SET SDNP=DUZ
- +12 IF '$DATA(^GMR(123,SDIEN))
- SET SDERR="1^No such consult"
- QUIT
- +13 IF $GET(SDALRT)=1
- Begin DoDot:1
- +14 FOR I=1:1
- SET X=$PIECE(SDALTO,";",I)
- if X=""
- QUIT
- SET SDDUZ(X)=""
- End DoDot:1
- +15 SET SDERR=$$SCH^GMRCGUIB(SDIEN,SDNP,SDAD,.SDDUZ,.SDCOM)
- +16 QUIT