Why not login to Qiita and try out its useful features?

We'll deliver articles that match you.

You can read useful information later.

0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

VaccImageのバイアル計算について

Last updated at Posted at 2022-01-21

VaccImageについては、

VaccImage

に記載のとおりです。
ワクチンのバイアル管理を目的としたWebアプリです。Ver1.0.1までは本当にひどいスパゲッティCodeだったんですが、Ver2.0.0ではSQLを駆使し、随分と見通しがよいCodeになりました。
今回はVaccImageについて初回のQiita投稿ということで、バイアル計算について取り上げてみます。

他の先生方がどうしているか知りたいのですが、

ここでわかりやすくPythonで書くとGitHub上で、
こちら
にも上げたんですが、直接書くと、

NA = int(input('大人の接種人数'))
NC = int(input('子供の接種人数'))
Ap = int(input('大人の接種ポイント数'))
Cp = int(input('子供の接種ポイント数'))
Vp = int(input('1バイアルの接種ポイント数'))

# インフルエンザワクチンを想定すると、Ap=2, Cp=1, Vp=4になります。
# ファイザーCOVID19を想定すると、Ap=3, Cp=1, Vp=18になります。

Tp = (NA * Ap) + (NC * Cp)
print('合計接種ポイント(Tp): ',Tp)

print('Tp/Vp(割り算しただけのもの): ', Tp/Vp)
print('Tp/Vpの整数部分: ', int(Tp/Vp))
print('Tp/Vpの余り: ', Tp%Vp)
print('半端バイアルで打てるポイント:', Vp-(Tp%Vp))

if((Vp-(Tp%Vp)) == Vp):
    print('破棄分も含めた必要バイアル(TotalVials): ', int(Tp/Vp))
else:
    print('破棄分も含めた必要バイアル(TotalVials): ', int(Tp/Vp) + 1)    

という事になります。
剰余の計算など、文章で書くよりCodeのほうがわかりやすいですよね。

半端のバイアルの計算って現場ではかなり面倒くさい。If文で仕分けしてあげないと、バイアル数を過小評価しちゃうんですよね。
これ、結構現場では困っているのじゃないでしょうか。

IF文で仕分けがいるので(フツーに考えたら)、その時点でExcelじゃ処理が面倒なんですよね。
このあたりが、VaccImageの開発のモチベになりました。
また、不定期ながら、VaccImageについて投稿していきます。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up

Qiita Conference 2025 will be held!: 4/23(wed) - 4/25(Fri)

Qiita Conference is the largest tech conference in Qiita!

Keynote Speaker

ymrl、Masanobu Naruse, Takeshi Kano, Junichi Ito, uhyo, Hiroshi Tokumaru, MinoDriven, Minorun, Hiroyuki Sakuraba, tenntenn, drken, konifar

View event details
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?