Skip to content

Conversation

@VeronicaMuthee
Copy link
Collaborator

The CSV contains alkaline phosphatase reference ranges, with gender-specific ranges for adolescents and adults, and pregnancy-specific ranges for women.

@dkayiwa
Copy link
Member

dkayiwa commented Sep 23, 2025

@VeronicaMuthee

  1. In which category is one who is exactly 2 weeks?
  2. When checking for gender male, use M instead of Male
  3. When checking for gender female use F instead of Female
  4. In which category is a female of exactly 15 years?
  5. Which concept do you use to tell whether a woman is pregnant or not?

@VeronicaMuthee
Copy link
Collaborator Author

@dkayiwa

  1. In which category is one who is exactly 2 weeks? ✅
  2. When checking for gender male, use M instead of Male ✅
  3. When checking for gender female use F instead of Female ✅
  4. In which category is a female of exactly 15 years? ✅
  5. Which concept do you use to tell whether a woman is pregnant or not?
  • Urine pregnancy test: 45AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA = Positive
  • Serum pregnancy test: 1945AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA = Positive

@dkayiwa
Copy link
Member

dkayiwa commented Sep 24, 2025

For pregnancy, is it both Urine and Serum? Or any of the two?

@VeronicaMuthee
Copy link
Collaborator Author

@dkayiwa it's either of the test and not both.

@dkayiwa
Copy link
Member

dkayiwa commented Sep 24, 2025

For the Urine pregnancy test, use:
$fn.isObsValueCodedAnswer("CIEL:45", $patient, "703AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")

For the Serum pregnancy test, use:
$fn.isObsValueCodedAnswer("CIEL:1945", $patient, "703AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")

For combining them with Urine or Serum pregnancy test, you can use:
($fn.isObsValueCodedAnswer("CIEL:45", $patient, "703AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") || $fn.isObsValueCodedAnswer("CIEL:1945", $patient, "703AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"))

@VeronicaMuthee
Copy link
Collaborator Author

@dkayiwa, based on the HB reference range conversation, this applies here as well. So ....the Pregnancy status (Is the patient pregnant Y/N - 5272AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) is better to use over individual pregnancy tests because it offers more comprehensive coverage. Beyond just test results, pregnancy status can be established through clinical assessment, known pregnancy from previous encounters, or even patient self-reporting.

@dkayiwa
Copy link
Member

dkayiwa commented Sep 25, 2025

@VeronicaMuthee in that case, the pregnancy expression becomes:
($fn.isObsValueCodedAnswer("CIEL:45", $patient, "703AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") || $fn.isObsValueCodedAnswer("CIEL:1945", $patient, "703AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") || $fn.isObsValueCodedAnswer("CIEL:5272", $patient, "CIEL:1065"))

@VeronicaMuthee
Copy link
Collaborator Author

@dkayiwa thanks, i have made the changes

dd9a6f84-74a3-4268-981a-57c07a47e282,785AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,ALP Late Adolescents (15 - 18 years) - F,0,80,120,350,450,,"$patient.getAge() >= 15 && $patient.getAge() <= 18 && $patient.getGender() == ""F"""
31fee95c-c070-40ed-95e8-c79bbc9c7708,785AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,ALP Adult Men (>18 years),0,25,35,147,200,,"$patient.getAge() > 18 && $patient.getGender() == ""M"""
93395ab8-deb2-4d28-aea5-1be73dc2554b,785AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,"ALP Adult (Non-Pregnant Women, > 18 years) ",0,25,35,147,200,,"$patient.getAge() > 18 && $patient.getGender() == ""F"" && $patient.isPregnant() == false"
f072fe91-dccc-4fa9-b4c6-c49cefb80202,785AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,ALP Pregnant Women,0,40,60,250,350,,"$patient.getGender() == ""F"" ($fn.isObsValueCodedAnswer("CIEL:45", $patient, "703AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") || $fn.isObsValueCodedAnswer("CIEL:1945", $patient, "703AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") || $fn.isObsValueCodedAnswer("CIEL:5272", $patient, "CIEL:1065")) == true"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
f072fe91-dccc-4fa9-b4c6-c49cefb80202,785AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,ALP Pregnant Women,0,40,60,250,350,,"$patient.getGender() == ""F"" ($fn.isObsValueCodedAnswer("CIEL:45", $patient, "703AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") || $fn.isObsValueCodedAnswer("CIEL:1945", $patient, "703AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") || $fn.isObsValueCodedAnswer("CIEL:5272", $patient, "CIEL:1065")) == true"
f072fe91-dccc-4fa9-b4c6-c49cefb80202,785AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,ALP Pregnant Women,0,40,60,250,350,,"$patient.getGender() == ""F"" && (($fn.isObsValueCodedAnswer(""CIEL:45"", $patient, ""703AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"") || $fn.isObsValueCodedAnswer(""CIEL:1945"", $patient, ""703AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"") || $fn.isObsValueCodedAnswer(""CIEL:5272"", $patient, ""CIEL:1065"")) == true)"

