cAN2279 ; algemene functies opzetten nieuwe codebestanden ; ; Compiled December 8, 2011 12:06:17 ; YZ Q ; BTW2N ; BTW-codes naar CODE.9011 N i,I1,INH,UI1,NB,TAB S $ZT="TRAP^cAN000" S I1="",LND=$P(@("^"_Q_"BA(39)"),D,3),LND=$$UI1^cAFA1("ISO.LAND",101,LND) I '$L(LND) X "STOP" BTW2NA S I1=$O(@("^"_Q_"BA(18,I1)")) G BTW2NZ:I1="" I I1>9 G BTW2NA S INH=^(I1) K NB S $P(NB(1),D)=$P(INH,D) S $P(NB(1),D,3)=LND F i=2,12,22,32 S $P(NB(1),D,i)=$P(INH,D,2) S $P(NB(1),D,30)=+$P(INH,D,3) S NUI1=$P(INH,D,48) ; ophalen link met nieuw bestand BTW2NB I $S('$L(NUI1):1,1:'$L($$SIGN^cAFA1("CODE.9011",NUI1,0))) S NUI1=$$UI1OP^cAFA1("CODE.9011","M1","",LND,$P(NB(1),D)) I '$L(NUI1) D P^cAN220("CODE.9011","",NUI1,"NB","") X:K="-" "STOP" G BTW2NC K TAB F i=1:1:27,32 S TAB(100+i)=$P(NB(1),D,i) D B^cAN220("CODE.9011","",NUI1,"TAB") X:K="-" "STOP" BTW2NC S $P(@("^"_Q_"BA(18,I1)"),D,48)=NUI1 G BTW2NA BTW2NZ Q ; COPY2N(UQC,USC,CODEB,NOCNV) ; kopieren naar nieuwe structuur ; UQC = UQC van oud bestand ; USC = USC van oud bestand ; CODEB = CODE.xxxx : adhv wordt het oude bestand bepaald. ; NOCNV = geen data veranderen, ook UI1 blijft hetzelfde ; ; KU : X "STOP" is niet mooi, maar als er iets misloopt is ; het beter dat de fout via een alert binnenkomt en Data-M kan ; dan manueel het bestand goed zetten ; ; Oud bestand is steeds in de vorm van "^"_Q_"xx(yy,CODE)="omschrijving\veld 2\..."; ; Nieuw bestand is steeds in de vorm van ^DKODE(0,"CODE.xxx",ui1)="Code\omschrijving\veld 2\..."; ; ; Uitzondering 1 : Muntcodes "^"_Q_"BA(11)") en ^DKODE(0,"CODE.9009") ; ; I '$L($G(CODEB)) G COPY2NZ N NUQC,NUSC,UI1,SW3,A,B,NUI1,TAB,SPATIE S $ZT="TRAP^cAN000" D DMS^cAN000("NUQC","NUSC",CODEB,1) I '$L(NUQC)!'$L(NUSC) G COPY2NZ S NUREF=$G(^DMC(NUQC,NUSC,"DATA","REF")) I '$L(NUREF) G COPY2NZ S NUREF=$P(NUREF,",UI1")_",NUI1"_$P(NUREF,",UI1",2,99) S UREF=$G(^DMC(UQC,USC,"DATA","REF")) I '$L(UREF) G COPY2NZ S UI1="",SW3=1 COPY2NA S UI1=$O(@UREF) I UI1="" G COPY2ND D R^cAN000 M NB=B I USC="KODE.VM" D MUNT S NOCNV=1 I $G(NOCNV) S NUI1=UI1 G COPY2NB ; algemeen wijzigen S SPATIE=$E(" ",UI1[" ") S NB(1)=$P(UI1," ")_D_$P(NB(1),D,1,27) ; code steeds op veld 1, de rest schuift op. F i=12,22,32 S $P(NB(1),D,i)=$P(NB(1),D,2) ; omschrijvingen invullen met omschrijving N S $P(NB(1),D,49)=Q,$P(NB(1),D,50)=UI1 ; wegschrijven link naar oud bestand S NUI1=$P(B(1),D,48) ; ophalen link met nieuw bestand COPY2NB I $S('$L(NUI1):1,1:'$L($$SIGN^cAFA1(CODEB,NUI1,0))) D P^cAN220(CODEB,"",NUI1,"NB","") X:K="-" "STOP" S $P(@UREF,D,48)=NUI1 G COPY2NC K TAB F i=1:1:27,32 S TAB(100+i)=$P(NB(1),D,i) D B^cAN220(CODEB,"",NUI1,"TAB") X:K="-" "STOP" G COPY2NC COPY2NC G COPY2NA ; zijn er verwijderde ? COPY2ND S NUI1="" F S NUI1=$O(@NUREF) Q:NUI1="" D . S NB(1)=@NUREF@(0) . I $P(NB(1),D,30) Q ; BG of verwijderd . D .. N UI1 I '$G(NOCNV) N Q .. S $ZT="TRAP^cAN000" .. I $G(NOCNV) S UI1=NUI1 .. I '$G(NOCNV) S UI1=$P(NB(1),D,50),Q=$P(NB(1),D,49) .. I '$D(@UREF) D V^cAN220(CODEB,"",NUI1) I K="-" X "STOP" COPY2NZ Q ; MUNT ; Overzetten muntcode naar structuur codebestand N ISO,I S $ZT="TRAP^cAN000" S NB(1)="" S ISO=$$SIGN^cAFA1("ISO.MUNT",$P(B(1),D,13),0) ; Code S $P(NB(1),D)=$P(B(1),D) ; Omschrijving Ned. + Fra + Duits + Eng. F I=2,12,22,32 S $P(NB(1),D,I)=$P(ISO,D,I) ; Intern nummer uit ISO.MUNT S $P(NB(1),D,3)=$P(B(1),D,13) ; Intern nummer koers S $P(NB(1),D,4)=$P(B(1),D,11) ; Aantal decimalen S $P(NB(1),D,5)=$P(B(1),D,7) ; $H S $P(NB(1),D,28)=$P(B(1),D,28) ; QU S $P(NB(1),D,29)=$P(B(1),D,29) ; Niveau S $P(NB(1),D,30)=+$P(B(1),D,30) ; Q-waarde S $P(NB(1),D,49)=$$Q49^cAFVBA03(Q,"CODE.9009") MUNTZ Q ; ZZ ; 19.03.07 - 15 u 31 * V8.08