[613] | 1 | PXCEDATE ;ISL/dee - Used for things related to Date and Time ;6/20/96
|
---|
| 2 | ;;1.0;PCE PATIENT CARE ENCOUNTER;**47,161**;Aug 12, 1996
|
---|
| 3 | ;; ;
|
---|
| 4 | Q
|
---|
| 5 | ;
|
---|
| 6 | NEWDATE ;
|
---|
| 7 | D ASKDATE(.PXCEDBEG,.PXCEDEND)
|
---|
| 8 | D DATE9S
|
---|
| 9 | D MAKELIST^PXCENEW
|
---|
| 10 | Q
|
---|
| 11 | ;
|
---|
| 12 | ASKDATE(DBEG,DEND) ;
|
---|
| 13 | N NEWDBEG,NEWDEND
|
---|
| 14 | S NEWDBEG=$P($$EDATE("",DBEG),".")
|
---|
| 15 | Q:NEWDBEG<0
|
---|
| 16 | S NEWDEND=$P($$LDATE("",DEND),".")
|
---|
| 17 | Q:NEWDEND<0
|
---|
| 18 | S DBEG=$S(NEWDBEG>0:NEWDBEG,1:DBEG)
|
---|
| 19 | S DEND=$S(NEWDEND>0:NEWDEND,1:DEND)
|
---|
| 20 | I DEND<DBEG S NEWDBEG=DEND,DEND=DBEG,DBEG=NEWDBEG
|
---|
| 21 | ;D DATE9S This must be called by the caller if it is wanted.
|
---|
| 22 | Q
|
---|
| 23 | ;
|
---|
| 24 | EDATE(PRMPT,DFLT) ; Get early date
|
---|
| 25 | N %DT,X,Y
|
---|
| 26 | S %DT="AEX"
|
---|
| 27 | S %DT("A")=" Start "_$S($L($G(PRMPT)):PRMPT_" ",1:"")_"Date: "
|
---|
| 28 | S %DT("B")=$S($L($G(DFLT)):$$FMTE^XLFDT(DFLT,5),1:"T-30")
|
---|
| 29 | D ^%DT
|
---|
| 30 | Q Y
|
---|
| 31 | ;
|
---|
| 32 | LDATE(PRMPT,DFLT) ; Get late date
|
---|
| 33 | N %DT,X,Y
|
---|
| 34 | S %DT="AEX"
|
---|
| 35 | S %DT("A")="Ending "_$S($L($G(PRMPT)):PRMPT_" ",1:"")_"Date: "
|
---|
| 36 | S %DT("B")=$S($L($G(DFLT)):$$FMTE^XLFDT(DFLT,5),1:"TODAY")
|
---|
| 37 | D ^%DT
|
---|
| 38 | Q Y
|
---|
| 39 | ;
|
---|
| 40 | DATE9S ;
|
---|
| 41 | S PXCE9END=9999999-PXCEDEND
|
---|
| 42 | S PXCE9BEG=9999999-PXCEDBEG+.999999
|
---|
| 43 | S SDBEG=PXCEDBEG
|
---|
| 44 | S SDEND=PXCEDEND
|
---|
| 45 | Q
|
---|
| 46 | ;
|
---|
| 47 | DATE(INDATE) ;Change internal date to an external date.
|
---|
| 48 | N OUTDATE,AT
|
---|
| 49 | Q:INDATE'>0 ""
|
---|
| 50 | S OUTDATE=$$FMTE^XLFDT(INDATE,5)
|
---|
| 51 | S AT=$F(OUTDATE,"@")
|
---|
| 52 | Q $E(OUTDATE,1,(AT-2))_" "_$P($E(OUTDATE,AT,99),":",1,2)
|
---|
| 53 | ;
|
---|