Post Reply 
(35S) HP35s - Medical applications
04-08-2020, 07:53 AM (This post was last modified: 05-03-2020 07:37 PM by Gene.)
Post: #1
(35S) HP35s - Medical applications
I never saw any medical application or equation listed for HP35s. I have developed some programs and equations for my job. The first is an Acid/Based disorder analyzer based on Arterial Blood Gas analysis. It is based on 2 different algorithms, a decision tree and an equation based algorithm and it can give from one to three answers. You can find it at https://github.com/drmchris21/ABG-Calculator-HP35s. There is also a HP Prime version.
Visit this user's website Find all posts by this user
Quote this message in a reply
04-08-2020, 02:02 PM
Post: #2
RE: HP35s - Medical applications
Nice to have different applications for this great HP calculator. Could you please bring some support literature and some numeric examples to show how it works (input and outputs). Thank you in advance. Pedro
Find all posts by this user
Quote this message in a reply
04-08-2020, 08:30 PM
Post: #3
RE: HP35s - Medical applications
The algorithm first follows a decision tree. Each node is a Yes/No question based on a single parameter. Finally it reaches the first answer out of 22 predefined. Then, according to the first answer it calculates some scores to find if there is a compensation. This is the second answer and in most cases is the same or similar with the first. Then if there is an anion-gap it runs a final calculation to find a third answer with the type of anion-gap disorder.
I tried to reduce the program to one label only, so it's spaghetti code.
Is more helpful to study the similar algorithms of for the HP Prime here https://github.com/drmchris21/ABG-Calculator-Perl, and for Perl here https://github.com/drmchris21/ABG-Calculator-Perl to find out how it works.
Visit this user's website Find all posts by this user
Quote this message in a reply
04-08-2020, 08:47 PM (This post was last modified: 05-01-2020 09:47 AM by mchris.)
Post: #4
RE: HP35s - Medical applications
The second medical stuff I post is a CKD-EPI equation. The CKD-EPI equation is for calculating the estimated GFR of a patient with chronic kidney failure. It is a complicated equation with 4 piecewise functions and 2 min/max functions.
[Image: e695776a5827ef76b340344758106f09888735e6]
The HP35s lacks both. It is easy to write a program to emulate them but I wanted to write the whole thing as an equation. Here comes linear algebra for the rescue. The equation has a term k. k is a function itself with a term 0.9 if it is a man or 0.7 if it is a woman. I wanted to write 1 for a man, 2 for a woman, 1 for non-black, 2 for black. There must be a system of equations 1x+y=0.9 and 2x+y=0.7 to solve to replace the piecewise function k. The same goes for term α and for the last two terms (1.018 if male, 1.159 if black). And finally I replaced min(a,b) and max(a,b) functions with a+b-abs(a-b) and a+b+abs(a-b) (thanks to this forum).
The final equation is:
141*((1+C/(S*-0,2+1,1)-abs(1-C/(S*-0,2+1,1)))/2)^(S*0,082-0,493)*((1+C/(S*-0,2+1,1)+abs(1-C/(S*-0,2+1,1)))/2)^-1,209*0,993^A*(S*0,018+0,982)*(R*0,159+0,841)
Visit this user's website Find all posts by this user
Quote this message in a reply
04-26-2020, 08:23 PM
Post: #5
RE: HP35s - Medical applications
I continue on the CKD-EPI formula. In order to make the formula shorter (and a bit faster) I reuse the A (Age) register after consume its computation.
A: Age
C: Serum Creatinine (mg/dL)
S: Sex (1=male, 2=female)
R: Race (1=non African American, 2=African American)

141*0,993^A*((1+(C/(S*-0,2+1,1)►A)-abs(1-A))/2)^(S*0,082-0,493)*((1+(C/(S*-0,2+1,1)►A)+abs(1-A))/2)^-1,209*(S*0,018+0,982)*(R*0,159+0,841)
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)