You are on page 1of 9

Socio-Econ. Plan. Sci. Vol. IO, pp. 7-15. Pergamon Press 1916.

Printed in Great Britain

SIMULATION OF A BLOOD-INVENTORY-BANK SYSTEM


IN A HOSPITAL

PREM VRAT and A. B. KHAN?


Indian Institute of Technology. Hauz Khas, New Delhi-l 10029 India

(Received 25 March 1975; revised 28 &ly 1975)

Abstract-A blood-bank inventory system has been analysed viewing it as an inventory-bank system where the
demand forecasting forms a part of the inventory model. A simulation model incorporating the “desired-beginning-
inventory-level” policy has been used for the analysis of system-performance. Optimal inventory policy-guidelines
have been suggested for a hospital blood-bank using blood shortage and blood out-dating as the two important
components of the measure of effectiveness. Numerical results have been given.

INTRODUCTION they arise, without increasing the blood expiration on


The desire for healthy living as a result of improved shelf unduly.
socio-economic and allied conditions, has tended to
increase the demand on the health services systems. The
hospital systems plays an important role in catering to the The blood bank of a major govemment hospital in
needs of community by providing medical care to the sick New Delhi was chosen for the study reported in this
and injured. The need for health care in the community is paper. The inputs and outputs of the blood bank are
virtually unlimited and matching of services with the need shown in the Fig. 1. The Red-cross, other blood-banks,
calls for a careful analysis and systematic planning. Blood random and paid donars supply the blood to the bank
bank systems are an important link of the entire which is received and kept in the unassigned blood cold
health-care systems and the investigations reported in this storage. The blood units are issued either to the patients
work are aimed at rationalizing the procurement. storage of the hospital or supplied to other hospitals (if it can be
and issue of blood inventories in the blood bank of a spared) on request. Units beyond 21 days in age are
hospital. discarded. The stock from unassigned refrigerator is
Essentially, blood banks are facilities which procure, shifted to assigned refrigerator where it is stocked after
store, process and dispense blood to ensure an adequate cross matching with the blood of the receiving patients. In
supply of blood for transfusion to the hospital patients. the assigned refrigerator the blood is kept till the end of
The inventory problem connected with the blood bank is a the working day (midnight). If not required by then, it is
chalIenging problem because of certain special charac- cross-matched again and issued to the patient who first
teristics of the problem and system components. requisitions it.
There are 4 basic types of blood groups, viz. A, B, AB
SPECIFIC ATTRIBUTES OF THE BLOOD and 0. They are further sub-divided on the basis of
INVENTORY PROBLEM Rhesus Factor as Rh positive and Rh negative. The
1. Whole-blood is a perishable commodity. Current issuing policy is that a patient should get the blood
medical practice avoids using whole blood for infusion if according to his or her own group. If not available, the
it has been stocked for more than 21 days. This may be other blood groups can be given on the recommendation
termed as the legal life of blood. of the treating doctor according to the relationships shown
2. Cost of non-availability of the blood, if required is in Fig. 2. The arrows in this figure point to the groups to
quite difficult as one hestiates to assign costs to loss of which transfusion is possible after proper cross-matching
human life or sufferings caused by postponement of is carried out. The female patients with Rh negative can
surgery. Hence cost is not an acceptable criterion of not be infused with Rh positive blood because of
performance. formation of antibodies.
3. Available supply is a function of public generosity. The present policy is that one of the relatives of the
Nearly all blood needs are met through voluntary patient requiring transfusion must donate blood at least
donations. Since it is difficult to uniformly motivate once. The collection of blood is about 250cm’ to which
volunteer donars, periods of short supply may be quite
Other hospitals
common.
4. A large number of staff involved in the collection and
distribution functions offer challenging control and
motivation problems.
5. The supply of the blood is to be matched with the
type of blood group of the patients requiring it.
6. The demand and supply of the blood is quite random
in nature.
The major inventory problem is to maintain an
adequate supply of blood to meet the needs as soon as
Out doted blood

*Present address: C.A.M.S., Cuttack-753007, India. Fig. 1. Hospital blood-inventory-bank system.

SEPS WI.. IO NO. I-B


8 PREM VRAT and A. B. KHAN

50 cm3 of preservatives are added. This 300 cm3 of blood 0 -A


and preservatives is known as a unit of blood. In case of

