Replies: 2 comments 1 reply
|
Oh, I completely forgot, related to yesterday's brief mention of the 'pits of success': One of the things we like to do with algebraic data types is to make illegal states unrepresentable. The current definition of > let a = { Years = -1<year>; Months = 13<month>; Weeks = 7<week>; Days = 1337<day> };;
val a: Age = { Years = -1
Months = 13
Weeks = 7
Days = 1337 } |
0 replies
|
@ploeh That's the part of the code base that really needs some quality improvement. GenPRES is a merge between what was originally intended an emergency list app that was client side only. Patient and related concepts are particularly tricky as there are now multiple libraries dealing with different views on what a patient is. So, you are. not missing anything. |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
The module
Shared.Types.Patientcontains this definition:I'm trying to understand why it looks like this. My current guess is that it's intended to address some user-interface concern, or perhaps model how clinicians normally work with patient ages.
Even so, this seems unwarranted. The only references to the
Years,Months,Weeks, orDaysproperties that I can find outside ofShared.Modelare two examples inApp.The first one looks like this:
The second is similar:
This seems like an overly complicated way to store what could just as well have been an integer measuring total days.
Am I missing something?
All reactions