Compare commits

..

No commits in common. "6181b6c83e332ac6e37415c04426130e4dfab047" and "be28b6db22cda7b53fc58daf016d3fe958643491" have entirely different histories.

1 changed files with 30 additions and 10 deletions

View File

@ -310,12 +310,32 @@
$('#field-rtm_dr').val($('option:selected', this).attr('rtm_dr'))
})
$('#field-contact_id').change(function() {
$('#field-absi_camp').val($('option:selected', this).attr('absi_camp'))
})
$('#field-contact_id').change(function() {
const selectedDoctor = $('option:selected', this);
let absiCamp = selectedDoctor.attr('absi_camp') || '';
console.log("Selected doctor:", selectedDoctor.text());
console.log("ABSI attribute:", absiCamp);
// Convert 1/0 to Yes/No if required
if (absiCamp == 1 || absiCamp === '1') {
absiCamp = 'Yes';
}
else if (absiCamp == 0 || absiCamp === '0') {
absiCamp = 'No';
}
$('#field-absi_camp').val(absiCamp);
// This will show/hide No of Patients Screened
toggleAbsiPatientsField();
});
@ -325,7 +345,7 @@
);
});
/* $('#field-pmos_dr').on('change',function(){
$('#field-pmos_dr').on('change',function(){
let value=$(this).val();
if(value=='Yes'){
$('#report-form').append('<input type="hidden" name="pmos_dr_count" value="1">')
@ -365,29 +385,29 @@
if(value=='Yes'){
$('#report-form').append('<input type="hidden" name="rtm_dr_count" value="1">')
}
}) */
})
$('#field-absi_camp').on('change', function(){
/* let value = $(this).val();
let value = $(this).val();
if(value == 'Yes'){
$('#report-form input[name="absi_camp_count"]').val(1);
} else {
$('#report-form input[name="absi_camp_count"]').val(0);
} */
}
toggleAbsiPatientsField();
});
/* $('#field-h1_cardio_conference').on('change',function(){
$('#field-h1_cardio_conference').on('change',function(){
let value=$(this).val();
if(value=='Yes'){
$('#report-form').append('<input type="hidden" name="h1_cardio_conference_count" value="1">')
}
}) */
})