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

VBECDCM0.m

Go to the documentation of this file.
  1. VBECDCM0 ;hoifo/gjc-VBECS MAPPING TABLE add, edit & delete utilities.;Nov 21, 2002
  1. ;;2.0;VBEC;;Jun 05, 2015;Build 4
  1. ;
  1. ; main entry point for VBECS MAPPING TABLE (#6005) file operations
  1. ;
  1. ;Medical Device #:
  1. ;Note: The food and Drug Administration classifies this software as a
  1. ;medical device. As such, it may not be changed in any way.
  1. ;Modifications to this software may result in an adulterated medical
  1. ;device under 21CFR820, the use of which is considered to be a
  1. ;violation of US Federal Statutes. Acquiring and implementing this
  1. ;software through the Freedom of Information Act requires the
  1. ;implementer to assume total responsibility for the software, and
  1. ;become a registered manufacturer of a medical device, subject to FDA
  1. ;regulations.
  1. ;
  1. ;Call to $$NEWERR^%ZTER is supported by IA: 1621
  1. ;Call to FILE^DIE is supported by IA: 2053
  1. ;Call to $$NOW^XLFDT is supported by IA: 10103
  1. ;Execution of ^%ZOSF("TEST") is supported by IA: 10096
  1. ;
  1. EN613 ;Initially populate the file with antigen/antibody data
  1. ;
  1. I $$NEWERR^%ZTER N $ETRAP,$ESTACK S $ETRAP="D ERR^VBECDCU1"
  1. E S X="D ERR^VBECDCU1",@^%ZOSF("TRAP")
  1. I +$O(^VBEC(6005,"AA","61.3-"))'=61.3 D
  1. .Q:'$$LOCK^VBECDCU2(61.3)
  1. .W !!,"Adding site configured 'Antigen/Antibody' information into the VBECS MAPPING",!,"TABLE file (#6005)."
  1. .S CNT=0
  1. .F VBECANTI="AB","AN" D ;antibodies & antigens
  1. ..S VBECY=0 F S VBECY=$O(^LAB(61.3,"E",VBECANTI,VBECY)) Q:'VBECY D
  1. ...S VBECY(0)=$G(^LAB(61.3,VBECY,0)),CNT=CNT+1
  1. ...D POP6005^VBECDCM2(61.3,VBECY,$P(VBECY(0),U),$P(VBECY(0),U,2),VBECANTI)
  1. ...W:'(CNT#100) "."
  1. ...Q
  1. ..Q
  1. .D UNLOCK^VBECDCU2(61.3)
  1. .Q
  1. S:+$O(^VBEC(6005,"AA","61.3-"))=61.3 VBECFLG=1
  1. I W !!,CNT_" antibody/antigen record"_$S(CNT=1:"",1:"s")_" added.",!
  1. ;
  1. ;handle antigen/antibody edit, delete, and add events here
  1. ;
  1. E D
  1. .Q:'$$LOCK^VBECDCU2(61.3) S VBECFLG=0
  1. .F VBECANTI="AB","AN" D ;antibodies & antigens
  1. ..S VBECY=0 F S VBECY=$O(^LAB(61.3,"E",VBECANTI,VBECY)) Q:'VBECY D
  1. ...S VBECY(0)=$G(^LAB(61.3,VBECY,0)),VBEC01=61.3_"-"_VBECY
  1. ...S VBECIEN=+$O(^VBEC(6005,"B",VBEC01,0))
  1. ...;
  1. ...;if antigen/antibody not filed in 6005, add it
  1. ...I 'VBECIEN S VBECFLG=1 D POP6005^VBECDCM2(61.3,VBECY,$P(VBECY(0),U),$P(VBECY(0),U,2),VBECANTI) Q
  1. ...S VBECIEN(0)=$G(^VBEC(6005,VBECIEN,0))
  1. ...;
  1. ...;check if the name or identifier attribute has been edited
  1. ...S VBECTOT=0,VBECTOT=$$CHECKSUM^VBECDCU2($P(VBECY(0),U))
  1. ...S VBECTOT=VBECTOT+$$CHECKSUM^VBECDCU2($P(VBECY(0),U,2))
  1. ...S VBECTOT=VBECTOT+$$CHECKSUM^VBECDCU2($P(VBECY(0),U,5))
  1. ...I VBECTOT'=$P(VBECIEN(0),U,6) D S VBECFLG=1 K VBECTOT
  1. ....S:$P(VBECY(0),U)'=$P(VBECIEN(0),U,2) VBECFDA(6005,VBECIEN_",",.02)=$P(VBECY(0),U)
  1. ....S:$P(VBECY(0),U,2)'=$P(VBECIEN(0),U,3) VBECFDA(6005,VBECIEN_",",.03)=$P(VBECY(0),U,2)
  1. ....S:$P(VBECY(0),U,5)'=$P(VBECIEN(0),U,4) VBECFDA(6005,VBECIEN_",",.04)=$P(VBECY(0),U,5)
  1. ....S VBECFDA(6005,VBECIEN_",",.05)="@"
  1. ....S VBECFDA(6005,VBECIEN_",",.06)=VBECTOT
  1. ....S VBECFDA(6005,VBECIEN_",",.07)=+$E($$NOW^XLFDT(),1,12)
  1. ....D FILE^DIE("","VBECFDA")
  1. ....Q
  1. ...;
  1. ...Q
  1. ..Q
  1. .D UNLOCK^VBECDCU2(61.3)
  1. .Q
  1. D DELETE^VBECDCM2(61.3)
  1. I $G(VBECFLG) W !!,"Antigen/Antibody information updated.",!
  1. E W !!,"Antigen/Antibody information current, not updated.",!
  1. D XIT^VBECDCM2
  1. Q
  1. ;