Open mahalakshme opened 2 weeks ago
Decision rule commented out. /web/rules
call continues to return a 400. To be looked at separately.
Updated message rule:
'use strict';
({params, imports}) => {
const programEncounter = params.entity;
const moment = imports.moment;
//let dateTime = programEncounter.getObservationReadableValue("Date of Attendance");
const groupedObservations = programEncounter.findGroupedObservation("Attendance Day");
const groupObservations = _.isEmpty(groupedObservations) ? [] : groupedObservations[0].groupObservations;
const dateTime = _.find(groupObservations, (observation) => {
return (observation.concept.name === "Date of Attendance");
});
const date = moment(dateTime).format("ll");
//console.log('enrolment====>',programEncounter.programEnrolment);
//const team = programEncounter.getObservationReadableValue("LAHI_TEAMS")[0];
const team = programEncounter.programEnrolment.getObservationReadableValue("LAHI_TEAMS")[0];
const individual = programEncounter.programEnrolment.individual;
const name = individual.name || individual.firstName + ' ' + individual.lastName;
//console.log(name, date, team);
return {
parameters: [name, 'Internship LAHI', date, team]
}
};
@AchalaBelokar testing this card does not require registration of a new subject. You can perform the 'LAHI INTERN ATTENDANCE' encounter on an existing subject.
Need:
With the below, we will be supporting DEA for LAHI as well as per their need. Since currently from the decision rule of program encounter we can't access individual. Hence 'lahi intern attendance' decision rule is throwing 400.
Context:
AC:
Testing:
Analysis notes: (Can ignore)
Analysis Context:
The workarounds done(to make glific message working) to find enrolment observations and group observations in decisions rule can be moved to message rule here - https://app.avniproject.org/#/appDesigner/encounterType/1814/show since the below cards are released as part of 3.39 release: avniproject/avni-models#43 avniproject/avni-server#529