source: FOIAVistA/trunk/r/MASTER_PATIENT_INDEX_VISTA-MPIF/MPIFP48.m@ 1429

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

initial load of FOIAVistA 6/30/08 version

File size: 921 bytes
Line 
1MPIFP48 ;BIRM/CMC-POST INT FOR MPIF*1*48 ;MAY 24, 2007
2 ;;1.0; MASTER PATIENT INDEX VISTA ;**48**;30 Apr 99;Build 6
3 ;
4POST ;This post init will correct the values in fields
5 ;LAST NUMBER USED (#1) and NEXT NUMBER TO USE (#3) in the
6 ;MASTER PATIENT INDEX (LOCAL NUMBERS) FILE (#984.1)
7 ;
8 N NODE,F1,F3,IEN,ICN
9 S IEN=$O(^MPIF(984.1,0))
10 S NODE=$G(^MPIF(984.1,IEN,0))
11 S F1=$P(NODE,"^",2)
12 S F3=$P(NODE,"^",4)
13 I $L(F1)=10&($L(F3)=10) D BMES^XPDUTL("Local ICNs in file #984.1 were 10 digits already.") Q
14 ;
15 D SETUP(IEN)
16 D BMES^XPDUTL("Local ICNs in file #984.1 are now 10 digits")
17 Q
18SETUP(IEN) ;
19 N CHK,NUM,NXTCHK,NXTNUM,SITE,DA,DIE,DR
20 S SITE=$$SITE^VASITE,SITE=$P(SITE,"^",3),SITE=SITE\1
21 S DIE="^MPIF(984.1,",DA=IEN
22 S NUM=SITE_"0000000",CHK=$$CHECKDG^MPIFSPC(NUM),MPINUM=NUM_"V"_CHK
23 S NXTNUM=NUM+1,NXTCHK=$$CHECKDG^MPIFSPC(NXTNUM)
24 S DR="1////"_NUM_";2////"_CHK_";3////"_NXTNUM_";5////"_NXTCHK
25 D ^DIE
26 K X,Y
27 Q
Note: See TracBrowser for help on using the repository browser.