source: WorldVistAEHR/trunk/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCPSMS0.m@ 862

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

initial load of WorldVistAEHR

File size: 1.0 KB
Line 
1PRCPSMS0 ;WISC/RFJ-isms trans, build segments: control, line count ;21 Oct 91
2 ;;5.1;IFCAP;;Oct 20, 2000
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4 Q
5 ;
6 ;
7CONTROL(V1,V2,V3) ; build control segment
8 ; v1=station number, v2=transaction code, v3=reference number
9 ; returns 'string' of segment
10 I 'V1!(V2="") S STRING="" Q
11 N %,%H,%I,DATE,NOW,TIME,X,Y
12 D NOW^%DTC S NOW=%,Y=%_"000000" D DD^%DT S TIME=$TR($P(Y,"@",2),":"),X1=$P(NOW,"."),X2=$E(NOW,1,3)_"0101" D ^%DTC S X=X+1,X=$E("000",$L(X)+1,3)_X,DATE=($E(NOW)+17)_$E(NOW,2,3)_X
13 S V3=V3_$E(" ",$L(V3)+1,11)
14 S STRING="ISM^"_V1_"^^"_V2_"^"_DATE_"^"_TIME_"^"_V3_"^001^001^040^|"
15 Q
16 ;
17 ;
18LINECNT(V1,V2) ; line count segment
19 ; v1=line count, v2=reference number
20 ; returns 'string("lc")' of data
21 I $L(V1)>3!($L(V2)>11) S STRING("LC")="" Q
22 S STRING("LC")="LC^"_V1_"^"_V2_"^|"
23 Q
24 ;
25 ;
26DELETE(DATA) ; delete segment
27 ; data=itemda
28 ; returns 'string("id")' of data
29 N NSN S NSN=$$NSN^PRCPUX1(DATA) I NSN="" S STRING("ID")="" Q
30 S STRING("ID")="ID^"_$TR(NSN,"-")_"^|"
31 Q
Note: See TracBrowser for help on using the repository browser.