Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: CIMSNCI1

CIMSNCI1.m

Go to the documentation of this file.
CIMSNCI1 ; CMI/TUCSON/LAB - NCI RECORD GENERATION ; 
 ;;1.0;NCI STUDY EXTRACT 1.0;;MAY 14, 1998
 ;
 ;
AREC(DFN,CIMSDDX,CIMSRTYP) ;PEP - called to send back a visit record as
 NEW CIMSREC,CIMSX,CIMS
 S CIMSREC=""
 I '$G(DFN) Q CIMSREC
 I '$D(^DPT(DFN)) Q CIMSREC
 I '$D(^AUPNPAT(DFN,0)) Q CIMSREC
 I '$D(^CIMSCPAT(DFN)) Q CIMSREC
 S CIMSRTYP("IEN")=$O(^CIMSCREC("B",CIMSRTYP,0))
 I 'CIMSRTYP("IEN") Q CIMSREC
 X:$G(^CIMSCREC(CIMSRTYP("IEN"),12))]"" ^CIMSCREC(CIMSRTYP("IEN"),12)
PROC ;
 S CIMSX=0
 F  S CIMSX=$O(^CIMSCREC(CIMSRTYP("IEN"),11,"AC",CIMSX)) Q:CIMSX'=+CIMSX!(CIMSREC=-1)  S CIMS=$O(^CIMSCREC(CIMSRTYP("IEN"),11,"AC",CIMSX,0))  D
 .S X="" X:$D(^CIMSCREC(CIMSRTYP("IEN"),11,CIMS,11)) ^CIMSCREC(CIMSRTYP("IEN"),11,CIMS,11)
 .S $E(CIMSREC,$P(^CIMSCREC(CIMSRTYP("IEN"),11,CIMS,0),U,2))=X
 Q CIMSREC
 ;
BREC(CIMSV,CIMSRTYP) ;PEP
 NEW CIMSREC,CIMSX,CIMS
 S CIMSREC=""
 I '$G(CIMSV) Q CIMSREC
 I '$D(^AUPNVSIT(CIMSV)) Q CIMSREC
 NEW CIMSDFN S CIMSDFN=$P(^AUPNVSIT(CIMSV,0),U,5)
 S CIMSRTYP("IEN")=$O(^CIMSCREC("B",CIMSRTYP,0))
 I 'CIMSRTYP("IEN") Q CIMSREC
 X:$G(^CIMSCREC(CIMSRTYP("IEN"),12))]"" ^CIMSCREC(CIMSRTYP("IEN"),12)
BPROC ;
 S CIMSX=0
 F  S CIMSX=$O(^CIMSCREC(CIMSRTYP("IEN"),11,"AC",CIMSX)) Q:CIMSX'=+CIMSX!(CIMSREC=-1)  S CIMS=$O(^CIMSCREC(CIMSRTYP("IEN"),11,"AC",CIMSX,0))  D
 .S X="" X:$D(^CIMSCREC(CIMSRTYP("IEN"),11,CIMS,11)) ^CIMSCREC(CIMSRTYP("IEN"),11,CIMS,11)
 .S $E(CIMSREC,$P(^CIMSCREC(CIMSRTYP("IEN"),11,CIMS,0),U,2))=X
 Q CIMSREC
 ;
LREC(CIMSLAB,CIMSRTYP) ;PEP
 NEW CIMSREC,CIMSX,CIMS
 S CIMSREC=""
 I '$G(CIMSLAB) Q CIMSREC
 I '$D(^AUPNVLAB(CIMSLAB)) Q CIMSREC
 NEW CIMSVDFN S CIMSVDFN=$P(^AUPNVLAB(CIMSLAB,0),U,3)
 NEW CIMSDFN S CIMSDFN=$P(^AUPNVLAB(CIMSLAB,0),U,2)
 S CIMSRTYP("IEN")=$O(^CIMSCREC("B",CIMSRTYP,0))
 I 'CIMSRTYP("IEN") Q CIMSREC
 X:$G(^CIMSCREC(CIMSRTYP("IEN"),12))]"" ^CIMSCREC(CIMSRTYP("IEN"),12)
