1 | DGPTFCR ;ALB/JDS - CREATE IN PATIENT PTF RECORD ; 11 JAN 85
|
---|
2 | ;;5.3;Registration;;Aug 13, 1993
|
---|
3 | ;
|
---|
4 | EN D LO^DGUTL F DGDUMB=0:0 K DFN D SEL Q:'$D(DFN)
|
---|
5 | Q K %,D0,DQ,T,Y,X,DGDUMB Q
|
---|
6 | ;
|
---|
7 | SEL ; -- pt select
|
---|
8 | W ! K DIC
|
---|
9 | S DIC(0)="AEQMZ",DIC="^DPT(",DIC("S")="I $D(^DGPM(""APTT1"",+Y))",DIC("A")="Select Patient: "
|
---|
10 | D ^DIC K DIC G SELQ:Y'>0 S DFN=+Y
|
---|
11 | ;
|
---|
12 | ; -- adm mvt select
|
---|
13 | ; will change to use ^DGPM("ADFN") cross-reference when available
|
---|
14 | W !
|
---|
15 | S DIC(0)="EQZ",DIC="^DGPM(",DIC("S")="I $P(^(0),U,2)=1,'$P(^(0),U,26),'$D(^DGPT(+$P(^(0),U,16),0))",DIC("A")="Select Admission Date: "
|
---|
16 | D DFN^DGPMUTL K DIC G SELQ:Y'>0
|
---|
17 | ;
|
---|
18 | N DGPMCA,DGPMAN,DGPMDN
|
---|
19 | S DGPMCA=+Y,DGPMAN=Y(0),DGPMDN=$S($D(^DGPM(+$P(DGPMAN,"^",17),0)):^(0),1:""),DGTY=$S($D(^DG(405.2,+$P(DGPMDN,"^",18),0)):$P(^(0),"^",8),1:0)
|
---|
20 | S Y=1 D RTY^DGPTUTL S Y=+DGPMAN
|
---|
21 | W !!?5,"Creating new PTF record..."
|
---|
22 | D CREATE I +Y<0 W *7,"unable to create record." G SELQ
|
---|
23 | S PTF=+Y,DR="[DG PTF ATTACH]",DIE="^DGPM(",DA=DGPMCA D ^DIE
|
---|
24 | W !?5,"record #",PTF," created.",!
|
---|
25 | SELQ K DR,X,DA,DIE,DIC,DGTY,DGRTY,DGRTY0,PTF,I,J,Y,DQ,DG Q
|
---|
26 | ;
|
---|
27 | CREATE ; -- entry point to create a new PTF record
|
---|
28 | ; input: DFN := pt number
|
---|
29 | ; Y := admission d/t ^ fee record
|
---|
30 | ; DGRTY := type of record (1-PTF ; 2-CENSUS)
|
---|
31 | ; (PTF assumed if undefined)
|
---|
32 | ; output: Y := ifn of ^DGPT
|
---|
33 | ;
|
---|
34 | I $S('$D(DFN):1,'DFN:1,1:'Y) S Y=-1,Y(0)="" G CREATEQ
|
---|
35 | S DGPTDATA=U_Y,DIC="^DGPT(",DIC("DR")="[DG PTF CREATE PTF ENTRY]"
|
---|
36 | S DIC(0)="FLZ",X=DFN K DD,DO D FILE^DICN S Y=+Y
|
---|
37 | I $S('$D(DGRTY):1,1:DGRTY=1) N PTF K DA S (PTF,DA)=Y,DIE="^DGPT(",DR="[DG PTF POST CREATE]" D ^DIE:DA>0 S Y=PTF
|
---|
38 | CREATEQ K DA,DIC,DGPTDATA,DIE,DR Q
|
---|