DGNFUNC ;BPCIOFO/CMC-NAME FORMAT FUNCTIONS ; 22 Jan 2002 10:39 AM
 ;;5.3;Registration;**149,244**;Aug 13, 1993
 ;
 ;This routine will contains functions for returning the name field
 ;in a variety of formats.  It will NOT update the Patient file,
 ;the name field.
 ;
FML(DFN) ;
 ;This function will return the name from the Patient file for the given
 ;DFN in the format of First Middle Last Suffix.
 ; Input:  DFN - ien of patient in Patient file
 ; Output: -1^error message OR 
 ;      Patient name formatted First Middle Last Suffix.
 ;
 I '$D(DFN) Q "-1^MISSING DFN"
 I $G(DFN)<0 Q "-1^Missing DFN"
 N DPTNAME
 S DPTNAME("IENS")=DFN_",",DPTNAME("FILE")=2,DPTNAME("FIELD")=.01
 Q $$NAMEFMT^XLFNAME(.DPTNAME,"G","")
 
--- Routine Detail   --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDGNFUNC   738     printed  Sep 23, 2025@20:21:58                                                                                                                                                                                                      Page 2
DGNFUNC   ;BPCIOFO/CMC-NAME FORMAT FUNCTIONS ; 22 Jan 2002 10:39 AM
 +1       ;;5.3;Registration;**149,244**;Aug 13, 1993
 +2       ;
 +3       ;This routine will contains functions for returning the name field
 +4       ;in a variety of formats.  It will NOT update the Patient file,
 +5       ;the name field.
 +6       ;
FML(DFN)  ;
 +1       ;This function will return the name from the Patient file for the given
 +2       ;DFN in the format of First Middle Last Suffix.
 +3       ; Input:  DFN - ien of patient in Patient file
 +4       ; Output: -1^error message OR 
 +5       ;      Patient name formatted First Middle Last Suffix.
 +6       ;
 +7        IF '$DATA(DFN)
               QUIT "-1^MISSING DFN"
 +8        IF $GET(DFN)<0
               QUIT "-1^Missing DFN"
 +9        NEW DPTNAME
 +10       SET DPTNAME("IENS")=DFN_","
           SET DPTNAME("FILE")=2
           SET DPTNAME("FIELD")=.01
 +11       QUIT $$NAMEFMT^XLFNAME(.DPTNAME,"G","")