LPROC ;
 S CIMSX=0
 F  S CIMSX=$O(^CIMSCREC(CIMSRTYP("IEN"),11,"AC",CIMSX)) Q:CIMSX'=+CIMSX!(CIMSREC=-1)  S CIMS=$O(^CIMSCREC(CIMSRTYP("IEN"),11,"AC",CIMSX,0))  D
 .S X="" X:$D(^CIMSCREC(CIMSRTYP("IEN"),11,CIMS,11)) ^CIMSCREC(CIMSRTYP("IEN"),11,CIMS,11)
 .S $E(CIMSREC,$P(^CIMSCREC(CIMSRTYP("IEN"),11,CIMS,0),U,2))=X
 Q CIMSREC
 ;
MREC(CIMSMED,CIMSRTYP) ;PEP
 NEW CIMSREC,CIMSX,CIMS
 S CIMSREC=""
 I '$G(CIMSMED) Q CIMSREC
 I '$D(^AUPNVMED(CIMSMED)) Q CIMSREC
 NEW CIMSVDFN S CIMSVDFN=$P(^AUPNVMED(CIMSMED,0),U,3)
 NEW CIMSDFN S CIMSDFN=$P(^AUPNVMED(CIMSMED,0),U,2)
 S CIMSRTYP("IEN")=$O(^CIMSCREC("B",CIMSRTYP,0))
 I 'CIMSRTYP("IEN") Q CIMSREC
 X:$G(^CIMSCREC(CIMSRTYP("IEN"),12))]"" ^CIMSCREC(CIMSRTYP("IEN"),12)
MPROC ;
 S CIMSX=0
 F  S CIMSX=$O(^CIMSCREC(CIMSRTYP("IEN"),11,"AC",CIMSX)) Q:CIMSX'=+CIMSX!(CIMSREC=-1)  S CIMS=$O(^CIMSCREC(CIMSRTYP("IEN"),11,"AC",CIMSX,0))  D
 .S X="" X:$D(^CIMSCREC(CIMSRTYP("IEN"),11,CIMS,11)) ^CIMSCREC(CIMSRTYP("IEN"),11,CIMS,11)
 .S $E(CIMSREC,$P(^CIMSCREC(CIMSRTYP("IEN"),11,CIMS,0),U,2))=X
 Q CIMSREC
 ;
PREC(CIMSPRB,CIMSRTYP) ;
 NEW CIMSREC,CIMSX,CIMS
 S CIMSREC=""
 I '$G(CIMSPRB) Q CIMSREC
 I '$D(^AUPNPROB(CIMSPRB)) Q CIMSREC
 NEW CIMSDFN S CIMSDFN=$P(^AUPNPROB(CIMSPRB,0),U,2)
 S CIMSRTYP("IEN")=$O(^CIMSCREC("B",CIMSRTYP,0))
 I 'CIMSRTYP("IEN") Q CIMSREC
 X:$G(^CIMSCREC(CIMSRTYP("IEN"),12))]"" ^CIMSCREC(CIMSRTYP("IEN"),12)
PPROC ;
 S CIMSX=0 F  S CIMSX=$O(^CIMSCREC(CIMSRTYP("IEN"),11,"AC",CIMSX)) Q:CIMSX'=+CIMSX!(CIMSREC=-1)  S CIMS=$O(^CIMSCREC(CIMSRTYP("IEN"),11,"AC",CIMSX,0))  D
 .S X="" X:$D(^CIMSCREC(CIMSRTYP("IEN"),11,CIMS,11)) ^CIMSCREC(CIMSRTYP("IEN"),11,CIMS,11)
 .S $E(CIMSREC,$P(^CIMSCREC(CIMSRTYP("IEN"),11,CIMS,0),U,2))=X
 Q CIMSREC
 ;