source: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORY107.m@ 1361

Last change on this file since 1361 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 1.8 KB
RevLine 
[613]1ORY107 ;DAN/SLC Clean up non-canonic dates ;3/14/01 14:03
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**107**;Mar 15, 2001
3 ;This routine will find all order date/time entries that
4 ;are non-canonical and enter them in canonic form.
5 N ORI,ORIEN,ORACT,ORMSG,DA,DIE,DR
6 S ORMSG(1)="A task is being queued in the background to identify"
7 S ORMSG(2)="any orders whose DATE/TIME ENTERED field is a non-canonic"
8 S ORMSG(3)="number (having trailing zeros)."
9 S ORMSG(4)=""
10 S ORMSG(5)="These entries will be set to the correct canonic form"
11 S ORMSG(6)="by the background job and a mail message will be sent"
12 S ORMSG(7)="to the initiator of this patch at completion."
13 S ORMSG(8)=""
14 S ZTRTN="DQ^ORY107",ZTIO="",ZTDESC="DATE/TIME ORDER field clean up - Patch 107",ZTDTH=$H,ZTSAVE("DUZ")="" D ^%ZTLOAD
15 S ORMSG(9)="The task number is "_$G(ZTSK)
16 D MES^XPDUTL(.ORMSG) I '$D(ZTQUEUED) N DIR,Y S DIR(0)="E",DIR("A")="Press return to continue installation" D ^DIR
17 Q
18DQ ;Start processing here
19 S ORI="00" F S ORI=$O(^OR(100,"AF",ORI)) Q:ORI="" I ORI'=+ORI D ;if date/time is non-canonic then fix
20 .S ORIEN="" F S ORIEN=$O(^OR(100,"AF",ORI,ORIEN)) Q:ORIEN="" S ORACT="" F S ORACT=$O(^OR(100,"AF",ORI,ORIEN,ORACT)) Q:ORACT="" D UPDATE
21 .Q
22 D MAIL ;send email notifying initiator that clean up is finished
23 Q
24UPDATE ;change date/time to canonic form and call DIE to reset cross references
25 S DIE="^OR(100,"_ORIEN_",8,",DA=ORACT,DA(1)=ORIEN,DR=".01///"_+ORI
26 D ^DIE
27 Q
28MAIL ; -- Send completion message to user who initiated conversion
29 N XMSUB,XMTEXT,XMDUZ,XMY,XMZ,XMMG,ORTXT
30 S XMDUZ="PATCH OR*3*107 CLEAN-UP",XMY(.5)="" S:$G(DUZ) XMY(DUZ)=""
31 S ORTXT(1)="The DATE/TIME ORDERED field clean up for patch OR*3*107"
32 S ORTXT(2)="completed at "_$$FMTE^XLFDT($$NOW^XLFDT)_"."
33 S XMTEXT="ORTXT(",XMSUB="PATCH OR*3*107 Clean Up COMPLETED"
34 D ^XMD
35 Q
Note: See TracBrowser for help on using the repository browser.