 Okay, so let's start with the session about the creation of tracker data. Okay, yesterday we saw in aggregated data, we saw how to create new data, how to handle data values, and that is a complete registration record. Today we are going to talk about the tracker data. The main thing that is important to notice is in the tracker data, we have two kinds of data. We have the data that is called identifiable. It means those elements that can be identified by a UID and the non not identifiable object, that is, those objects that cannot be identified by a UID. So this is very similar to what we saw yesterday with data values. Now instead of data values, data value model, we will have the event model, tracker entity model, enrollment model, all that. And within each model, we will have a repository to access the event or the tracker entity instances or the enrollment. So, when we are, I said, I said that we have two main kinds of elements, the identifiable objects are the not identifiable objects. The identifiable objects are the tracker entity instances, the enrollment, the event, the nodes, and the file resources. I mean, these elements can be identified by the 11 charter UID that you, I think you are familiar with. And you can use that UID to do an investigation also on those elements. And in the not identifiable objects, we have the tracker entity instance, tracker entity attribute values, and the tracker entity data values. It means that these objects are not identified by a UID, but by a combination of fields. For example, the tracker entity attribute values are identified by the combination of a tracker entity instance and an attribute. And the data values are identified by the combination of an event, another element. So how to deal with the identifiable objects. As I said, the identifiable objects are identified by a UID. This UID is unique. And this UID is generated by the SDK. So how is the flow here? The flow is, in first place, you have to create like the base object, a base object with a minimum information required to create an object. And this is what is called a projection in the SDK. So for example, here in this code snippet, we have the tracker entity instance projection that only needs to fill the organization unit and the tracker entity type. So this is the minimum information required to create a tracker entity instance in the system. So in the repository, we have an add method that accepts this projection and returns a UID. So once you create the object using this projection and you get the UID, now you can use that UID to access the tracker entity instance or enrollment or event or whatever. And modify and change a field or deleted or update anything like here, for example, the object repository. In this object repository, you will find method with the name set. For example, in the case of tracker entity instances, you will have set, I don't know, geometry, set, follow up, set, whatever, and a value. Okay. Also the delete, delete if exist, and then we have the create method to get the object, get the element, or check if the object exists or not. Okay, and this was for identifiable object. Okay, now for not identifiable object. If you remember from yesterday, for the aggregated data values, we have to specify the data element, the organization unit, the period, the attribute of the combo thing. So you need to specify all that information to identify the data value. In the case of a tracker data, we have track entity attribute values and track entity data values. Those values are can be uniquely identified by in the case of attribute values by the track entity attribute on the track entity instance. Because this combination of track entity instance and track entity attribute is unique. And in the case of track entity data values. And you can identify a data value by the event and the data element. In the same way that it's for. We have some right method methods methods to upload. And to update the data. The set to modify any value in the database delete on delete if exist. And also the, the same read method and before. Yeah. In the same way that with all the repositories and models in the decay. We always have two ways to access the repository, the reactive method and the blocking method. This is the same thing. Okay, any questions so far. This is about the issue of tracking data. Because now I'm going to change the subject a little, a little, we are still in creation of data. But more focus on the data entry form. And this is about the, the research values. Okay, and you know that. So the target entity attribute target entity attributes can have some properties like the value type for example if it's numeric or or a text or text or a date or whatever. And also there's a property called unique and automatically generated that it means that it is not the user who enters the that the value for that attribute. It's the system that generate the value for this. And this value is unique, usually. And also you can specify a pattern to generate the value to this value has to be unique in the whole system. But we know that in the device in the mobile device, you can be working offline. So the SDK and the web API, they have a mechanism to reserve some values. So the back end generate regenerate some values for the device. So, in this way we want to that those values are going to be unique. And this is required to operate offline and to be sure that they are going to be. Yeah, the. Okay, we have to download before we go offline. We have to download these values. And this is automatically done in the skeleton app and they're calling this method. The important thing is that we can get a new value using the reserve it value manager. It value and we have to specify the attribute you ID and the organization unit. And so in this way you can regenerate, you can get a unique value and you, you are sure that that value is unique. And it's important to do that to regenerate the attribute value. And it's important to know that the SDK regenerate download a certain number of activities values, usually 100, but this is, this can be parametric side. And once the SDK has run out of values, it automatically query request for more values to the server. This is automatic. And also the SDK handles all the logic about the expiration of research with values because they have an S pretty date. And also to, to be sure that we always have values in the device to use. Okay, any questions so far about the traditional tracker data or the reserve values. There are no questions. Okay, so let's start with the exercise. Yeah. So this is quite a long exercise. Yeah, we will have more than half an hour for this. This exercise. Okay, I'm going to the code. So in this exercise, I'm going to run the application. This exercise has three parts. It has three parts, the creation of the second entity in turn, the creation of the enrollment and the creation of the attribute value. It means all the steps involved in the creation of a new rocket entity in terms with enrollment in a, in a program. Okay, if you go to this, to this brand to the initial brand, the exercise eight, then you go to programs, programs. You can see a plus bottom that in the, yeah, in the use cases branch. And this button gives you access to the, to the flow to enroll a second entity in a program. So, here, I click the bottom, but it does nothing because it's not implemented. So what will you, what you will have to do is to implement the missing method in this flow. So in first place, you have to create a new TI, and you have to go to this class, the target entity instance, target entity instance activity class. And let's go here. Yeah, is this one, target entity instance activity class. And the first part of the exercise is that here you have to create the target entity instance. And in the description, the tips. And you can see that you have to set any organization unit in the capture scope so probably the first step here is to get an organization unit using the transition to new depository filtering back up to the scope and get the first one. And also we saw here that the target entity instance and projection. And it requires two fields, the organization unit and the target entity type here we have the program. So, and the program has a target entity type link. So this is the targeted type we have to. And this method returns. A string, a single of a string. This string is a UID of the object created. That has we, we know this method returns that string. And this is the first part of the exercise. And so I'm going to explain the three parts. And each part in will give you access to a next step in the flow. I mean, if you want to have the targeted instance, you can click the plus button. And it will do something. But it will not enroll the target entity yet. And now it's enrollment. In the enrollment form service. Let's go here. You can check the produce here and look for the enrollment form service. Okay, so here we have the exercise eight B. And it says, create a new enrollment and save the enrollment you ID in the variable room and you ID of the here. In this class we have this variable, and I mean you ID that is used by other methods within the service. It's important to save the field. This variable with the enrollment you ID. And we know the method in the room and service returns the room and you have to create the room and you ID. And then the enrollment date and incident date to today. And we have a helper class hyper method for that. Okay, this is the second part. Once you are here, you can click this button. And probably that the eyes want to be enrolled. And the last part, the attribute values, probably that the eyes want to be enrolled, but with, without the values. So we have to go to the enrollment form activity class. We have enrollment form for activity class. Yeah, and we have this other method. Okay, this method is a listener of the former of the data entry for the enrollment form. This is the listener that is triggered every time that a value is modified. So here you have the parameters that attribute you ID and the value. And what you have to do is to save the value. Otherwise, delete it, because if you delete, you remove a value in the identity form, what you are going to have here probably is an empty thing. So you have to check if the value is empty or not. If it's empty, delete it. Otherwise, save it. Okay. And yes, and I think that's all so far. Then we have an optional exercise about precepted values, because in this way, I will recommend you to use the child program. Use please a child program. And in this enrollment in this program, we have an attribute that is unique and auto generated. So if you, if you do until the exercise. And you will be able to fill the form, the form and the track and the distance will be a role in the program. But the attribute that is generated will not be at the negative because it's not implemented. The exercise is the one that implement this behavior. So this is optional. Okay. Any question about the exercise.