RGRSMSH ;ALB/RJS-REGISTRATION MESSAGE PARSER FOR CIRN ;03/8/96
 ;;1.0;CLINICAL INFO RESOURCE NETWORK;**4,8**;30 Apr 99
EN() ;
 ;This function call returns information from the MSH and EVN segments
 ;
 ; Output:
 ;    date received^event date from EVN segment^sending facility
 ;    (station # -or- station#~domain)
 ;
 N RGRSMSH,RGC,RGRSEVN,RECDATE,EVDATE,%,INSTNUM
 S RGC=$E(HL("ECH"))
 S RGRSMSH=$$SEG1^RGRSUTIL("MSH",1,"MSH")
 S RGRSEVN=$$SEG1^RGRSUTIL("EVN",1,"EVN")
 ;;S INSTNUM=$P(RGRSMSH,HL("FS"),4)
 ;; ^ changed 11/20/98 by cmc - MSH segment read into 2 array entries
 ;; need to use new supported variable HL("SFN")
 D NOW^%DTC
 S (RECDATE)=$G(%)
 S EVDATE=$P(RGRSEVN,HL("FS"),3)
 S EVDATE=$$FMDATE^HLFNC(EVDATE)
 ;
 ; HL("SFN") expected in one of the following formats:
 ; station # -or- station #~domain
 ;
 Q $G(RECDATE)_"^"_$G(EVDATE)_"^"_$G(HL("SFN"))
 
--- Routine Detail   --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRGRSMSH   892     printed  Sep 23, 2025@19:18:54                                                                                                                                                                                                      Page 2
RGRSMSH   ;ALB/RJS-REGISTRATION MESSAGE PARSER FOR CIRN ;03/8/96
 +1       ;;1.0;CLINICAL INFO RESOURCE NETWORK;**4,8**;30 Apr 99
EN()      ;
 +1       ;This function call returns information from the MSH and EVN segments
 +2       ;
 +3       ; Output:
 +4       ;    date received^event date from EVN segment^sending facility
 +5       ;    (station # -or- station#~domain)
 +6       ;
 +7        NEW RGRSMSH,RGC,RGRSEVN,RECDATE,EVDATE,%,INSTNUM
 +8        SET RGC=$EXTRACT(HL("ECH"))
 +9        SET RGRSMSH=$$SEG1^RGRSUTIL("MSH",1,"MSH")
 +10       SET RGRSEVN=$$SEG1^RGRSUTIL("EVN",1,"EVN")
 +11      ;;S INSTNUM=$P(RGRSMSH,HL("FS"),4)
 +12      ;; ^ changed 11/20/98 by cmc - MSH segment read into 2 array entries
 +13      ;; need to use new supported variable HL("SFN")
 +14       DO NOW^%DTC
 +15       SET (RECDATE)=$GET(%)
 +16       SET EVDATE=$PIECE(RGRSEVN,HL("FS"),3)
 +17       SET EVDATE=$$FMDATE^HLFNC(EVDATE)
 +18      ;
 +19      ; HL("SFN") expected in one of the following formats:
 +20      ; station # -or- station #~domain
 +21      ;
 +22       QUIT $GET(RECDATE)_"^"_$GET(EVDATE)_"^"_$GET(HL("SFN"))