DVBABDOD ;ALB/SPH - FHIE SERVER RPC'S ; 04/21/2009
 ;;2.7;AMIE;**140**;Apr 10, 1995;Build 16
 ;
 ; This routine supports the following remote procedure calls:
 ;
 ;   RPC Name                 Tag
 ;   ----------------------   ---------
 ;   DVBAB DOD REPORT TYPES   RPTTYPS
 ;   DVBAB DOD INFO           INFOMSG
 ;   DVBAB DOD REPORT         SENDRPT
 ;   DVBAB FIND DFN BY ICN    ICN
 ;              
 ; The routine is designed specifically for the Federal Health Information
 ; Exchange (FHIE) server (Station 200). It is distributed nationally with
 ; the CAPRI application so the RPC's and this supporting routine are
 ; consistent on all systems using CAPRI.
 ;
 ;
SENDRPT(DVBABY,IEN,DATATYPE,BEGDATE,ENDDATE,ORMAX,DVBABTMP) ;return DOD report
 ;This remote procedure call returns a DOD report from the FHIE framework.
 ;
 ; -- rpc: DVBAB DOD REPORT
 ; 
 ; Supported References:
 ;  DBIA #3486: D GCPR^OMGCOAS1(IEN,DATATYPE,BEGDATE,ENDDATE,ORMAX) 
 ;
 ; Input:  IEN       = Patient's DFN
 ;         DATATYPE  = Type of data being requested:
 ;                       LRO - Lab Orders
 ;                       LRC - Chem & Hem
 ;                       SP  - Surgical Path
 ;                       CY  - Cytology
 ;                       MI  - Microbiology
 ;                       RR  - Radiology Report
 ;                       RXOP- All Outpatient RX
 ;                       ADT - ADT Summary
 ;                       DS  - Discharge Summary
 ;        
 ;                       RI  - Radiology Impression
 ;                       RXA - Active Outpatient RX
 ;                       ALRG - Allergies
 ;
 ;    TIUPRG - Progress Notes
 ;
 ;    Outpatient encounter
 ;    TIUPRG - Progress Notes
 ;
 ;         BEGDATE   = Beginning search date
 ;         ENDDATE   = Ending search date
 ;         ORMAX     = Max number of entries for report 
 ;
 ;quit if Clinical Observation Access Service (routine: OMGCOAS1) not installed
 Q:'$L($T(GCPR^OMGCOAS1))
 ;
 N DVBATXT
 ;
 S DVBABY=$NA(^TMP(DVBABTMP,$J))
 D GCPR^OMGCOAS1(IEN,DATATYPE,BEGDATE,ENDDATE,ORMAX)
 ; S ^TMP("CAPRI",DUZ)=IEN+"-"+DATATYPE+"-"+BEGDATE+"-"+ENDDATE+"-"+ORMAX
 S DVBATXT=IEN_","_DATATYPE_","_BEGDATE_","_ENDDATE_","_ORMAX_","_DVBABTMP
 S ^TMP("CAPRI",DUZ,$J)=DVBATXT
 ; K IEN,DATATYPE,BEGDATE,ENDDATE,ORMAX,DVBABTMP
 Q
 ;
RPTTYPS(Y) ;return list of available report types
 ;This remote procedure call returns a list of available report types.
 ; 
 ; -- rpc: DVBAB DOD REPORT TYPES
 ;
 S Y(1)="Allergies^ALRG^ORDATA"
 ;S Y(2)="Ambulatory Data^ADR^ORDATA"
 S Y(3)="Expanded ADT^ADT^ORDATA"
 S Y(4)="Consult Report^CONS^ORDATA"
 S Y(5)="Discharge Summary^DS^ORDATA"
 S Y(6)="Lab Orders^LRO^LRO"
 S Y(7)="Chem & Hem^LRC^LRC"
 S Y(8)="Surgical Path^SP^LRA"
 S Y(9)="Cytology^CY^LRCY"
 S Y(10)="Microbiology^MI^LRM"
 S Y(11)="Radiology Report^RR^RAE"
 S Y(12)="Outpatient RX^RXOP^PSOO"
 S Y(13)="Progress Notes^PN^ORDATA"
 Q
 ;