45d59594-8216-4e17-93fc-4e578090fcaf,785AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,ALP Adolescents (10 - 18 years) - M,0,150,200,400,500,,"$patient.getAge() > 10 && $patient.getAge() <= 18 && $patient.getGender() == ""M"""
dd9a6f84-74a3-4268-981a-57c07a47e282,785AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,ALP Late Adolescents (15 - 18 years) - F,0,80,120,350,450,,"$patient.getAge() >= 15 && $patient.getAge() <= 18 && $patient.getGender() == ""F"""
31fee95c-c070-40ed-95e8-c79bbc9c7708,785AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,ALP Adult Men (>18 years),0,25,35,147,200,,"$patient.getAge() > 18 && $patient.getGender() == ""M"""
93395ab8-deb2-4d28-aea5-1be73dc2554b,785AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,"ALP Adult (Non-Pregnant Women, > 18 years) ",0,25,35,147,200,,"$patient.getAge() > 18 && $patient.getGender() == ""F"" && $patient.isPregnant() == false"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
93395ab8-deb2-4d28-aea5-1be73dc2554b,785AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,"ALP Adult (Non-Pregnant Women, > 18 years) ",0,25,35,147,200,,"$patient.getAge() > 18 && $patient.getGender() == ""F"" && $patient.isPregnant() == false"
93395ab8-deb2-4d28-aea5-1be73dc2554b,785AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,"ALP Adult (Non-Pregnant Women, > 18 years)",0,25,35,147,200,,"$patient.getAge() > 18 && $patient.getGender() == ""F"" && $patient.isPregnant() == false"

VeronicaMuthee and others added 5 commits September 29, 2025 14:54
The CSV contains alkaline phosphatase reference ranges, with gender-specific ranges for adolescents and adults, and pregnancy-specific ranges for women.
@dkayiwa
Copy link
Member

dkayiwa commented Sep 29, 2025

@VeronicaMuthee can you also replace $patient.isPregnant() == false? with:
!($fn.isObsValueCodedAnswer("CIEL:45", $patient, "703AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") || $fn.isObsValueCodedAnswer("CIEL:1945", $patient, "703AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") || $fn.isObsValueCodedAnswer("CIEL:5272", $patient, "CIEL:1065"))

@dkayiwa
Copy link
Member

dkayiwa commented Sep 30, 2025

@VeronicaMuthee for ALP Children (1 - 9 years) you have used $patient.getAge() <= 10. Did you intentionally include the 10yrs?

@dkayiwa
Copy link
Member

dkayiwa commented Sep 30, 2025

@VeronicaMuthee if the above was a typo, you will create a followup pull request.

@dkayiwa dkayiwa merged commit 1dfc0e9 into main Sep 30, 2025
1 check passed
@VeronicaMuthee
Copy link
Collaborator Author

VeronicaMuthee commented Oct 1, 2025

Thanks @dkayiwa i have made corrections on the age overlaps in this new PR

@denniskigen
Copy link
Member

denniskigen commented Oct 1, 2025

Is there a gap at age 1 @dkayiwa @VeronicaMuthee? For a child aged 13-23 months:

  • getAgeInMonths() returns 13-23
  • getAge() returns 1
  • Infants criteria: getAgeInWeeks() > 2 && getAgeInMonths() <= 12 → FALSE (13 > 12)
  • Children criteria: getAge() > 1 && getAge() <= 9 → FALSE (1 is NOT > 1)

This leaves 13-23 month old children without any matching reference range.

Should we change:

$patient.getAge() > 1 && $patient.getAge() <= 9

To:

$patient.getAge() >= 1 && $patient.getAge() <= 9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants