source: FOIAVistA/tag/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/DGPTFCR.m@ 1683

Last change on this file since 1683 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 1.6 KB
Line 
1DGPTFCR ;ALB/JDS - CREATE IN PATIENT PTF RECORD ; 11 JAN 85
2 ;;5.3;Registration;;Aug 13, 1993
3 ;
4EN D LO^DGUTL F DGDUMB=0:0 K DFN D SEL Q:'$D(DFN)
5Q K %,D0,DQ,T,Y,X,DGDUMB Q
6 ;
7SEL ; -- 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.",!
25SELQ K DR,X,DA,DIE,DIC,DGTY,DGRTY,DGRTY0,PTF,I,J,Y,DQ,DG Q
26 ;
27CREATE ; -- 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
38CREATEQ K DA,DIC,DGPTDATA,DIE,DR Q
Note: See TracBrowser for help on using the repository browser.