INFOMSG(Y) ;return DOD data message
 ;This remote procedure call returns a message to be displayed in CAPRI. 
 ;
 ; -- rpc: DVBAB DOD INFO
 ;
 S Y="NOTE:  DoD data at shared sites is available immediately.  All other sites will be available less than a week after discharge."
 Q
 ;
ICN(RESULT,DVBAICN) ;retrieve patient DFN
 ;
 ;This remote procedure call returns the patient's DFN associated
 ;with the ICN passed to the RPC. The DFN is the internal entry
 ;number in the Patient (#2) file.  
 ;
 ; -- rpc: DVBAB FIND DFN BY ICN
 ; 
 ;  Supported References:
 ;    DBIA #4679: GETDFN^VAFCTFU1
 ;
 ;  Input:
 ;   DVBAICN - patient's Integration Control Number
 ;    
 ; Output:
 ;    RESULT - global array containing patient's DFN, otherwise
 ;             an error msg if ICN can't be converted to a DFN
 ;
 N DVBADFN  ;patient DFN
 ;
 S DVBADFN=0
 K ^TMP("DVBAICN",$J)
 ;
 I $G(DVBAICN)>0 D
 . D GETDFN^VAFCTFU1(.DVBADFN,DVBAICN) ;convert icn to dfn
 S ^TMP("DVBAICN",$J,0)=$S(DVBADFN>0:DVBADFN,1:"NOT A VALID ICN")
 S RESULT=$NA(^TMP("DVBAICN",$J))
 Q
 
--- Routine Detail   --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDVBABDOD   4067     printed  Sep 23, 2025@19:16:49                                                                                                                                                                                                    Page 2
DVBABDOD  ;ALB/SPH - FHIE SERVER RPC'S ; 04/21/2009
 +1       ;;2.7;AMIE;**140**;Apr 10, 1995;Build 16
 +2       ;
 +3       ; This routine supports the following remote procedure calls:
 +4       ;
 +5       ;   RPC Name                 Tag
 +6       ;   ----------------------   ---------
 +7       ;   DVBAB DOD REPORT TYPES   RPTTYPS
 +8       ;   DVBAB DOD INFO           INFOMSG
 +9       ;   DVBAB DOD REPORT         SENDRPT
 +10      ;   DVBAB FIND DFN BY ICN    ICN
 +11      ;              
 +12      ; The routine is designed specifically for the Federal Health Information
 +13      ; Exchange (FHIE) server (Station 200). It is distributed nationally with
 +14      ; the CAPRI application so the RPC's and this supporting routine are
 +15      ; consistent on all systems using CAPRI.
 +16      ;
 +17      ;
SENDRPT(DVBABY,IEN,DATATYPE,BEGDATE,ENDDATE,ORMAX,DVBABTMP) ;return DOD report
 +1       ;This remote procedure call returns a DOD report from the FHIE framework.
 +2       ;
 +3       ; -- rpc: DVBAB DOD REPORT
 +4       ; 
 +5       ; Supported References:
 +6       ;  DBIA #3486: D GCPR^OMGCOAS1(IEN,DATATYPE,BEGDATE,ENDDATE,ORMAX) 
 +7       ;
 +8       ; Input:  IEN       = Patient's DFN
 +9       ;         DATATYPE  = Type of data being requested:
 +10      ;                       LRO - Lab Orders
 +11      ;                       LRC - Chem & Hem
 +12      ;                       SP  - Surgical Path
 +13      ;                       CY  - Cytology
 +14      ;                       MI  - Microbiology
 +15      ;                       RR  - Radiology Report
 +16      ;                       RXOP- All Outpatient RX
 +17      ;                       ADT - ADT Summary
 +18      ;                       DS  - Discharge Summary
 +19      ;        
 +20      ;                       RI  - Radiology Impression
 +21      ;                       RXA - Active Outpatient RX
 +22      ;                       ALRG - Allergies
 +23      ;
 +24      ;    TIUPRG - Progress Notes
 +25      ;
 +26      ;    Outpatient encounter
 +27      ;    TIUPRG - Progress Notes
 +28      ;
 +29      ;         BEGDATE   = Beginning search date
 +30      ;         ENDDATE   = Ending search date
 +31      ;         ORMAX     = Max number of entries for report 
 +32      ;
 +33      ;quit if Clinical Observation Access Service (routine: OMGCOAS1) not installed
 +34       if '$LENGTH($TEXT(GCPR^OMGCOAS1))
               QUIT 
 +35      ;
 +36       NEW DVBATXT
 +37      ;
 +38       SET DVBABY=$NAME(^TMP(DVBABTMP,$JOB))
 +39       DO GCPR^OMGCOAS1(IEN,DATATYPE,BEGDATE,ENDDATE,ORMAX)
 +40      ; S ^TMP("CAPRI",DUZ)=IEN+"-"+DATATYPE+"-"+BEGDATE+"-"+ENDDATE+"-"+ORMAX
 +41       SET DVBATXT=IEN_","_DATATYPE_","_BEGDATE_","_ENDDATE_","_ORMAX_","_DVBABTMP
 +42       SET ^TMP("CAPRI",DUZ,$JOB)=DVBATXT
 +43      ; K IEN,DATATYPE,BEGDATE,ENDDATE,ORMAX,DVBABTMP
 +44       QUIT 
 +45      ;
RPTTYPS(Y) ;return list of available report types
 +1       ;This remote procedure call returns a list of available report types.
 +2       ; 
 +3       ; -- rpc: DVBAB DOD REPORT TYPES
 +4       ;
 +5        SET Y(1)="Allergies^ALRG^ORDATA"
 +6       ;S Y(2)="Ambulatory Data^ADR^ORDATA"
 +7        SET Y(3)="Expanded ADT^ADT^ORDATA"
 +8        SET Y(4)="Consult Report^CONS^ORDATA"
 +9        SET Y(5)="Discharge Summary^DS^ORDATA"
 +10       SET Y(6)="Lab Orders^LRO^LRO"
 +11       SET Y(7)="Chem & Hem^LRC^LRC"
 +12       SET Y(8)="Surgical Path^SP^LRA"
 +13       SET Y(9)="Cytology^CY^LRCY"
 +14       SET Y(10)="Microbiology^MI^LRM"
 +15       SET Y(11)="Radiology Report^RR^RAE"
 +16       SET Y(12)="Outpatient RX^RXOP^PSOO"
 +17       SET Y(13)="Progress Notes^PN^ORDATA"
 +18       QUIT 
 +19      ;
INFOMSG(Y) ;return DOD data message
 +1       ;This remote procedure call returns a message to be displayed in CAPRI. 
 +2       ;
 +3       ; -- rpc: DVBAB DOD INFO
 +4       ;
 +5        SET Y="NOTE:  DoD data at shared sites is available immediately.  All other sites will be available less than a week after discharge."
 +6        QUIT 
 +7       ;
ICN(RESULT,DVBAICN) ;retrieve patient DFN
 +1       ;
 +2       ;This remote procedure call returns the patient's DFN associated
 +3       ;with the ICN passed to the RPC. The DFN is the internal entry
 +4       ;number in the Patient (#2) file.  
 +5       ;
 +6       ; -- rpc: DVBAB FIND DFN BY ICN
 +7       ; 
 +8       ;  Supported References:
 +9       ;    DBIA #4679: GETDFN^VAFCTFU1
 +10      ;
 +11      ;  Input:
 +12      ;   DVBAICN - patient's Integration Control Number
 +13      ;    
 +14      ; Output:
 +15      ;    RESULT - global array containing patient's DFN, otherwise
 +16      ;             an error msg if ICN can't be converted to a DFN
 +17      ;
 +18      ;patient DFN
           NEW DVBADFN
 +19      ;
 +20       SET DVBADFN=0
 +21       KILL ^TMP("DVBAICN",$JOB)
 +22      ;
 +23       IF $GET(DVBAICN)>0
               Begin DoDot:1
 +24      ;convert icn to dfn
                   DO GETDFN^VAFCTFU1(.DVBADFN,DVBAICN)
               End DoDot:1
 +25       SET ^TMP("DVBAICN",$JOB,0)=$SELECT(DVBADFN>0:DVBADFN,1:"NOT A VALID ICN")
 +26       SET RESULT=$NAME(^TMP("DVBAICN",$JOB))
 +27       QUIT