,_)
shortage either the bank requests other hospitals to help
or tries to collect it from paid donors. Usually difficulties
in Rh negative blood are encountered as it is rare in India.
At present no rational inventory policy is being
followed and every systematic record of collections and
issues are not maintained for scientific planning of blood
AB
inventory. Shortages are quite frequent and the requests B
to other hospitals and Red-cross are frequently turned
down. Hence an effort was made in this study to analyse Fig. 2. Possiblealternativebloodgroupfor transfusion.
the inventory system and to formulate rational inventory
policies keeping in mind the uncertainty of the system
exhibited by the variability of demand and supply. (c) Inventory level (Independent, non-controllable,
external).
LITTLE SURVEY (d) Order-size from outsize agencies (dependent, con-
In the literature on the analysis of system under trollably, internal).
investigation, attempts have been made to justify the rule The parameters governing the behaviour of the system
of thumb to provide adequate service on one hand and are:
analysis of highly simplified models of blood bank on the 1. Probability distribution of input or collection.
other. Rockwell et al. [l] have used the fixed lot size and 2. Probability distribution of output or issues.
fixed cycle time inventory policies and analysed effects of 3. Level of inventory.
ordering policies on probability of stock-out and Average age of blood for infusion varies according to
expiration. Elston and Pickrel[Z] have simulated the the input and output conditions. Some delay due to
system to determine the ordering and usage policies of the grouping, serological tests and holding the blood in
blood bank, assigning only specific transfusions using storage to kill the germs and bacteria always puts a lower
FIFO policy. Jennings[3] has stressed that inventory bound on the average age of the blood. Similarly,
policy should be examined mainly on the basis of the mismatching between the time and level of collection and
effects on shortages and expirations. The model de- infusion results in shortages and expirations.
veloped by him has considered shortages and expirations
as the main criteria of effectiveness and has demon- ASSUMPTIONS
strated the effect of inventory level on shortages and The following assumptions have been made for
out-dating (expiration) with the help of operating charac- developing a simulation model for the inventory-bank
teristic curves. Hurlburt and Jones [4] Silver and Silver [5] system.
and Sathianatham[6] have also analysed the blood bank 1. The data collected over 365 days to compute input
inventory systems. The simulation model developed and and output distributions truely represent the stable
used in this paper aims at investigating the effects of distributions of the universe in the statistical sense.
different inventory levels on the shortages and out-dating 2. The request for blood from any outside agency is
with the help of inventory-bank model concept originated not met unless there is any unit which is about to expire due
by Naddor [7]. to storage.
PROBLEM OVULATION
3. The reviewing period of inventory status has been
taken to be 24 hr.
The basic purpose of analysing the inventory system 4. When fresh blood is demanded, the collected blood
was to develop procedures leading to stability in order is immediately sent to the physician. It is excluded from
schedules and to eliminate extreme fluctuations in inventory considerations.
inventory while reducing the risk of shortage and 5. For raising the inventory level, the blood can be
expiration on the shelf. The inventory policies have been obtained fresh through Red-Cross Control Blood Bank or
evaluated with respect to the following parameters: paid donors can be used for bleeding.
6. Only type-specific group infusions are permitted.
(i) average inventory level
7. Demands not met on any day is given top priority for
(ii) average age of blood at the time of infusion consideration on the subsequent day. (This is often true in
(iii) average number of units short and expired.
case of surgery but not for emergency demands.)
SYSTEM COMPONENTS,
VARIABLES AM, PARAMETERS COLLECTION OF DATA

The entities (components) of the system were: The probability distributions of input (collections) and
1. Inputs to the blood bank. output (issues) are relevant for designing the simulation
2. Output demands for blood by the physicians. experiments. The data were collected for more than 365
3. Emergency orders to sources outside the system for days to obtain the frequency distribution to the input and
raising the inventory to meet emergency demands. output for each type of blood, for a specified Rh factor.
4. Demand from outside agencies requesting for blood. The blood groups are coded as A, B, AB and 0 each group
The variables associated with the system under study further sub-dividing for -ve and +ve Rh factors, thus
are: making 8 distinct kinds of blood groups.
(a) Size of input to the bank (external, non- Tables 1 and 2 give the cumulative probability
controllable). distribution for the collections and issues respectively for
(b) Size of demand for blood (external, non A and AB blood groups with Rh + ve. Similar data were
controllable). obtained for the other blood groups.
Simulation of a blood-inventory-bank system in a hospital 9

