Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: MAGDRPC4

MAGDRPC4.m

Go to the documentation of this file.
  1. MAGDRPC4 ;WOIFO/EDM,DAC - Imaging RPCs ; Feb 15, 2022@10:29:19
  1. ;;3.0;IMAGING;**11,30,51,50,54,49,138,156,180,305**;Mar 19, 2002;Build 3
  1. ;; Per VHA Directive 2004-038, this routine should not be modified.
  1. ;; +---------------------------------------------------------------+
  1. ;; | Property of the US Government. |
  1. ;; | No permission to copy or redistribute this software is given. |
  1. ;; | Use of unreleased versions of this software requires the user |
  1. ;; | to execute a written test agreement with the VistA Imaging |
  1. ;; | Development Office of the Department of Veterans Affairs, |
  1. ;; | telephone (301) 734-0100. |
  1. ;; | The Food and Drug Administration classifies this software as |
  1. ;; | a medical device. As such, it may not be changed in any way. |
  1. ;; | Modifications to this software may result in an adulterated |
  1. ;; | medical device under 21CFR820, the use of which is considered |
  1. ;; | to be a violation of US Federal Statutes. |
  1. ;; +---------------------------------------------------------------+
  1. ;;
  1. Q
  1. ;
  1. LOOKUP(OUT,NUMBER) ; RPC = MAG DICOM LOOKUP STUDY
  1. ; Look Up for Radiology, Consults, and Lab (anatomic pathology)
  1. N ACNUMB ;--- Accession Number
  1. N CPTCODE ;-- CPT code for the procedure
  1. N CPTNAME ;-- CPT name for the procedure
  1. N DFN ;------ Patient pointer
  1. N EXAMSTS ;-- Exam status (don't post images to CANCELLED exams)
  1. N EXAMTYPE ;- Type of exam (Rad,Con, or Lab)
  1. N GMRCIEN ;-- Pointer for GMRC
  1. N INFO ;----- return array from $$ACCRPT^RAAPI()
  1. N PROCIEN ;-- Radiology procedure IEN in ^RAMIS(71)
  1. N RAA ;------ Radiology array (for $$ACCFIND)
  1. N RAIX ;----- cross reference subscript for case number lookup
  1. N RADFN ;---- first level subscript in ^RADPT
  1. N RADTI ;---- second level subscript in ^RADPT (after "DT")
  1. N RACNI ;---- third level subscript in ^RADPT (after "P")
  1. N RARPT ;---- Radiology Report pointer
  1. N I,LIST,NOUT,X,Y,Z
  1. ;
  1. K OUT S NOUT=1
  1. I $G(NUMBER)="" S OUT(1)="-1,No Case or Consult Number Specified" Q
  1. I $E(NUMBER,2)="`" D Q
  1. . ; lookup the image by the IEN
  1. . D IENLOOK^MAGDRPC9
  1. . Q
  1. ;
  1. S EXAMTYPE=$E(NUMBER,1)
  1. I "RCL"[EXAMTYPE S NUMBER=$E(NUMBER,2,$L(NUMBER))
  1. E S OUT(1)="-2,Need to specify Radiology, Consults, or Lab" Q
  1. K DFN
  1. I EXAMTYPE="R" D
  1. . D RADLKUP(.NOUT,.OUT,.ACNUMB,NUMBER) ; radiology lookup
  1. . Q
  1. E I EXAMTYPE="C" D
  1. . D CONLKUP(.NOUT,.OUT,.ACNUMB,NUMBER) ; CPRS consult/procedure lookup
  1. . Q
  1. E D
  1. . D LABLKUP(.NOUT,.OUT,.ACNUMB,NUMBER) ; anatomic pathology lab lookup
  1. . Q
  1. ;
  1. D NEWLKUP^MAGDRPCD(.NOUT,.OUT,ACNUMB) ; check if there are any DICOM objects in the new SOP Class database
  1. ;
  1. I '$D(OUT(1)) S OUT(1)=NOUT-1 ; allow error messages to be passed back in OUT(1)
  1. Q
  1. ;
  1. RADLKUP(NOUT,OUT,ACNUMB,NUMBER) ; Radiology lookup
  1. S ACNUMB=""
  1. S RACNI=0 ; must get this value to find study
  1. I NUMBER?1N.N D I 'RACNI S OUT(1)="-14,Radiology case number not on file" Q
  1. . ; Look for the patient/study in ^RADPT using the Radiology Case Number
  1. . N RAIX ;----- cross reference subscript for case number lookup
  1. . S RAIX=$S($D(^RADPT("C")):"C",1:"AE") ; for Radiology Patch RA*5*7
  1. . S RAIX=$S(NUMBER["-":"ADC",1:RAIX) ; select the cross-reference
  1. . S RADFN=$O(^RADPT(RAIX,NUMBER,"")) Q:'RADFN
  1. . S RADTI=$O(^RADPT(RAIX,NUMBER,RADFN,""))
  1. . S RACNI=$O(^RADPT(RAIX,NUMBER,RADFN,RADTI,""))
  1. . Q
  1. E D I 'RACNI S OUT(1)="-15,Radiology accession number not on file" Q
  1. . ; lookup using Radiololgy Package API
  1. . S X=$$ACCFIND^RAAPI(NUMBER,.RAA)
  1. . I X<0 Q
  1. . S Y=RAA(1)
  1. . S RADFN=$P(Y,"^",1),RADTI=$P(Y,"^",2),RACNI=$P(Y,"^",3)
  1. . Q
  1. I '$D(^RADPT(RADFN,0)) S OUT(1)="-12,No patient demographics file pointer" Q
  1. S DFN=$P(^RADPT(RADFN,0),"^",1)
  1. I '$G(DFN) S OUT(1)="-13,Radiology exam not on file" Q
  1. S EXAMSTS=$P($G(^RADPT(DFN,"DT",RADTI,"P",RACNI,0)),"^",3)
  1. I 'EXAMSTS S OUT(1)="-16,Radiology EXAM STATUS field not present" Q
  1. I $$GET1^DIQ(72,EXAMSTS,3)=0 S OUT(1)="-17,Radiology exam cancelled" Q
  1. D:$D(^RADPT(DFN,"DT",RADTI,0)) ; p305 PMK 03/30/2021
  1. . S RARPT=$P($G(^RADPT(DFN,"DT",RADTI,"P",RACNI,0)),"^",17) Q:'RARPT
  1. . S X=$$ACCRPT^RAAPI(RARPT,.INFO)
  1. . I X<0 S OUT(1)="-11,Radiology Problem: "_X Q
  1. . S ACNUMB=INFO(1)
  1. . S I=0 F S I=$O(^RARPT(RARPT,2005,I)) Q:'I D
  1. . . S X="74^"_RARPT_"^"_$P($G(^RARPT(RARPT,2005,I,0)),"^",1)_"^"_ACNUMB
  1. . . S NOUT=NOUT+1,OUT(NOUT)=X
  1. . . Q
  1. . Q
  1. Q
  1. ;
  1. CONLKUP(NOUT,OUT,ACNUMB,NUMBER) ; CPRS Consult/Procedure study lookup
  1. N MAGIEN,MAGPTR,REPORTF,REPORTI,TIUIEN,TIUPTR,TIUXIEN,X
  1. S X=$$GMRCIEN^MAGDFCNV(NUMBER) S GMRCIEN=$S(X:X,1:NUMBER)
  1. S ACNUMB=$$GMRCACN^MAGDFCNV(GMRCIEN)
  1. D
  1. . S DFN=$$GET1^DIQ(123,GMRCIEN,.02,"I") Q:'DFN
  1. . S EXAMSTS=$$GET1^DIQ(123,GMRCIEN,8,"I") ; check acceptable status
  1. . ; EXAMSTS=2 for COMPLETE, 5=PENDING, 6=ACTIVE, 8=SCHEDULED, STATUS=9 for PARTIAL RESULTS
  1. . I EXAMSTS'=2,EXAMSTS'=5,EXAMSTS'=6,EXAMSTS'=8,EXAMSTS'=9 D Q
  1. . . S EXAMSTS=$$GET1^DIQ(123,GMRCIEN,8,"E") ; get name of status
  1. . . S OUT(1)="-4,Consult is "_EXAMSTS Q
  1. . . Q
  1. . Q
  1. I $D(OUT(1)) Q ; bad EXAMSTS
  1. I '$G(DFN) S OUT(1)="-5,Consult/procedure not on file" Q
  1. ; Find the images - they can be linked to TIU or imaging file 2006.5839
  1. S MAGPTR=0 ; find in ^MAG(2006.5839) - may not be in ^TIU yet
  1. F S MAGPTR=$O(^MAG(2006.5839,"C",123,GMRCIEN,MAGPTR)) Q:'MAGPTR D
  1. . S X=^MAG(2006.5839,MAGPTR,0)
  1. . S X=$P(X,"^",1)_"^"_$P(X,"^",2)_"^"_$P(X,"^",3)_"^"_ACNUMB
  1. . S NOUT=NOUT+1,OUT(NOUT)=X
  1. . Q
  1. ; also try to find images in ^TIU
  1. N I,RESULT,X
  1. D TIUALL^MAGDGMRC(GMRCIEN,.RESULT)
  1. S I="" F S I=$O(RESULT(I)) Q:I="" D
  1. . S X="8925^"_$P(RESULT(I),"^",1)_"^"_$P(RESULT(I),"^",3)_"^"_$P(RESULT(I),"^",2)
  1. . S NOUT=NOUT+1,OUT(NOUT)=X
  1. . Q
  1. Q
  1. ;
  1. LABLKUP(NOUT,OUT,ACNUMB,NUMBER) ; Lab (Anatomic Pathology) study lookup
  1. N DFN,FILEDATA,LRDFN,LRI,LRSS,MAGIEN,MAGPTR,PARENTFILE,TIUIEN,TIUXIEN,X
  1. S ACNUMB=NUMBER D LABLKUP^MAGDIR8A
  1. I '$G(DFN) S OUT(1)="-6,Anatomic Pathology case not on file" Q
  1. D SUBFILES^MAGDIR9F(LRSS)
  1. ; Find the images - they can be linked to TIU or imaging file 2006.5838
  1. S MAGPTR=$O(^MAG(2006.5838,"C",PARENTFILE,LRDFN,LRI,0))
  1. I MAGPTR D Q ; Found it in ^MAG(2006.5838) - not in ^TIU yet
  1. . S X=^MAG(2006.5838,MAGPTR,0)
  1. . ; separate the two subscripts that point to the study with a comma
  1. . S X=$P(X,"^",1)_"^"_$P(X,"^",2)_","_$P(X,"^",3)_"^"_$P(X,"^",4)_"^"_ACNUMB
  1. . S NOUT=NOUT+1,OUT(NOUT)=X
  1. . Q
  1. D ; Otherwise find images in ^TIU
  1. . S TIUIEN=$$TIUIEN^MAGT7MA(LRSS,LRDFN,LRI)
  1. . I TIUIEN D
  1. . . S TIUXIEN=$O(^TIU(8925.91,"B",TIUIEN,""))
  1. . . I TIUXIEN D
  1. . . . S MAGIEN=$$GET1^DIQ(8925.91,TIUXIEN,.02,"I")
  1. . . . S X="8925^"_TIUIEN_"^"_MAGIEN_"^"_ACNUMB
  1. . . . S NOUT=NOUT+1,OUT(NOUT)=X
  1. . . . Q
  1. . . Q
  1. . Q
  1. Q
  1. ;
  1. NEXTIMG(OUT,FROMS,ONLYCHECK,SENT) ; RPC = MAG DICOM GET NEXT QUEUE ENTRY
  1. ; Get next file to be DICOM transmitted
  1. N D0,D1,F1,F2,F3,FAILTIME,FROM,GROUP,I,JBTOHD,LOC,N,PRIORITY,SITE,STATE,TYPE,X,XMITTIME
  1. N ARTIFACTIX,ARTIFACTINSTIX,DFN,DISKVOLUME,FILEPATH,PHYSICALREF,STUDYIX
  1. S X=$G(FROMS) S:X FROM(X)=1
  1. S I="" F S I=$O(FROMS(I)) Q:I="" S X=$P($G(FROMS(I)),"^",1) S:X FROM(X)=1
  1. I '$O(FROM("")) S OUT(1)="-1,No Origin Specified" Q
  1. ;
  1. L +^MAGDOUTP(2006.574):1E9 ; P305 PMK 09/23/2021 - Lock entire global, RPC MUST wait
  1. ;
  1. ; First clean up transmitted queue entries
  1. S I="" F S I=$O(SENT(I)) Q:I="" D CLEAN
  1. S SITE=$O(^MAG(2006.1,"B",DUZ(2),"")) ; parameters are defined for the sending site
  1. S XMITTIME=$$GET1^DIQ(2006.1,SITE,208)
  1. S FAILTIME=$$GET1^DIQ(2006.1,SITE,209)
  1. S H=$$SECOND($H)
  1. ;
  1. ; ONLYCHECK=1 for batch export (^MAGDIWBE) but 0 for a transmission process (^MAGDIWB2)
  1. I 'ONLYCHECK D ; do only when called from a transmission process, not batch export
  1. . ; check for DICOM objects stuck in XMIT state or that previously failed to be transmitted
  1. . S FROM="" F S FROM=$O(FROM(FROM)) Q:FROM="" D
  1. . . S PRIORITY="" F S PRIORITY=$O(^MAGDOUTP(2006.574,"STATE",FROM,PRIORITY)) Q:PRIORITY="" D
  1. . . . D RETRYXMT(FROM,PRIORITY,"XMIT",XMITTIME,0) ; XMIT is disabled by default
  1. . . . D RETRYXMT(FROM,PRIORITY,"FAIL",FAILTIME,300) ; default for FAIL is 5 minutes
  1. . . . Q
  1. . . Q
  1. . Q
  1. ;
  1. ; Find the highest priority among the selected FROM locations
  1. S FROM="" F S FROM=$O(FROM(FROM)) Q:FROM="" D
  1. . S PRIORITY="" F S PRIORITY=$O(^MAGDOUTP(2006.574,"STATE",FROM,PRIORITY)) Q:PRIORITY="" D
  1. . . S X=$O(^MAGDOUTP(2006.574,"STATE",FROM,PRIORITY,"WAITING","")) S:X PRIORITY(PRIORITY,FROM)=""
  1. . . Q
  1. . Q
  1. K OUT S OUT(1)="",PRIORITY=$O(PRIORITY(""),-1) D:PRIORITY'=""
  1. . S FROM=$O(PRIORITY(PRIORITY,""))
  1. . S D0="" F S D0=$O(^MAGDOUTP(2006.574,"STATE",FROM,PRIORITY,"WAITING",D0)) Q:D0="" D Q:OUT(1)'=""
  1. . . S D1="" F S D1=$O(^MAGDOUTP(2006.574,"STATE",FROM,PRIORITY,"WAITING",D0,D1)) Q:D1="" D Q:OUT(1)'=""
  1. . . . ; ONLYCHECK=1 for batch export; ONLYCHECK=0 for a transmission process
  1. . . . I 'ONLYCHECK D ; do only when called from a transmission process, not batch export
  1. . . . . S $P(^MAGDOUTP(2006.574,D0,1,D1,0),"^",2,3)="XMIT^"_$H
  1. . . . . K ^MAGDOUTP(2006.574,"STATE",FROM,PRIORITY,"WAITING",D0,D1)
  1. . . . . S ^MAGDOUTP(2006.574,"STATE",FROM,PRIORITY,"XMIT",D0,D1)=""
  1. . . . . Q
  1. . . . S OUT(1)=1
  1. . . . S OUT(2)=D0
  1. . . . S OUT(3)=D1
  1. . . . S X=$G(^MAGDOUTP(2006.574,D0,0))
  1. . . . S OUT(4)=$P(X,"^",1) ; Application
  1. . . . S (OUT(5),GROUP)=$P(X,"^",2) ; Group
  1. . . . S (ACNUMB,OUT(6))=$P(X,"^",3) ; Accession Number
  1. . . . S JBTOHD=+$P(X,"^",6)
  1. . . . S OUT(7)=$P(^MAGDOUTP(2006.574,D0,1,D1,0),"^",1) ; Image IEN or Artifact IEN
  1. . . . I GROUP="New SOP Class DB" D
  1. . . . . S ARTIFACTIX=OUT(7) ; ARTIFACT file (#2006.916) IEN
  1. . . . . S OUT(8)=GROUP ; no legacy Object Type (2005 field 3)
  1. . . . . ; get DFN from IMAGE STUDY file (#2005.62) and IMAGING PATIENT REFERENCE file (#2005.61)
  1. . . . . S STUDYIX=$O(^MAGV(2005.62,"D",ACNUMB,"")) ; get IMAGE STUDY pointer
  1. . . . . S DFN=$$GET1^DIQ(2005.62,STUDYIX,13,"E") ; get IMAGING PATIENT REFERENCE (DFN)
  1. . . . . ; there may be multiple artifact instances - use the first one
  1. . . . . ; could check the NETWORK LOCATION file (2005.2) STORAGE TYPE = "TIER 1"
  1. . . . . S ARTIFACTINSTIX=$O(^MAGV(2006.918,"B",ARTIFACTIX,"")) ; get first Artifact Instance pointer
  1. . . . . S F1=$$UP^MAGDFCNV($$GET1^DIQ(2006.918,ARTIFACTINSTIX,6)) ; FILEREF (filename)
  1. . . . . S DISKVOLUME=$$GET1^DIQ(2006.918,ARTIFACTINSTIX,7,"I") ; DISK VOLUME
  1. . . . . S PHYSICALREF=$$GET1^DIQ(2005.2,DISKVOLUME,1) ; PHYSICAL REFERENCE
  1. . . . . S FILEPATH=$$GET1^DIQ(2006.918,ARTIFACTINSTIX,8) ; FILEPATH
  1. . . . . S (F2,F3)=PHYSICALREF_FILEPATH_F1
  1. . . . . Q
  1. . . . E D
  1. . . . . S IMAGEIEN=OUT(7)
  1. . . . . S OUT(8)=$P($G(^MAG(2005,IMAGEIEN,0)),"^",6) ; Object Type
  1. . . . . S TYPE=$S($G(^MAG(2005,IMAGEIEN,"FBIG"))'="":"BIG",1:"FULL")
  1. . . . . ; 3rd parameter set to 1 to allow retrieval from jukebox
  1. . . . . D FILEFIND^MAGDFB(IMAGEIEN,TYPE,1,0,.F1,.F2)
  1. . . . . S DFN=$P($G(^MAG(2005,+OUT(7),0)),"^",7) ; P156 DAC - get DFN from image (not group)
  1. . . . . ; get path for *.TXT, always the same as the FULL file
  1. . . . . D FILEFIND^MAGDFB(IMAGEIEN,"FULL",JBTOHD,0,.F1,.F3)
  1. . . . . Q
  1. . . . S OUT(9)=F1 ; file name
  1. . . . S OUT(10)=F2 ; full file path
  1. . . . S OUT(11)=DFN
  1. . . . S OUT(12)=F3 ; full file path
  1. . . . S X=$G(^MAGDOUTP(2006.574,D0,1,0))
  1. . . . S OUT(13)=$P(X,"^",4) ; Object count
  1. . . . Q
  1. . . Q
  1. . Q
  1. I OUT(1)="" D
  1. . S OUT(1)="-2,Nothing to be transmitted."
  1. . D CLEANUP
  1. . Q
  1. L -^MAGDOUTP(2006.574) ; P180 DAC - Unlock global
  1. Q
  1. ;
  1. RETRYXMT(FROM,PRIORITY,OLDSTATE,TIMEOUT,DEFAULTTIMEOUT) ; retry transmission
  1. ; move images from XMIT or FAIL state to WAITING state
  1. N D0,D1,H,X
  1. ;
  1. I TIMEOUT="" S TIMEOUT=DEFAULTTIMEOUT ; XMIT/FAIL timeout not defined
  1. ;
  1. I TIMEOUT=0 Q ; retransmission is disabled
  1. ;
  1. S H=$$SECOND($H)
  1. S D0="" F S D0=$O(^MAGDOUTP(2006.574,"STATE",FROM,PRIORITY,OLDSTATE,D0)) Q:D0="" D
  1. . S D1="" F S D1=$O(^MAGDOUTP(2006.574,"STATE",FROM,PRIORITY,OLDSTATE,D0,D1)) Q:D1="" D
  1. . . S X=$$SECOND($P($G(^MAGDOUTP(2006.574,D0,1,D1,0),"^^"_$H),"^",3))
  1. . . Q:H-X<TIMEOUT
  1. . . S $P(^MAGDOUTP(2006.574,D0,1,D1,0),"^",2)="WAITING"
  1. . . K ^MAGDOUTP(2006.574,"STATE",FROM,PRIORITY,OLDSTATE,D0,D1)
  1. . . S ^MAGDOUTP(2006.574,"STATE",FROM,PRIORITY,"WAITING",D0,D1)=""
  1. . . Q
  1. . Q
  1. Q
  1. ;
  1. CLEANUP ; remove old studies
  1. N D0,D1,I,REQUESTDATETIME,SENT
  1. S REQUESTDATETIME=$$FMADD^XLFDT($$NOW^XLFDT,-15,0,0,0) ; delete anything 15 days older or older
  1. F S REQUESTDATETIME=$O(^MAGDOUTP(2006.574,"C",REQUESTDATETIME),-1) Q:REQUESTDATETIME="" D
  1. . S D0="" F S D0=$O(^MAGDOUTP(2006.574,"C",REQUESTDATETIME,D0)) Q:D0="" D
  1. . . S D1=0 F S D1=$O(^MAGDOUTP(2006.574,D0,1,D1)) Q:D1="" D
  1. . . . S I=1,SENT(1)=D0_"^"_D1_"^" D CLEAN ; STATE=<null>
  1. . . . Q
  1. . . Q
  1. . Q
  1. Q
  1. ;
  1. CLEAN ; remove one image entry from the queue
  1. N D0,D1,REQUESTDATETIME,STUID,PRIORITY,STATE,NEWSTATE ; P305 PMK 09/29/2021
  1. S D0=$P(SENT(I),"^",1),D1=$P(SENT(I),"^",2),NEWSTATE=$P(SENT(I),"^",3)
  1. Q:'$D(^MAGDOUTP(2006.574,D0,1,D1))
  1. ;
  1. S X=$G(^MAGDOUTP(2006.574,D0,0)),LOC=$P(X,"^",4),PRIORITY=+$P(X,"^",5)
  1. S REQUESTDATETIME=$P(X,"^",7)
  1. S STATE=$P($G(^MAGDOUTP(2006.574,D0,1,D1,0)),"^",2)
  1. ;
  1. I NEWSTATE'="" D Q ; just update the status and get out
  1. . S $P(^MAGDOUTP(2006.574,D0,1,D1,0),"^",2)=NEWSTATE,$P(^(0),"^",3)=$H
  1. . ; remove the old xref before setting the new one - P305 PMK 09/29/2021
  1. . I LOC'="",PRIORITY'="",STATE'="" K ^MAGDOUTP(2006.574,"STATE",LOC,PRIORITY,STATE,D0,D1)
  1. . I LOC'="",PRIORITY'="" S ^MAGDOUTP(2006.574,"STATE",LOC,PRIORITY,NEWSTATE,D0,D1)=""
  1. . Q
  1. ;
  1. K ^MAGDOUTP(2006.574,D0,1,D1)
  1. I LOC'="",PRIORITY'="",STATE'="" K ^MAGDOUTP(2006.574,"STATE",LOC,PRIORITY,STATE,D0,D1)
  1. S X=$G(^MAGDOUTP(2006.574,D0,1,0))
  1. S $P(X,"^",4)=$P(X,"^",4)-1
  1. S ^MAGDOUTP(2006.574,D0,1,0)=X
  1. ;
  1. Q:$O(^MAGDOUTP(2006.574,D0,1,0)) ; don't delete the study node yet
  1. ;
  1. S STUID=$G(^MAGDOUTP(2006.574,D0,2))
  1. K ^MAGDOUTP(2006.574,D0)
  1. K:REQUESTDATETIME'="" ^MAGDOUTP(2006.574,"C",REQUESTDATETIME,D0)
  1. K:STUID'="" ^MAGDOUTP(2006.574,"STUDY",STUID)
  1. S X=$G(^MAGDOUTP(2006.574,0))
  1. S $P(X,"^",4)=$P(X,"^",4)-1
  1. S ^MAGDOUTP(2006.574,0)=X
  1. Q
  1. ;
  1. FIND(DATE,CASE,NUM) ;
  1. ; Use the ADC x-reference in the radiology patient file
  1. N NDATE
  1. S NDATE=$$FMADD^XLFDT(DATE,NUM) Q:NDATE<1 0
  1. Q $O(^RADPT("ADC",$$MMDDYY(NDATE)_"-"_CASE,""))
  1. ;
  1. MMDDYY(DAY) ; Convert Fileman date to mmddyy
  1. I DAY'?7N Q 0
  1. Q $E(DAY,4,7)_$E(DAY,2,3)
  1. ;
  1. SECOND(H) Q H*86400+$P(H,",",2)
  1. ;