 So problem rules, what are we gonna be doing? For the next 45 minutes, we are gonna be talking about problem rules. And what I would like you to know or to have acquired when we finish this session is that you understand what problem rules are, even though you should pretty much know it already, but how to use them, how we can use them to improve experience of the user to pay that quality or different things. And the most important thing for me is that you understand that there are differences between the Android and the web in terms of problem rules. And you have to submit an exercise that reflects that knowledge. You will have to perform something on the server and then you will have to go on the application and show the screenshot that you have managed to set up the problem rule. So let me ask you something and I will be checking the chat, but what are problem rules? I would like you to think for the next five, 10, 15 seconds on these two examples. And I would like you to tell me if you want, you can write on the chat. I'm not checking Slack. So here on the Zoom chat. But I'd like you to tell me what are these two pictorams? Why do you have? Sorry, I will be answering the questions on the chat, not related to this later on. So let me rephrase this question again. Sorry, in these two real world samples, what do you do here on the left side when your phone is telling you nobody or in the traffic light when you see a red light? Can you think, can you reflect or can you think about the process that you do when this happens in real life? If you want, please write something on the chat. Okay, recharge battery and stop, charge and stop. Okay, follow the rules. Okay, but on the left side, which rules do you follow? You charge it as well? Take an action, yeah. For the battery, I go for the battery saving. Okay, well done. Direction is just by the plug in, yeah. Okay, so what you're telling me, it's pretty much the actions you're doing. But because I told you what will you do, but in the, yeah. Somehow, but I want you, so it's well answered. I didn't put the question maybe the best way possible, but what I wanted to come back is to this. You are evaluating and then you're taking the action. So you were telling me to stop, recharge, blah, blah. All these things, right? So basically what you do is you evaluate the context. So you say, okay, if my battery is low, I charge. If the traffic light is red, I stop, right? And when it becomes green, I continue. Or I turn, whatever I have to do. If there's someone from the US, I think you can turn right, even if it's red. Not the case where I am from. In any case, so evaluation and action. And these are the basic two words I'm gonna be talking during this session, because this is what basically we are going to be doing. So let's see. What are problem rules? Basically, this principle of evaluation and action is defined via program rules. And the evaluation we can perform based on these things. So we can evaluate the current state of data entry and respond with a series of effects. So basically we evaluate the current states and we perform effects, effects, actions, whatever. And here I'm putting something. I am not going to describe everything, but some of these actions we could do is we could assign a value to something. We could hide a field if we want to ease the entering for the intent of data. If we want to, for example, imagine, I'm gonna, well, I will not go to examples. We're going now, let me go on this slide. And then we can also show our warning. And the evaluation, we can evaluate in terms of context. So things that are actually not input as we have here. And the context would be, for example, what date is it today, in which organization unit I am, or how many events I have recorded, et cetera. And the input is actually a data encoder has put something, okay? So we evaluate something based on this left part and then we perform actions or effects. For example, a couple of real details to examples, we can calculate the score of the facility based on the checks. I know this being used in Uganda, for example. They go to facilities and they perform a facility assessment. They check, does this facility have, for example, a microscope? Yes, no, yes. So they sum up or they add these values and they give you a score in terms of facility. If the user has elastic mail, we hide the pregnancy status. So it doesn't make sense to have a very big form. If at one point you see, okay, it's a mail, I can hide something like this. I improve the data quality probably because no one will be making the mistake of mail and pregnant. And also if the patient has hemoglobin really low, show a warning to the nurse, okay? Another real life sample. I think this is on the child program on the default DHS2 example programs we use. You can check on your program, the one we gave you access to yesterday. You can see this and you can see there are some problems. Let's not do that now. You can do it afterwards during the exercise because actually you will need to set up a problem. But what I wanted to do is now make another quiz. So I'm going to try to ask some questions. I know this is a bit difficult being online. So I'm talking here. I don't see anyone in the room, in the room, but well. I'll try to make a quiz and maybe I will ask you to raise hands to have some participation somehow interaction. But let's see. So if we're going to use this sentence. So if the patient has hemoglobin really low, show a warning to the nurse. Let's take a quiz to see if we understand what's going on. So the components, this is what I'm going to be asking you to kind of fill. We have three different components in prone rules. We have what we call the actions that I've been telling you already, like stopping the traffic light, charge the phone. We have rules variables that is something that we are going to be using to evaluate. So according to different values, there's no or numbers, et cetera. And then we have the rule expression that we'll probably be using those rule variables. So I'm going to be asking you in this sentence, what do you think is the rule action? So if I read this, if the patient has hemoglobin really low, show warning to the nurse. What do you think is this? Instead of, yeah, instead of raising the hand to put in the chat, and then I'm going to say, who thinks is this? And then I will ask you to raise the hand if you don't mind. Because if not, you will be answering very quickly and we don't have, we don't allow people to. So please lower your hands, everyone. Okay, show warning, showing the warning. Some people are saying the warning. I'm going to ask you now, who thinks that show warning to the nurse is the rule action? Please raise your hand and zoom. Now you can raise the hand. If you think show warning to the nurse is the rule action, please raise your hand. Okay. Okay. Four or five people think that. Six people think that. Okay, I see a lot of hands raised. I'm trying to imagine you'll hear people like doing this. Working hard on my imagination. Okay, very good. Like several of you are thinking this, still like 20 people are not thinking this. Let's see if you're correct. Yes, that's good. So that's the rule action, show warning to the nurse. I don't know if I can lower all the hands. No. Okay, put your hands out. Let's see now, what do you think is a rule expression? If the patient has hemoglobin real low, show warning to the nurse, what do you think it's the expression? HP, so hemoglobin less than cuter value. So I guess, yeah. Okay. I'm gonna make this to see because certain value, check the value between high and low, patient has hemoglobin real low. Yes, hemoglobin real low, hemoglobin normal, yeah. Okay. I'm gonna ask the question. I'm gonna make this, yeah. This is a bit harder, yes, yes, very good. So yes, if the patient has hemoglobin real low. I think that was easy because we have expression and action. So there were only two parts. But now let's try to see if we can identify what is the rule variable. So before I was telling you that in the expressions, we can have context and we can have input. Usually rule variables would be used to input. So here, what do you think of this sentence if the patient has hemoglobin really low? What is the rule variable? And there's not a very straight answer because some people could argue that what I'm gonna say is not correct. If someone says that, I will try to explain why I decided to explain like this. Okay, someone is saying hemoglobin. Yes, okay. Who thinks it's hemoglobin? Raise your hand. Okay, okay. And now I'm gonna be a bit bad teacher. Lower your hands. All right, I see 13 people. Everybody lower your hand. And who thinks like low is the rule variable? Does anyone think that low is the rule variable? Less people. Okay, all right. We still have some people that think that I'm gonna tell you that you're not correct, but what I was saying, you can be actually, as someone is saying, that's very nice. I didn't know you could do, I should have used that with checks and I don't know who put a wrong thing, but I'm gonna be using this for future lectures. I like it. So actually here, most of you reply that it's hemoglobin and that's correct. And if some people is replying that low, I can tell that you were kind of right because I could have coded low as well as a rule variable. The thing is usually we have defined low variable as constants, so I will be using a specific number here. So for example, I have no idea about hemoglobin, but it feels like less than, I'm gonna say 100, I don't know if that's low or not. So this low I could have created as a rule variable instead of putting a straight away 100. So those who raised the hand the first time with hemoglobin were right. Those who dare to raise the hand with the second, you're also kind of correct. So thanks for the participation in this quiz. If we go back to a bit more of theory kind of, yeah, I just want to tell you that pro and rules are kind of, at least for me, were difficult to understand because they contain many different ways of setting up, many different actions, et cetera. So I cannot cover all this 45 minutes we have. What I'm doing is I'm putting here some links where you can check the official documentation. We have spent a lot of time documenting this, trying to make your life easier. So please go to this that you can find on the slides. The slides are public, so you can download them or check the links. Basically, if you also go to documents.docs.dhi2.org, you can also find this documentation. And you will see that we have a specific comment in the Android documentation because we differ from web in certain things. Putting these slides as a bit reference, the next 10 slides I think are kind of like reference. So I will not be covering much, but here basically what I wanted to mention is that in order to create a pro and rule variable, you need to go to maintenance, program, pro and rule variables, and you can fill with this information that these are the things you can use as pro and rule variables. So you could be collecting the data element from the new website in the program, these kind of things. Okay, here I'm putting something with an asterisk because we here find already some differences between web and Android. Very quickly spent, and you don't have to remember this, but for example, when we say data element from the newest event in the program, Android, because the way it works, downloading as much information as possible without overloading the system can only look at the 10 newest or previous events. So in web, you don't have this limitation that you have in Android. Doesn't matter, it's just for you to, so one of these differences I'm gonna be talking about or I have been talking about. Okay, so pro and rule variables. Then we have the pro and rule components that basically we're gonna be setting up pro and rules here in maintenance, program and pro and rules. And here you have to define the name of the pro and rule in which pro and will be acting the pro and rule, some description. Then you have to compose the expression. As I was telling before, pro and rule is basically evaluation, action. So this will be the part of evaluation. If I go back to my examples before, traffic light is red, then I will do something. My charge, my phone is battery is low. I do something. If a mobile is low, I do something. Okay, so this one we will be putting here. You can create the pro and rule expression with this, I will not cover in this, but you have this in the reference. Basically these are the things you can use for the expressions. And then we have actions. And here what I want to mention that is important to know is that when a pro and rule expression evaluates true, all the actions will be executed. So if you want to have different actions for different expressions, you need to compose different ones, but the moment you have an expression and it's matched as true, all your actions will be executed. So I'm going back to the real world example and let's say that I see if the traffic light is red, I can put several actions. So I will put stop, the car, stop the engine, talk to my co-pilot that is here, whatever. So all these actions will be executed. I cannot say execute the first one and the second and the third, so the second and the third, but not the first. No, whenever this is matched, all these ones are being executed. Here you only see one action, but you have here the plus button, so you could be adding several points. You will find that the problem rule that you will need to create now, probably you only want to have one rule action. If you want to put more, you can put more. So these are some available actions you can do. I'm putting in blueish, the ones you can use in Android and this one in gray because it's not supported in Android. So if you're using the actions and message because of Android nature of being usually offline, this has not been implemented yet. So another difference between web and Android. So we just important to know that we are trying to consolidate and have the same rule evaluator is already the evaluator, but the rule action the same in Android and in web. At the moment, they are different. So you might have difficulties when setting up rules. So we encourage you, we ask you to test well in both environments. One of the quiz questions this morning was I have to make sure that if my project will be using Android, I need to take care of that. And we were saying about assigning less organization units because we don't want so much information to be downloaded. But also here now we are including that we need to test problems. Not because something works on web, it's gonna work immediately in Android and not because something works in Android, it's gonna work immediately in web. So we ask you to prepare your problems and test that is working properly in both environments. You can achieve this. So it's not that it's incompatible at all. They are fully compatible at some rules that you might think are gonna be working because they're working here and are not working here, okay? So please check this. And these discrepancies don't think that you need to go blind checking everything. We have included them in the documentation. So if you go here, you can check what's going on and what are the differences and what are the things you need to check. That's the presentation for problem rules in terms of theory. We have now 20 minutes. So I'm going to jump to the exercise that we are asking you to do to prove that you have acquired the knowledge kind of problem rules. I know I took for like 40 minutes, not even 30 minutes, and might be a bit rushy, but I hope that you get the idea of what problem rules are. This is not a tracker academy, it's an Android. So you should already have some knowledge about problem rules. What I've been trying to explain is the differences or what are the components or why you should do one thing or another one. So if there are no questions regarding this that I guess they're not going to be. If they are, maybe I will not reply them until I have finished explaining the exercise. So not that I'm not going to answer questions, but let me explain if you don't mind the exercise and then you can count with questions either related to the exercise or problem rules either on the chat or if someone is seeing this video later on, we can do it on a slide. Let's go to this. Okay. So, exercise problem rules. Let me check. Okay. So now we're focusing on these 15 minutes. We're going to have a little bit more. I think not because we're finishing up. So we have until 11. So we're fine on time. So the exercise you have to submit, let me tell you this. I'm going to play a gamification or simulation and I want to ask you to think in case you are not, maybe you are already the HH2 experts and you actually are experts in the HH2 not only in everything related to the HH2 but you're also experts in problem rules. And you think after having evaluated the program we gave you yesterday on the Academy server that we are not doing our best in terms of data quality. We can call it like this because you think that you could implement problem rules that could improve the quality of this data. So you have come with the following idea. If you were playing yesterday a little bit with the program, you will see or you just have seen that in the phase one, the clinical scene and symptoms we are asking for the temperature. So if there are no symptoms or there is, yeah. So there's already some problem rules in the system if there are no symptoms you cannot see this but if there is symptoms you will see that the temperature. In any case what you want to do is you want to improve the data quality by not allowing users to insert a wrong value. I'm gonna reference this because I think it was not very clear, sorry about that. So when you check fever, yes. You will see that there is a box here that it's open. So there is a problem rule already working that say if fever is yes, the temperature data element pops up or it's shown. And if fever is no, this goes away. This is something that we as not me because I'm not an expert in the H2 but someone on the H2 thought it was a good idea and I agree. However, if we think one step further we can see that I could put temperature so I could put fever yes, I could say fever yes and then this box to put the temperature populates so I can put the value in case I can put well, just like temperature is gonna be 37.7 but you can say, well, but what if someone puts 25? There would be an inconsistency because we humans have decided that fever is temperature above 37. So I could be putting fever yes, check. This temperature box comes out. I put here 31, let's say 31 and this is not right. So you as experts, as experts in problem rules have decided that you want to avoid these kind of things because you're very, very picky and you want to be very, very good in this data quality or data capture. So you see that if the temperature is lower than 37 you should display an error. You should say you have marked fever yes but then you're giving me a value of the temperature that is not possible because you cannot have 31 degrees and then marking fever. So basically what we're asking you is to create a problem rule that does this. So whenever the temperature is lower than 37 you show an error to the person who's capturing this. So you avoid these data inconsistencies. In case that's not clear, let me show you with an example, if you access your program the one you downloaded yesterday and you go to the case where surveillance and you have created a TI that you should have all done this by now because that was one of the first exercise. You will see this and let me put the module. So here basically in clinical science and symptoms I have chose send the option yes. So because I chose this here, I click here this measure temperature was populated. And here I have put 35 and it's what I'm telling you, this setting consistency. So at the moment the system is not working as good as it could because it would allow us me to save this value. However, with the program rule we are asking you to do you will see that here I have put 36 and I have created a problem rule that tells me the temperature cannot be lower than 37. So this is basically on the right side what we are asking you to achieve. So I'm creating a program rule that performs this. So this is what you have to do. I don't know if I mentioned but someone in the feedback yesterday was saying sometimes not very clear what we have to do. If it's not clear, please tell me in the chat or in Zoom or in Slack. Again, you can always find the exercises on the slides. In case it's not here I have tried to make it a bit more clear by saying this is what you need to do on the server side. So this is what you need to, the configuration you need to change on the HIS2 using your admin account. You need to do this. You need to create a program rule viable for a temperature data element. You need to define a program rule details with a stage name and description. You need to create the expression. I'm putting here two little hints and then you need to define the program rule action. Before I was mentioning that all the actions are gonna be executed at this moment we're only having one action because we're only showing one message. You could have other ones if you want. If you come out with great ideas, please do so. And then what you need to do in Android is synchronize your configuration and create capture a screenshot like this one here and submit it. Here I'm giving you some help. So basically this is the way to create the program variable what you should do. Using your specific program, of course. And these are the expressions and the actions. So...