Changeset 364


Ignore:
Timestamp:
Feb 9, 2009, 7:16:47 PM (16 years ago)
Author:
George Lilly
Message:

improved CCR ELEMENT interface

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ccr/trunk/p/C0CFM1.m

    r360 r364  
    1818 ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
    1919 ;
    20  W "This is the CCR RXNORM Utility Library ",!
     20 W "This is the CCR FILEMAN Utility Library ",!
    2121 W !
    2222 Q
     
    3232 . S C0CVARS=$NA(@C0CGLB)
    3333 . S C0CI=""
    34  . F  S C0CI=$O(C0CVARS(C0CI)) Q:C0CI=""  D  ;FOR EACH SECTION
    35  . . S C0CVARSN=$NA(C0CVARS(C0CI)) ; GRAB ONE SECTION
     34 . F  S C0CI=$O(@C0CVARS@(C0CI)) Q:C0CI=""  D  ;FOR EACH SECTION
     35 . . S C0CVARSN=$NA(@C0CVARS@(C0CI)) ; GRAB ONE SECTION
    3636 . . D PUTRIM1(DFN,C0CI,C0CVARSN)
    3737 Q
    3838 ;
    39 PUTRIM1(DFN,ZZTYP,ZVARS) ;INTERNAL TO PUTRIM FOR ONE SECTION
     39PUTRIM1(DFN,ZZTYP,ZVARS) ; PUT ONE SECTION OF VARIABLES INTO CCR ELEMENTS
    4040 ; ZVARS IS PASSED BY NAME AN HAS THE FORM @ZVARS@(1,"VAR1")="VAL1"
    4141 S C0CX=0
    42  F  S C0CX=$O(@ZVARS@(C0CX)) Q:C0CX=2  D  ; FOR EACH OCCURANCE
     42 F  S C0CX=$O(@ZVARS@(C0CX)) Q:C0CX=""  D  ; FOR EACH OCCURANCE
     43 . W "ZOCC=",C0CX,!
    4344 . S C0CV=$NA(@ZVARS@(C0CX)) ; VARIABLES FOR THIS OCCURANCE
    44  . B
    4545 . D PUTELS(DFN,ZZTYP,C0CX,C0CV) ; PUT THEM TO THE CCR ELEMENTS FILE
    4646 Q
     
    5656 S ZSRC=1 ; CCR SOURCE IS ASSUMED TO BE THIS EHR, WHICH IS ALWAYS SOURCE 1
    5757 ; PUT THIS IN PARAMETERS - SO SOURCE NUMBER FOR PROCESSING IN CONFIGURABLE
    58  N ZF,ZSUBF S ZF=171.201 S ZSUBF=171.20122 ;FILE AND SUBFILE NUMBERS
     58 N ZF,ZFV S ZF=171.201 S ZFV=171.2012
     59 S ZSUBF=171.20122 ;FILE AND SUBFILE NUMBERS
    5960 N ZSFV S ZSFV=171.201221 ; SUBFILE VARIABLE FILE NUMBER
    6061 N ZTYPN S ZTYPN=$O(^C0CDIC(170.101,"B",ZTYPE,""))
     
    6263 N ZVARN ; IEN OF VARIABLE BEING PROCESSED
    6364 ;N C0CFDA ; FDA FOR CCR ELEMENT UPDATE
    64  S C0CFDA(ZF,"+1,",.01)=DFN
    65  S C0CFDA(ZF,"+1,"_DFN_",",.02)=ZSRC
    66  S C0CFDA(ZF,"+1,"_DFN_","_ZSRC_",",.03)=ZTYPN
    67  S C0CFDA(ZF,"+1,"_DFN_","_ZSRC_","_ZTYPN_",",.04)=ZOCC ;CREATE OCCURANCE
     65 S C0CFDA(ZF,"?+1,",.01)=DFN
     66 S C0CFDA(ZF,"?+1,",.02)=ZSRC
     67 S C0CFDA(ZF,"?+1,",.03)=ZTYPN
     68 S C0CFDA(ZF,"?+1,",.04)=ZOCC ;CREATE OCCURANCE
     69 K ZERR
     70 D UPDATE^DIE("","C0CFDA","","ZERR") ;ASSIGN RECORD NUMBER
     71 I $D(ZERR) B  ;OOPS
     72 K C0CFDA
     73 S ZD0=$O(^C0C(ZF,"C",DFN,ZSRC,ZTYPN,ZOCC,""))
     74 W "RECORD NUMBER: ",ZD0,!
     75 ;B
     76 S ZCNT=0
    6877 S ZC0CI="" ;
    6978 F  S ZC0CI=$O(@ZVALS@(ZC0CI)) Q:ZC0CI=""  D  ;
    7079 . I ZC0CI'="M" D  ; NOT A SUBVARIABLE
     80 . . S ZCNT=ZCNT+1 ;INCREMENT COUNT
    7181 . . S ZVARN=$$VARPTR(ZC0CI,ZTYPE) ;GET THE POINTER TO THE VAR IN THE CCR DICT
    7282 . . ; WILL ALLOW FOR LAYGO IF THE VARIABLE IS NOT FOUND
    73  . . S C0CFDA(ZSFV,"+1,"_DFN_","_ZSRC_","_ZTYPN_","_ZOCC_",",.01)=ZVARN
    74  . . S C0CFDA(ZSFV,"+1,"_DFN_","_ZSRC_","_ZTYPN_","_ZOCC_",",1)=@ZVALS@(ZC0CI)
     83 . . S C0CFDA(ZFV,"?+"_ZCNT_","_ZD0_",",.01)=ZVARN
     84 . . S C0CFDA(ZFV,"?+"_ZCNT_","_ZD0_",",1)=@ZVALS@(ZC0CI)
     85 . . ;S C0CFDA(ZSFV,"+1,"_DFN_","_ZSRC_","_ZTYPN_","_ZOCC_",",.01)=ZVARN
     86 . . ;S C0CFDA(ZSFV,"+1,"_DFN_","_ZSRC_","_ZTYPN_","_ZOCC_",",1)=@ZVALS@(ZC0CI)
    7587 ;S GT1(170,"?+1,",.01)="ZZZ NEW MEDVEHICLETEXT"
    7688 ;S GT1(170,"?+1,",12)="DIR"
Note: See TracChangeset for help on using the changeset viewer.