Table 1. Cumulative probability of collections of blood of various groups and Rh factors

Blood Cumulative prob. for number of units per day


Group 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14

ARh+ 0.06 0.144 0.266 0.394 0.560 0.667 0.761 0.864 0.914 0.948 0.967 0,979 0.986 0.993 1.000
AB Rht 0.255 0.585 0.781 0.903 0.969 0.988 l+OO

Table 2. Cumulative probability of issue of blood of various groups and Rh factors

Blood
Group 0 1 2 3 4 5 6 7 8 9 10 11 12 13

ARh+ 0,046 0,150 0,273 0.454 0.605 0,721 0.807 0.838 0.874 0,960 0,971 0,987 0.995 1~000
AbRh+ 0.268 0,580 0,775 0.920 0.952 0,984 0.996 0.998 1.000

SIMULATION MODEL FOR BLOOD-INVENTORY-BANK


Another important aspect of the computer-simulation
The model used in the analysis of the blood bank is of the inventory-bank system was to initialize the
similar to the “Inventory-bank” model as proposed by conditions for starting the simulation experiment. The
Naddor [8]. The inventory status and replenishment following starting initial conditions have been assumed in
decisions are reviewed every “t” units of time. The value the simulation model:
of “t” in this study has been taken to be 24 hr. Thus the
blood inventory is reviewed daily. The amount re- a=6
plenished at time i raises the available inventory Ai to a S,=S for i=a-M+l,...... a-l
bank Bi. No returns are permitted. The quantity Pi
P,= S for i = a -L,. .. a - 1
ordered for replenishment is defined by
qa-, = (N-L - 1)s
Pi = max (B, - A,, 0). R,m, = s

