BQIPLCR ;PRXM/HC/ALA-Create Panel Functions ; 18 Oct 2005 3:45 PM
;;2.3;ICARE MANAGEMENT SYSTEM;**1,3,4**;Apr 18, 2012;Build 66
;
Q
;
APTM(DFN) ;EP - Add patient record manually
NEW DIC,DIE,BQIPTUP,IENS,DA,RESULT
S DA(2)=OWNR,DA(1)=PLIEN
S (X,DINUM)="`"_DFN
S DIC="^BQICARE("_DA(2)_",1,"_DA(1)_",40,",DIC(0)="LN"
S DLAYGO=90505.04,DIC(0)="LN"
I '$D(^BQICARE(DA(2),1,DA(1),40,0)) S ^BQICARE(DA(2),1,DA(1),40,0)="^90505.04P^^"
D ^DIC
I +Y=-1 S RESULT=-1 Q
; Update the user for flags for this patient
I '$D(^BQICARE(DA(2),1,"AB",DFN)) D UPU^BQIFLAG(DFN,OWNR)
; Update the patient record in panel
S DA=DFN,IENS=$$IENS^DILF(.DA)
S BQIPTUP(90505.04,IENS,.02)="A"
S BQIPTUP(90505.04,IENS,.03)=DUZ
S BQIPTUP(90505.04,IENS,.04)=$$NOW^XLFDT()
S BQIPTUP(90505.04,IENS,.08)=$S($$FLG^BQIULPT(OWNR,PLIEN,DFN)="Y":1,1:0)
D FILE^DIE("","BQIPTUP","ERROR")
I $D(ERROR) S RESULT=-1 Q
S RESULT=1
Q
;
APMTC(CDATA,CTYP,CDFN) ;EP - Add a patient's matched criteria
NEW DIC,DIE,DA,MTC
S DA(3)=OWNR,DA(2)=PLIEN,DA(1)=CDFN,X=CTYP
I $G(^BQICARE(DA(3),1,DA(2),40,DA(1),0))="" Q
S DIC="^BQICARE("_DA(3)_",1,"_DA(2)_",40,"_DA(1)_",5,",DIC(0)="LN"
S DLAYGO=90505.18,DIC(0)="LN"
I '$D(^BQICARE(DA(3),1,DA(2),40,DA(1),5,0)) S ^BQICARE(DA(3),1,DA(2),40,DA(1),5,0)="^90505.18^^"
D ^DIC
I +Y=-1 Q
S MTC=+Y
; update the records
K DA
S DA(4)=OWNR,DA(3)=PLIEN,DA(2)=CDFN,DA(1)=MTC
S DIC="^BQICARE("_DA(4)_",1,"_DA(3)_",40,"_DA(2)_",5,"_DA(1)_",1,",DIC(0)="LN"
S DLAYGO=90505.181,DIC(0)="LN"
I '$D(^BQICARE(DA(4),1,DA(3),40,DA(2),5,DA(1),1,0)) S ^BQICARE(DA(4),1,DA(3),40,DA(2),5,DA(1),1,0)="^90505.181^^"
S CDA="" F S CDA=$O(@CDATA@(CTYP,CDFN,CDA)) Q:CDA="" D
. S X=CDA
. D ^DIC S DA=+Y I DA=-1 Q
. ;M ^BQICARE(DA(4),1,DA(3),40,DA(2),5,DA(1),1,DA)=@CDATA@(CTYP,CDFN,CDA)
Q
;
RPTM(DFN) ;EP - Remove patient record manually
NEW DA,IENS,BQIPTUP,RESULT
S DA(2)=OWNR,DA(1)=PLIEN
S DA=DFN,IENS=$$IENS^DILF(.DA)
S BQIPTUP(90505.04,IENS,.02)="R"
S BQIPTUP(90505.04,IENS,.05)=DUZ
S BQIPTUP(90505.04,IENS,.06)=$$NOW^XLFDT()
S BQIPTUP(90505.04,IENS,.08)=0
D FILE^DIE("","BQIPTUP","ERROR")
I $D(ERROR) S RESULT=-1 Q
S RESULT=1
Q
;
APT(DFN) ;EP - Add patient
NEW DIC,DIE,BQIPTUP,DA,IENS,X
S DA(2)=OWNR,DA(1)=PLIEN,(X,DINUM)=DFN
S DIC="^BQICARE("_DA(2)_",1,"_DA(1)_",40,",DIE=DIC
S DLAYGO=90505.04,DIC(0)="L",DIC("P")=DLAYGO
I '$D(^BQICARE(DA(2),1,DA(1),40,0)) S ^BQICARE(DA(2),1,DA(1),40,0)="^90505.04P^^"
K DO,DD D FILE^DICN
I +Y=-1 Q
S DA=+Y,IENS=$$IENS^DILF(.DA)
S BQIPTUP(90505.04,IENS,.07)=$$NOW^XLFDT()
D FILE^DIE("","BQIPTUP","ERROR")
; Update the user for flags for this patient
D UPU^BQIFLAG(DFN,OWNR)
Q
;
DPT(DFN) ;EP - Delete patient
;
;Input
; DFN - Patient internal entry number
NEW DIK,DA
S DA(2)=OWNR,DA(1)=PLIEN
S DA=DFN,DIK="^BQICARE("_DA(2)_",1,"_DA(1)_",40,"
D ^DIK
Q
;
CNTP(OWNR,PLIEN) ;EP - Count patients and file the total
;
;Input
; OWNR - Owner of the panel
; PLIEN - Panel internal entry number
;
NEW DA,PIENS,DFN,IENS,CNT,BQIUP,SFLG
S DA(1)=OWNR,DA=PLIEN,PIENS=$$IENS^DILF(.DA)
S DFN=0,CNT=0,SFLG=0
F S DFN=$O(^BQICARE(OWNR,1,PLIEN,40,DFN)) Q:'DFN D
. S DA(2)=OWNR,DA(1)=PLIEN,DA=DFN,IENS=$$IENS^DILF(.DA)
. I $$GET1^DIQ(90505.04,IENS,.02,"I")="R" Q
. S CNT=CNT+1
. ; Check for sensitive patient
. I $$SENS^BQIULPT(DFN)="Y" S SFLG=1
. ; Set flags for patient
. D UPU^BQIFLAG(DFN,OWNR)
;
S BQIUP(90505.01,PIENS,.1)=CNT
S BQIUP(90505.01,PIENS,.07)=$$NOW^XLFDT()
S BQIUP(90505.01,PIENS,3.5)=DUZ
S BQIUP(90505.01,PIENS,3.6)=SFLG
D FILE^DIE("I","BQIUP")
;
; Count flags for panel
D CNTP^BQIFLG(OWNR,PLIEN)
Q
;
CRPNL(DATA,OWNR,PLIEN,PLNM,PLDES,SRCNM,SRC,FSOURCE,AUFL,STATUS,ASSOC,IPCPL,PCAT) ; Create/Update a new panel
; EP - BQI SET PANEL DEF
; Description
; Adds/updates a panel using the user defined panel name and description.
; If no name is passed, generates a temporary name which is a composite
; of "TEMP PANEL " and the last assigned panel ien plus 1.
; If no Panel IEN is passed then it generates a new one.
; Input:
; OWNR - Owner of the panel
; PLIEN - Panel internal entry number (if blank, a new panel is being created)
; PLNM - User defined panel name (optional)
; PLDES - User defined panel description (optional)
; SRCNM - Source name (optional)
; SRC - Source type (optional)
; FSOURCE - Filter source name (optional)
; AUFL - Autopopulate flag
; STATUS - I=in progress, T=temporary, @=remove status flag
; ASSOC - associated panel IEN (either existing to TEMP or vice versa), @=remove association
; IPCPL - IPC Panel flag
; PCAT - Category for folder grouping
; Output:
; PLIEN - panel IEN
; PLID - panel ID (owner and panel ien)
; PLNM - panel name
; or
; BMXSEC - if record can't be locked or if $D(ERROR)
; when filing or M error encountered
;
N UID,X,BQII,PLID,TMP
S UID=$S($G(ZTSK):"Z"_ZTSK,1:$J)
S DATA=$NA(^TMP("BQIPLCR",UID))
K ^TMP("BQIPLCR",UID)
;
S AUFL=$G(AUFL),SRCNM=$G(SRCNM),SRC=$G(SRC),FSOURCE=$G(FSOURCE)
S PLNM=$G(PLNM),PLDES=$G(PLDES),PLIEN=$G(PLIEN),STATUS=$G(STATUS)
S ASSOC=$G(ASSOC),IPCPL=$G(IPCPL),PCAT=$G(PCAT)
;
NEW $ESTACK,$ETRAP S $ETRAP="D ERR^BQIPLCR D UNWIND^%ZTER" ; SAC 2006 2.2.3.3.2
;
; Create owner if new to iCare - If unable to do so - error
I '$$OWNR^BQIPLUSR(OWNR) S BMXSEC="Unable to create panel" Q
;
; Check that panel name is unique
I PLNM'="" D Q:$G(BMXSEC)'=""
. N DA,IENS,ERROR
. S DA(1)=OWNR,DA=""
. S IENS=$$IENS^DILF(.DA)
. S TMP=$$FIND1^DIC(90505.01,IENS,"X",PLNM,"","","ERROR")
. I TMP=0 Q ; Name not currently in use
. I PLIEN=TMP Q ; Name in use on the panel being edited
. S BMXSEC="Panel name already exists" ; Name in use on another panel
. Q
;
; Create header record
S BQII=0,^TMP("BQIPLCR",UID,BQII)="I00010PANEL_IEN^T00020PANEL_ID^T00120PANEL_NAME"_$C(30)
;
;If no panel IEN entered, assign a new one
I PLIEN="" D Q:$G(BMXSEC)'=""
. L +^BQICARE(OWNR,1,0):5
. I '$T S BMXSEC="Unable to create panel" Q ; Error - unable to assign next panel IEN
. I '$D(^BQICARE(OWNR,1,0)) S ^BQICARE(OWNR,1,0)="^90505.01^^"
. ;If no panel name entered, assign a temporary name
. I PLNM="" D
.. N PLN
.. S PLN=$P(^BQICARE(OWNR,1,0),"^",3)+1
.. S PLNM=$$TMPNM(PLN)
.. I $D(^BQICARE(OWNR,1,"B",PLNM)) D
... S PLN=$O(^BQICARE(OWNR,1,"B","TEMP PANEL A"),-1)
... S PLN=$P(PLNM,"TEMP PANEL ",2)+1,PLNM=$$TMPNM(PLN)
. ;Filing is included in structured do to allow locks to frame the
. ;assignment of the IEN and the record filing
. D FILE
. ;
. ;Copy User Templates into Panel
. D TMPL(OWNR,PLIEN)
. ;
. L -^BQICARE(OWNR,1,0)
D UPD Q:$G(BMXSEC)'=""
G DONE
;
FILE ;File new panel
N DA,X,DINUM,DIC,DIE,DLAYGO
S DA(1)=OWNR,X=PLNM,DLAYGO=90505.01
S DIC="^BQICARE("_DA(1)_",1,",DIE=DIC
S DIC(0)="L",DIC("P")=DLAYGO
K DO,DD D FILE^DICN
S (DA,PLIEN)=+Y
I PLIEN=-1 S BMXSEC="Error encountered while filing panel." Q
;I $G(ASSOC)'="" D CPY^BQIPLCP(OWNR,ASSOC,.PLIEN,1)
I $G(ASSOC)'="" D CPY(OWNR,PLIEN,ASSOC)
Q
;
UPD ; Update panel definition values
NEW DA,IENS,BQIPLUP,ERROR,OPLNM
S DA(1)=OWNR,DA=PLIEN
S IENS=$$IENS^DILF(.DA)
;
D CHK
;
I $$GET1^DIQ(90505.01,IENS,.02,"I")="" S BQIPLUP(90505.01,IENS,.02)=$$NOW^XLFDT()
S BQIPLUP(90505.01,IENS,.04)=DUZ
S BQIPLUP(90505.01,IENS,.05)=$$NOW^XLFDT()
S BQIPLUP(90505.01,IENS,3.7)=DUZ(2)
;
I ASSOC'="" S OPLNM=$P(^BQICARE(OWNR,1,ASSOC,0),U,1)
I ASSOC="" S OPLNM=$$GET1^DIQ(90505.01,IENS,.01,"E")
;
I PLNM]"" D
. I OPLNM="" S BQIPLUP(90505.01,IENS,.01)=PLNM Q
. S BQIPLUP(90505.01,IENS,.01)=PLNM
. ; Check if panel is a specified panel and update with new panel name
. I $D(^BQICARE("SPNL",OPLNM,OWNR)) S BQIPLUP(90505,OWNR_",",.03)=PLNM
. ; Check if any filters have this panel name
. I STATUS="T"!(ASSOC'="") Q
. NEW PLIDEN,TUSR,TPNL,TN,NPLIDEN,TNN
. S PLIDEN=OWNR_$C(26)_OPLNM,TUSR="",NPLIDEN=OWNR_$C(26)_PLNM
. F S TUSR=$O(^BQICARE("AD",PLIDEN,TUSR)) Q:TUSR="" D
.. S TPNL=""
.. F S TPNL=$O(^BQICARE("AD",PLIDEN,TUSR,TPNL)) Q:TPNL="" D
... S TN=""
... F S TN=$O(^BQICARE("AD",PLIDEN,TUSR,TPNL,TN)) Q:TN="" D
.... I ^BQICARE(TUSR,1,TPNL,15,TN,0)'="PLIDEN" Q
.... S TNN=0
.... F S TNN=$O(^BQICARE(TUSR,1,TPNL,15,TN,1,TNN)) Q:'TNN D
..... I $P(^BQICARE(TUSR,1,TPNL,15,TN,1,TNN,0),U,1)=PLIDEN D
...... S $P(^BQICARE(TUSR,1,TPNL,15,TN,1,TNN,0),U,1)=NPLIDEN
...... K ^BQICARE(TUSR,1,TPNL,15,TN,1,"B",PLIDEN,TNN)
...... S ^BQICARE(TUSR,1,TPNL,15,TN,1,"B",NPLIDEN,TNN)=""
...... K ^BQICARE("AD",PLIDEN,TUSR,TPNL,TN)
...... S ^BQICARE("AD",NPLIDEN,TUSR,TPNL,TN)=""
;
I PLNM="" D
. I ASSOC'="" S PLNM=OPLNM
;
I PLDES]"" S BQIPLUP(90505.01,IENS,1)=PLDES
I SRC]"" S BQIPLUP(90505.01,IENS,.03)=SRC
I SRCNM]"" S BQIPLUP(90505.01,IENS,.11)=SRCNM
I FSOURCE]"" S BQIPLUP(90505.01,IENS,.14)=FSOURCE
I AUFL]"" S BQIPLUP(90505.01,IENS,.06)=AUFL
I STATUS]"" S BQIPLUP(90505.01,IENS,.13)=STATUS
I ASSOC]"" S BQIPLUP(90505.01,IENS,.15)=ASSOC
I IPCPL'="" S BQIPLUP(90505.01,IENS,2.1)=$S(IPCPL="Y":1,1:IPCPL)
;I IPCPL="" S BQIPLUP(90505.01,IENS,2.1)="@"
I PCAT'="" D
. I OWNR=DUZ S BQIPLUP(90505.01,IENS,2.2)=PCAT Q
. NEW DA,IENS
. S DA(2)=OWNR,DA(1)=PLIEN,DA=DUZ,IENS=$$IENS^DILF(.DA)
. S BQIPLUP(90505.03,IENS,.06)=PCAT
;
;I PCAT="" S BQIPLUP(90505.01,IENS,2.2)="@"
D FILE^DIE("","BQIPLUP","ERROR")
I $D(ERROR) S BMXSEC="Error encountered while filing panel." Q
;
; Send notification
I $G(STATUS)'="T" D
. NEW TEXT
. I OPLNM'=PLNM S TEXT="Panel name changed from "_OPLNM_" to "_PLNM_"."
. E S TEXT="Panel Definition for "_OPLNM_" has been modified."
. D UPD^BQINOTF(OWNR,PLIEN,TEXT)
;
; Return panel IEN, ID, and NAME on success
S PLID=$$PLID^BQIUG1(OWNR,PLIEN)
S BQII=BQII+1,^TMP("BQIPLCR",UID,BQII)=PLIEN_"^"_PLID_"^"_PLNM_$C(30)
Q
;
TMPNM(NM) ;EP -- Return temporary panel name
S NM=$E("0000000000",1,10-$L(NM))_NM
Q "TEMP PANEL "_NM
;
ERR ;
L -^BQICARE(OWNR,1,0)
D ^%ZTER
N Y,ERRDTM
S Y=$$NOW^XLFDT() X ^DD("DD") S ERRDTM=Y
S BMXSEC="Recording that an error occurred at "_ERRDTM
; If a temporary panel was created when an error occurred, delete it
I $G(ASSOC)'="" D
. NEW DA,DIK
. S DA(1)=OWNR,DA=PLIEN
. S DIK="^BQICARE("_DA(1)_",1,"
. D ^DIK
Q
;
DONE ; -- exit code
S BQII=BQII+1,^TMP("BQIPLCR",UID,BQII)=$C(31)
Q
;
CHK ; Check Source Type changed to Manual
; If the panel is already Manual and is changed to manual, quit
I $$GET1^DIQ(90505.01,IENS,.03,"I")="M",SRC="M" Q
; If the panel is not manual and is not being changed to manual, quit
I $$GET1^DIQ(90505.01,IENS,.03,"I")'="M",SRC'="M" Q
; If changing a panel to a manual from any other definition type,
; set all users not having a manual flag, the manual flag of 'Add'.
NEW DFN
S DFN=0
F S DFN=$O(^BQICARE(OWNR,1,PLIEN,40,DFN)) Q:'DFN D
. I $P(^BQICARE(OWNR,1,PLIEN,40,DFN,0),U,2)'="" Q
. S $P(^BQICARE(OWNR,1,PLIEN,40,DFN,0),U,2)="A"
. S $P(^BQICARE(OWNR,1,PLIEN,40,DFN,0),U,4)=$$NOW^XLFDT()
Q
;
CPY(OWNR,PLIEN,OPLIEN) ;EP - Copy a temporary panel
S $P(^BQICARE(OWNR,1,PLIEN,0),U,2,14)=$P(^BQICARE(OWNR,1,OPLIEN,0),U,2,14)
;
; Copy PANEL DESCRIPTION
I $D(^BQICARE(OWNR,1,OPLIEN,1)) M ^BQICARE(OWNR,1,PLIEN,1)=^BQICARE(OWNR,1,OPLIEN,1)
;
; Copy Panel information
I $D(^BQICARE(OWNR,1,OPLIEN,3)) M ^BQICARE(OWNR,1,PLIEN,3)=^BQICARE(OWNR,1,OPLIEN,3)
;
; Copy GENERATED DESCRIPTION
I $D(^BQICARE(OWNR,1,OPLIEN,5)) M ^BQICARE(OWNR,1,PLIEN,5)=^BQICARE(OWNR,1,OPLIEN,5)
;
; Copy PARAMETER DEFINITION
I $D(^BQICARE(OWNR,1,OPLIEN,10)) M ^BQICARE(OWNR,1,PLIEN,10)=^BQICARE(OWNR,1,OPLIEN,10)
;
; Copy FILTER DEFINITION
I $D(^BQICARE(OWNR,1,OPLIEN,15)) M ^BQICARE(OWNR,1,PLIEN,15)=^BQICARE(OWNR,1,OPLIEN,15)
;
; Copy CUSTOMIZED VIEW
I $D(^BQICARE(OWNR,1,OPLIEN,20)) M ^BQICARE(OWNR,1,PLIEN,20)=^BQICARE(OWNR,1,OPLIEN,20)
;
; Copy SHARED USERS
I $D(^BQICARE(OWNR,1,OPLIEN,30)) M ^BQICARE(OWNR,1,PLIEN,30)=^BQICARE(OWNR,1,OPLIEN,30)
;
; Copy PATIENT LIST
I $D(^BQICARE(OWNR,1,OPLIEN,40)) M ^BQICARE(OWNR,1,PLIEN,40)=^BQICARE(OWNR,1,OPLIEN,40)
;
; Update cross references for merged entries
S DIK="^BQICARE("_DA(1)_",1,"
D IX^DIK
Q
;
;Copy template information into new panels
TMPL(OWNR,PLIEN) ;EP - Copy template information into new panel
;
N IEN
I $G(OWNR)="" Q ;Quit if no owner
I $G(PLIEN)="" Q ;Quit if no panel ien
;
;Quit if template node has already been set up
I $O(^BQICARE(OWNR,1,PLIEN,4,0))]"" Q
;
;Quit if user has no defined templates
I $O(^BQICARE(OWNR,15,0))="" Q
;
;Set top node
I '$D(^BQICARE(OWNR,1,PLIEN,4,0)) S ^BQICARE(OWNR,1,PLIEN,4,0)="^90505.14^^"
;
;Loop through user templates and move to panel
S IEN=0 F S IEN=$O(^BQICARE(OWNR,15,IEN)) Q:'IEN D
. ;
. N BQDATA,DA,DIC,ERROR,IENS,TMPLT,TMPLN,X,Y
. ;
. ;Get the template
. S DA(1)=OWNR,DA=IEN
. S IENS=$$IENS^DILF(.DA)
. S TMPLN=$$GET1^DIQ(90505.015,IENS,.01,"E")
. ;
. ;Only copy if set to default
. I $$GET1^DIQ(90505.015,IENS,.03,"I")'="Y" Q
. ;
. ;Get the code
. S TMPLT=$$GET1^DIQ(90505.015,IENS,.02,"I")
. ;
. ;Lookup/Define new entry
. S DA(2)=OWNR,DA(1)=PLIEN
. S X=TMPLN
. S DIC(0)="L",DIC="^BQICARE("_DA(2)_",1,"_DA(1)_",4,"
. D ^DIC
. S:+Y>0 DA=+Y
. S IENS=$$IENS^DILF(.DA)
. ;
. ;Insert TYPE
. S BQDATA(90505.14,IENS,".02")=TMPLT
. ;
. ;File update
. I $D(BQDATA) D FILE^DIE("","BQDATA","ERROR")
BQIPLCR ;PRXM/HC/ALA-Create Panel Functions ; 18 Oct 2005 3:45 PM
+1 ;;2.3;ICARE MANAGEMENT SYSTEM;**1,3,4**;Apr 18, 2012;Build 66
+2 ;
+3 QUIT
+4 ;
APTM(DFN) ;EP - Add patient record manually
+1 NEW DIC,DIE,BQIPTUP,IENS,DA,RESULT
+2 SET DA(2)=OWNR
SET DA(1)=PLIEN
+3 SET (X,DINUM)="`"_DFN
+4 SET DIC="^BQICARE("_DA(2)_",1,"_DA(1)_",40,"
SET DIC(0)="LN"
+5 SET DLAYGO=90505.04
SET DIC(0)="LN"
+6 IF '$DATA(^BQICARE(DA(2),1,DA(1),40,0))
SET ^BQICARE(DA(2),1,DA(1),40,0)="^90505.04P^^"
+7 DO ^DIC
+8 IF +Y=-1
SET RESULT=-1
QUIT
+9 ; Update the user for flags for this patient
+10 IF '$DATA(^BQICARE(DA(2),1,"AB",DFN))
DO UPU^BQIFLAG(DFN,OWNR)
+11 ; Update the patient record in panel
+12 SET DA=DFN
SET IENS=$$IENS^DILF(.DA)
+13 SET BQIPTUP(90505.04,IENS,.02)="A"
+14 SET BQIPTUP(90505.04,IENS,.03)=DUZ
+15 SET BQIPTUP(90505.04,IENS,.04)=$$NOW^XLFDT()
+16 SET BQIPTUP(90505.04,IENS,.08)=$SELECT($$FLG^BQIULPT(OWNR,PLIEN,DFN)="Y":1,1:0)
+17 DO FILE^DIE("","BQIPTUP","ERROR")
+18 IF $DATA(ERROR)
SET RESULT=-1
QUIT
+19 SET RESULT=1
+20 QUIT
+21 ;
APMTC(CDATA,CTYP,CDFN) ;EP - Add a patient's matched criteria
+1 NEW DIC,DIE,DA,MTC
+2 SET DA(3)=OWNR
SET DA(2)=PLIEN
SET DA(1)=CDFN
SET X=CTYP
+3 IF $GET(^BQICARE(DA(3),1,DA(2),40,DA(1),0))=""
QUIT
+4 SET DIC="^BQICARE("_DA(3)_",1,"_DA(2)_",40,"_DA(1)_",5,"
SET DIC(0)="LN"
+5 SET DLAYGO=90505.18
SET DIC(0)="LN"
+6 IF '$DATA(^BQICARE(DA(3),1,DA(2),40,DA(1),5,0))
SET ^BQICARE(DA(3),1,DA(2),40,DA(1),5,0)="^90505.18^^"
+7 DO ^DIC
+8 IF +Y=-1
QUIT
+9 SET MTC=+Y
+10 ; update the records
+11 KILL DA
+12 SET DA(4)=OWNR
SET DA(3)=PLIEN
SET DA(2)=CDFN
SET DA(1)=MTC
+13 SET DIC="^BQICARE("_DA(4)_",1,"_DA(3)_",40,"_DA(2)_",5,"_DA(1)_",1,"
SET DIC(0)="LN"
+14 SET DLAYGO=90505.181
SET DIC(0)="LN"
+15 IF '$DATA(^BQICARE(DA(4),1,DA(3),40,DA(2),5,DA(1),1,0))
SET ^BQICARE(DA(4),1,DA(3),40,DA(2),5,DA(1),1,0)="^90505.181^^"
+16 SET CDA=""
FOR
SET CDA=$ORDER(@CDATA@(CTYP,CDFN,CDA))
IF CDA=""
QUIT
Begin DoDot:1
+17 SET X=CDA
+18 DO ^DIC
SET DA=+Y
IF DA=-1
QUIT
+19 ;M ^BQICARE(DA(4),1,DA(3),40,DA(2),5,DA(1),1,DA)=@CDATA@(CTYP,CDFN,CDA)
End DoDot:1
+20 QUIT
+21 ;
RPTM(DFN) ;EP - Remove patient record manually
+1 NEW DA,IENS,BQIPTUP,RESULT
+2 SET DA(2)=OWNR
SET DA(1)=PLIEN
+3 SET DA=DFN
SET IENS=$$IENS^DILF(.DA)
+4 SET BQIPTUP(90505.04,IENS,.02)="R"
+5 SET BQIPTUP(90505.04,IENS,.05)=DUZ
+6 SET BQIPTUP(90505.04,IENS,.06)=$$NOW^XLFDT()
+7 SET BQIPTUP(90505.04,IENS,.08)=0
+8 DO FILE^DIE("","BQIPTUP","ERROR")
+9 IF $DATA(ERROR)
SET RESULT=-1
QUIT
+10 SET RESULT=1
+11 QUIT
+12 ;
APT(DFN) ;EP - Add patient
+1 NEW DIC,DIE,BQIPTUP,DA,IENS,X
+2 SET DA(2)=OWNR
SET DA(1)=PLIEN
SET (X,DINUM)=DFN
+3 SET DIC="^BQICARE("_DA(2)_",1,"_DA(1)_",40,"
SET DIE=DIC
+4 SET DLAYGO=90505.04
SET DIC(0)="L"
SET DIC("P")=DLAYGO
+5 IF '$DATA(^BQICARE(DA(2),1,DA(1),40,0))
SET ^BQICARE(DA(2),1,DA(1),40,0)="^90505.04P^^"
+6 KILL DO,DD
DO FILE^DICN
+7 IF +Y=-1
QUIT
+8 SET DA=+Y
SET IENS=$$IENS^DILF(.DA)
+9 SET BQIPTUP(90505.04,IENS,.07)=$$NOW^XLFDT()
+10 DO FILE^DIE("","BQIPTUP","ERROR")
+11 ; Update the user for flags for this patient
+12 DO UPU^BQIFLAG(DFN,OWNR)
+13 QUIT
+14 ;
DPT(DFN) ;EP - Delete patient
+1 ;
+2 ;Input
+3 ; DFN - Patient internal entry number
+4 NEW DIK,DA
+5 SET DA(2)=OWNR
SET DA(1)=PLIEN
+6 SET DA=DFN
SET DIK="^BQICARE("_DA(2)_",1,"_DA(1)_",40,"
+7 DO ^DIK
+8 QUIT
+9 ;
CNTP(OWNR,PLIEN) ;EP - Count patients and file the total
+1 ;
+2 ;Input
+3 ; OWNR - Owner of the panel
+4 ; PLIEN - Panel internal entry number
+5 ;
+6 NEW DA,PIENS,DFN,IENS,CNT,BQIUP,SFLG
+7 SET DA(1)=OWNR
SET DA=PLIEN
SET PIENS=$$IENS^DILF(.DA)
+8 SET DFN=0
SET CNT=0
SET SFLG=0
+9 FOR
SET DFN=$ORDER(^BQICARE(OWNR,1,PLIEN,40,DFN))
IF 'DFN
QUIT
Begin DoDot:1
+10 SET DA(2)=OWNR
SET DA(1)=PLIEN
SET DA=DFN
SET IENS=$$IENS^DILF(.DA)
+11 IF $$GET1^DIQ(90505.04,IENS,.02,"I")="R"
QUIT
+12 SET CNT=CNT+1
+13 ; Check for sensitive patient
+14 IF $$SENS^BQIULPT(DFN)="Y"
SET SFLG=1
+15 ; Set flags for patient
+16 DO UPU^BQIFLAG(DFN,OWNR)
End DoDot:1
+17 ;
+18 SET BQIUP(90505.01,PIENS,.1)=CNT
+19 SET BQIUP(90505.01,PIENS,.07)=$$NOW^XLFDT()
+20 SET BQIUP(90505.01,PIENS,3.5)=DUZ
+21 SET BQIUP(90505.01,PIENS,3.6)=SFLG
+22 DO FILE^DIE("I","BQIUP")
+23 ;
+24 ; Count flags for panel
+25 DO CNTP^BQIFLG(OWNR,PLIEN)
+26 QUIT
+27 ;
CRPNL(DATA,OWNR,PLIEN,PLNM,PLDES,SRCNM,SRC,FSOURCE,AUFL,STATUS,ASSOC,IPCPL,PCAT) ; Create/Update a new panel
+1 ; EP - BQI SET PANEL DEF
+2 ; Description
+3 ; Adds/updates a panel using the user defined panel name and description.
+4 ; If no name is passed, generates a temporary name which is a composite
+5 ; of "TEMP PANEL " and the last assigned panel ien plus 1.
+6 ; If no Panel IEN is passed then it generates a new one.
+7 ; Input:
+8 ; OWNR - Owner of the panel
+9 ; PLIEN - Panel internal entry number (if blank, a new panel is being created)
+10 ; PLNM - User defined panel name (optional)
+11 ; PLDES - User defined panel description (optional)
+12 ; SRCNM - Source name (optional)
+13 ; SRC - Source type (optional)
+14 ; FSOURCE - Filter source name (optional)
+15 ; AUFL - Autopopulate flag
+16 ; STATUS - I=in progress, T=temporary, @=remove status flag
+17 ; ASSOC - associated panel IEN (either existing to TEMP or vice versa), @=remove association
+18 ; IPCPL - IPC Panel flag
+19 ; PCAT - Category for folder grouping
+20 ; Output:
+21 ; PLIEN - panel IEN
+22 ; PLID - panel ID (owner and panel ien)
+23 ; PLNM - panel name
+24 ; or
+25 ; BMXSEC - if record can't be locked or if $D(ERROR)
+26 ; when filing or M error encountered
+27 ;
+28 NEW UID,X,BQII,PLID,TMP
+29 SET UID=$SELECT($GET(ZTSK):"Z"_ZTSK,1:$JOB)
+30 SET DATA=$NAME(^TMP("BQIPLCR",UID))
+31 KILL ^TMP("BQIPLCR",UID)
+32 ;
+33 SET AUFL=$GET(AUFL)
SET SRCNM=$GET(SRCNM)
SET SRC=$GET(SRC)
SET FSOURCE=$GET(FSOURCE)
+34 SET PLNM=$GET(PLNM)
SET PLDES=$GET(PLDES)
SET PLIEN=$GET(PLIEN)
SET STATUS=$GET(STATUS)
+35 SET ASSOC=$GET(ASSOC)
SET IPCPL=$GET(IPCPL)
SET PCAT=$GET(PCAT)
+36 ;
+37 ; SAC 2006 2.2.3.3.2
NEW $ESTACK,$ETRAP
SET $ETRAP="D ERR^BQIPLCR D UNWIND^%ZTER"
+38 ;
+39 ; Create owner if new to iCare - If unable to do so - error
+40 IF '$$OWNR^BQIPLUSR(OWNR)
SET BMXSEC="Unable to create panel"
QUIT
+41 ;
+42 ; Check that panel name is unique
+43 IF PLNM'=""
Begin DoDot:1
+44 NEW DA,IENS,ERROR
+45 SET DA(1)=OWNR
SET DA=""
+46 SET IENS=$$IENS^DILF(.DA)
+47 SET TMP=$$FIND1^DIC(90505.01,IENS,"X",PLNM,"","","ERROR")
+48 ; Name not currently in use
IF TMP=0
QUIT
+49 ; Name in use on the panel being edited
IF PLIEN=TMP
QUIT
+50 ; Name in use on another panel
SET BMXSEC="Panel name already exists"
+51 QUIT
End DoDot:1
IF $GET(BMXSEC)'=""
QUIT
+52 ;
+53 ; Create header record
+54 SET BQII=0
SET ^TMP("BQIPLCR",UID,BQII)="I00010PANEL_IEN^T00020PANEL_ID^T00120PANEL_NAME"_$CHAR(30)
+55 ;
+56 ;If no panel IEN entered, assign a new one
+57 IF PLIEN=""
Begin DoDot:1
+58 LOCK +^BQICARE(OWNR,1,0):5
+59 ; Error - unable to assign next panel IEN
IF '$TEST
SET BMXSEC="Unable to create panel"
QUIT
+60 IF '$DATA(^BQICARE(OWNR,1,0))
SET ^BQICARE(OWNR,1,0)="^90505.01^^"
+61 ;If no panel name entered, assign a temporary name
+62 IF PLNM=""
Begin DoDot:2
+63 NEW PLN
+64 SET PLN=$PIECE(^BQICARE(OWNR,1,0),"^",3)+1
+65 SET PLNM=$$TMPNM(PLN)
+66 IF $DATA(^BQICARE(OWNR,1,"B",PLNM))
Begin DoDot:3
+67 SET PLN=$ORDER(^BQICARE(OWNR,1,"B","TEMP PANEL A"),-1)
+68 SET PLN=$PIECE(PLNM,"TEMP PANEL ",2)+1
SET PLNM=$$TMPNM(PLN)
End DoDot:3
End DoDot:2
+69 ;Filing is included in structured do to allow locks to frame the
+70 ;assignment of the IEN and the record filing
+71 DO FILE
+72 ;
+73 ;Copy User Templates into Panel
+74 DO TMPL(OWNR,PLIEN)
+75 ;
+76 LOCK -^BQICARE(OWNR,1,0)
End DoDot:1
IF $GET(BMXSEC)'=""
QUIT
+77 DO UPD
IF $GET(BMXSEC)'=""
QUIT
+78 GOTO DONE
+79 ;
FILE ;File new panel
+1 NEW DA,X,DINUM,DIC,DIE,DLAYGO
+2 SET DA(1)=OWNR
SET X=PLNM
SET DLAYGO=90505.01
+3 SET DIC="^BQICARE("_DA(1)_",1,"
SET DIE=DIC
+4 SET DIC(0)="L"
SET DIC("P")=DLAYGO
+5 KILL DO,DD
DO FILE^DICN
+6 SET (DA,PLIEN)=+Y
+7 IF PLIEN=-1
SET BMXSEC="Error encountered while filing panel."
QUIT
+8 ;I $G(ASSOC)'="" D CPY^BQIPLCP(OWNR,ASSOC,.PLIEN,1)
+9 IF $GET(ASSOC)'=""
DO CPY(OWNR,PLIEN,ASSOC)
+10 QUIT
+11 ;
UPD ; Update panel definition values
+1 NEW DA,IENS,BQIPLUP,ERROR,OPLNM
+2 SET DA(1)=OWNR
SET DA=PLIEN
+3 SET IENS=$$IENS^DILF(.DA)
+4 ;
+5 DO CHK
+6 ;
+7 IF $$GET1^DIQ(90505.01,IENS,.02,"I")=""
SET BQIPLUP(90505.01,IENS,.02)=$$NOW^XLFDT()
+8 SET BQIPLUP(90505.01,IENS,.04)=DUZ
+9 SET BQIPLUP(90505.01,IENS,.05)=$$NOW^XLFDT()
+10 SET BQIPLUP(90505.01,IENS,3.7)=DUZ(2)
+11 ;
+12 IF ASSOC'=""
SET OPLNM=$PIECE(^BQICARE(OWNR,1,ASSOC,0),U,1)
+13 IF ASSOC=""
SET OPLNM=$$GET1^DIQ(90505.01,IENS,.01,"E")
+14 ;
+15 IF PLNM]""
Begin DoDot:1
+16 IF OPLNM=""
SET BQIPLUP(90505.01,IENS,.01)=PLNM
QUIT
+17 SET BQIPLUP(90505.01,IENS,.01)=PLNM
+18 ; Check if panel is a specified panel and update with new panel name
+19 IF $DATA(^BQICARE("SPNL",OPLNM,OWNR))
SET BQIPLUP(90505,OWNR_",",.03)=PLNM
+20 ; Check if any filters have this panel name
+21 IF STATUS="T"!(ASSOC'="")
QUIT
+22 NEW PLIDEN,TUSR,TPNL,TN,NPLIDEN,TNN
+23 SET PLIDEN=OWNR_$CHAR(26)_OPLNM
SET TUSR=""
SET NPLIDEN=OWNR_$CHAR(26)_PLNM
+24 FOR
SET TUSR=$ORDER(^BQICARE("AD",PLIDEN,TUSR))
IF TUSR=""
QUIT
Begin DoDot:2
+25 SET TPNL=""
+26 FOR
SET TPNL=$ORDER(^BQICARE("AD",PLIDEN,TUSR,TPNL))
IF TPNL=""
QUIT
Begin DoDot:3
+27 SET TN=""
+28 FOR
SET TN=$ORDER(^BQICARE("AD",PLIDEN,TUSR,TPNL,TN))
IF TN=""
QUIT
Begin DoDot:4
+29 IF ^BQICARE(TUSR,1,TPNL,15,TN,0)'="PLIDEN"
QUIT
+30 SET TNN=0
+31 FOR
SET TNN=$ORDER(^BQICARE(TUSR,1,TPNL,15,TN,1,TNN))
IF 'TNN
QUIT
Begin DoDot:5
+32 IF $PIECE(^BQICARE(TUSR,1,TPNL,15,TN,1,TNN,0),U,1)=PLIDEN
Begin DoDot:6
+33 SET $PIECE(^BQICARE(TUSR,1,TPNL,15,TN,1,TNN,0),U,1)=NPLIDEN
+34 KILL ^BQICARE(TUSR,1,TPNL,15,TN,1,"B",PLIDEN,TNN)
+35 SET ^BQICARE(TUSR,1,TPNL,15,TN,1,"B",NPLIDEN,TNN)=""
+36 KILL ^BQICARE("AD",PLIDEN,TUSR,TPNL,TN)
+37 SET ^BQICARE("AD",NPLIDEN,TUSR,TPNL,TN)=""
End DoDot:6
End DoDot:5
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+38 ;
+39 IF PLNM=""
Begin DoDot:1
+40 IF ASSOC'=""
SET PLNM=OPLNM
End DoDot:1
+41 ;
+42 IF PLDES]""
SET BQIPLUP(90505.01,IENS,1)=PLDES
+43 IF SRC]""
SET BQIPLUP(90505.01,IENS,.03)=SRC
+44 IF SRCNM]""
SET BQIPLUP(90505.01,IENS,.11)=SRCNM
+45 IF FSOURCE]""
SET BQIPLUP(90505.01,IENS,.14)=FSOURCE
+46 IF AUFL]""
SET BQIPLUP(90505.01,IENS,.06)=AUFL
+47 IF STATUS]""
SET BQIPLUP(90505.01,IENS,.13)=STATUS
+48 IF ASSOC]""
SET BQIPLUP(90505.01,IENS,.15)=ASSOC
+49 IF IPCPL'=""
SET BQIPLUP(90505.01,IENS,2.1)=$SELECT(IPCPL="Y":1,1:IPCPL)
+50 ;I IPCPL="" S BQIPLUP(90505.01,IENS,2.1)="@"
+51 IF PCAT'=""
Begin DoDot:1
+52 IF OWNR=DUZ
SET BQIPLUP(90505.01,IENS,2.2)=PCAT
QUIT
+53 NEW DA,IENS
+54 SET DA(2)=OWNR
SET DA(1)=PLIEN
SET DA=DUZ
SET IENS=$$IENS^DILF(.DA)
+55 SET BQIPLUP(90505.03,IENS,.06)=PCAT
End DoDot:1
+56 ;
+57 ;I PCAT="" S BQIPLUP(90505.01,IENS,2.2)="@"
+58 DO FILE^DIE("","BQIPLUP","ERROR")
+59 IF $DATA(ERROR)
SET BMXSEC="Error encountered while filing panel."
QUIT
+60 ;
+61 ; Send notification
+62 IF $GET(STATUS)'="T"
Begin DoDot:1
+63 NEW TEXT
+64 IF OPLNM'=PLNM
SET TEXT="Panel name changed from "_OPLNM_" to "_PLNM_"."
+65 IF '$TEST
SET TEXT="Panel Definition for "_OPLNM_" has been modified."
+66 DO UPD^BQINOTF(OWNR,PLIEN,TEXT)
End DoDot:1
+67 ;
+68 ; Return panel IEN, ID, and NAME on success
+69 SET PLID=$$PLID^BQIUG1(OWNR,PLIEN)
+70 SET BQII=BQII+1
SET ^TMP("BQIPLCR",UID,BQII)=PLIEN_"^"_PLID_"^"_PLNM_$CHAR(30)
+71 QUIT
+72 ;
TMPNM(NM) ;EP -- Return temporary panel name
+1 SET NM=$EXTRACT("0000000000",1,10-$LENGTH(NM))_NM
+2 QUIT "TEMP PANEL "_NM
+3 ;
ERR ;
+1 LOCK -^BQICARE(OWNR,1,0)
+2 DO ^%ZTER
+3 NEW Y,ERRDTM
+4 SET Y=$$NOW^XLFDT()
XECUTE ^DD("DD")
SET ERRDTM=Y
+5 SET BMXSEC="Recording that an error occurred at "_ERRDTM
+6 ; If a temporary panel was created when an error occurred, delete it
+7 IF $GET(ASSOC)'=""
Begin DoDot:1
+8 NEW DA,DIK
+9 SET DA(1)=OWNR
SET DA=PLIEN
+10 SET DIK="^BQICARE("_DA(1)_",1,"
+11 DO ^DIK
End DoDot:1
+12 QUIT
+13 ;
DONE ; -- exit code
+1 SET BQII=BQII+1
SET ^TMP("BQIPLCR",UID,BQII)=$CHAR(31)
+2 QUIT
+3 ;
CHK ; Check Source Type changed to Manual
+1 ; If the panel is already Manual and is changed to manual, quit
+2 IF $$GET1^DIQ(90505.01,IENS,.03,"I")="M"
IF SRC="M"
QUIT
+3 ; If the panel is not manual and is not being changed to manual, quit
+4 IF $$GET1^DIQ(90505.01,IENS,.03,"I")'="M"
IF SRC'="M"
QUIT
+5 ; If changing a panel to a manual from any other definition type,
+6 ; set all users not having a manual flag, the manual flag of 'Add'.
+7 NEW DFN
+8 SET DFN=0
+9 FOR
SET DFN=$ORDER(^BQICARE(OWNR,1,PLIEN,40,DFN))
IF 'DFN
QUIT
Begin DoDot:1
+10 IF $PIECE(^BQICARE(OWNR,1,PLIEN,40,DFN,0),U,2)'=""
QUIT
+11 SET $PIECE(^BQICARE(OWNR,1,PLIEN,40,DFN,0),U,2)="A"
+12 SET $PIECE(^BQICARE(OWNR,1,PLIEN,40,DFN,0),U,4)=$$NOW^XLFDT()
End DoDot:1
+13 QUIT
+14 ;
CPY(OWNR,PLIEN,OPLIEN) ;EP - Copy a temporary panel
+1 SET $PIECE(^BQICARE(OWNR,1,PLIEN,0),U,2,14)=$PIECE(^BQICARE(OWNR,1,OPLIEN,0),U,2,14)
+2 ;
+3 ; Copy PANEL DESCRIPTION
+4 IF $DATA(^BQICARE(OWNR,1,OPLIEN,1))
MERGE ^BQICARE(OWNR,1,PLIEN,1)=^BQICARE(OWNR,1,OPLIEN,1)
+5 ;
+6 ; Copy Panel information
+7 IF $DATA(^BQICARE(OWNR,1,OPLIEN,3))
MERGE ^BQICARE(OWNR,1,PLIEN,3)=^BQICARE(OWNR,1,OPLIEN,3)
+8 ;
+9 ; Copy GENERATED DESCRIPTION
+10 IF $DATA(^BQICARE(OWNR,1,OPLIEN,5))
MERGE ^BQICARE(OWNR,1,PLIEN,5)=^BQICARE(OWNR,1,OPLIEN,5)
+11 ;
+12 ; Copy PARAMETER DEFINITION
+13 IF $DATA(^BQICARE(OWNR,1,OPLIEN,10))
MERGE ^BQICARE(OWNR,1,PLIEN,10)=^BQICARE(OWNR,1,OPLIEN,10)
+14 ;
+15 ; Copy FILTER DEFINITION
+16 IF $DATA(^BQICARE(OWNR,1,OPLIEN,15))
MERGE ^BQICARE(OWNR,1,PLIEN,15)=^BQICARE(OWNR,1,OPLIEN,15)
+17 ;
+18 ; Copy CUSTOMIZED VIEW
+19 IF $DATA(^BQICARE(OWNR,1,OPLIEN,20))
MERGE ^BQICARE(OWNR,1,PLIEN,20)=^BQICARE(OWNR,1,OPLIEN,20)
+20 ;
+21 ; Copy SHARED USERS
+22 IF $DATA(^BQICARE(OWNR,1,OPLIEN,30))
MERGE ^BQICARE(OWNR,1,PLIEN,30)=^BQICARE(OWNR,1,OPLIEN,30)
+23 ;
+24 ; Copy PATIENT LIST
+25 IF $DATA(^BQICARE(OWNR,1,OPLIEN,40))
MERGE ^BQICARE(OWNR,1,PLIEN,40)=^BQICARE(OWNR,1,OPLIEN,40)
+26 ;
+27 ; Update cross references for merged entries
+28 SET DIK="^BQICARE("_DA(1)_",1,"
+29 DO IX^DIK
+30 QUIT
+31 ;
+32 ;Copy template information into new panels
TMPL(OWNR,PLIEN) ;EP - Copy template information into new panel
+1 ;
+2 NEW IEN
+3 ;Quit if no owner
IF $GET(OWNR)=""
QUIT
+4 ;Quit if no panel ien
IF $GET(PLIEN)=""
QUIT
+5 ;
+6 ;Quit if template node has already been set up
+7 IF $ORDER(^BQICARE(OWNR,1,PLIEN,4,0))]""
QUIT
+8 ;
+9 ;Quit if user has no defined templates
+10 IF $ORDER(^BQICARE(OWNR,15,0))=""
QUIT
+11 ;
+12 ;Set top node
+13 IF '$DATA(^BQICARE(OWNR,1,PLIEN,4,0))
SET ^BQICARE(OWNR,1,PLIEN,4,0)="^90505.14^^"
+14 ;
+15 ;Loop through user templates and move to panel
+16 SET IEN=0
FOR
SET IEN=$ORDER(^BQICARE(OWNR,15,IEN))
IF 'IEN
QUIT
Begin DoDot:1
+17 ;
+18 NEW BQDATA,DA,DIC,ERROR,IENS,TMPLT,TMPLN,X,Y
+19 ;
+20 ;Get the template
+21 SET DA(1)=OWNR
SET DA=IEN
+22 SET IENS=$$IENS^DILF(.DA)
+23 SET TMPLN=$$GET1^DIQ(90505.015,IENS,.01,"E")
+24 ;
+25 ;Only copy if set to default
+26 IF $$GET1^DIQ(90505.015,IENS,.03,"I")'="Y"
QUIT
+27 ;
+28 ;Get the code
+29 SET TMPLT=$$GET1^DIQ(90505.015,IENS,.02,"I")
+30 ;
+31 ;Lookup/Define new entry
+32 SET DA(2)=OWNR
SET DA(1)=PLIEN
+33 SET X=TMPLN
+34 SET DIC(0)="L"
SET DIC="^BQICARE("_DA(2)_",1,"_DA(1)_",4,"
+35 DO ^DIC
+36 IF +Y>0
SET DA=+Y
+37 SET IENS=$$IENS^DILF(.DA)
+38 ;
+39 ;Insert TYPE
+40 SET BQDATA(90505.14,IENS,".02")=TMPLT
+41 ;
+42 ;File update
+43 IF $DATA(BQDATA)
DO FILE^DIE("","BQDATA","ERROR")
End DoDot:1