HMPXGDPT ; ASMR/PB - Patient File Utilities;Nov 03, 2015 18:23:03
 ;;2.0;ENTERPRISE HEALTH MANAGEMENT PLATFORM;**2**;November 30,2015;Build 28
 ;Per VA Directive 6402, this routine should not be modified.
 ;
 ; External References
 ; -------------------
 ; Patient File - IA 10035
 ; DBIA3327
 ;
 Q
 ;
TOP(HMPARRAY,HMPDFN,HMPFLDS,HMPFLG) ; returns data based on the DFN and the list of fields supplied.
 ;This API only returns fields that are at the top level of the record.
 ;It will not return data from multiples, use the LOWER API to return fields from a multiple in the Patient file.
 ;Data is returned in the array passed in the ARRAY parameter. Data is returned for both internal and external values.
 ;
 ; HMPARRAY - result array, passed by reference
 ; HMPDFN - IEN of the Patient, required
 ; HMPFLDS - FileMan field list (optional), if not passed all fields returned 
 ; HMPFLG - FileMan data flag (optional)
 ; 
 N DA,DR,DIQ,DIC,FLAGS
 Q:$G(HMPDFN)=""  ;DFN must be defined
 Q:$G(HMPFLDS)=""  ;FLDS must have a least one field defined. Fields are listed by field number and separated by a semi colon
 S:'$G(HMPFLG) FLAGS="IE"
 S DIC=2,DR=HMPFLDS,DA=HMPDFN,DIQ=HMPARRAY,DIQ(0)=$G(HMPFLG)
 D EN^DIQ1
 Q
 ;
INOUT(HMPDFN) ; Boolean function, 1 for inpatient, else zero
 N LOC S LOC=$G(^DPT(+$G(HMPDFN),.1)) Q $S($L(LOC):1,1:0)  ;ICR 10035, (#.1) WARD LOCATION [E1,30F]
 ;
 
--- Routine Detail   --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HHMPXGDPT   1412     printed  Sep 23, 2025@19:30:53                                                                                                                                                                                                    Page 2
HMPXGDPT  ; ASMR/PB - Patient File Utilities;Nov 03, 2015 18:23:03
 +1       ;;2.0;ENTERPRISE HEALTH MANAGEMENT PLATFORM;**2**;November 30,2015;Build 28
 +2       ;Per VA Directive 6402, this routine should not be modified.
 +3       ;
 +4       ; External References
 +5       ; -------------------
 +6       ; Patient File - IA 10035
 +7       ; DBIA3327
 +8       ;
 +9        QUIT 
 +10      ;
TOP(HMPARRAY,HMPDFN,HMPFLDS,HMPFLG) ; returns data based on the DFN and the list of fields supplied.
 +1       ;This API only returns fields that are at the top level of the record.
 +2       ;It will not return data from multiples, use the LOWER API to return fields from a multiple in the Patient file.
 +3       ;Data is returned in the array passed in the ARRAY parameter. Data is returned for both internal and external values.
 +4       ;
 +5       ; HMPARRAY - result array, passed by reference
 +6       ; HMPDFN - IEN of the Patient, required
 +7       ; HMPFLDS - FileMan field list (optional), if not passed all fields returned 
 +8       ; HMPFLG - FileMan data flag (optional)
 +9       ; 
 +10       NEW DA,DR,DIQ,DIC,FLAGS
 +11      ;DFN must be defined
           if $GET(HMPDFN)=""
               QUIT 
 +12      ;FLDS must have a least one field defined. Fields are listed by field number and separated by a semi colon
           if $GET(HMPFLDS)=""
               QUIT 
 +13       if '$GET(HMPFLG)
               SET FLAGS="IE"
 +14       SET DIC=2
           SET DR=HMPFLDS
           SET DA=HMPDFN
           SET DIQ=HMPARRAY
           SET DIQ(0)=$GET(HMPFLG)
 +15       DO EN^DIQ1
 +16       QUIT 
 +17      ;
INOUT(HMPDFN) ; Boolean function, 1 for inpatient, else zero
 +1       ;ICR 10035, (#.1) WARD LOCATION [E1,30F]
           NEW LOC
           SET LOC=$GET(^DPT(+$GET(HMPDFN),.1))
           QUIT $SELECT($LENGTH(LOC):1,1:0)
 +2       ;