The notations used in the model are same as used by The rest of the logic in the simulation model makes use of
Naddor[8] and hence are not included here. The the expressions developed by Naddor[8] for the computa-
important parameters that completely define the inven- tion of the dependent parameters I,, 1*, 1, and L. The
tory policy are N, the number of days in a bank, and M, system was simulated for various values of the decision
the number of days immediately preceding ith day. Here variable N ranging from 1 to 7 days for various blood
the forecast of the demand is a part of the inventory groups and Rh factors.
system itself. The expected inventory per day (I,), Figure 3 shows the flow diagram of the computer-model
expected shortages per day (1J expected units re- developed for simulating the blood-inventory-bank sys-
plenished per day (I,) and expected units expired on the tem. The first part of the flow diagram concerns with the
shelf per day (L) are dependent controllable parameters setting up of the initial conditions for starting the
and are functions of the controllable parameters N and M. simulation experiment. The computer listing of the
The lead-time in this study has been assumed to be simulation model of the blood-inventory-bank is shown in
constant and taken to be 3 days as evidenced by the the Appendix. The program has a master segment
records available. supported by various sub-routines which are linked up
Most expressions for II, Iz, I,, I, and the total system with the main program according to the logic shown in
costs are same as derived by Naddor[8] and hence are Fig. 3.
omitted in this paper. Simulation approach has been The computer simulation model developed provided the
adopted in this paper in order to find the relationship of relationship of the decision variable N with the average
decision variable N and the dependent controllable blood inventory, average age of the blood, percentage
parameters II, I>, I,, Id. As shown by Naddor [8], the value shortages and % blood expirations on the shelf. The curve
of M does not have a significant effect on the variables, relating the % expirations (or blood outdating) with the %
hence M was fixed and assumed to be M = 3 in the shortages has been termed as the operating characteristic
present study, thus leaving N to be the only decision curve of the inventory system which can give a very
variables in the inventory-bank system. Simulation meaningful insight into the operation of the inventory
approach was used for estimating the relevant inventory bank system and help in making the optimal decision
parameters outlined above as a function of N. One of the regarding the value of N, since the blood shortage and
important aspects of the computer-simulation model blood-outdating are the two important components of the
developed were generating the random events pertaining measure of the effectiveness of the blood-inventory-bank
to the collections of the blood and issues of the blood, the system.
latter being synonymous to the generation of random
ANALYSIS OF RESULTS
demand. This has been accomplished by making use of
the Monte Carto sampling technique where the cumula- Table 3 gives the result obtained by simulation of the
tive distributions for various blood groups shown in blood bank inventory system for various values of N.
Tables 1 and 2 have been used for generating the random Some important observations may be summarised as
events. Computer subroutines were developed for the follows:
generation of random events as shown in the Appendix 1. For A group with Rh + ve, the average inventory in
giving the computer listing. the system increases with increase in N. The system is
10 ‘REM VRAT and A. R. KHAN

2. For A, Rh -ve, there is no minimum value of %


shortages and expirations. Same is true for B, and 0 groups
with Rh -ve as can be readily seen by the operating
characteristic curves of Fig. 4.
3. For B, Rh t ve, the system is quite sensitive between
N = 3 to N = 5 and at N = 4, it gives the minimum
shortages as well as expirations. With average age of
blood as 6 days and average inventory level at 3823 units.
IS (DISBAR
4. For AB, Rh + ve, values of N between 4 to 5 will be
quite reasonable from the point of view of shortages as
well as expirations.
5. AB, Rh - ve is not found to be consistent. Since Ab,
Rh - ve is very rare among the AB donors, the collections
were meagre and hence the data collected were probably
insu~cieRt.
6. For 0, Rh + ve, the average inventory tends to rise
rapidly with increase in N and the favourable range of N
is between 3 to 7 days, The optima1 policy is at N = 4
which has no shortages or expirations and the average
inventory will be 26.68 units, with the average age of
blood as 6 days.
CONCLUSIONS
On the basis of the simulation results, it can be seen that
for blood group A, Rh fve, the best policy will be at
N = 4 and this will minimize the percentage shortages as
110 ~I~-IQA~I-II+IR1I-B~
I well as percentage expirations. Similarly, the optimal
policy for other blood groups were obtained. In this
analysis, it was presumed that the cost of expiration and
cost of shortages are two important considerations in the
measure of effectiveness and the cost of inventory was
not as important. However, if the cost data are available,
it is possible to optimize the inventory bank policy by
minimizing the total relevant cost consisting of carrying
inventory, replenishment, shortages and blood expira-
tions, on the basis of the information provided by the
simulation model described above.
As can be readily seen from Table 3, it is easy to find the
optimal policy for the Rh t ve blood groups, but the Rh
- ve blood groups pose some problems as the optimal
solution is not obvious from the results of the simulation.
As can be seen from the Fig. 4, the % expirations wilt
increase for these blood groups if a certain reasonable

K- 1.4
J(K)=J(K)+I(K)

Fig. 3. Flow diagram for computer simulation.

0 1 1
quite sensitive in the range 3-5 for N. As N = 4, there is a
44 48 52 56 60 64 68 72
low probability of shortage and expirations. The %
Percentage expirations of the blood
shortages and expirations are expressed as a % of total
blood handled, annually. Fig. 4. Operating characterstics of Rh - ve bloodgroups.
Simulation of a blood-inventory-bank system in a hospital

Table 3. Sjmulation results for blood groups A and AB, Rh + ve

No. of days
in the Bank Average Average
(decision inventory age of
Blood variable) level in blood in Per cent Per cent
Group N. units days Shortages expirations

A, Rh+ 1 8.99 6.8 20,82 0.0


2 1404 7.3 2.65 0.0
3 21.49 12.2 0.48 a.0
4 26,53 11.2 0.0 0.0
(optimal
policy)
5 36.44 14.1 o-0 0.23
6 40.22 12-S 0.0 0.65
7 41.20 14‘3 0.0 2.34

AB Rh+ 1 5.83 4.9 18.3 0.17


2 5.57 5.3 13.9 0.0
3 9% 5.4 0.54 1.38
4 12.25 5.6 0,057 142
(near
optimal)
5 14.83 6.9 0.0 2.28
(near
optimal)
6 17.40 7.8 0.0 5.16
7 18.87 8.6 0.0 5.49

level of blood availability is to be ensured. For example; Hospital but as yet no feed back is available as to the effect
the expiration for A, Rh - for 6.18% shortage level will be of changes incorporated. Such information, if available,
as high as 69.10% and for B Rh - a 2.18% shortage level could have validated the simulation model substantially.
will result in 61.37% blood expiration. The blood Thus at this stage the study presented gives only the
expiration for 2.52% of shortage level was 58.44% in findings of a research model for better planning, but its
blood group 0, Rh-ve. This means that the total actual validation in practice and impact on improved
operating cost of the blood-inventory-bank system will be system p~rformation is yet to be seen.
substantially higher in case of negative Rh factors as
compared to positive Rh factors. Thus it is proposed, that
for negative blood groups, the management should keep a Acknowledgements-Authors thank Prof. T. J. Ramiah of
National Institute of Health Administration and Education for his
list of potential donors for rare blood groups in order to
valuable assistance in the study undertaken. Thanks are also due
meet any emergency situation and aim at a relatively to referees for their useful suggestions regarding the presentation
higher % of shortages at inventory planning level in order of this paper.
to reduce the blood expirations.
Interestingly, the average age of the blood in all
RF~ERENC~
negative Rh blood groups was constant at 3 days and the
average inventory was not sensitive to the decision 1. T. H. Rockwell, R. A. Barum and W. C. Gin, Inventory
variable h? For example, the average inventory varied analysis as applied to hospital whole blood supply and demand,
from 2.05 to 2.96 units for B Rh -ve as compared to J. Ind. Engng XIII, 109-W (1962).
2. R. C. Elston and J. C. Pickrel, Guide to inventory levels for a
18~12-63.48units for B Rh t ve for N ranging from 1 to 7.
hospital blood bank determined by electronic computer
Thus, average inventory ~onsjderat~ons hardly should simulation, ~ra~s~~~si~~5, 465-470 (1965).
influence the inventory decisions in these blood groups. 3. J. B. Jennings, An analysis of hospital blo~bank whole blood
Blood group AB Rh- gave very inconsistent results and inventory control policies, ~~ans~~s~on8, 335-342(1968).
nothing could be said with confidence regarding the 4. E. L. Hurlburt and A, R. Jones, Blood bank inventory control,
group; except that more data may be collected and a Trunsfttsirin 4, 126- 130 f 1964).
similar analysis applied to see that a coherent picture of 5. A. Silver and k\. M, Silver, An empirical system for hospital
the system behaviour emerges. blood banks, 1. Am. Hf?sp~~a~ A~soc~ufion38, 56-60 (19641.
The limitations of the study reported here are that the 6. M. J. Ashok Sath~anatham~ Management TechniqlIes in
hospital, ~~dKstriu1Etzgng Pngmt 7, 43-49 (1972).
possibility of substituting a blood group by some other
7. E. Naddor, Markov chains and simulation in an inventory-bank
permissible blood groups is not examined. For example, system, J. ind. Engag XIV,91-98 (I963).
as per Fig. 2 the shortages of blood group AR can be met 8. E. Naddor, Inuenlory systems. Wiley, New York (1966).
by inventories of blood group A, 0 or B. This will make 9. A. B. Khan, Optimal inventory policies in central drugstore and
the model more complex though more realistic. The the blood-bank of a Hospital, unpublished &&Tech. thesis
proposed recommendations have been submitted to the I.I.T., Delhi (July 1974).

APPE~IX
LIST (LP)
SEND TO (SIMULATION SM22f
L,IBRARY(SUBGROUPSR~t)
12 PREM VRAT and A. B. KHAN

PROGRAM jl3ANK.l
IWUTI = CR0
OUTPUT2 = LPO
END
MASTER BLOODBANKINVENTORYSIMULATION
REAL II,12
REAL Jl,J2
INTEGER SBAR
DIMENSION NAGE (lOO),IS(11OO),IC(11OO)
DIMENSION IQ(llOO),IQi(l1OO)
DIMENSION DISTBO)
DIMENSION COL(&)
DIMENSION IP( I lOO),ISBARjl ~OO),IA~(ilOO),~BA~K(l lOO)IR(llOO)
CO~~~~ON!BLOODl~~A~~,~A,IS,IC.~4
CG~~O;\J(BLGGD2iiQ,IQ‘4,~1,12
CO~MGNiBLG~D3inrST,ND
CO~MG~~BLG~D4~&GL.~C
COMMG~~3LG~D~~A~C~
COMMvroNI3LDOD6iIP,rSBAR,IBI,IBANK,IR
READ (I, 103)STREAM
103 FORMAT(FO,O)
DO 58 JSIM = 1,8
READ (l,lOl)NC,ND
101 FORMAT(210)
READ(1,102)(COL(I),I = l,NC),(DIST(I),I = 1,ND)
102 FORMAT(lOF0,)
READ(l,IOO)SBAR,IA,M,IL,NMAX,IM
100 FORMAT(610)
DO SO I = IA-IL,IA - 1
IP(II = SBAR
50 IC(I)=ct
&AL TIME(S)
WRITE(2,I I il)S
DO 51 I=IA-M+ &IA-.1
51 IS(I) = SB AR
DO 999 J = 1,NMAX
IQA(IA - 1) = SBAR
IR(IA - I) = SBAR
Jl=O
52 = 0
53 = 0
J4 = 0
NA= SBAR
DO 52 II = I,NA
52 NAGE(I1) = 9
AVEA = 9.0
DO 53 I= IA,IA+fM- 1
IF(~A.~Q.~) GO TO 14
CALL ADDl(I)
GO TO 13
14 14=0
13 IF(IQA(I- l),GT.O) IQA(I - 1) = IQA(I- 1) - 14
IA(I) = IQA(I - 1)+ IR(I- 1)
IF(IQA(I- l),LT,O)GOTOIS
15 IF(IQ(I).LT.O)GOTOl6
NA = IQ(I)
AVEA = (AVEA + 3)/2.
GOT0 18
16 NA=O
AVE.4 = (AVEA i- 3)/Z
GO TO 18
17 CALL ADDCOL@f
$8 CALL DEMAND
IQA(I) = rQ@ - K(I)
IF(NA.EQ.0) GO TO 12
CALL ADJUST(I)
AVEA = (AVEA + AiCU)iZ
12 ISBAR(1) = 0
DO54JJ=I-M+l,I
54 ISBAR(1) = ISBAR(1) + IS(JJ)
ISBAR(1) = ISBAR(I)/FLOAT(M) + 0.5
IAI(1) = IQA(1)
DO%JJ=I-IL,I-I
5S IAI(1) = IAI(1) + IP(JJ) + IC(JJ)
Simulationof a bled-inventory-bank system in a hospital 13

IBANK~) = J*ISBAR(I)
IF(I~(I).LT.lBANK(I))GO TO 10
IP(I) = 0
13=0
GO TO 19
10 IP(1) = IBANK(1) - IAI(1)
13= 1
19 TEST = FLOAT(I)/7.
NTEST = TEST
IF(NTEST.EQ.TEST) GO TO 20
CALL COLLECTION(I)
GO TO 21
20 IC(I)=O
21 IR(IR) = IP(I- 1) + IC(1 - 1)
CALL AVERSHOT(1)
Jl=Jl+Il
J2=J2+12
53 = .I3+ I3
J4=54+14
53 CONTINUE
AVEIl = Jl/IM
AVE12 = 52
AVE13 = FLOAT(J3)/IM
AVE14 = FLOAT(J4)/IM
CALL STAR
WRITE (2,202)M,J,AVEIi,AVEI2,AVEI3,AVEI4
202 FORMAT(SX,‘M = ‘,12,10X,‘N = ‘,12//SX,‘AVG,INVENTORY = ‘,Fl
10.2iiSX:AVG.SHORTAGE = ‘,FlO,2//5X:AVG.REPLENISHMENT = ‘,F
210.2/iSX.‘AVG. EXPIRATION = ‘,F10.2/)
CALL STAR
WRITE(2.203)Jl,J2,J3,J4
203 FORMAT(~~lOX;Jl =‘,El?.ll/lOX:J2= ‘,El7.ll~SOX;l3 =I,
lIlO/lOX;J4 = ‘,110/i)
CALL STAR
WRITE(2,204)AVEA
204 FORMAT(////ZOX,‘****‘,‘AVERAGE AGE = ‘,F10,2X,‘****‘)
CALL STAR
KTOCON = 0
IORD = 0
IDEM = 0
DO 56 I = 6,llOO
IDEM = IDEM + IS(I)
IORD = IORD t IP(1)
56 KTOCON = KTOCON t IR(I)
ADEM = FLOAT(IDEM)/IM
PSHORT = FLOAT(J3)/KTOCON
PEXP = FLOAT(J4)/KTOCON
CALL STAR
WR~E(2,2O~)KTOCON,PSHORT,PEXP
205 FORMAT(2OX~TOTAL UNITS = ‘,110/20X,‘PERCENTAGE SHORTAGE = l’,
E17.1i/ZOX,‘PERCENTAGE EXPIRATION =‘,El?.lll)
WRITE(2,206)IORD,ADEM
206 FORMAT(20X,‘TOTAL UNITS ORDERED = ‘,110//20X,‘AVERAGE DEMAND = l’,F6.2)
999 CONTINUE
CALL TIME(S)
WRITE(2,llll)S
111I FORMAT(ZlX,AS)
58 CONTINUE
STOP
END
SUBROUTINE ADDI
DIMENSION NAGE(l~),IS(ll~),IC(ll~)
COMMON~BLOODi~NAGE,NA,IS.IC,l4
NAE=NA
IF(NA.EQ.0) GO TO 64
DO 60 IAD = 1,NA
60 NAGE(IAD) = NAGE(IAD) + 1
14 = 0
DO 61 IAD = 1,NA
IF(NAGE(IAD) .GE .20) GO TO 62
GdTO61 ’
62 14=14+1
NAE=NAE-I
61 CONTINUE
14 PREM VRAT and A. 8. KHAN

IF(NAE.EQ. NA)GO TO 64
IF(~AE.EQ. 0)GO TO 65
DO 63 IAD=i,NAE
63 NAGE(IAD)=NAGE(IAD+NA-NAE)
65 NA=NAE
64 RETURN
END
SUBROUTINE ADDCOL(1)
DIMENSION NAGE(lOO),lS(ilOO),IC(llOO)
DIMENSION IP(1100),ISBAR(1100),IAI(1100),IBANK(1100),IR(1100)
COMMON/BLOODl/NAGE,NA,IS,IC,14
COMMON/BLOOD6/IP,ISBAR,IAI,IBANK,IR
IF(IR(I-l).EQ.O) GO TO 81
NC1 = NA f IR(I- 1)
DO 80 JCO = NA t I,NCI
80 NAGE(J~O)=3
NA=NCI
81 RETURN
END
SUBROUTINE DEMAND(I)
DIMENSION NAGE(l00),IS(11OO)IC(1100)
DIMENSION DIST(S0)
COMMON/BLOODl/NAGE,NA,IS,IC,I4
COMMON/BLOOD3/DIST,ND
IZ=FPMCRV(STREAM)*lOOO
RAN=IZ/lOOO.
DO 90JJ= l,ND
IF(RAN,LT.DIST(JJ))GO TO 40
GOT090
40 IS(I)=JJ -1
\ TOT094
90 CON~NUE
94 RETURN
END
SUBROUTINE ADJUST(I)
DIMENSION NAGE(IOO),IS(I100),IC(11OO)
COMMON/BLOODl/NAGE,NA,IS,IC,I4
COMMON/BLOODS/AICU
AICU = 0.0
IF(IS(1) .GT.NA)GO TO 20
IF(IS(1) .EQ.O) GO TO 21
NN = IS(I)
DO 71JAD=l,NN
71 AICU=AICU+NAGE(JAD)
AICU=AICU/NN
NA = NA - IS(I)
DO 70 JAD = I,NA
NAGE~JAD) = NAGE(JAD+ NN)
70 CONTINUE
GO TO 21
20 NN=NA
DO 72 JAD = 1,NN
72 AICU = AICU + NAGE(JAD)
AICU = AICU/NN
NA=O
21 RETURN
END
SUBROUTINE COLLECTION(I)
DIMENSION NAGE(lOO),IS(l lOO),IC(l100)
DIMENSION COL (5)
COMMON/BLOODl/NAGE,NA,iS,IC,I4
COMMON~BLOO~/COL,NC
IZ = FPMCRV(STREM)~l~
RAN = JZ/lOOO.
DO 91 JJ = l,NC
IF(RAN.LT.COL(JJ)) GO TO 41
GO TO 91
41 IO(I) = JJ - 1
GO TO 93
91 CONTINUE
93 RETURN
END
SUBROUTINE AVERSHOT(1)
REAL Il,I2
Simulationof a blood-inventory-banksystem in a hospital

DIMENSION NAGE (l~),IS(l l~),IC(ll~)


DIMENSION lQ(i i~),IQA(llOO)
COMMON~BLOODl~NAGE,NA,iS,IC,I4
COMMON/BLOOD2/IQ,IQA,II,I2
IF(IQA(1) GE. 0) GO TO 30
IF(IQ(1)GT.O) GO TO 31
11 =o
I2 = -(IQ(I) + IQA(I))/Z
GO TO 32
31 I1 = IQ(I)**2/(2*Is(I))
I2 = IQA(I)**2/(2*IS(I))
GO TO 32
30 I1 = (IQ(I) + IQA(I))/2
I2 = 0
32 RETURN
END
SUBROUTINE STAR
WRITE(2.5~)
500 FORMAT( 1X,119(‘*‘))
RETURN
END
FINISH

You might also like