I am guessing u were looking for a hack to get BMIā¦
I had to do something similar though didnāt use complexExpression and instead took a longer route( will try to assimilate your approach too though)
So i seem to be having some trouble when i call the earliestObs vs latestObsā¦I get back the last entered Obs when i use earliestObs and I end up with the first Obs I entered when I call the latestObs as seen in this PR https://github.com/METS-Programme/openmrs-module-ugandaemr-iss/pull/13/files#diff-293bb631be5f600040e06969745ee7e8R450 Could there be something I am missing English-wise or my code is just not well constructedā¦Thanks for the advice. @dkayiwa@mozzy@mogoodrich@ssmusoke
The result it also returns for BMI is wrong because it assumes $ht is already in metres yet when being captured by a tool like capture vitals it is in centimetresā¦
I have tried to manipulate the values within the compressExpression but without success because they give wrong results (Tried dividing $fn.latestObs(ā5090ā).valueNumeric with 100 before it is used and also tried dividing each of the $ht in #set( $bmi = $wt / ($ht * $ht)) with 100.